37 #include <TPolyLine3D.h>
39 #include <TRootEmbeddedCanvas.h>
41 #include <TGComboBox.h>
45 #include <TGButtonGroup.h>
46 #include <TGNumberEntry.h>
47 #include <TGListBox.h>
48 #include <TObjArray.h>
50 #include <TClonesArray.h>
51 #include <TSystemDirectory.h>
54 #include <TSpectrum.h>
64 #include <TApplication.h>
67 #include "TMethodCall.h"
100 : TGMainFrame(p, w, h, opt)
156 hDoca =
new TH1F(
"hDoca",
";DOCA [mm]",500,0,50);
157 hOpenAngle =
new TH1F(
"hOpenAngle",
";#theta [^{o}]",360,-180,180);
158 hOmegaAngle =
new TH1F(
"hOmegaAngle",
";#theta [^{o}]",360,-180,180);
159 Long64_t clusteringType;
164 Long64_t trackingType;
258 printf (
"Int ERROR exiting ...\n");
262 printf (
"Initialized\n");
268 fHistEvent[0] =
new TH2F(
"fHistEventX",
";time [30ns bin]; X channel",512,0,512,288,0,288);
269 fHistEvent[1] =
new TH2F(
"fHistEventY",
";time [30ns bin]; Y channel",512,0,512,288,0,288);
271 fHistSpectrum[0] =
new TH1F(
"fHistSpectrumX",
";time [30ns bin]; X Q [ADC]",512,0,512);
272 fHistSpectrum[1] =
new TH1F(
"fHistSpectrumY",
";time [30ns bin]; Y Q [ADC]",512,0,512);
274 fHistEventEmpty[0] =
new TH2F(
"fHistEventEmptyX",
";time [30ns bin]; X channel",512,0,512,288,0,288);
275 fHistEventEmpty[1] =
new TH2F(
"fHistEventEmptyY",
";time [30ns bin]; Y channel",512,0,512,288,0,288);
279 UInt_t mainx = xsize1 + xsize2;
282 gStyle->SetFrameBorderMode(1);
283 gStyle->SetFrameBorderSize(1);
284 gStyle->SetOptStat(0);
286 TGVerticalFrame* f1 =
new TGVerticalFrame(
this,xsize1,mainy,kVerticalFrame);
287 TGVerticalFrame* f2 =
new TGVerticalFrame(
this,xsize2,mainy,kVerticalFrame);
288 this->AddFrame(f1,
new TGLayoutHints(kLHintsLeft | kLHintsExpandY,5,5,5,5));
289 this->AddFrame(f2,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
290 TGVerticalFrame* f20 =
new TGVerticalFrame(f2,xsize2,mainy,kVerticalFrame);
291 f2->AddFrame(f20,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
292 TGHorizontalFrame* f21 =
new TGHorizontalFrame(f2,xsize2,150,kHorizontalFrame);
293 f2->AddFrame(f21,
new TGLayoutHints(kLHintsExpandX | kLHintsBottom ,5,5,5,5));
301 SetWindowName(
"HARPO Reco Monitor");
302 MoveResize(0,0,mainx,mainy);
323 gApplication->Terminate(0);
333 UInt_t xsize2 = f20->GetWidth();
334 UInt_t mainy = f20->GetHeight();
338 f20->AddFrame(
fEventLabel,
new TGLayoutHints(kLHintsExpandX,5,5,5,5));
340 fTab =
new TGTab(f20, xsize2, mainy);
342 TGCompositeFrame *tf =
fTab->AddTab(
"Raw maps");
343 ecTabRaw =
new TRootEmbeddedCanvas(
"ecTabRaw",tf,xsize2,mainy);
344 tf->AddFrame(
ecTabRaw,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
346 tf =
fTab->AddTab(
"Noise Suppr");
347 ecTabNoiseSuppr =
new TRootEmbeddedCanvas(
"ecTabNoiseSuppr",tf,xsize2,mainy);
348 tf->AddFrame(
ecTabNoiseSuppr,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
350 tf =
fTab->AddTab(
"Clusters");
351 ecTabClusters =
new TRootEmbeddedCanvas(
"ecTabClusters",tf,xsize2,mainy);
352 tf->AddFrame(
ecTabClusters,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
354 tf =
fTab->AddTab(
"Tracking");
356 tf->AddFrame(
ecTabClustersTracks,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
358 tf =
fTab->AddTab(
"Tracks");
359 ecTabTracks =
new TRootEmbeddedCanvas(
"ecTabTracks",tf,xsize2,mainy);
360 tf->AddFrame(
ecTabTracks,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
362 tf =
fTab->AddTab(
"Matching");
363 ecTabMatching =
new TRootEmbeddedCanvas(
"ecTabMatching",tf,xsize2,mainy);
364 tf->AddFrame(
ecTabMatching,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
366 tf =
fTab->AddTab(
"Vertexing");
367 ecTabVertexing =
new TRootEmbeddedCanvas(
"ecTabVertex",tf,xsize2,mainy);
368 tf->AddFrame(
ecTabVertexing,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
370 tf =
fTab->AddTab(
"Vertexes");
371 ecTabVertex =
new TRootEmbeddedCanvas(
"ecTabVertex",tf,xsize2,mainy);
372 tf->AddFrame(
ecTabVertex,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
374 tf =
fTab->AddTab(
"3D");
375 ecTab3D =
new TRootEmbeddedCanvas(
"ecTab3D",tf,xsize2,mainy);
376 tf->AddFrame(
ecTab3D,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
378 tf =
fTab->AddTab(
"Sim");
379 ecTabSim =
new TRootEmbeddedCanvas(
"ecTabSim",tf,xsize2,mainy);
380 tf->AddFrame(
ecTabSim,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
382 tf =
fTab->AddTab(
"Analysis");
383 ecTabAnalysis =
new TRootEmbeddedCanvas(
"ecTabAnalysis",tf,xsize2,mainy);
384 tf->AddFrame(
ecTabAnalysis,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
386 f20->AddFrame(
fTab,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5));
390 ecTabRaw->GetCanvas()->SetName(
"cTabRaw");
406 ecTab3D->GetCanvas()->SetName(
"cTab3D");
407 ecTab3D->GetCanvas()->Divide(2);
408 ecTabSim->GetCanvas()->SetName(
"cTabSim");
422 UInt_t xsize = f21->GetWidth();
424 UInt_t ysize = f21->GetHeight();
429 TGLayoutHints* fLayout3 =
new TGLayoutHints(kLHintsTop | kLHintsExpandX ,5,5,5,5);
509 UInt_t xsize1 = f1->GetWidth();
513 TGLayoutHints* fLayout2 =
new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5);
517 TGHorizontalFrame* autorefreshFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
518 TGLabel* fDelayLabel =
new TGLabel(f1,
"");
526 autorefreshFrame->AddFrame(fDelayLabel,fLayout2);
535 fSave =
new TGTextButton(f1,
"Save Current Event",
M_SAVE);
536 fSave->Associate(
this);
550 TGHorizontalFrame* fCheckShowSpectrumFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
551 TGLabel* fCheckShowSpectrumLabel =
new TGLabel(fCheckShowSpectrumFrame,
"Show spectrum");
553 fCheckShowSpectrumFrame->AddFrame(
fCheckShowSpectrum,
new TGLayoutHints(kLHintsLeft,5,5,5,5));
554 fCheckShowSpectrumFrame->AddFrame(fCheckShowSpectrumLabel,
new TGLayoutHints(kLHintsLeft,5,5,5,5));
556 TGHorizontalFrame* fCheckAnimClusteringFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
557 TGLabel* fCheckAnimClusteringLabel =
new TGLabel(fCheckAnimClusteringFrame,
"Show clustering");
559 fCheckAnimClusteringFrame->AddFrame(
fCheckAnimClustering,
new TGLayoutHints(kLHintsLeft,5,5,5,5));
560 fCheckAnimClusteringFrame->AddFrame(fCheckAnimClusteringLabel,
new TGLayoutHints(kLHintsLeft,5,5,5,5));
562 TGHorizontalFrame* fCheckAnimTrackingFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
563 TGLabel* fCheckAnimTrackingLabel =
new TGLabel(fCheckAnimTrackingFrame,
"Show Kalman tracking");
565 fCheckAnimTrackingFrame->AddFrame(
fCheckAnimTracking,
new TGLayoutHints(kLHintsLeft,5,5,5,5));
566 fCheckAnimTrackingFrame->AddFrame(fCheckAnimTrackingLabel,
new TGLayoutHints(kLHintsLeft,5,5,5,5));
568 TGHorizontalFrame* fCheckAnimFittingFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
569 TGLabel* fCheckAnimFittingLabel =
new TGLabel(fCheckAnimFittingFrame,
"Show Kalman fitting");
571 fCheckAnimFittingFrame->AddFrame(
fCheckAnimFitting,
new TGLayoutHints(kLHintsLeft,5,5,5,5));
572 fCheckAnimFittingFrame->AddFrame(fCheckAnimFittingLabel,
new TGLayoutHints(kLHintsLeft,5,5,5,5));
574 TGHorizontalFrame* triggerFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
597 TGHorizontalFrame* eventTypeFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
616 TGHorizontalFrame* clusteringTypeFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
617 TGLabel* clusteringLabel =
new TGLabel(clusteringTypeFrame,
"Clustering");
632 clusteringTypeFrame->AddFrame(clusteringLabel,fLayout2);
634 TGTextButton* fConfClustering =
new TGTextButton(clusteringTypeFrame,
"Config",
M_CONF_CLUSTERING);
635 fConfClustering->Associate(
this);
636 clusteringTypeFrame->AddFrame(fConfClustering,fLayout2);
638 TGHorizontalFrame* trackingTypeFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
639 TGLabel* trackingLabel =
new TGLabel(trackingTypeFrame,
"Tracking");
656 trackingTypeFrame->AddFrame(trackingLabel,fLayout2);
658 TGTextButton* fConfTracking =
new TGTextButton(trackingTypeFrame,
"Config",
M_CONF_TRACKING);
659 fConfTracking->Associate(
this);
660 trackingTypeFrame->AddFrame(fConfTracking,fLayout2);
662 TGHorizontalFrame* matchingTypeFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
663 TGLabel* matchingLabel =
new TGLabel(matchingTypeFrame,
"Matching");
674 matchingTypeFrame->AddFrame(matchingLabel,fLayout2);
676 TGTextButton* fConfMatching =
new TGTextButton(matchingTypeFrame,
"Config",
M_CONF_MATCHING);
677 fConfMatching->Associate(
this);
678 matchingTypeFrame->AddFrame(fConfMatching,fLayout2);
680 TGHorizontalFrame* vertexingTypeFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
681 TGLabel* vertexingLabel =
new TGLabel(vertexingTypeFrame,
"Vertexing");
691 vertexingTypeFrame->AddFrame(vertexingLabel,fLayout2);
693 TGTextButton* fConfVertexing =
new TGTextButton(vertexingTypeFrame,
"Config",
M_CONF_VERTEXING);
694 fConfVertexing->Associate(
this);
695 vertexingTypeFrame->AddFrame(fConfVertexing,fLayout2);
697 TGHorizontalFrame* analysisTypeFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
698 TGLabel* analysisLabel =
new TGLabel(analysisTypeFrame,
"Analysis");
713 analysisTypeFrame->AddFrame(analysisLabel,fLayout2);
715 TGTextButton* fConfAnalysis =
new TGTextButton(analysisTypeFrame,
"Config",
M_CONF_ANALYSIS);
716 fConfAnalysis->Associate(
this);
717 analysisTypeFrame->AddFrame(fConfAnalysis,fLayout2);
719 TGHorizontalFrame* selectorTypeFrame =
new TGHorizontalFrame(f1,xsize1,ysize,kHorizontalFrame);
720 TGLabel* selectorLabel =
new TGLabel(selectorTypeFrame,
"Selector");
740 selectorTypeFrame->AddFrame(selectorLabel,fLayout2);
742 TGTextButton* fConfSelector =
new TGTextButton(selectorTypeFrame,
"Config",
M_CONF_SELECTOR);
743 fConfSelector->Associate(
this);
744 selectorTypeFrame->AddFrame(fConfSelector,fLayout2);
749 f1->AddFrame(autorefreshFrame,fLayout2);
751 f1->AddFrame(
fSave,fLayout2);
755 f1->AddFrame(fCheckShowSpectrumFrame,fLayout2);
756 f1->AddFrame(fCheckAnimClusteringFrame,fLayout2);
757 f1->AddFrame(fCheckAnimTrackingFrame,fLayout2);
758 f1->AddFrame(fCheckAnimFittingFrame,fLayout2);
759 f1->AddFrame(triggerFrame,fLayout2);
760 f1->AddFrame(eventTypeFrame,fLayout2);
761 f1->AddFrame(clusteringTypeFrame,fLayout2);
762 f1->AddFrame(trackingTypeFrame,fLayout2);
763 f1->AddFrame(matchingTypeFrame,fLayout2);
764 f1->AddFrame(vertexingTypeFrame,fLayout2);
765 f1->AddFrame(analysisTypeFrame,fLayout2);
766 f1->AddFrame(selectorTypeFrame,fLayout2);
790 Info(
"DisplayMap",
"%p",evt);
794 for(Int_t ndet=0;ndet<2;ndet++) {
797 if ( m == NULL )
continue;
800 for(Int_t i=1;i<
NADC;i++){
803 for(Int_t j=0;j<
NCHAN;j++){
819 Info(
"DisplayMap",
"%p",
fEvent);
824 TCanvas* cTab = ecTab->GetCanvas();
825 cTab->GetPad(1)->Delete();
826 cTab->GetPad(2)->Delete();
829 cTab->GetPad(1)->Divide(1,2);
830 cTab->GetPad(2)->Divide(1,2);
833 TLatex* latex =
new TLatex();
834 latex->SetTextFont(132);
835 latex->SetTextAlign(12);
836 latex->SetTextSize(0.08);
838 for(Int_t ndet=0;ndet<2;ndet++) {
841 if ( m == NULL )
continue;
842 Int_t color = ndet? kRed : kBlue;
843 latex->SetTextColor(color);
871 TLine* line =
new TLine();
872 line->SetLineWidth(2);
873 line->SetLineStyle(2);
874 line->DrawLine(0,194,511,194);
875 line->DrawLine(0,94,511,94);
878 line->SetLineWidth(1);
879 line->SetLineStyle(3);
880 line->DrawLine(0,259,511,259);
881 line->DrawLine(0,226,511,226);
882 line->DrawLine(0,160.5,511,160.5);
883 line->DrawLine(0,127.5,511,127.5);
884 line->DrawLine(0,61.5,511,61.5);
885 line->DrawLine(0,28.5,511,28.5);
895 TH1D* hEventProjX =
fHistEvent[0]->ProjectionX();
897 hEventProjX->SetLineColor(kBlue);
898 TH1D* hEventProjY =
fHistEvent[1]->ProjectionX();
899 hEventProjY->SetLineColor(kRed);
901 hEventProjY->DrawCopy(
"same");
902 TH1D* hRatio = (TH1D*)hEventProjX->Clone();
903 hRatio->SetLineColor(kBlack);
904 hRatio->Divide(hEventProjY);
905 hRatio->SetMinimum(0);
906 hRatio->SetMaximum(2);
910 TLine* line =
new TLine();
911 line->SetLineWidth(1);
912 line->SetLineStyle(2);
913 line->DrawLine(0,1,511,1);
923 Info(
"DisplayMap",
"%p",
fEvent);
928 TCanvas* cTab = ecTab->GetCanvas();
929 cTab->GetPad(1)->Delete();
930 cTab->GetPad(2)->Delete();
933 TLatex* latex =
new TLatex();
934 latex->SetTextFont(132);
935 latex->SetTextAlign(12);
936 latex->SetTextSize(0.08);
938 for(Int_t ndet=0;ndet<2;ndet++) {
940 Int_t color = ndet? kRed : kBlue;
941 latex->SetTextColor(color);
947 TLine* line =
new TLine();
948 line->SetLineWidth(2);
949 line->SetLineStyle(2);
950 line->DrawLine(0,194,511,194);
951 line->DrawLine(0,94,511,94);
954 line->SetLineWidth(1);
955 line->SetLineStyle(3);
956 line->DrawLine(0,259,511,259);
957 line->DrawLine(0,226,511,226);
958 line->DrawLine(0,160.5,511,160.5);
959 line->DrawLine(0,127.5,511,127.5);
960 line->DrawLine(0,61.5,511,61.5);
961 line->DrawLine(0,28.5,511,28.5);
1058 TCanvas* cTab = ecTab->GetCanvas();
1061 Int_t nCl = clArray->GetEntries();
1067 TGraph* gXnoise[10];
1068 TGraph* gYnoise[10];
1069 for(Int_t i = 0; i<10; i++){
1070 gX[i] =
new TGraph();
1071 gY[i] =
new TGraph();
1072 gX[i]->SetMarkerStyle(7);
1073 gY[i]->SetMarkerStyle(7);
1074 gX[i]->SetMarkerSize(0.5);
1075 gY[i]->SetMarkerSize(0.5);
1076 gX[i]->SetMarkerColor(i+2);
1077 gY[i]->SetMarkerColor(i+2);
1079 gXnoise[i] =
new TGraph();
1080 gYnoise[i] =
new TGraph();
1081 gXnoise[i]->SetMarkerStyle(28);
1082 gYnoise[i]->SetMarkerStyle(28);
1083 gXnoise[i]->SetMarkerSize(1);
1084 gYnoise[i]->SetMarkerSize(1);
1085 gXnoise[i]->SetMarkerColor(i+2);
1086 gYnoise[i]->SetMarkerColor(i+2);
1089 for(Int_t icl = 0; icl<nCl; icl++){
1092 Double_t mean = cluster->
GetMean();
1095 Int_t nTr = cluster->
GetNtr();
1096 for(Int_t k = 0; k<nTr; k++){
1100 if(itr>=10)
continue;
1102 if(plane==
XPLANE && type ==
CCLUSTER) gX[itr]->SetPoint(gX[itr]->GetN(),mean,ind+0.5);
1103 if(plane==
XPLANE && type ==
TCLUSTER) gX[itr]->SetPoint(gX[itr]->GetN(),ind+0.5,mean);
1104 if(plane==
YPLANE && type ==
CCLUSTER) gY[itr]->SetPoint(gY[itr]->GetN(),mean,ind+0.5);
1105 if(plane==
YPLANE && type ==
TCLUSTER) gY[itr]->SetPoint(gY[itr]->GetN(),ind+0.5,mean);
1107 if(plane==
XPLANE && type ==
CCLUSTER) gXnoise[itr]->SetPoint(gXnoise[itr]->GetN(),mean,ind+0.5);
1108 if(plane==
XPLANE && type ==
TCLUSTER) gXnoise[itr]->SetPoint(gXnoise[itr]->GetN(),ind+0.5,mean);
1109 if(plane==
YPLANE && type ==
CCLUSTER) gYnoise[itr]->SetPoint(gYnoise[itr]->GetN(),mean,ind+0.5);
1110 if(plane==
YPLANE && type ==
TCLUSTER) gYnoise[itr]->SetPoint(gYnoise[itr]->GetN(),ind+0.5,mean);
1115 TLegend* lX =
new TLegend(0.1,0.5,0.3,0.98);
1116 TLegend* lY =
new TLegend(0.1,0.5,0.3,0.98);
1117 for(Int_t i = 0; i<10; i++){
1119 if(gX[i]->GetN()>0){
1120 std::cout <<
"gX[" << i <<
"] => " << gX[i]->GetN() << endl;
1121 gX[i]->Draw(
"Psame");
1122 gXnoise[i]->Draw(
"Psame");
1123 lX->AddEntry(gX[i],Form(
"%d",i),
"P");
1126 if(gY[i]->GetN()>0){
1127 std::cout <<
"gY[" << i <<
"] => " << gY[i]->GetN() << endl;
1128 gY[i]->Draw(
"Psame");
1129 gYnoise[i]->Draw(
"Psame");
1130 lY->AddEntry(gY[i],Form(
"%d",i),
"P");
1145 TFile* savefile = NULL;
1146 Char_t filename[256];
1147 sprintf(filename,
"plots/tracking/run%d_evt%ld.root",
1150 Bool_t save = !gSystem->AccessPathName(filename);
1151 if(save) savefile =
new TFile(filename,
"update");
1153 TCanvas* cTab = ecTab->GetCanvas();
1156 Int_t nTr = trArray->GetEntries();
1159 Int_t nCl = clArray->GetEntries();
1163 l[0] =
new TLegend(0.1,0.5,0.3,0.98);
1164 l[1] =
new TLegend(0.1,0.5,0.3,0.98);
1165 TLatex* latex =
new TLatex();
1166 latex->SetTextFont(132);
1167 latex->SetTextAlign(12);
1168 latex->SetTextSize(0.08);
1170 Double_t angleX[10], angleY[10];
1171 Int_t nclX[10], nclY[10];
1179 gAll[0] =
new TGraph();
1180 gAll[1] =
new TGraph();
1181 gAll[0]->SetMarkerStyle(6);
1182 gAll[1]->SetMarkerStyle(6);
1183 gAll[0]->SetMarkerColor(kGray);
1184 gAll[1]->SetMarkerColor(kGray);
1185 for(Int_t icl = 0; icl<nCl; icl++){
1188 Double_t x = cluster->
GetX();
1189 Double_t z = cluster->
GetZ();
1190 gAll[ndet]->SetPoint(gAll[ndet]->GetN(),z,x);
1193 gAll[0]->Draw(
"Psame");
1195 gAll[1]->Draw(
"Psame");
1197 for(Int_t itr = 0; itr<nTr; itr++){
1203 Int_t color = trId+2;
1206 g[ndet][itr] =
new TGraph();
1207 g[ndet][itr]->SetMarkerStyle(6);
1208 g[ndet][itr]->SetMarkerColor(color);
1209 for(Int_t icl = 0; icl<nCl; icl++){
1211 if(cluster->
GetPlane()!=ndet)
continue;
1212 Bool_t test = kFALSE;
1213 Int_t nTr = cluster->
GetNtr();
1214 for(Int_t i = 0; i<nTr; i++)
1218 Double_t x = cluster->
GetX();
1219 Double_t z = cluster->
GetZ();
1221 g[ndet][itr]->SetPoint(g[ndet][itr]->GetN(),z,x);
1224 Double_t x0 = track->
GetX0();
1229 Double_t xEnd = track->
GetXend();
1230 Double_t zEnd = track->
GetZend();
1231 Info(
"DisplayTracks",
"%g %g %g %g",xStart,zStart,xEnd,zEnd);
1234 TEllipse* eStart =
new TEllipse(zStart,xStart,4);
1235 eStart->SetFillColor(color);
1237 TEllipse* eEnd =
new TEllipse(zEnd,xEnd,4);
1238 eEnd->SetFillColor(color);
1244 TGraph* gStart =
new TGraph();
1245 Int_t l = 0, start = 1000;
1246 Bool_t empty = kFALSE;
1247 for(Int_t i=0;i<1000;i++){
1248 Double_t phi = i*4*TMath::Pi()/1000;
1249 Double_t xTmp = xStart + 30*TMath::Cos(phi);
1250 Double_t zTmp = zStart + 30*TMath::Sin(phi);
1251 Int_t channel = Int_t(xTmp);
1252 Int_t timebin = Int_t(zTmp);
1253 if(channel<0 || channel>=
NCHAN)
continue;
1254 if(timebin<0 || timebin>=
NADC)
continue;
1255 Int_t q = m->
GetData(channel,timebin);
1257 gStart->SetPoint(n,zTmp,xTmp);
1261 if(!empty) start = i;
1262 if(i-start>l) l = i-start;
1266 gStart->SetLineWidth(2);
1267 gStart->SetLineStyle(2);
1268 gStart->Draw(
"Lsame");
1269 latex->DrawLatex(zStart,xStart,Form(
"%d",l));
1271 l = 0; start = 1000;
1272 TGraph* gEnd =
new TGraph();
1273 for(Int_t i=0;i<1000;i++){
1274 Double_t phi = i*4*TMath::Pi()/1000;
1275 Double_t xTmp = xEnd + 30*TMath::Cos(phi);
1276 Double_t zTmp = zEnd + 30*TMath::Sin(phi);
1277 Int_t channel = Int_t(xTmp);
1278 Int_t timebin = Int_t(zTmp);
1280 if(channel<0 || channel>=
NCHAN || timebin<0 || timebin>=
NADC) q = 0;
1281 else q = m->
GetData(channel,timebin);
1283 gEnd->SetPoint(n,zTmp,xTmp);
1287 if(!empty) start = i;
1288 if(i-start>l) l = i-start;
1292 gEnd->SetLineWidth(2);
1293 gEnd->SetLineStyle(3);
1294 gEnd->Draw(
"Lsame");
1295 latex->DrawLatex(zEnd,xEnd,Form(
"%d",l));
1301 Double_t zmin, zmax;
1309 line[ndet][itr] =
new TF1(Form(
"line%d_%d",itr,ndet),
"pol1",zmin,zmax);
1311 line[ndet][itr]->SetParameter(0,x0);
1312 line[ndet][itr]->SetParameter(1,slope);
1314 l[ndet]->AddEntry(line[ndet][itr],Form(
"%d (%d)",trId,track->
GetQtTrack()),
"L");
1315 line[ndet][itr]->SetLineColor(color);
1316 g[ndet][itr]->Draw(
"Psame");
1317 line[ndet][itr]->DrawCopy(
"same");
1319 g[ndet][itr]->Write(Form(
"g_%d_%d",itr,ndet));
1320 line[ndet][itr]->Write(Form(
"line_%d_%d",itr,ndet));
1323 if(save) savefile->Close();
1348 Int_t nTrK = trArrayK->GetEntries();
1349 TGraph* g2[2][nTrK];
1350 for(Int_t i = 0; i<nTrK; i++){
1351 g2[0][i] =
new TGraph();
1352 g2[1][i] =
new TGraph();
1354 for(Int_t icl = 0; icl<nCl; icl++){
1359 if(idTr<0)
continue;
1360 if(idTr>=nTrK)
continue;
1361 g2[plane][idTr]->SetPoint(g2[plane][idTr]->GetN(),cluster->
GetZfit(0),cluster->
GetXfit(0));
1364 Info(
"DisplayTracks",
"NtracksK = %d",nTrK);
1366 for(Int_t itr = 0; itr<nTrK; itr++){
1371 if(!g2[plane][trId])
continue;
1372 if(g2[plane][trId]->GetN()<1)
continue;
1373 Info(
"DisplayTracks",
"Plane %d, Tr %d => Ncl = %d",plane, trId,g2[plane][trId]->GetN());
1374 g2[plane][trId]->SetMarkerColor(trId+2);
1375 g2[plane][trId]->SetMarkerStyle(6);
1376 g2[plane][trId]->Draw(
"Psame");
1377 l[plane]->AddEntry(g2[plane][trId],Form(
"%d",trId),
"P");
1400 for(Int_t itr = 0; itr<nTr; itr++){
1413 if(ndet==0) cout<<
"angle="<<angX<<endl;
1422 Int_t color = trId+2;
1424 Double_t x0 = track->
GetX0();
1430 Double_t zmin, zmax;
1438 line[ndet][itr] =
new TF1(Form(
"line%d",itr),
"pol1",zmin,zmax);
1440 line[ndet][itr]->SetParameter(0,x0);
1441 line[ndet][itr]->SetParameter(1,slope);
1443 l[ndet]->AddEntry(line[ndet][itr],Form(
"%d (%d)",trId,track->
GetQtTrack()),
"L");
1444 line[ndet][itr]->SetLineColor(color);
1446 line[ndet][itr]->DrawCopy(
"same");
1462 TGraph* gCXAssoc[10];
1463 TGraph* gTXAssoc[10];
1464 TGraph* gCYAssoc[10];
1465 TGraph* gTYAssoc[10];
1467 for(Int_t i = 0; i<10; i++){
1470 gCXAssoc[i] =
new TGraph();
1471 gCYAssoc[i] =
new TGraph();
1472 gTXAssoc[i] =
new TGraph();
1473 gTYAssoc[i] =
new TGraph();
1489 gCXAssoc[i] -> SetMarkerStyle(7);
1490 gCYAssoc[i] -> SetMarkerStyle(7);
1491 gTXAssoc[i] -> SetMarkerStyle(7);
1492 gTYAssoc[i] -> SetMarkerStyle(7);
1494 gCXAssoc[i] -> SetMarkerSize(0.5);
1495 gCYAssoc[i] -> SetMarkerSize(0.5);
1496 gTXAssoc[i] -> SetMarkerSize(0.5);
1497 gTYAssoc[i] -> SetMarkerSize(0.5);
1499 gCXAssoc[i] -> SetMarkerColor(color);
1500 gCYAssoc[i] -> SetMarkerColor(color);
1501 gTXAssoc[i] -> SetMarkerColor(color);
1502 gTYAssoc[i] -> SetMarkerColor(color);
1504 Info(
"DisplayTracks",
"Draw Track %p (%d)",gCXAssoc[0],nTr);
1508 for(Int_t icl = 0; icl<nCl; icl++){
1511 Double_t mean = cluster->
GetMean();
1517 for(Int_t i = 0; i<10; i++){
1521 if(itr>=10)
continue;
1528 if(plane==
XPLANE && type ==
CCLUSTER) gCXAssoc[itr]->SetPoint(gCXAssoc[itr]->GetN(),mean,ind);
1529 if(plane==
XPLANE && type ==
TCLUSTER) gTXAssoc[itr]->SetPoint(gTXAssoc[itr]->GetN(),ind,mean);
1530 if(plane==
YPLANE && type ==
CCLUSTER) gCYAssoc[itr]->SetPoint(gCYAssoc[itr]->GetN(),mean,ind);
1531 if(plane==
YPLANE && type ==
TCLUSTER) gTYAssoc[itr]->SetPoint(gTYAssoc[itr]->GetN(),ind,mean);
1540 Double_t ylatexX = 280, ylatexY = 280;
1541 for(Int_t i = 0; i<10; i++){
1546 if(!gCXAssoc[i])
continue;
1547 if(gCXAssoc[i]->GetN()>0)
1548 gCXAssoc[i]->Draw(
"Psame");
1549 if(gTXAssoc[i]->GetN()>0)
1550 gTXAssoc[i]->Draw(
"Psame");
1551 latex->SetTextSize(0.06);
1552 latex->SetTextColor(i+2);
1553 if(angleX[i] != 100){
1554 latex->DrawLatex(10,ylatexX,Form(
"track %d: %.2f %d",i, angleX[i]*180./TMath::Pi(), nclX[i]));
1568 if(gCYAssoc[i]->GetN()>0) gCYAssoc[i]->Draw(
"Psame");
1569 if(gTYAssoc[i]->GetN()>0) gTYAssoc[i]->Draw(
"Psame");
1570 latex->SetTextSize(0.06);
1571 latex->SetTextColor(i+2);
1572 if(angleY[i] != 100){
1573 latex->DrawLatex(10,ylatexY,Form(
"track %d: %.2f %d",i, angleY[i]*180./TMath::Pi(),nclY[i]));
1599 TCanvas* c = ecTab->GetCanvas();
1601 Int_t nV = vArray->GetEntries();
1602 Info(
"DisplayAnalysis",
"nV = %d",nV);
1603 for(Int_t i = 0; i<nV; i++){
1612 Info(
"DisplayAnalysis",
"%d %g %g",plane,zV,xV);
1613 TEllipse* eStart =
new TEllipse(zV,xV,4);
1614 eStart->SetLineColor(kGray);
1616 eStart->SetFillColor(kGray);
1618 eStart->SetFillColor(kGreen);
1621 TArrow* arrow =
new TArrow();
1622 arrow->SetLineColor(kGray);
1623 arrow->SetFillColor(kGray);
1624 arrow->SetArrowSize(0.01);
1625 arrow->DrawArrow(zV,xV,zV+30*pzV,xV+30*pxV);
1627 Double_t cTh = TMath::Cos(thV*0.5);
1628 Double_t sTh = TMath::Sin(thV*0.5);
1629 Double_t px1 = pxV*cTh + pzV*sTh;
1630 Double_t pz1 = pzV*cTh - pxV*sTh;
1631 Double_t px2 = pxV*cTh - pzV*sTh;
1632 Double_t pz2 = pzV*cTh + pxV*sTh;
1633 TLine* l1 =
new TLine();
1634 l1->SetLineColor(kGray);
1635 l1->SetLineWidth(3);
1636 l1->DrawLine(zV,xV,zV+30*pz1,xV+30*px1);
1637 TLine* l2 =
new TLine();
1638 l2->SetLineColor(kGray);
1639 l2->SetLineWidth(2);
1640 l2->DrawLine(zV,xV,zV+30*pz2,xV+30*px2);
1665 TCanvas* cTab = ecTab->GetCanvas();
1673 Int_t nV3D = vertex3DArray->GetEntries();
1675 for(Int_t i = 0; i<nV3D; i++){
1686 Double_t angle_omega = atan2(pz2*px1-pz1*px2,pz2*py1-pz1*py2);
1691 TEllipse* eStartX =
new TEllipse(z,x,3);
1692 eStartX->SetLineColor(color);
1693 eStartX->SetFillColor(color);
1696 TLine* l1x =
new TLine();
1697 l1x->SetLineColor(color);
1698 l1x->SetLineWidth(2);
1699 l1x->SetLineStyle(2);
1700 l1x->DrawLine(z,x,z+100*pz1,x+100*px1);
1701 TLine* l2x =
new TLine();
1702 l2x->SetLineColor(color);
1703 l2x->SetLineWidth(2);
1704 l2x->SetLineStyle(3);
1705 l2x->DrawLine(z,x,z+100*pz2,x+100*px2);
1708 TEllipse* eStartY =
new TEllipse(z,y,3);
1709 eStartY->SetLineColor(color);
1710 eStartY->SetFillColor(color);
1713 TLine* l1y =
new TLine();
1714 l1y->SetLineColor(color);
1715 l1y->SetLineWidth(2);
1716 l1y->SetLineStyle(2);
1717 l1y->DrawLine(z,y,z+100*pz1,y+100*py1);
1718 TLine* l2y =
new TLine();
1719 l2y->SetLineColor(color);
1720 l2y->SetLineWidth(2);
1721 l2y->SetLineStyle(3);
1722 l2y->DrawLine(z,y,z+100*pz2,y+100*py2);
1726 if(angle_omega>0.5*TMath::Pi()) angle_omega -= TMath::Pi();
1727 if(angle_omega<-0.5*TMath::Pi()) angle_omega += TMath::Pi();
1728 fInfoBox->NewEntry(Form(
"%d: omega = %g",i,angle_omega));
1745 Double_t angle_omega_sim = 0;
1746 Double_t psim[2][3];
1750 for(Int_t i = 0; i<nMCtr; i++){
1752 Double_t x = track->
GetX0() + 149.3;
1753 Double_t y = track->
GetY0() + 149.3;
1754 Double_t z = track->
GetZ0() + 228.5;
1755 Double_t px = track->
GetPx();
1756 Double_t py = track->
GetPy();
1757 Double_t pz = track->
GetPz();
1759 TLine* lx =
new TLine();
1760 lx->SetLineColor(kBlack);
1761 lx->SetLineWidth(2);
1762 lx->SetLineStyle(2+i);
1764 lx->DrawLine(z,x,z+100*pz,x+100*px);
1765 TLine* ly =
new TLine();
1766 ly->SetLineColor(kBlack);
1767 ly->SetLineWidth(2);
1768 ly->SetLineStyle(2+i);
1770 ly->DrawLine(z,y,z+100*pz,y+100*py);
1774 Double_t norm[2] = {0,0};
1775 for(Int_t i = 0; i<nMCtr; i++){
1777 psim[i][0] = track->
GetPy();
1778 psim[i][1] = track->
GetPx();
1779 psim[i][2] = track->
GetPz();
1780 norm[i] = TMath::Sqrt(psim[i][0]*psim[i][0]+psim[i][1]*psim[i][1]+psim[i][2]*psim[i][2]);
1784 for(Int_t k = 0; k<3; k++){
1785 psim[0][k] /= norm[0];
1786 psim[1][k] /= norm[1];
1787 u1u2 += psim[0][k]*psim[1][k];
1790 angle_omega_sim = atan2((psim[1][2]*psim[0][0]-psim[0][2]*psim[1][0]),(psim[1][2]*psim[0][1]-psim[0][2]*psim[1][1]));
1792 if(angle_omega_sim>0.5*TMath::Pi()) angle_omega_sim -= TMath::Pi();
1793 if(angle_omega_sim<-0.5*TMath::Pi()) angle_omega_sim += TMath::Pi();
1794 fInfoBox->NewEntry(Form(
"omega_sim = %g",angle_omega_sim));
1994 TCanvas* cTab = ecTab->GetCanvas();
2001 for(Int_t i = 0; i<nIonTr; i++){
2004 TGraph* gX =
new TGraph();
2005 gX->SetMarkerStyle(7);
2006 gX->SetMarkerColor(2+i);
2007 TGraph* gY =
new TGraph();
2008 gY->SetMarkerStyle(7);
2009 gY->SetMarkerColor(2+i);
2010 for(Int_t j = 0; j<nPoints; j++){
2012 gX->SetPoint(j,point->
GetZ()+ 88.5,point->
GetX()+ 150.5);
2013 gY->SetPoint(j,point->
GetZ()+ 88.5,point->
GetY()+ 150.5);
2025 for(Int_t i = 0; i<nMCtr; i++){
2027 Double_t x = track->
GetX0() + 149.3;
2028 Double_t y = track->
GetY0() + 149.3;
2029 Double_t z = track->
GetZ0() + 228.5;
2030 Double_t px = track->
GetPx();
2031 Double_t py = track->
GetPy();
2032 Double_t pz = track->
GetPz();
2037 Int_t color = kBlack;
2039 px = -px; py = -py; pz = -pz;
2043 TLine* lx =
new TLine();
2044 lx->SetLineColor(color);
2045 lx->SetLineWidth(2);
2046 lx->SetLineStyle(2+i);
2048 lx->DrawLine(z,x,z+100*pz,x+100*px);
2049 TLine* ly =
new TLine();
2050 ly->SetLineColor(color);
2051 ly->SetLineWidth(2);
2052 ly->SetLineStyle(2+i);
2054 ly->DrawLine(z,y,z+100*pz,y+100*py);
2075 if(fClusteringType<0 || fClusteringType>=(Int_t)
kNclustering)
2078 if(fTrackingType<0 || fTrackingType>=(Int_t)
kNtracking)
2081 if(fMatchingType<0 || fMatchingType>=(Int_t)
kNmatching)
2084 if(fVertexingType<0 || fVertexingType>=(Int_t)
kNvertexing)
2088 if(fAnalysisType<0 || fAnalysisType>=(Int_t)
kNanalysis)
2091 if(fSelectorType<0 || fSelectorType>=(Int_t)
kNselector)
2111 for(Int_t ndet=0;ndet<2;ndet++) {
2114 if ( m == NULL )
continue;
2115 for(Int_t i=1;i<
NADC;i++){
2116 for(Int_t j=0;j<
NCHAN;j++){
2118 if(q<=-1000)
continue;
2124 Double_t ratio = -1;
2125 if(qtot[1]) ratio = qtot[0]/qtot[1];
2127 fInfoBox->NewEntry(Form(
"Ratio: %g", ratio));
2137 if ( mX == NULL )
return;
2138 if ( mY == NULL )
return;
2141 Double_t qTotX3 = 0, qTotY3 = 0;
2142 Double_t meanX3 = 0, meanY3 = 0;
2143 Double_t meanXevt = 0, meanYevt = 0;
2145 for(Int_t i=0;i<
NADC;i++){
2146 Double_t qTotX = 0, qTotY = 0;
2147 Double_t meanX = 0, meanY = 0;
2148 for(Int_t j=0;j<
NCHAN;j++){
2149 Double_t qX = mX->
GetData(j,i);
2150 Double_t qY = mY->
GetData(j,i);
2164 if(qTotX*qTotY == 0)
continue;
2168 meanXevt = meanX3/qTotX3;
2169 meanYevt = meanY3/qTotY3;
2170 fInfoBox->NewEntry(Form(
"X = %g, Y = %g", meanXevt, meanYevt));
2171 if(TMath::Abs(meanXevt-144)>10)
break;
2172 if(TMath::Abs(meanYevt-144)>10)
break;
2175 if(i<150 && i2>2)
break;
2177 Double_t xMin = 400, yMin = 400, xMax = -1, yMax = -1;
2178 for(Int_t J=0;J<
NCHAN;J++){
2179 Double_t qXch = 0, qYch = 0;
2180 for(Int_t I=i-1;I<i+100 && I<
NADC;I++){
2181 Double_t qX = mX->
GetData(J,I);
2182 Double_t qY = mY->
GetData(J,I);
2188 if(qXch>1000 && J<xMin) xMin = J;
2189 if(qYch>1000 && J<yMin) yMin = J;
2190 if(qXch>1000 && J>xMax) xMax = J;
2191 if(qYch>1000 && J>yMax) yMax = J;
2193 std::cout << xMin <<
" " << yMin <<
" " << xMax <<
" " <<yMax << std::endl;
2194 Int_t widthX = xMax-xMin+1;
2195 Int_t widthY = yMax-yMin+1;
2196 fInfoBox->NewEntry(Form(
"wX = %d, wY = %d", widthX, widthY));
2209 Info(
"DisplayEvent",
"%p",
fEvent);
2210 if(event == 0)
return;
2259 std::cout <<
"**** " <<
event->GetRecoEvent()->GetClustersArray()->GetEntries() <<
" ****" << std::endl;
2263 std::cout <<
"**** " <<
event->GetRecoEvent()->GetClustersArray()->GetEntries() <<
" ****" << std::endl;
2271 event->GetRecoEvent()->ResetTracksArray();
2283 event->GetRecoEvent()->ResetVertexArray();
2307 event->GetRecoEvent()->ResetTracksArray();
2319 event->GetRecoEvent()->ResetMatchingArray();
2321 event->GetRecoEvent()->ResetVertex3DArray();
2340 std::cout <<
"**** " <<
event->GetRecoEvent()->GetClustersArray()->GetEntries() <<
" ****" << std::endl;
2356 std::cout <<
"**** " <<
event->GetRecoEvent()->GetClustersArray()->GetEntries() <<
" ****" << std::endl;
2385 Warning(
"PrevEvent",
"Cannot navigate back with RAW Reader");
2407 std::cout <<
"############ " << test <<
" ##############" << std::endl;
2425 for(Int_t i = 0; i<nEvents; i++){
2447 std::cout <<
"." << std::flush;
2455 Int_t triggerType = -1;
2535 Char_t savedir[512];
2537 gSystem->Exec(Form(
"mkdir -p %s",savedir));
2538 if(!gSystem->AccessPathName(savedir)){
2572 TLatex* latex =
new TLatex();
2573 latex->SetTextFont(132);
2574 latex->SetTextAlign(12);
2575 latex->SetTextSize(0.08);
2580 Int_t nMatch = matchArray->GetEntries();
2583 cSave =
new TCanvas(
"cSave",
"c",1100,1100);
2587 cSaveLog =
new TCanvas(
"cSaveLog",
"log",1100,1100);
2591 cSaveSp =
new TCanvas(
"cSaveSp",
"spectrum",1100,1100);
2595 cSaveAll =
new TCanvas(
"cSaveAll",
"all",1500,500);
2596 cSaveAll->Divide(3);
2597 TVirtualPad* cSaveAll1 = cSaveAll->GetPad(1);
2598 cSaveAll1->SetName(
"cSaveAll1");
2599 TVirtualPad* cSaveAll2 = cSaveAll->GetPad(2);
2600 cSaveAll2->SetName(
"cSaveAll2");
2603 Double_t left = 0.12, right = 0.12, bottom = 0.07, top = 0.01;
2611 Double_t vcorr = ((1. - bottom - top)/2. + top)/((1. - bottom - top)/2. + bottom);
2613 TLine* lineT =
new TLine();
2614 lineT->SetLineStyle(10);
2615 lineT->SetLineWidth(2);
2616 lineT->SetLineColor(kGray+1);
2617 Double_t tmin = 90.,
tmax = 415.;
2620 for(Int_t i = 0; i<nMatch; i++){
2622 TCanvas* cMatch =
new TCanvas(Form(
"cMatch%d",i));
2634 for(Int_t plane = 0; plane<2; plane++){
2635 for(Int_t i = 0; i<
NADC-35; i++){
2636 for(Int_t j = 0; j<
NCHAN; j++){
2637 fHistEvent[plane]->SetBinContent(NADC-i+1,j+1,
fHistEvent[plane]->GetBinContent(NADC-35-i+1,j+1));
2644 sprintf(name,
"%s_%i_%i",cSave->GetName(),0,1);
2645 std::cout << name << std::endl;
2647 ((TPad*) gROOT->FindObject(name))->Draw();
2648 ((TPad*) gROOT->FindObject(name))->cd();
2651 lineT->DrawLine(tmin,1,tmin,288);
2653 sprintf(name,
"%s_%i_%i",cSave->GetName(),0,0);
2654 std::cout << name << std::endl;
2656 ((TPad*) gROOT->FindObject(name))->Draw();
2657 ((TPad*) gROOT->FindObject(name))->cd();
2663 lineT->DrawLine(tmin,1,tmin,288);
2666 sprintf(name,
"%s_%i_%i",cSaveLog->GetName(),0,1);
2667 std::cout << name << std::endl;
2669 ((TPad*) gROOT->FindObject(name))->Draw();
2670 ((TPad*) gROOT->FindObject(name))->SetLogz();
2671 ((TPad*) gROOT->FindObject(name))->cd();
2674 lineT->DrawLine(tmin,1,tmin,288);
2676 sprintf(name,
"%s_%i_%i",cSaveLog->GetName(),0,0);
2677 std::cout << name << std::endl;
2679 ((TPad*) gROOT->FindObject(name))->Draw();
2680 ((TPad*) gROOT->FindObject(name))->SetLogz();
2681 ((TPad*) gROOT->FindObject(name))->cd();
2684 lineT->DrawLine(tmin,1,tmin,288);
2690 sprintf(name,
"%s_%i_%i",cSaveAll1->GetName(),0,1);
2691 std::cout << name << std::endl;
2693 ((TPad*) gROOT->FindObject(name))->Draw();
2694 ((TPad*) gROOT->FindObject(name))->cd();
2697 lineT->DrawLine(tmin,1,tmin,288);
2699 sprintf(name,
"%s_%i_%i",cSaveAll1->GetName(),0,0);
2700 std::cout << name << std::endl;
2702 ((TPad*) gROOT->FindObject(name))->Draw();
2703 ((TPad*) gROOT->FindObject(name))->cd();
2709 lineT->DrawLine(tmin,1,tmin,288);
2722 Int_t nTr = trArray->GetEntries();
2726 if(ntrX>ntrY) ntrY = ntrX;
2732 Int_t nTrK = trArrayK->GetEntries();
2733 TGraph* g2[2][nTrK];
2734 for(Int_t i = 0; i<nTrK; i++){
2735 g2[0][i] =
new TGraph();
2736 g2[1][i] =
new TGraph();
2739 Int_t nCl = clArray->GetEntries();
2740 for(Int_t icl = 0; icl<nCl; icl++){
2745 if(idTr<0)
continue;
2749 g2[plane][idTr]->SetPoint(g2[plane][idTr]->GetN(),cluster->
GetZfit(0),cluster->
GetXfit(0));
2755 for(Int_t plane = 0; plane<2; plane++){
2756 sprintf(name,
"%s_%i_%i",cSaveAll2->GetName(),0,1-plane);
2757 std::cout << name << std::endl;
2759 ((TPad*) gROOT->FindObject(name))->Draw();
2760 ((TPad*) gROOT->FindObject(name))->cd();
2762 lineT->DrawLine(tmin,1,tmin,288);
2764 l[plane] =
new TLegend(0.1,0.7 + 0.01*plane,0.3,.99 + 0.01*plane);
2766 for(Int_t itr = 0; itr<nTrK; itr++){
2769 if(plane != track->
GetPlane())
continue;
2770 if(!g2[plane][trId])
continue;
2771 if(g2[plane][trId]->GetN()<1)
continue;
2772 Info(
"DisplayTracks",
"Plane %d, Tr %d => Ncl = %d",plane, trId,g2[plane][trId]->GetN());
2773 g2[plane][trId]->SetMarkerColor(trId+2);
2774 g2[plane][trId]->SetMarkerStyle(6);
2775 g2[plane][trId]->Draw(
"Psame");
2776 l[plane]->AddEntry(g2[plane][trId],Form(
"%d",trId),
"P");
2802 for(Int_t itr = 0; itr<nTr; itr++){
2812 if(ndet==0) cout<<
"angle="<<angX<<endl;
2821 sprintf(name,
"%s_%i_%i",cSaveAll2->GetName(),0,1-ndet);
2822 std::cout << name << std::endl;
2825 ((TPad*) gROOT->FindObject(name))->cd();
2856 fInfoBox->NewEntry(Form(
"nMatch = %d",matchArray->GetEntries()));
2859 TH3F* hDummy3D =
new TH3F(
"hDummy3D",
";Z;X;Y",10,0,511,10,0,288,10,0,288);
2864 for(Int_t i = 0; i<
NTRACK; i++)
2865 for(Int_t j = 0; j<
NTRACK; j++)
2866 used[i][j] = kBlack;
2868 Double_t z0[nMatch], x0[nMatch], y0[nMatch], slopeX[nMatch], slopeY[nMatch];
2869 for(Int_t i = 0; i<nMatch; i++){
2878 if(used[trX][trY] == kBlack){
2879 used[trX][trY] = color;
2886 for(Int_t itr = 0; itr<nTr; itr++){
2892 if(trId == trX && plane ==
XPLANE){
2905 if(trId == trY && plane ==
YPLANE){
2912 TPolyLine3D *l =
new TPolyLine3D(2);
2913 l->SetPoint(0,z0[i],x0[i] + z0[i]*slopeX[i],y0[i] + z0[i]*slopeY[i]);
2914 l->SetPoint(1,500,x0[i] + 500*slopeX[i],y0[i]+500*slopeY[i]);
2915 l->SetLineColor(used[trX][trY]);
2920 const Int_t kNeReal = 13;
2921 Double_t eGammaReal[kNeReal] = {1.74, 2.73, 3.93, 4.68, 6.76, 11.8, 16.9, 18.5, 26.6, 33.3, 38.1, 52.1, 74.3};
2922 for(Int_t i = 0; i<kNeReal; i++)
2923 if(eGammaReal[i]-egamma>0 && eGammaReal[i]-egamma<2) egamma = eGammaReal[i];
2925 Info(
"Save",
"Egamma = %g",egamma);
2926 sprintf(name,
"%s_%i_%i",cSave->GetName(),0,1);
2928 ((TPad*) gROOT->FindObject(name))->cd();
2929 latex->SetTextSize(0.12);
2945 std::ofstream textfile;
2947 for(Int_t i = 1; i<=
fHistEvent[0]->GetXaxis()->GetNbins(); i++)
2948 for(Int_t j = 1; j<=
fHistEvent[0]->GetYaxis()->GetNbins(); j++)
2950 textfile << i <<
"\t" << j << endl;
2953 for(Int_t i = 1; i<=
fHistEvent[0]->GetXaxis()->GetNbins(); i++)
2954 for(Int_t j = 1; j<=
fHistEvent[0]->GetYaxis()->GetNbins(); j++)
2956 textfile << i <<
"\t" << j <<
"\t" <<
fHistEvent[0]->GetBinContent(i,j) << endl;
2959 for(Int_t i = 1; i<=
fHistEvent[1]->GetXaxis()->GetNbins(); i++)
2960 for(Int_t j = 1; j<=
fHistEvent[1]->GetYaxis()->GetNbins(); j++)
2962 textfile << i <<
"\t" << j << endl;
2965 for(Int_t i = 1; i<=
fHistEvent[0]->GetXaxis()->GetNbins(); i++)
2966 for(Int_t j = 1; j<=
fHistEvent[0]->GetYaxis()->GetNbins(); j++)
2968 textfile << i <<
"\t" << j <<
"\t" <<
fHistEvent[1]->GetBinContent(i,j) << endl;
2999 switch(GET_MSG(msg)){
3001 switch(GET_SUBMSG(msg)){
3049 default: cout <<
"Unknown button" << endl;
break;
3080 Int_t size = vect->GetSize();
3081 Double_t truncMean = 0;
3082 Double_t truncSigma = 0;
3083 Int_t* index =
new Int_t[size];
3084 TMath::Sort(size,vect->GetArray(),index,kFALSE);
3085 Int_t t = 0, tLow, tHigh;
3088 while(vect->At(index[t])<10&&t<size-1) t++;
3089 tLow = TMath::FloorNint(t + (size - t)*tl);
3090 tHigh = TMath::FloorNint(t + (size - t)*th);
3092 for(Int_t tind = tLow; tind<tHigh; tind++){
3093 truncMean += vect->At(index[tind]);
3094 truncSigma += vect->At(index[tind])*vect->At(index[tind]);
3099 if(tHigh-tLow == 0)
return 0;
3101 truncMean /= (tHigh-tLow);
3102 truncSigma /= (tHigh-tLow);
3103 truncSigma -= truncMean*truncMean;
3106 truncS = TMath::Sqrt(truncSigma);
HarpoAnalyse * fSelector[kNselector]
void SetListOfRuns(TGComboBox *box, const char *dirname)
Double_t GetZfit(Int_t i=0)
HarpoKalmanFitting * fTrackFitting
TGComboBox * fChooseTrigger
TH2F * fHistEventEmpty[2]
TpcSimIonisationTrack * GetIonisationTrack(Int_t iTr)
Dummy analysis to run as test and example. Give basic histograms of the data.
TRootEmbeddedCanvas * ecTabSim
HarpoRecoMonitorGui(const TGWindow *p, UInt_t w, UInt_t h, UInt_t opt, int argc, char **argv)
Long_t Find(Long_t eventNo)
Find raw event by event number.
HarpoRecoEvent * GetRecoEvent()
TRootEmbeddedCanvas * ecTabVertexing
TClonesArray * GetKalmanTracksArray()
TGComboBox * fChooseClusteringType
TGComboBox * fChooseAnalysisType
Double_t GetPz1Vertex3D()
Double_t GetPy2Vertex3D()
TGCheckButton * fCheckAnimTracking
TGNumberEntry * fChooseNEvents
Dummy analysis to run as test and example. Give basic histograms of the data.
TRootEmbeddedCanvas * ecTabClusters
TGTextButton * fAutoRefreshButton
Analysis and suppression of baseline fluctuations.
void Display3D(TRootEmbeddedCanvas *c)
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
void BuildDisplayFrame(TGVerticalFrame *f)
Bool_t Init(hReadMode mode=hSyncTime)
HarpoAnalyse * fClustering[kNclustering]
virtual void CloseWindow()
HarpoAnalyseBaselineFluct * fBaselineFluct
HarpoAnalyse * fTracking[kNtracking]
Double_t GetThetaVertex()
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
TGCheckButton * fCheckAnimFitting
HarpoAnalyse * fAnalysis[kNanalysis]
Track object, containing position, angle, charge and quality information.
Object containing the reconstruction information for one event (with array of HarpoRecoClusters Harpo...
TRootEmbeddedCanvas * ecTabVertex
Matching object, containing matched track number, and quality info.
TRootEmbeddedCanvas * ecTabMatching
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
TGCheckButton * fCheckShowSpectrum
A class which instantiate the real top level reader.
Int_t fCurrentEventNumber
2D vertex object, containing position, angle and associated track numbers, and quality info ...
const ULong_t kNvertexing
TClonesArray * GetMatchingArray()
Dummy analysis to run as test and example. Give basic histograms of the data.
TRootEmbeddedCanvas * ecTab3D
Double_t TruncSigma(TArrayD *vect, Double_t &truncS, Double_t &truncM, Double_t tl, Double_t th)
TClonesArray * CanvasPartition(TVirtualPad *C, const Int_t Nx, const Int_t Ny, Float_t lMargin, Float_t rMargin, Float_t bMargin, Float_t tMargin)
HarpoRunHeader * GetRunHeader()
TGTextButton * fFindEvent
void DisplayTracks(TRootEmbeddedCanvas *c)
Track finder with Kalman filter.
TGTextButton * fPrevEvent
TGComboBox * fChooseTrackingType
TpcSimIonisationPoint * GetPoint(Int_t i)
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
TGNumberEntry * fChooseEvent
const ULong_t kNclustering
TClonesArray * GetVertexArray()
void SaveEvent(HarpoEvent *evt, const char *savedir)
Dummy analysis to run as test and example. Give basic histograms of the data.
A class store HARPO row DCC event data and header. End provide access metods to the row data...
Double_t GetPx1Vertex3D()
void LoopEvents(Int_t nEvents=1)
Dummy analysis to run as test and example. Give basic histograms of the data.
HarpoAnalysePedestalShift * fSaturation
Bool_t TestEvent(HarpoEvent *event)
HarpoRecoTracks object, Obtained with Kalman filter.
Cluster object, containing position, charge and quality information.
void DisplayInfo(HarpoEvent *event)
virtual void DisplayAnalysis(TRootEmbeddedCanvas *, TGListBox *)
void BuildInfoFrame(TGHorizontalFrame *f)
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
HarpoDetEvent * GetDetEvent(Long_t plane=XDCC)
TGComboBox * fChooseMatchingType
Double_t GetPy1Vertex3D()
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
HarpoAnalyse * fVertexing[kNvertexing]
Data from Keller temperuture and pressure sensors.
TRootEmbeddedCanvas * ecTabTracks
Dummy analysis to run as test and example. Give basic histograms of the data.
TVirtualPad * MakeNiceHisto(TH1 *hist, TVirtualPad *c1, const char *opt, Bool_t copy)
void DisplayEmptyMap(TRootEmbeddedCanvas *c, Int_t copy=0)
Int_t GetIdClusterTrack()
void SetRunHeader(HarpoRunHeader *rh)
TGNumberEntry * fChooseDelay
TpcSimMCTrack * GetTrack(Int_t i)
TRootEmbeddedCanvas * ecSideSummary
TGComboBox * fChooseVertexingType
HarpoAnalyse * fMatching[kNmatching]
void SetHistStyle(TH1 *hist)
void DisplayVertex(TRootEmbeddedCanvas *c)
TGComboBox * fChooseSelectorType
TGTextButton * fDisplayEvent
void DisplayClustersTracks(TRootEmbeddedCanvas *c)
Dummy analysis to run as test and example. Give basic histograms of the data.
void InitEvent(HarpoEvent *evt)
TRootEmbeddedCanvas * ecTabRaw
TpcSimMCEvent * GetMCEvent()
virtual void ProcessEvent(HarpoEvent *event)
Set pointer to new event for analyse, anlyse event , and delete.
TGNumberEntry * fChooseNch
void BuildButtonsFrame(TGVerticalFrame *f)
Bool_t Lookup(const char *path, Bool_t &val)
Lookup function for scalar values.
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
TGComboBox * fChooseEventType
A class store HARPO raw PMM2 event buffer and header. End provide access metods to the row data...
TGCheckButton * fCheckAnimClustering
TClonesArray * GetVertex3DArray()
Long_t GetReadEvts()
Number of readed events.
void DisplayMap(TRootEmbeddedCanvas *c, Int_t proj=0, Int_t copy=0)
HarpoEventHeader * GetHeader()
void print() const
Read config file in libconfig format.
Long64_t GetFromEvent()
Get First Event to process.
A class store HARPO row event data and header. Provide access metods to the row event data...
TRootEmbeddedCanvas * ecTabClustersTracks
TGTextButton * fNextEvent
Double_t GetPx2Vertex3D()
TRootEmbeddedCanvas * ecTabAnalysis
Double_t GetPz2Vertex3D()
Dummy analysis to run as test and example. Give basic histograms of the data.
virtual void ConfigFrame(TGMainFrame *, Int_t)
Double_t GetXfit(Int_t i=0)
TClonesArray * GetTracksArray()
TGNumberEntry * fChooseDelta
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
static hReaderType gHReaderType
Reader Type.
TGTextButton * fDisplayBox
HarpoRunHeader * GetRunHeader()
Clustering algorithm, runs on RAW data (HarpoMap), produces HarpoRecoClusters objects.
HarpoRecoTracks object, obtained with Hough tracking method.
TClonesArray * GetClustersArray()
A class which keeps track of the entire configuration of the analysis.
R__EXTERN HarpoDetSet * gHDetSet
void DisplaySim(TRootEmbeddedCanvas *c)
void SetBaselineFluctParam()
TGNumberEntry * fChooseSig
Dummy analysis to run as test and example. Give basic histograms of the data.
TRootEmbeddedCanvas * ecTabNoiseSuppr
3D vertex object, containing position, angle and associated 2D vertexes, and quality info ...