29 #include "TRootEmbeddedCanvas.h"
35 #include "TPolyLine.h"
56 if (plane != NULL )plane->
print();
73 for(Int_t ndet=0;ndet<2;ndet++) {
76 if ( m == NULL )
continue;
103 fHist[ndet]->GetXaxis()->SetRangeUser(0,511);
104 fHist[ndet]->GetYaxis()->SetRangeUser(0,304);
111 fHist[ndet]->GetXaxis()->SetRangeUser(0,511);
112 fHist[ndet]->GetYaxis()->SetRangeUser(0,304);
162 Int_t iMax = 0, jMax = 0;
173 Warning(
"FindCluster",
"Unknown cluster type %d",type);
177 Double_t xStart = 0, tStart = 0, qStart = 0;
178 Int_t nbinsStart = 0;
180 for(Int_t i=0;i<iMax;i++){
182 Double_t qTot = 0, qTotCh = 0, qMax = 0;
183 Double_t mean = 0, sigma = 0;
185 Double_t qold = -1000;
188 Bool_t noisy = kFALSE;
189 for(Int_t j=0;j<jMax;j++){
190 Double_t q, noise, noiseThr, thr;
191 Double_t xmin, xmax, ymin, ymax, xp, yp;
211 noise = 500*(7*
fBadCh[j] - 6) ;
213 Info(
"FindCluster",
"Dead Channel %d (%d, %d)", j, i, up);
242 if(
fHist[plane] != 0 && q>-1000){
259 TPolyLine* triangle =
new TPolyLine(4,x,y,
"FL");
260 triangle->SetLineColor(kBlack);
261 triangle->SetFillColor(3+up);
264 triangle->Draw(
"FL");
278 if(up == 1 && q < qold - noiseThr){
282 if((up == 2 && q > qold + noiseThr) || (up != -1 && (q < thr || j == jMax-1))){
284 Info(
"FindCluster",
"%d %d (%d, %d)", i, j, type, plane);
285 Info(
"FindCluster",
"q=%f qold=%f noise=%f fThr=%f", q, qold, noise,
fThr);
292 if(q > qold + noiseThr || j == jMax-1)
297 Info(
"FindCluster",
"Noisy Cluster %d %d %d %g",
fNcl,flag,type,mean);
300 Info(
"FindCluster",
"%d: iFirst = %d",
fNcl,j-width);
301 HarpoRecoClusters *cl =
new HarpoRecoClusters(type,qTot,qMax,mean,i,TMath::Sqrt(sigma),j-width,width,-1,plane,flag);
334 if(q > qold + noiseThr || (qold<thr && q>thr))
390 TCanvas* cTab = ecTab->GetCanvas();
393 Int_t nCl = clArray->GetEntries();
395 TGraph* gCX =
new TGraph();
396 TGraph* gCY =
new TGraph();
397 TGraph* gTX =
new TGraph();
398 TGraph* gTY =
new TGraph();
400 TGraph* gTXnoise =
new TGraph();
401 TGraph* gTYnoise =
new TGraph();
402 gTXnoise->SetMarkerStyle(28);
403 gTYnoise->SetMarkerStyle(28);
409 for(Int_t icl = 0; icl<nCl; icl++){
412 Double_t mean = cluster->
GetMean();
421 if(plane==
XPLANE && type ==
CCLUSTER) gCX->SetPoint(gCX->GetN(),mean,ind+0.5);
422 if(plane==
XPLANE && type ==
TCLUSTER) gTX->SetPoint(gTX->GetN(),ind+0.5,mean);
423 if(plane==
YPLANE && type ==
CCLUSTER) gCY->SetPoint(gCY->GetN(),mean,ind+0.5);
424 if(plane==
YPLANE && type ==
TCLUSTER) gTY->SetPoint(gTY->GetN(),ind+0.5,mean);
430 if(plane==
XPLANE && type ==
TCLUSTER) gTXnoise->SetPoint(gTXnoise->GetN(),ind+0.5,mean);
431 if(plane==
YPLANE && type ==
TCLUSTER) gTYnoise->SetPoint(gTYnoise->GetN(),ind+0.5,mean);
440 gCX->SetMarkerStyle(7);
441 gTX->SetMarkerStyle(7);
442 gCY->SetMarkerStyle(7);
443 gTY->SetMarkerStyle(7);
444 gCX->SetMarkerSize(0.5);
445 gTX->SetMarkerSize(0.5);
446 gCY->SetMarkerSize(0.5);
447 gTY->SetMarkerSize(0.5);
448 gCX->SetMarkerColor(kGray);
449 gCY->SetMarkerColor(kGray);
455 std::cout << gCX->GetN() <<
" " << gCY->GetN() <<
" " << gTX->GetN() <<
" " << gTY->GetN() << std::endl;
459 if(gCX->GetN()>0) gCX->Draw(
"Psame");
460 if(gTX->GetN()>0) gTX->Draw(
"Psame");
461 if(gTXnoise->GetN()>0) gTXnoise->Draw(
"Psame");
463 if(gCY->GetN()>0) gCY->Draw(
"Psame");
464 if(gTY->GetN()>0) gTY->Draw(
"Psame");
465 if(gTYnoise->GetN()>0) gTYnoise->Draw(
"Psame");
486 Info(
"Init",
"Use default Threshold %g",
fThr);
489 Info(
"Init",
"Use Threshold %g",
fThr);
495 Info(
"Init",
"Use default Noise Threshold %g",
fNoiseThr);
498 Info(
"Init",
"Use Noise Threshold %g",
fNoiseThr);
HarpoRecoEvent * GetRecoEvent()
void FindCluster(HarpoDccMap *m, Int_t type, Int_t plane)
Cluster finder.
void SetQtotXEvt(Int_t val)
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
void SetNclXEvt(Int_t val)
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Object containing the reconstruction information for one event (with array of HarpoRecoClusters Harpo...
void SetNclYEvt(Int_t val)
void DisplayAnalysis(TRootEmbeddedCanvas *ecTab, TGListBox *infobox)
void Save(char *mode=NULL)
void AddClusters(HarpoRecoClusters *val)
void SetNTclXEvt(Int_t val)
Cluster object, containing position, charge and quality information.
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
void SetNTclYEvt(Int_t val)
void ResetClustersArray()
Bool_t Lookup(const char *path, Bool_t &val)
Lookup function for scalar values.
void SetTstart(Double_t val)
HarpoEventHeader * GetHeader()
const ULong_t gkNDetectors
void SetNCclYEvt(Int_t val)
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
Double_t GetSigmaNoise(Int_t i)
void SetYstart(Double_t val)
void SetQtotYEvt(Int_t val)
Clustering algorithm, runs on RAW data (HarpoMap), produces HarpoRecoClusters objects.
TClonesArray * GetClustersArray()
void SetXstart(Double_t val)
R__EXTERN HarpoDetSet * gHDetSet
void SetNCclXEvt(Int_t val)