4 #include "TClonesArray.h"
8 #include "TGeoManager.h"
34 #include "CbmRichUtil.h"
37 #include "CbmTofHit.h"
52 #include <boost/assign/list_of.hpp>
60 using boost::assign::list_of;
66 : FairTask(
"CbmRichMCbmQaReal")
79 , fNofDrawnRichTofEv(0)
80 , fMaxNofDrawnEvents(100)
83 , fOutputDir(
"result") {}
86 cout <<
"CbmRichMCbmQaReal::Init" << endl;
88 FairRootManager* ioman = FairRootManager::Instance();
89 if (
nullptr == ioman) {
90 Fatal(
"CbmRichMCbmQaReal::Init",
"RootManager not instantised!");
97 Fatal(
"CbmRichMCbmQaReal::Init",
"No Rich Digis!");
100 Fatal(
"CbmRichMCbmQaReal::Init",
"No Tof Digis!");
103 fRichHits = (TClonesArray*) ioman->GetObject(
"RichHit");
105 Fatal(
"CbmRichMCbmQaReal::Init",
"No Rich Hits!");
108 fRichRings = (TClonesArray*) ioman->GetObject(
"RichRing");
110 Fatal(
"CbmRichMCbmQaReal::Init",
"No Rich Rings!");
113 fTofHits = (TClonesArray*) ioman->GetObject(
"TofHit");
114 if (
nullptr ==
fTofHits) { Fatal(
"CbmRichMCbmQaReal::Init",
"No Tof Hits!"); }
116 fTofTracks = (TClonesArray*) ioman->GetObject(
"TofTracks");
118 Fatal(
"CbmRichMCbmQaReal::Init",
"No Tof Tracks!");
124 fT0Digis = ioman->InitObjectAs<std::vector<CbmTofDigi>
const*>(
"T0Digi");
144 fCbmEvent = (TClonesArray*) ioman->GetObject(
"CbmEvent");
145 if (
nullptr ==
fCbmEvent) { Fatal(
"CbmRichMCbmQaReal::Init",
"No Event!"); }
180 fHM->
Create1<TH1D>(
"fhNofEvents",
"fhNofEvents;Entries", 1, 0.5, 1.5);
181 fHM->
Create1<TH1D>(
"fhNofCbmEvents",
"fhNofCbmEvents;Entries", 1, 0.5, 1.5);
183 "fhNofCbmEventsRing",
"fhNofCbmEventsRing;Entries", 1, 0.5, 1.5);
186 "fhHitsInTimeslice",
"fhHitsInTimeslice;Timeslice;#Hits", 200, 1, 200);
190 "fhNofRichDigisInTimeslice",
191 "fhNofRichDigisInTimeslice;# RICH digis / timeslice;Entries",
195 fHM->
Create1<TH1D>(
"fhNofRichHitsInTimeslice",
196 "fhNofRichHitsInTimeslice;# RICH hits / timeslice;Entries",
201 "fhNofRichRingsInTimeslice",
202 "fhNofRichRingsInTimeslice;# RICH rings / timeslice;Entries",
209 "fhRichHitXY;RICH hit X [cm];RICH hit Y [cm];Entries",
217 "fhRichDigiPixelRate;RICH Digi X [cm];RICH Digi Y [cm];Hz",
228 "fhNofRichDigisTimeLog;Time [ns];Entries",
233 "fhNofRichDigisTimeLogZoom;Time [ns];Entries",
238 "fhNofRichDigisTimeLogZoom2;Time [ns];Entries",
244 "fhNofRichRingsTimeLog;Time [ns];Entries",
249 "fhNofRichRingsTimeLogZoom;Time [ns];Entries",
254 "fhNofRichRingsTimeLogZoom2;Time [ns];Entries",
260 "fhTofDigisTimeLog",
"fhTofDigisTimeLog;Time [ns];Entries", 400, 0., 0.);
262 "fhTofDigisTimeLogZoom;Time [ns];Entries",
267 "fhTofDigisTimeLogZoom2;Time [ns];Entries",
273 "fhStsDigisTimeLog",
"fhStsDigisTimeLog;Time [ns];Entries", 400, 0., 0.);
275 "fhStsDigisTimeLogZoom;Time [ns];Entries",
280 "fhStsDigisTimeLogZoom2;Time [ns];Entries",
286 "fhT0DigisTimeLog",
"fhT0DigisTimeLog;Time [ns];Entries", 400, 0., 0.);
288 "fhT0DigisTimeLogZoom;Time [ns];Entries",
293 "fhT0DigisTimeLogZoom2;Time [ns];Entries",
300 "fhRichDigisToT",
"fhRichDigisToT;ToT [ns];Entries", 601, 9.975, 40.025);
302 "fhRichHitToT",
"fhRichHitToT;ToT [ns];Entries", 601, 9.975, 40.025);
304 "fhRichHitToTEvent;ToT [ns];Entries",
309 "fhRichHitXYEvent;RICH hit X [cm];RICH hit Y [cm];Entries",
321 "fhRichRingXY;Ring center X [cm];Ring center Y [cm];Entries",
329 "fhRichRingXY_goodTrack",
330 "fhRichRingXY_goodTrack;Ring center X [cm];Ring center Y [cm];Entries",
338 "fhRichRing_goodTrackXY",
339 "fhRichRing_goodTrackXY;Track center X [cm];Track center Y [cm];Entries",
349 "fhRichRingRadiusY;Ring Radius [cm]; Y position[cm];Entries",
357 "fhRichHitsRingRadius",
358 "fhRichHitsRingRadius;#Rich Hits/Ring; Ring Radius [cm];Entries",
367 "fhRichRingRadius;Ring radius [cm];Entries",
372 "fhNofHitsInRing;# hits in ring;Entries",
377 fHM->
Create1<TH1D>(
"fhRichRingRadius_goodRing",
378 "fhRichRingRadius_goodRing;Ring radius [cm];Entries",
382 fHM->
Create1<TH1D>(
"fhNofHitsInRing_goodRing",
383 "fhNofHitsInRing_goodRing;# hits in ring;Entries",
390 "fhTofRichX;Rich Hit X [cm];TofHit X [cm];Entries",
398 "fhTofRichX_stack1;Rich Hit X [cm];TofHit X [cm];Entries",
406 "fhTofRichX_stack2;Rich Hit X [cm];TofHit X [cm];Entries",
414 "fhTofRichX_stack3;Rich Hit X [cm];TofHit X [cm];Entries",
422 "fhTofRichY;Rich Hit Y [cm];TofHit Y [cm];Entries",
431 "fhTofTrackRichHitX",
432 "fhTofTrackRichHitX;RICH Hit X [cm];TofTrack X [cm];Entries",
440 "fhTofTrackRichHitY",
441 "fhTofTrackRichHitY;RICH Hit Y [cm];TofTrack Y [cm];Entries",
450 fHM->
Create2<TH2D>(
"fhTofTrackHitRichHitX_oBetacuts_dtime",
451 "fhTofTrackHitRichHitX_oBetacuts_dtime;Rich Hit X "
452 "[cm];TofHit X [cm];Entries",
459 fHM->
Create2<TH2D>(
"fhTofTrackHitRichHitY_oBetacuts_dtime",
460 "fhTofTrackHitRichHitY_oBetacuts_dtime;Rich Hit Y "
461 "[cm];TofHit Y [cm];Entries",
471 "fhTofTrackRichHitX_cuts",
472 "fhTofTrackRichHitX_cuts;RICH Hit X [cm];TofTrack X [cm];Entries",
480 "fhTofTrackRichHitY_cuts",
481 "fhTofTrackRichHitY_cuts;RICH Hit Y [cm];TofTrack Y [cm];Entries",
490 "fhTofTrackRichHitX_oBetacuts",
491 "fhTofTrackRichHitX_oBetacuts;RICH Hit X [cm];TofTrack X [cm];Entries",
499 "fhTofTrackRichHitY_oBetacuts",
500 "fhTofTrackRichHitY_oBetacuts;RICH Hit Y [cm];TofTrack Y [cm];Entries",
507 fHM->
Create1<TH1D>(
"fhTofTrackRichHitTime_oBetacuts",
508 "fhTofTrackRichHitTime_oBetacuts;#Delta Time [ns];Entries",
514 "fhTofTrackRichHitX_uBetacuts",
515 "fhTofTrackRichHitX_uBetacuts;RICH Hit X [cm];TofTrack X [cm];Entries",
523 "fhTofTrackRichHitY_uBetacuts",
524 "fhTofTrackRichHitY_uBetacuts;RICH Hit Y [cm];TofTrack Y [cm];Entries",
532 fHM->
Create2<TH2D>(
"fhTofTrackRichHitX_oBetacuts_dtime",
533 "fhTofTrackRichHitX_oBetacuts_dtime;RICH Hit X "
534 "[cm];TofTrack X [cm];Entries",
541 fHM->
Create2<TH2D>(
"fhTofTrackRichHitY_oBetacuts_dtime",
542 "fhTofTrackRichHitY_oBetacuts_dtime;RICH Hit Y "
543 "[cm];TofTrack Y [cm];Entries",
551 fHM->
Create2<TH2D>(
"fhTofTrackRichHitX_oBetacuts_dtime_4",
552 "fhTofTrackRichHitX_oBetacuts_dtime_4;RICH Hit X "
553 "[cm];TofTrack X [cm];Entries",
560 fHM->
Create2<TH2D>(
"fhTofTrackRichHitY_oBetacuts_dtime_4",
561 "fhTofTrackRichHitY_oBetacuts_dtime_4;RICH Hit Y "
562 "[cm];TofTrack Y [cm];Entries",
570 fHM->
Create2<TH2D>(
"fhTofTrackRichHitX_oBetacuts_dtime_6",
571 "fhTofTrackRichHitX_oBetacuts_dtime_6;RICH Hit X "
572 "[cm];TofTrack X [cm];Entries",
579 fHM->
Create2<TH2D>(
"fhTofTrackRichHitY_oBetacuts_dtime_6",
580 "fhTofTrackRichHitY_oBetacuts_dtime_6;RICH Hit Y "
581 "[cm];TofTrack Y [cm];Entries",
589 fHM->
Create2<TH2D>(
"fhTofTrackRichHitX_oBetacuts_dtime_8",
590 "fhTofTrackRichHitX_oBetacuts_dtime_8;RICH Hit X "
591 "[cm];TofTrack X [cm];Entries",
598 fHM->
Create2<TH2D>(
"fhTofTrackRichHitY_oBetacuts_dtime_8",
599 "fhTofTrackRichHitY_oBetacuts_dtime_8;RICH Hit Y "
600 "[cm];TofTrack Y [cm];Entries",
608 fHM->
Create2<TH2D>(
"fhTofTrackRichHitX_oBetacuts_dtime_10",
609 "fhTofTrackRichHitX_oBetacuts_dtime_10;RICH Hit X "
610 "[cm];TofTrack X [cm];Entries",
617 fHM->
Create2<TH2D>(
"fhTofTrackRichHitY_oBetacuts_dtime_10",
618 "fhTofTrackRichHitY_oBetacuts_dtime_10;RICH Hit Y "
619 "[cm];TofTrack Y [cm];Entries",
628 "fhTofTrackRichRingHitX",
629 "fhTofTrackRichRingHitX;RICH Ring Hit X [cm];TofTrack X [cm];Entries",
637 "fhTofTrackRichRingHitY",
638 "fhTofTrackRichRingHitY;RICH Ring Hit Y [cm];TofTrack Y [cm];Entries",
647 "fhTofHitRichRingHitX",
648 "fhTofHitRichRingHitX;RICH Ring Hit X [cm];Tof Hit X [cm];Entries",
656 "fhTofHitRichRingHitY",
657 "fhTofHitRichRingHitY;RICH Ring Hit Y [cm];Tof Hit Y [cm];Entries",
667 "fhTofRichX_zoomed;Rich Hit X [cm];TofHit X [cm];Entries",
675 "fhTofRichY_zoomed;Rich Hit Y [cm];TofHit Y [cm];Entries",
685 "fhClosTrackRingX;Rich Ring center X [cm];Tof Track X [cm];Entries",
694 "fhClosTrackRingY;Rich Ring center Y [cm];Tof Track Y [cm];Entries",
704 "fhTofRichRingX;Rich Ring Center X [cm];TofHit X [cm];Entries",
713 "fhTofRichRingY;Ring Ring Center Y [cm];TofHit Y [cm];Entries",
721 "fhTofRichXZ; Z [cm];Hit/Ring X [cm];Entries",
730 "fhTofTrackRichRingXY; X [cm]; Y [cm];Entries",
737 fHM->
Create2<TH2D>(
"fhTofClosTrackRichRingXY",
738 "fhTofClosTrackRichRingXY; X [cm]; Y [cm];Entries",
748 "fhTofXYZ;Tof Hit X [cm];TofHit Z [cm];Tof Hit Y [cm];Entries",
759 "fhTofHitsXY;Tof Hit X [cm];Tof Hit Y [cm];Entries",
767 "fhTofHitsZ",
"fhTofHitsZ;Z [cm];Entries", 350, -0.5, 349.5);
769 "fhTofHitsXZ;Z [cm];X [cm];Entries",
778 "fhTofTracksPerEvent;NofTracks/Event;Entries",
783 "fhTofTracksPerRichEvent;NofTracks/RichEvent;Entries",
789 "fhTofTracksXY;X[cm];Y[cm];NofTracks/cm^2",
798 "fhTofTracksXY_Target",
799 "fhTofTracksXY_Target;X[cm];Y[cm];NofTracks/cm^2",
807 "fhGoodRingsXY_TargetPos",
808 "fhGoodRingsXY_TargetPos;X[cm];Y[cm];NofTracks/cm^2",
817 "fhTofTrackRichRingX",
818 "fhTofTrackRichRingX;Rich Ring Center X [cm];TofTrack X [cm];Entries",
826 "fhTofTrackRichRingY",
827 "fhTofTrackRichRingY;Ring Ring Center Y [cm];TofTrack Y [cm];Entries",
836 "fhTofTracksXYRICH;X[cm];Y[cm];NofTracks/cm^2",
844 "fhNofTofTracks;X[cm];Y[cm];NofTracks",
850 "fhRingTrackDistance;RingTrackDistance [cm];Entries",
856 "fhTrackRingDistance;TrackRingDistance [cm];Entries",
861 "fhTrackRingDistanceOnTarget",
862 "fhTrackRingDistanceOnTarget;TrackRingDistance [cm];Entries",
867 "fhTrackRingDistanceOffTarget",
868 "fhTrackRingDistanceOffTarget;TrackRingDistance [cm];Entries",
872 fHM->
Create2<TH2D>(
"fhTrackRingDistanceVSRingradius",
873 "fhTrackRingDistanceVSRingradius;TrackRingDistance "
874 "[cm];RingRadius [cm];Entries",
883 "fhTrackRingDistanceVSRingChi2",
884 "fhTrackRingDistanceVSRingChi2;TrackRingDistance [cm];\\Chi^2;Entries",
891 fHM->
Create2<TH2D>(
"fhTrackRingDistanceVSRingChi2_goodRing",
892 "fhTrackRingDistanceVSRingChi2_goodRing;TrackRingDistance "
893 "[cm];\\Chi^2;Entries",
901 fHM->
Create1<TH1D>(
"fhTrackRingDistance_corr",
902 "fhTrackRingDistance_corr;TrackRingDistance [cm];Entries",
907 fHM->
Create1<TH1D>(
"fhTofBetaTracksWithHitsNoRing",
908 "fhTofBetaTracksWithHitsNoRing; \\beta;Entries",
913 "fhTofBetaTracksWithHits; \\beta;Entries",
918 "fhTofBetaTracksNoRing; \\beta;Entries",
922 fHM->
Create1<TH1D>(
"fhTofBetaTrackswithClosestRingInRange",
923 "fhTofBetaTrackswithClosestRingInRange; \\beta;Entries",
929 "fhRichRingBeta",
"fhRichRingBeta; \\beta;Entries", 151, -0.005, 1.505);
931 "fhRichRingBeta_GoodRing; \\beta;Entries",
937 "fhTofBetaRing",
"fhTofBetaRing; \\beta;Entries", 151, -0.005, 1.505);
939 "fhTofBetaAll",
"fhTofBetaAll; \\beta;Entries", 151, -0.005, 1.505);
941 "fhTofBetaVsRadius; \\beta;ring radius [cm];Entries",
949 "fhTofBetaRingDist; \\beta;ring Dist [cm];Entries",
957 "fhTofBetaAllFullAcc; \\beta;Entries",
963 "fhRingDeltaTime; \\Delta Time/ns;Entries",
968 "fhRingToTs",
"fhRingToTs; ToT/ns;Entries", 601, 9.975, 40.025);
969 fHM->
Create1<TH1D>(
"fhRingLE",
"fhRingLE;LE/ns;Entries", 201, -0.5, 200.5);
971 "fhGoodRingLE",
"fhGoodRingLE;LE/ns;Entries", 201, -0.5, 200.5);
973 "fhRingNoClTrackLE",
"fhRingNoClTrackLE;LE/ns;Entries", 201, -0.5, 200.5);
975 "fhRingClTrackFarAwayLE;LE/ns;Entries",
980 "fhRingLEvsToT;LE/ns;ToT/ns;Entries",
989 "fhInnerRingDeltaTime; \\Delta Time/ns;Entries",
994 "fhInnerRingToTs",
"fhInnerRingToTs; ToT/ns;Entries", 601, 9.975, 40.025);
996 "fhInnerRingLE",
"fhInnerRingLE;LE/ns;Entries", 201, -0.5, 200.5);
998 "fhInnerGoodRingLE",
"fhInnerGoodRingLE;LE/ns;Entries", 201, -0.5, 200.5);
1000 "fhInnerRingNoClTrackLE;LE/ns;Entries",
1004 fHM->
Create1<TH1D>(
"fhInnerRingClTrackFarAwayLE",
1005 "fhInnerRingClTrackFarAwayLE;LE/ns;Entries",
1010 "fhInnerRingFlag",
"fhInnerRingFlag;Has|HasNot;Entries", 2, -0.5, 1.5);
1012 "fhNofInnerHits",
"fhNofInnerHits;#Hits;Entries", 31, -0.5, 30.5);
1015 "fhDiRICHsInRegion",
"fhNofInnerHits;#Hits;DiRICH", 4096, 28672, 32767);
1019 "fhBlobTrackDistX; |TofTrackX - MAPMT center X| [cm];Entries",
1025 "fhBlobTrackDistY; |TofTrackY - MAPMT center Y| [cm];Entries",
1031 "fhBlobTrackDist; |TofTrack - MAPMT center dist| [cm];Entries",
1037 "fhNofBlobEvents;;#Events with min. one Blob",
1042 "fhNofBlobsInEvent;#Blobs in Event;Entries",
1048 "fhRichDigisConsecTime;consecutive time [ns];Entries",
1052 fHM->
Create1<TH1D>(
"fhRichDigisConsecTimeTOT",
1053 "fhRichDigisConsecTimeTOT;consecutive time [ns];Entries",
1059 "fhNofHitsInGoodRing;# hits in ring;Entries",
1064 "fhTracksWithRings",
"fhTracksWithRings;Scenarios;Entries", 5, -0.5, 4.5);
1067 "fhRichRingChi2",
"fhRichRingChi2;\\Chi^2;Entries", 101, 0., 10.1);
1068 fHM->
Create1<TH1D>(
"fhRichRingChi2_goodRing",
1069 "fhRichRingChi2_goodRing;\\Chi^2;Entries",
1074 fHM->
Create2<TH2D>(
"fhTofTracksXYRICH_Accectance",
1075 "fhTofTracksXYRICH_Accectance;X[cm];Y[cm];NofTracks/cm^2",
1087 fHM->
H1(
"fhNofEvents")->Fill(1);
1088 cout <<
"CbmRichMCbmQaReal, event No. " <<
fEventNum << endl;
1091 auto nOfCbmEvent =
fCbmEvent->GetEntriesFast();
1092 if (nOfCbmEvent > 0) {
1099 if (ev !=
nullptr) {
1109 double dTZoom1 = 0.8e9;
1110 double dTZoom2 = 0.008e9;
1111 fHM->
H1(
"fhRichDigisTimeLog")
1113 ->SetLimits(minTime, minTime + dT);
1114 fHM->
H1(
"fhRichDigisTimeLogZoom")
1116 ->SetLimits(minTime, minTime + dTZoom1);
1117 fHM->
H1(
"fhRichDigisTimeLogZoom2")
1119 ->SetLimits(minTime, minTime + dTZoom2);
1121 fHM->
H1(
"fhRichRingsTimeLog")
1123 ->SetLimits(minTime, minTime + dT);
1124 fHM->
H1(
"fhRichRingsTimeLogZoom")
1126 ->SetLimits(minTime, minTime + dTZoom1);
1127 fHM->
H1(
"fhRichRingsTimeLogZoom2")
1129 ->SetLimits(minTime, minTime + dTZoom2);
1131 fHM->
H1(
"fhTofDigisTimeLog")
1133 ->SetLimits(minTime, minTime + dT);
1134 fHM->
H1(
"fhTofDigisTimeLogZoom")
1136 ->SetLimits(minTime, minTime + dTZoom1);
1137 fHM->
H1(
"fhTofDigisTimeLogZoom2")
1139 ->SetLimits(minTime, minTime + dTZoom2);
1141 fHM->
H1(
"fhStsDigisTimeLog")
1143 ->SetLimits(minTime, minTime + dT);
1144 fHM->
H1(
"fhStsDigisTimeLogZoom")
1146 ->SetLimits(minTime, minTime + dTZoom1);
1147 fHM->
H1(
"fhStsDigisTimeLogZoom2")
1149 ->SetLimits(minTime, minTime + dTZoom2);
1151 fHM->
H1(
"fhT0DigisTimeLog")
1153 ->SetLimits(minTime, minTime + dT);
1154 fHM->
H1(
"fhT0DigisTimeLogZoom")
1156 ->SetLimits(minTime, minTime + dTZoom1);
1157 fHM->
H1(
"fhT0DigisTimeLogZoom2")
1159 ->SetLimits(minTime, minTime + dTZoom2);
1169 fHM->
H1(
"fhNofRichDigisInTimeslice")->Fill(nofRichDigis);
1170 for (
int i = 0;
i < nofRichDigis;
i++) {
1173 fHM->
H1(
"fhRichDigisTimeLogZoom")->Fill(digi->
GetTime());
1174 fHM->
H1(
"fhRichDigisTimeLogZoom2")->Fill(digi->
GetTime());
1178 for (
int i = 0;
i < nofRichRings;
i++) {
1181 fHM->
H1(
"fhRichRingsTimeLogZoom")->Fill(ring->
GetTime());
1182 fHM->
H1(
"fhRichRingsTimeLogZoom2")->Fill(ring->
GetTime());
1186 for (
int i = 0;
i < nofTofDigis;
i++) {
1189 fHM->
H1(
"fhTofDigisTimeLogZoom")->Fill(digi->
GetTime());
1190 fHM->
H1(
"fhTofDigisTimeLogZoom2")->Fill(digi->
GetTime());
1195 for (
int i = 0;
i < nofStsDigis;
i++) {
1198 fHM->
H1(
"fhStsDigisTimeLogZoom")->Fill(digi->
GetTime());
1199 fHM->
H1(
"fhStsDigisTimeLogZoom2")->Fill(digi->
GetTime());
1204 Int_t nrT0Digis = 0;
1207 LOG(debug) <<
"T0Digis: " << nrT0Digis;
1209 for (Int_t iT0 = 0; iT0 < nrT0Digis; ++iT0) {
1215 fHM->
H1(
"fhT0DigisTimeLogZoom")->Fill(T0Digi->
GetTime());
1216 fHM->
H1(
"fhT0DigisTimeLogZoom2")->Fill(T0Digi->
GetTime());
1221 int nofRichHits =
fRichHits->GetEntries();
1222 fHM->
H1(
"fhNofRichHitsInTimeslice")->Fill(nofRichHits);
1227 for (
int i = 0;
i < nofRichDigis;
i++) {
1229 fHM->
H1(
"fhRichDigisToT")->Fill(richDigi->
GetToT());
1233 fHM->
H1(
"fhRichDigisConsecTime")
1236 fHM->
H1(
"fhRichDigisConsecTimeTOT")
1244 Double_t zPos_tmp = 0.;
1245 for (
int iH = 0; iH < nofRichHits; iH++) {
1247 fHM->
H2(
"fhRichHitXY")->Fill(richHit->
GetX(), richHit->
GetY());
1249 zPos_tmp = ((zPos_tmp * iH) + richHit->
GetZ()) / (iH + 1);
1252 if (nofRichHits > 0)
RichZPos = zPos_tmp;
1256 auto fNCbmEvent =
fCbmEvent->GetEntriesFast();
1258 for (
int i = 0;
i < fNCbmEvent;
i++) {
1259 fHM->
H1(
"fhNofCbmEvents")->Fill(1);
1271 std::vector<int> ringIndx;
1272 std::vector<int> evRichHitIndx;
1273 std::array<uint32_t, 36> pmtHits;
1274 for (
auto& a : pmtHits)
1292 evRichHitIndx.push_back(iRichHit);
1294 fHM->
H1(
"fhRichHitToTEvent")->Fill(richHit->
GetToT());
1295 fHM->
H2(
"fhRichHitXYEvent")->Fill(richHit->
GetX(), richHit->
GetY());
1297 uint32_t pmtId = (((richHit->
GetAddress()) >> 20) & 0xF)
1298 + (((richHit->
GetAddress()) >> 24) & 0xF) * 9;
1302 if (richHit->
GetTime() < startTime) {
1303 startTime = richHit->
GetTime();
1305 int nofRichRings2 =
fRichRings->GetEntries();
1306 for (
int l = 0; l < nofRichRings2; l++) {
1309 for (
int m = 0;
m < NofRingHits;
m++) {
1310 auto RingHitIndx = ring->
GetHit(
m);
1311 if (RingHitIndx == iRichHit) {
1312 Bool_t used =
false;
1313 for (
auto check : ringIndx) {
1319 if (used ==
false) ringIndx.push_back(l);
1328 if (tofHit->
GetTime() < startTime) {
1329 startTime = tofHit->
GetTime();
1331 if (tofHit->
GetZ() < 2.)
continue;
1332 fHM->
H2(
"fhTofRichX")->Fill(richHit->
GetX(), tofHit->
GetX());
1339 if (tofHit->
GetZ() > 230. && tofHit->
GetZ() < 255)
1340 fHM->
H2(
"fhTofRichX_stack1")->Fill(richHit->
GetX(), tofHit->
GetX());
1341 if (tofHit->
GetZ() >= 255. && tofHit->
GetZ() < 272)
1342 fHM->
H2(
"fhTofRichX_stack2")->Fill(richHit->
GetX(), tofHit->
GetX());
1343 if (tofHit->
GetZ() >= 272. && tofHit->
GetZ() < 290)
1344 fHM->
H2(
"fhTofRichX_stack3")->Fill(richHit->
GetX(), tofHit->
GetX());
1346 fHM->
H2(
"fhTofRichY")->Fill(richHit->
GetY(), tofHit->
GetY());
1347 fHM->
H2(
"fhTofRichX_zoomed")->Fill(richHit->
GetX(), tofHit->
GetX());
1348 fHM->
H2(
"fhTofRichY_zoomed")->Fill(richHit->
GetY(), tofHit->
GetY());
1350 fHM->
H2(
"fhTofHitsXY")->Fill(tofHit->
GetX(), tofHit->
GetY());
1371 fHM->
H1(
"fhTofTracksPerEvent")->Fill(noftofTracks);
1373 for (
int j = 0; j < noftofTracks; j++) {
1377 if (tTrack ==
nullptr)
continue;
1379 fHM->
H1(
"fhTracksWithRings")->Fill(0);
1380 fHM->
H2(
"fhTofTracksXY")
1382 fHM->
H2(
"fhTofTracksXY_Target")
1384 fHM->
H1(
"fhNofTofTracks")
1399 if (richHit ==
nullptr)
continue;
1412 fHM->
H2(
"fhTofTracksXYRICH")
1415 fHM->
H1(
"fhNofTofTracks")
1417 std::vector<int> evTofTrack;
1418 evTofTrack.push_back(iTofTrack);
1421 if (ringIndx.size() == 0 && evRichHitIndx.size() > 0)
1422 fHM->
H1(
"fhTofBetaTracksWithHitsNoRing")
1424 if (evRichHitIndx.size() > 0)
1425 fHM->
H1(
"fhTofBetaTracksWithHits")->Fill(
getBeta(tTrack));
1426 if (ringIndx.size() == 0)
1427 fHM->
H1(
"fhTofBetaTracksNoRing")->Fill(
getBeta(tTrack));
1435 if (trackXpos > -8 && trackXpos < 13 && trackYpos > -21
1436 && trackYpos < 24) {
1437 if (!(trackXpos > -8 && trackXpos < -3 && trackYpos > 5
1439 && !(trackXpos > 7.8 && trackXpos < 13 && trackYpos > 5
1441 && !(trackXpos > -8 && trackXpos < 2 && trackYpos > 21
1443 && !(trackXpos > 7.8 && trackXpos < 13 && trackYpos > 21
1445 && !(trackXpos > 2.2 && trackXpos < 13 && trackYpos > 21
1446 && trackYpos < 16)) {
1447 fHM->
H2(
"fhTofTracksXYRICH_Accectance")
1448 ->Fill(trackXpos, trackYpos);
1449 fHM->
H1(
"fhTracksWithRings")->Fill(2);
1450 if (ringIndx.size() > 0)
fHM->
H1(
"fhTracksWithRings")->Fill(4);
1452 fHM->
H1(
"fhTracksWithRings")->Fill(3);
1461 if (closeRing.first > -1) {
1462 fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange")
1464 fHM->
H1(
"fhRingTrackDistance")->Fill(closeRing.second);
1465 fHM->
H1(
"fhTracksWithRings")->Fill(1);
1472 fHM->
H1(
"fhNofTofTracks")
1475 fHM->
H1(
"fhNofTofTracks")->Fill(1.5);
1480 std::vector<TVector3> RichTofEv;
1485 if (tofHit->
GetZ() < 2.)
continue;
1487 fHM->
H1(
"fhTofHitsZ")->Fill(tofHit->
GetZ());
1488 fHM->
H2(
"fhTofHitsXZ")->Fill(tofHit->
GetZ(), tofHit->
GetX());
1492 if (ringIndx.size() > 0) {
1500 for (
int k = 0; k < ring->
GetNofHits(); k++) {
1501 Int_t hitInd = ring->
GetHit(k);
1503 if (
nullptr == hit)
continue;
1504 fHM->
H2(
"fhTofHitRichRingHitX")->Fill(hit->
GetX(), tofHit->
GetX());
1505 fHM->
H2(
"fhTofHitRichRingHitY")->Fill(hit->
GetY(), tofHit->
GetY());
1512 if (ringIndx.size() > 0) {
1513 std::vector<CbmTofTracklet*> TracksOfEvnt;
1516 fHM->
H1(
"fhTofTracksPerRichEvent")->Fill(nofTofTracks);
1517 for (
int j = 0; j < nofTofTracks; j++) {
1521 if (track ==
nullptr)
continue;
1523 TracksOfEvnt.emplace_back(track);
1525 fHM->
H2(
"fhTofTrackRichRingXY")
1531 if (richHit ==
nullptr)
continue;
1532 fHM->
H2(
"fhTofTrackRichHitX")
1534 fHM->
H2(
"fhTofTrackRichHitY")
1540 fHM->
H2(
"fhTofTrackRichHitX_cuts")
1542 fHM->
H2(
"fhTofTrackRichHitY_cuts")
1545 fHM->
H2(
"fhTofTrackRichHitX_oBetacuts")
1547 fHM->
H2(
"fhTofTrackRichHitY_oBetacuts")
1550 fHM->
H1(
"fhTofTrackRichHitTime_oBetacuts")->Fill(deltatime);
1551 if (deltatime > -10 && deltatime < +40) {
1553 fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime")
1555 fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime")
1560 fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime_4")
1562 fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime_4")
1565 fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime_6")
1567 fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime_6")
1570 fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime_8")
1572 fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime_8")
1575 fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime_10")
1577 fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime_10")
1582 for (
int l = 0; l < track->
GetNofHits(); ++l) {
1587 if (tofHit->
GetZ() < 2.)
continue;
1588 fHM->
H2(
"fhTofTrackHitRichHitX_oBetacuts_dtime")
1589 ->Fill(richHit->
GetX(), tofHit->
GetX());
1590 fHM->
H2(
"fhTofTrackHitRichHitY_oBetacuts_dtime")
1591 ->Fill(richHit->
GetY(), tofHit->
GetY());
1596 fHM->
H2(
"fhTofTrackRichHitX_uBetacuts")
1598 fHM->
H2(
"fhTofTrackRichHitY_uBetacuts")
1614 if (
nullptr == ring)
continue;
1628 for (
int j = 0; j < nofTofTracks; j++) {
1632 if (track ==
nullptr)
continue;
1642 fHM->
H2(
"fhTofTrackRichRingX")
1644 fHM->
H2(
"fhTofTrackRichRingY")
1649 const double rDist =
std::sqrt(xDist * xDist + yDist * yDist);
1650 fHM->
H1(
"fhTrackRingDistance_corr")->Fill(rDist);
1654 for (
int k = 0; k < ring->
GetNofHits(); k++) {
1655 Int_t hitInd = ring->
GetHit(k);
1657 if (
nullptr == hit)
continue;
1658 fHM->
H2(
"fhTofTrackRichRingHitX")
1660 fHM->
H2(
"fhTofTrackRichRingHitY")
1665 if (clTrack.first > -1) {
1669 fHM->
H1(
"fhTrackRingDistance")->Fill(clTrack.second);
1673 if (track ==
nullptr)
continue;
1675 fHM->
H1(
"fhTrackRingDistanceOnTarget")->Fill(clTrack.second);
1678 fHM->
H1(
"fhTrackRingDistanceOffTarget")->Fill(clTrack.second);
1680 fHM->
H2(
"fhTrackRingDistanceVSRingradius")
1681 ->Fill(clTrack.second, ring->
GetRadius());
1682 fHM->
H2(
"fhTrackRingDistanceVSRingChi2")
1683 ->Fill(clTrack.second, ring->
GetChi2());
1685 fHM->
H2(
"fhRichRingXY_goodTrack")
1687 fHM->
H2(
"fhRichRing_goodTrackXY")
1690 fHM->
H2(
"fhClosTrackRingX")
1692 fHM->
H2(
"fhClosTrackRingY")
1694 fHM->
H2(
"fhTofClosTrackRichRingXY")
1696 if ((clTrack.second < (ring->
GetRadius() * 1.2))) {
1697 fHM->
H2(
"fhGoodRingsXY_TargetPos")
1699 fHM->
H1(
"fhRichRingChi2_goodRing")->Fill(ring->
GetChi2());
1700 fHM->
H2(
"fhTrackRingDistanceVSRingChi2_goodRing")
1701 ->Fill(clTrack.second, ring->
GetChi2());
1703 fHM->
H2(
"fhTofBetaRingDist")->Fill(
getBeta(track), clTrack.second);
1704 fHM->
H2(
"fhTofBetaVsRadius")
1709 fHM->
H1(
"fhRichRingBeta_GoodRing")->Fill(
getBeta(ring));
1713 fHM->
H2(
"fhTofRichRingXZ")
1718 RichTofEv.emplace_back(
1721 fHM->
H2(
"fhTofTrackRichRingXY")
1728 fHM->
H1(
"fhNofCbmEventsRing")->Fill(1);
1739 for (
unsigned int j = 0; j < pmtHits.size(); ++j) {
1740 if (pmtHits[j] > 30) {
1743 double xBlob = -7.95 + (int((j / 9)) * 5.3) +
fXOffsetHisto;
1744 double yBlob = 21.2 - ((j % 9) * 5.3);
1750 if (track ==
nullptr)
continue;
1755 fHM->
H1(
"fhBlobTrackDist")
1757 std::sqrt(xBlobTrack * xBlobTrack + yBlobTrack * yBlobTrack));
1762 fHM->
H1(
"fhNofBlobEvents")->Fill(1);
1763 fHM->
H1(
"fhNofBlobsInEvent")->Fill(blob);
1774 fHM->
H1(
"fhNofRichRingsInTimeslice")->Fill(nofRichRings);
1775 for (
int i = 0;
i < nofRichRings;
i++) {
1777 if (ring ==
nullptr)
continue;
1783 fHM->
H2(
"fhRichHitsRingRadius")
1788 std::pair<int, double>
1790 const std::vector<CbmTofTracklet*> track) {
1795 double closDist = -999999.99;
1797 for (
unsigned int indx = 0; indx < track.size(); ++indx) {
1800 if (track[indx]->GetNofHits() <= 3)
continue;
1801 const double xDist = (track[indx]->GetFitX(
RichZPos) - ringX);
1802 const double yDist = (track[indx]->GetFitY(
RichZPos) - ringY);
1803 const double rDist =
std::sqrt(xDist * xDist + yDist * yDist);
1804 const double RadiusFactor =
1807 if (rDist < ring->GetRadius() * RadiusFactor) {
1815 if (closDist > rDist) {
1823 std::pair<int, double> p;
1824 p.first = closTrack;
1825 p.second = closDist;
1830 std::pair<int, double>
1832 std::vector<int>& ringIndx) {
1838 double closDist = -999999.99;
1840 for (
unsigned int indx = 0; indx < ringIndx.size(); ++indx) {
1848 const double xDist = (x_track - ringX);
1849 const double yDist = (y_track - ringY);
1850 const double rDist =
std::sqrt(xDist * xDist + yDist * yDist);
1851 const double RadiusFactor =
1854 if (rDist < ring->GetRadius() * RadiusFactor &&
cutRadius(ring)) {
1861 if (closDist > rDist) {
1870 std::pair<int, double> p;
1871 p.first = closTrack;
1872 p.second = closDist;
1881 double nofEvents =
fHM->
H1(
"fhNofCbmEvents")->GetEntries();
1886 "rich_mcbm_fhNofCbmEvents",
"rich_mcbm_fhNofCbmEvents", 600, 600);
1892 "rich_mcbm_fhNofCbmEventsRing",
"rich_mcbm_fhNofCbmEventsRing", 600, 600);
1898 "rich_mcbm_fhNofEvents",
"rich_mcbm_fhNofEvents", 600, 600);
1908 fHM->
CreateCanvas(
"RichDigisConsecTime",
"RichDigisConsecTime", 600, 600);
1915 "RichDigisConsecTimeTOT",
"RichDigisConsecTimeTOT", 600, 600);
1929 "RichRingXY_goodTrack",
"RichRingXY_goodTrack", 1200, 600);
1940 "rich_mcbm_nofObjectsInTimeslice",
1953 TCanvas* c =
fHM->
CreateCanvas(
"rich_mcbm_XY",
"rich_mcbm_XY", 1200, 600);
1963 TCanvas* c =
fHM->
CreateCanvas(
"rich_tof_XY",
"rich_tof_XY", 1200, 600);
1974 fHM->
CreateCanvas(
"rich_tof_XY_zoomed",
"rich_tof_XY_zoomed", 1200, 600);
1985 "rich_mcbm_richDigisTimeLog",
"rich_mcbm_richDigisTimeLog", 1200, 1200);
1989 fHM->
H1(
"fhTofDigisTimeLog"),
1990 fHM->
H1(
"fhT0DigisTimeLog"),
1991 fHM->
H1(
"fhStsDigisTimeLog")},
1992 {
"RICH",
"TOF",
"T0",
"STS"},
2000 gPad->SetLeftMargin(0.1);
2001 gPad->SetRightMargin(0.10);
2002 fHM->
H1(
"fhStsDigisTimeLog")->GetYaxis()->SetTitleOffset(0.7);
2003 fHM->
H1(
"fhStsDigisTimeLog")->SetMinimum(0.9);
2006 fHM->
H1(
"fhTofDigisTimeLogZoom"),
2007 fHM->
H1(
"fhT0DigisTimeLogZoom"),
2008 fHM->
H1(
"fhStsDigisTimeLogZoom")},
2009 {
"RICH",
"TOF",
"T0",
"STS"},
2017 gPad->SetLeftMargin(0.1);
2018 gPad->SetRightMargin(0.1);
2019 fHM->
H1(
"fhStsDigisTimeLogZoom")->GetYaxis()->SetTitleOffset(0.7);
2020 fHM->
H1(
"fhStsDigisTimeLogZoom")->SetMinimum(0.9);
2025 "rich_mcbm_richDigisTimeLog2",
"rich_mcbm_richDigisTimeLog2", 1200, 600);
2027 fHM->
H1(
"fhTofDigisTimeLogZoom2"),
2028 fHM->
H1(
"fhT0DigisTimeLogZoom2"),
2029 fHM->
H1(
"fhStsDigisTimeLogZoom2")},
2030 {
"RICH",
"TOF",
"T0",
"STS"},
2038 gPad->SetLeftMargin(0.1);
2039 gPad->SetRightMargin(0.1);
2040 fHM->
H1(
"fhStsDigisTimeLogZoom2")->GetYaxis()->SetTitleOffset(0.7);
2041 fHM->
H1(
"fhStsDigisTimeLogZoom2")->SetMinimum(0.9);
2046 "rich_mcbm_richDigisRingTimeLog",
2049 TH1D* copyRichDigi = (TH1D*)
fHM->
H1(
"fhRichDigisTimeLog")->Clone();
2050 TH1D* copyRichRing = (TH1D*)
fHM->
H1(
"fhRichRingsTimeLog")->Clone();
2052 fHM->
H1(
"fhTofDigisTimeLog"),
2053 fHM->
H1(
"fhT0DigisTimeLog"),
2055 {
"RICH",
"TOF",
"T0",
"RICH RING"},
2063 gPad->SetLeftMargin(0.1);
2064 gPad->SetRightMargin(0.1);
2065 copyRichDigi->GetYaxis()->SetTitleOffset(0.7);
2066 copyRichDigi->SetMinimum(0.9);
2072 "rich_mcbm_richRingsTimeLog",
"rich_mcbm_richRingsTimeLog", 1200, 1200);
2084 gPad->SetLeftMargin(0.1);
2085 gPad->SetRightMargin(0.10);
2086 fHM->
H1(
"fhRichDigisTimeLog")->GetYaxis()->SetTitleOffset(0.7);
2087 fHM->
H1(
"fhRichDigisTimeLog")->SetMinimum(0.9);
2090 {
fHM->
H1(
"fhRichDigisTimeLogZoom"),
fHM->
H1(
"fhRichRingsTimeLogZoom")},
2099 gPad->SetLeftMargin(0.1);
2100 gPad->SetRightMargin(0.1);
2101 fHM->
H1(
"fhRichDigisTimeLogZoom")->GetYaxis()->SetTitleOffset(0.7);
2102 fHM->
H1(
"fhRichDigisTimeLogZoom")->SetMinimum(0.9);
2107 "rich_mcbm_richRingsTimeLog2",
"rich_mcbm_richRingsTimeLog2", 1200, 600);
2109 {
fHM->
H1(
"fhRichDigisTimeLogZoom2"),
fHM->
H1(
"fhRichRingsTimeLogZoom2")},
2118 gPad->SetLeftMargin(0.1);
2119 gPad->SetRightMargin(0.1);
2120 fHM->
H1(
"fhRichDigisTimeLogZoom2")->GetYaxis()->SetTitleOffset(0.7);
2121 fHM->
H1(
"fhRichDigisTimeLogZoom2")->SetMinimum(0.9);
2136 fHM->
CreateCanvas(
"rich_BlobTrackDist",
"rich_BlobTrackDist", 1800, 600);
2148 fHM->
H3(
"fhTofXYZ")->Draw();
2164 fHM->
H1(
"fhTofHitsZ")->Draw();
2168 fHM->
CreateCanvas(
"TofTracksPerEvent",
"TofTracksPerEvent", 1200, 1200);
2174 "TofTracksPerRichEvent",
"TofTracksPerRichEvent", 1200, 1200);
2219 fHM->
CreateCanvas(
"TofTrackRichRingXY",
"TofTrackRichRingXY", 1200, 1200);
2226 "TofClosTrackRichRingXY",
"TofClosTrackRichRingXY", 1200, 1200);
2232 TCanvas* c =
fHM->
CreateCanvas(
"TrackRingDist",
"TrackRingDist", 1200, 800);
2237 DrawH2(
fHM->
H2(
"fhTrackRingDistanceVSRingradius"));
2256 TCanvas* c =
fHM->
CreateCanvas(
"TrackRingXY",
"TrackRingXY", 1200, 800);
2265 TCanvas* c =
fHM->
CreateCanvas(
"TofTracksXY",
"TofTracksXY", 1200, 800);
2274 fHM->
CreateCanvas(
"TofTracksXY_Target",
"TofTracksXY_Target", 800, 800);
2280 "GoodRingsXY_TargetPos",
"GoodRingsXY_TargetPos", 800, 800);
2286 gStyle->SetOptStat(0);
2287 fHM->
H1(
"fhTofBetaAll")->Draw(
"HIST");
2288 fHM->
H1(
"fhTofBetaTracksWithHitsNoRing")->SetLineColorAlpha(kGreen, 1);
2289 fHM->
H1(
"fhTofBetaTracksWithHitsNoRing")->Draw(
"HIST SAME");
2297 fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange")->SetLineColorAlpha(44, 1);
2298 fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange")->Draw(
"HIST SAME");
2300 fHM->
H1(
"fhTofBetaRing")->SetLineColorAlpha(kRed, 1);
2301 fHM->
H1(
"fhTofBetaRing")->Draw(
"HIST SAME");
2303 auto legend =
new TLegend(0.1, 0.75, 0.4, 0.9);
2304 legend->AddEntry(
fHM->
H1(
"fhTofBetaTracksWithHitsNoRing"),
2305 "Tracks with RichHits and no Ring",
2309 legend->AddEntry(
fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange"),
2310 "Tracks with clos. Ring in +20% Radius",
2312 legend->AddEntry(
fHM->
H1(
"fhTofBetaRing"),
"Tracks in good ring",
"l");
2315 fHM->
H1(
"fhTofBetaAll"),
"All Tracks in mRICH Acc.",
"l");
2318 fHM->
H1(
"fhTofBetaAll"),
"All Tracks in full mRICH Acc.",
"l");
2320 legend->AddEntry(
fHM->
H1(
"fhTofBetaAll"),
"All Tracks",
"l");
2326 TCanvas* c =
fHM->
CreateCanvas(
"TofBetaLog",
"TofBetaLog", 1000, 1000);
2329 Double_t
max =
fHM->
H1(
"fhTofBetaAll")->GetMaximum();
2330 fHM->
H1(
"fhTofBetaAll")->Draw(
"HIST");
2332 if (
fHM->
H1(
"fhTofBetaTracksWithHitsNoRing")->GetMaximum() >
max)
2333 max =
fHM->
H1(
"fhTofBetaTracksWithHitsNoRing")->GetMaximum();
2334 fHM->
H1(
"fhTofBetaTracksWithHitsNoRing")->SetLineColorAlpha(kGreen, 1);
2335 fHM->
H1(
"fhTofBetaTracksWithHitsNoRing")->Draw(
"HIST SAME");
2343 if (
fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange")->GetMaximum() >
max)
2344 max =
fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange")->GetMaximum();
2345 fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange")->SetLineColorAlpha(12, 1);
2346 fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange")->Draw(
"HIST SAME");
2348 if (
fHM->
H1(
"fhTofBetaRing")->GetMaximum() >
max)
2349 max =
fHM->
H1(
"fhTofBetaRing")->GetMaximum();
2350 fHM->
H1(
"fhTofBetaRing")->SetLineColorAlpha(kRed, 1);
2351 fHM->
H1(
"fhTofBetaRing")->Draw(
"HIST SAME");
2353 fHM->
H1(
"fhTofBetaAll")->SetAxisRange(1.,
max * 1.8,
"Y");
2355 auto legend =
new TLegend(0.75, 0.77, 0.99, 0.96);
2356 legend->AddEntry(
fHM->
H1(
"fhTofBetaTracksWithHitsNoRing"),
2357 "Tracks with RichHits and no Ring",
2361 legend->AddEntry(
fHM->
H1(
"fhTofBetaTrackswithClosestRingInRange"),
2362 "Tracks with clos. Ring in +20% Radius",
2364 legend->AddEntry(
fHM->
H1(
"fhTofBetaRing"),
"Tracks in good ring",
"l");
2367 fHM->
H1(
"fhTofBetaAll"),
"All Tracks in mRICH Acc.",
"l");
2370 fHM->
H1(
"fhTofBetaAll"),
"All Tracks in full mRICH Acc.",
"l");
2372 legend->AddEntry(
fHM->
H1(
"fhTofBetaAll"),
"All Tracks",
"l");
2388 fHM->
CreateCanvas(
"TofBetaAllFullAcc",
"TofBetaAllFullAcc", 800, 800);
2394 "TofBetaAllFullAccLog",
"TofBetaAllFullAccLog", 800, 800);
2400 TCanvas* c =
fHM->
CreateCanvas(
"RingAnalysis",
"RingAnalysis", 1000, 1000);
2409 fHM->
H1(
"fhRingNoClTrackLE"),
2410 fHM->
H1(
"fhRingClTrackFarAwayLE"),
2411 fHM->
H1(
"fhGoodRingLE")},
2413 "Rings w/o closest Track",
2414 "Rings w/ closest Track >5cm",
2429 fHM->
CreateCanvas(
"InnerRingAnalysis",
"InnerRingAnalysis", 1000, 1200);
2438 fHM->
H1(
"fhInnerRingNoClTrackLE"),
2439 fHM->
H1(
"fhInnerRingClTrackFarAwayLE"),
2440 fHM->
H1(
"fhInnerGoodRingLE")},
2442 "Rings w/o closest Track",
2443 "Rings w/ closest Track >5cm",
2465 fHM->
CreateCanvas(
"RichRingRadiusVsY",
"RichRingRadiusVsY", 800, 800);
2471 fHM->
CreateCanvas(
"RichRingHitsVsRadius",
"RichRingHitsVsRadius", 800, 800);
2488 "rich_mcbm_fhBlobEvents",
"rich_mcbm_fhBlobEvents", 600, 600);
2494 "rich_mcbm_fhBlobsInCbmEvent",
"rich_mcbm_fhBlobsInCbmEvent", 600, 600);
2500 fHM->
CreateCanvas(
"TofTrackRichHitXY",
"TofTrackRichHitXY", 1200, 800);
2510 "TofTrackRichRingHitXY",
"TofTrackRichRingHitXY", 1200, 800);
2520 "TofHitRichRingHitXY",
"TofHitRichRingHitXY", 1200, 800);
2530 "TrackRingDistance_Target",
"TrackRingDistance_Target", 1200, 800);
2540 "TofTrackRichHitXY_cut",
"TofTrackRichHitXY_cut", 1200, 800);
2550 "TofTrackRichHitXY_overBetaCut",
2562 "TofTrackRichHitXY_underBetaCut",
2574 "TofTrackRichHitXY_oBetacuts_dtime",
2579 DrawH2(
fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime"));
2581 DrawH2(
fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime"));
2585 TCanvas* c =
fHM->
CreateCanvas(
"TofTrackHitRichHitXY_oBetacuts_dtime",
2586 "TofTrackHitRichHitXY_oBetacuts_dtime",
2591 DrawH2(
fHM->
H2(
"fhTofTrackHitRichHitX_oBetacuts_dtime"));
2593 DrawH2(
fHM->
H2(
"fhTofTrackHitRichHitY_oBetacuts_dtime"));
2598 "TofTrackRichHitTime_oBetacuts",
2601 DrawH1(
fHM->
H1(
"fhTofTrackRichHitTime_oBetacuts"));
2606 TCanvas* c =
fHM->
CreateCanvas(
"TofTrackHitRichHitXY_oBetacuts_dtime_evo",
2607 "TofTrackHitRichHitXY_oBetacuts_dtime_evo",
2612 DrawH2(
fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime_4"));
2614 DrawH2(
fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime_4"));
2617 DrawH2(
fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime_6"));
2619 DrawH2(
fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime_6"));
2622 DrawH2(
fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime_8"));
2624 DrawH2(
fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime_8"));
2627 DrawH2(
fHM->
H2(
"fhTofTrackRichHitX_oBetacuts_dtime_10"));
2629 DrawH2(
fHM->
H2(
"fhTofTrackRichHitY_oBetacuts_dtime_10"));
2634 "TrackRingDistance_AfterCorr",
"TrackRingDistance_AfterCorr", 600, 600);
2653 TCanvas* c =
fHM->
CreateCanvas(
"richRingBeta",
"richRingBeta", 1200, 800);
2663 "TrackRingDistanceVSRingChi2",
"TrackRingDistanceVSRingChi2", 1200, 800);
2668 DrawH2(
fHM->
H2(
"fhTrackRingDistanceVSRingChi2_goodRing"));
2673 TCanvas* c =
fHM->
CreateCanvas(
"RichRingChi2",
"RichRingChi2", 1600, 800);
2684 "TofTracksXYRICH_Accectance",
"TofTracksXYRICH_Accectance", 1200, 1200);
2690 std::vector<CbmTofTracklet*> track;
2695 std::vector<CbmTofTracklet*> track,
2703 TCanvas* c =
nullptr;
2709 c->SetGrid(
true,
true);
2710 TH2D* pad =
nullptr;
2712 pad =
new TH2D(ss.str().c_str(),
2713 (ss.str() +
";X [cm];Y [cm]").c_str(),
2721 pad =
new TH2D(ss.str().c_str(),
2722 (ss.str() +
";X [cm];Y [cm]").c_str(),
2731 pad->SetStats(
false);
2736 TLine* line0 =
new TLine(-6.25, 8, -6.25, 15.9);
2738 TLine* line1 =
new TLine(-6.25, 15.9, -1.05, 15.9);
2740 TLine* line2 =
new TLine(-1.05, 15.9, -1.05, 13.2);
2742 TLine* line3 =
new TLine(-1.05, 13.2, +4.25, 13.2);
2744 TLine* line4 =
new TLine(4.25, 13.2, +4.25, 8);
2746 TLine* line5 =
new TLine(4.25, 8, -6.25, 8);
2755 if (full ==
false) {
2756 double xmin = 99999., xmax = -99999., ymin = 99999., ymax = -99999.;
2758 Int_t hitInd = ring->
GetHit(
i);
2760 if (
nullptr == hit)
continue;
2761 if (xmin > hit->
GetX()) xmin = hit->
GetX();
2762 if (xmax < hit->GetX()) xmax = hit->
GetX();
2763 if (ymin > hit->
GetY()) ymin = hit->
GetY();
2764 if (ymax < hit->GetY()) ymax = hit->
GetY();
2766 xCur = (xmin + xmax) / 2.;
2767 yCur = (ymin + ymax) / 2.;
2771 TEllipse* circle =
new TEllipse(
2773 circle->SetFillStyle(0);
2774 circle->SetLineWidth(3);
2782 uint nofDrawHits = 0;
2786 Int_t hitInd = ring->
GetHit(
i);
2788 if (
nullptr == hit)
continue;
2789 TEllipse* hitDr =
new TEllipse(hit->
GetX() - xCur, hit->
GetY() - yCur, .25);
2792 hitDr->SetFillColor(kRed);
2794 hitDr->SetFillColor(kBlue);
2796 hitZ += hit->
GetZ();
2800 hitZ /= nofDrawHits;
2805 if (track.size() > 0) {
2807 std::string sTrackLabel;
2808 double dist = -99999.999;
2809 for (
auto trackInd : track) {
2810 TEllipse* hitDr =
new TEllipse(
2811 trackInd->GetFitX(hitZ) - xCur, trackInd->GetFitY(hitZ) - yCur, .25);
2812 hitDr->SetFillColor(kGreen);
2815 if (trackInd->GetFitX(hitZ) < 30.0) {
2818 std::sqrt(trackInd->GetFitX(hitZ) * trackInd->GetFitX(hitZ)
2819 + trackInd->GetFitY(hitZ) * trackInd->GetFitY(hitZ));
2820 if (dist < -99999.0) {
2823 "\\beta : " + std::to_string((
double)
getBeta(trackInd));
2824 }
else if (dist > tmp_dist) {
2827 "\\beta : " + std::to_string((
double)
getBeta(trackInd));
2832 TLatex* latex1 =
new TLatex(-4., 0.5, ss3.str().c_str());
2841 if (full ==
false) {
2842 ss2 <<
"(x,y,r,n)=(" << setprecision(3) << ring->
GetCenterX() <<
", "
2846 ss2 <<
"(x,y,r,n,T,Tc)=(" << setprecision(3) << ring->
GetCenterX() <<
", "
2848 << ring->
GetNofHits() <<
", " << track.size() <<
", " << Tc <<
")";
2850 TLatex* latex =
nullptr;
2855 latex =
new TLatex(-4., 4., ss2.str().c_str());
2861 const std::vector<int> tofTrackIndx) {
2862 if (richHitIndx.size() < 1 || tofTrackIndx.size() < 1)
return;
2865 std::string dir =
"./" +
fOutputDir +
"/png/TREv/";
2866 gSystem->mkdir(dir.c_str(),
true);
2869 TCanvas* c =
nullptr;
2871 c->SetGrid(
true,
true);
2873 TH2D* pad =
new TH2D(ss.str().c_str(),
2874 (ss.str() +
";X [cm];Y [cm]").c_str(),
2882 pad->SetStats(
false);
2886 TLine* line0 =
new TLine(-6.25, 8, -6.25, 15.9);
2888 TLine* line1 =
new TLine(-6.25, 15.9, -1.05, 15.9);
2890 TLine* line2 =
new TLine(-1.05, 15.9, -1.05, 13.2);
2892 TLine* line3 =
new TLine(-1.05, 13.2, +4.25, 13.2);
2894 TLine* line4 =
new TLine(4.25, 13.2, +4.25, 8);
2896 TLine* line5 =
new TLine(4.25, 8, -6.25, 8);
2899 int nofDrawHits = 0;
2902 for (
unsigned int i = 0;
i < richHitIndx.size();
i++) {
2904 if (
nullptr == hit)
continue;
2905 TEllipse* hitDr =
new TEllipse(hit->
GetX(), hit->
GetY(), .25);
2907 hitDr->SetFillColor(kRed);
2909 hitDr->SetFillColor(kBlue);
2911 hitZ += hit->
GetZ();
2915 if (nofDrawHits != 0) {
2916 hitZ /= nofDrawHits;
2923 for (
unsigned int i = 0;
i < tofTrackIndx.size();
i++) {
2925 if (track ==
nullptr)
continue;
2928 trDr->SetFillColor(kGreen);
2931 ss2 <<
"\\beta: " <<
getBeta(track);
2934 TLatex* latex =
new TLatex(-4., 4., ss2.str().c_str());
2942 std::cout <<
"Drawing Hists...";
2944 std::cout <<
"DONE!" << std::endl;
2948 std::cout <<
"Canvas saved to Images!" << std::endl;
2952 TDirectory* oldir = gDirectory;
2953 std::string s =
fOutputDir +
"/RecoHists.root";
2954 TFile* outFile =
new TFile(s.c_str(),
"RECREATE");
2955 if (outFile->IsOpen()) {
2957 std::cout <<
"Written to Root-file \"" << s <<
"\" ...";
2959 std::cout <<
"Done!" << std::endl;
2961 gDirectory->cd(oldir->GetPath());
2964 std::cout <<
"fTracksinRich: " <<
fTracksinRich << std::endl;
2968 std::cout <<
"fTracksinRichWithRichHits > 0: "
2974 std::cout <<
"fTracksinRichWithRichHits > 5: "
2980 std::cout <<
"fTracksinRichWithRichHits > 10: "
2986 std::cout <<
"fTracksinRichWithRichHits > 15: "
3001 const string& outputDir) {
3004 if (
fHM !=
nullptr)
delete fHM;
3007 TFile* file =
new TFile(fileName.c_str());
3017 bool inside =
false;
3021 if (
x >= -6.25 &&
x <= -1.05) {
3023 if (
y > 8 &&
y < 15.9) { inside =
true; }
3024 }
else if (
x > -1.05 &&
x < 4.25) {
3026 if (
y > 8 &&
y < 13.2) { inside =
true; }
3034 Double_t inVel = 1e7 / (track->
GetTt());
3035 Double_t beta = inVel / TMath::C();
3045 const Double_t Aerogel_Dist = 11.5;
3046 const Double_t aeroPenetr_Y =
3048 const Double_t aeroPenetr_X =
3054 + Aerogel_Dist * Aerogel_Dist);
3056 const Double_t ioR = 1.05;
3076 Double_t
x =
pos.X();
3077 Double_t
y =
pos.Y();
3086 bool inside =
false;
3087 if (
x >= -16.85 &&
x <= 4.25) {
3089 if (
y >= -23.8 &&
y <= 23.8) { inside =
true; }
3097 std::pair<int, double>& clTrack) {
3101 Double_t meanTime = 0.;
3102 unsigned int hitCnt = 0;
3105 Int_t hitInd = ring->
GetHit(
i);
3107 if (
nullptr == hit)
continue;
3114 const Float_t tmpHitRadius2 = (diffX * diffX + diffY * diffY);
3116 if (tmpHitRadius2 < minRHit2) { minRHit2 = tmpHitRadius2; }
3118 meanTime = meanTime / hitCnt;
3122 Int_t hitInd = ring->
GetHit(
i);
3124 if (
nullptr == hit)
continue;
3131 fHM->
H2(
"fhRingLEvsToT")
3137 if ((Tdiff_ring > 20.) && (Tdiff_ring < 30.)) {
3142 if (clTrack.first == -1)
3143 fHM->
H1(
"fhRingNoClTrackLE")
3145 if ((clTrack.first >= 0) && !(clTrack.second < 10.))
3146 fHM->
H1(
"fhRingClTrackFarAwayLE")
3149 fHM->
H1(
"fhGoodRingLE")
3151 fHM->
H1(
"fhRingDeltaTime")
3152 ->Fill(
static_cast<Double_t
>(meanTime - hit->
GetTime()));
3156 int InnerHitCnt = 0;
3157 int InnerHitCnt_cut = 0;
3161 if (
nullptr == richHit)
continue;
3165 if (diffX * diffX + diffY * diffY < minRHit2) {
3168 if ((Tdiff_inner > 20.) && (Tdiff_inner < 30.)) {
3172 fHM->
H1(
"fhDiRICHsInRegion")
3176 fHM->
H1(
"fhInnerRingDeltaTime")
3177 ->Fill(
static_cast<Double_t
>(meanTime - richHit->
GetTime()));
3178 fHM->
H1(
"fhInnerRingToTs")->Fill(richHit->
GetToT());
3179 fHM->
H1(
"fhInnerRingLE")
3181 if (clTrack.first == -1)
3182 fHM->
H1(
"fhInnerRingNoClTrackLE")
3185 if ((clTrack.first >= 0) && !(clTrack.second < 5.))
3186 fHM->
H1(
"fhInnerRingClTrackFarAwayLE")
3190 fHM->
H1(
"fhInnerGoodRingLE")
3196 if (InnerHitCnt == 0) {
3197 fHM->
H1(
"fhInnerRingFlag")->Fill(1);
3199 fHM->
H1(
"fhInnerRingFlag")->Fill(0);
3201 fHM->
H1(
"fhNofInnerHits")->Fill(InnerHitCnt);
3213 if ((clTrack.first >= 0) && (clTrack.second < 10.))
return true;