19 #include "CbmTofHit.h"
42 #include "FairLogger.h"
43 #include "FairMCEventHeader.h"
44 #include "FairRootManager.h"
45 #include "FairRunAna.h"
46 #include "FairRuntimeDb.h"
49 #include "Riostream.h"
50 #include "TClonesArray.h"
51 #include "TDirectory.h"
52 #include "TEfficiency.h"
54 #include "TFitResult.h"
55 #include "TGeoManager.h"
56 #include "TGeoPhysicalNode.h"
60 #include "TMCProcess.h"
68 #include <boost/lexical_cast.hpp>
69 #include <boost/regex.hpp>
91 static std::vector<std::vector<CbmTofHit*>>
fvLHit;
96 return std::strcmp(a, b) < 0;
112 {130,
"#Kappa^{0}_{L}"},
113 {310,
"#Kappa^{0}_{S}"},
115 {-321,
"#Kappa^{-}"},
121 {3112,
"#Sigma^{-}"},
122 {-3112,
"#Sigma^{+}"},
124 {-3122,
"#bar{#Lambda}"},
125 {3212,
"#Sigma^{0}"},
126 {-3212,
"#bar{#Sigma^{0}}"},
127 {3222,
"#Sigma^{+}"},
128 {-3222,
"#Sigma^{-}"},
132 {-3322,
"#bar{#Xi^{0}}"},
133 {3334,
"#Omega^{-}"},
134 {-3334,
"#Omega^{+}"},
138 {1000020040,
"#alpha"},
144 {
"RPCgas_noact",
"gas"},
145 {
"RPCglass",
"glass"},
147 {
"aluminium",
"box"},
149 {
"targetMaterial",
"target"},
150 {
"silicon",
"diamond"}};
153 {
"Compton scattering",
"Compton"},
155 {
"Delta ray",
"Delta"},
156 {
"Hadronic interaction",
"Hadronic"},
157 {
"Lepton pair production",
"Pair"},
158 {
"Photoelectric effect",
"Photo"},
159 {
"Positron annihilation",
"Annil"},
160 {
"Primary particle emission",
"Primary"},
161 {
"Bremstrahlung",
"Brems"}};
163 void GetPdgName(Int_t iPdgCode,
const char*& cPdgName);
164 void GetMaterialName(
const char* cMaterial,
const char*& cMaterialName);
165 void GetProcessName(
const char* cProcess,
const char*& cProcessName);
176 cout <<
"CbmTofTests: Task started " << endl;
182 : FairTask(name, verbose)
187 , fChannelInfoRef(NULL)
188 , fChannelInfoDut(NULL)
189 , fChannelInfoSel2(NULL)
190 , fMbsMappingPar(NULL)
199 , fTofDigisColl(NULL)
201 , fTofDigiMatchColl(NULL)
202 , fTofTrackColl(NULL)
204 , fTofDigisCollIn(NULL)
205 , fTofHitsCollIn(NULL)
206 , fTofDigiMatchCollIn(NULL)
207 , fTofTrackCollIn(NULL)
215 , fhTriggerPattern(NULL)
216 , fhTriggerType(NULL)
217 , fhTimeInSpill(NULL)
233 , fhDTLH_DStrip(NULL)
254 , fhNMatch04sel(NULL)
256 , fhDigiMul0best(NULL)
257 , fhDigiMul4best(NULL)
261 , fhChiDT04best(NULL)
262 , fhDT24DT04best(NULL)
263 , fhDTD4DT04best(NULL)
266 , fhNMatchD4sel(NULL)
267 , fhChi04D4best(NULL)
270 , fhDigiMul0D4best(NULL)
271 , fhDigiMul4D4best(NULL)
272 , fhCluSize04D4best(NULL)
273 , fhCluMul04D4best(NULL)
274 , fhStrMul04D4best(NULL)
275 , fhCluMulTSig0D4best(NULL)
276 , fhCluMulTSig4D4best(NULL)
277 , fhCluMulTrel0D4best(NULL)
278 , fhCluMulTrel4D4best(NULL)
279 , fhCluSizeTrel0D4best(NULL)
280 , fhCluSizeTrel4D4best(NULL)
281 , fhDXDY04D4best(NULL)
282 , fhDXDT04D4best(NULL)
283 , fhDYDT04D4best(NULL)
284 , fhDistDT04D4best(NULL)
285 , fhTexpDT04D4best(NULL)
286 , fhCluSize0DT04D4best(NULL)
287 , fhCluSize4DT04D4best(NULL)
288 , fhTot0DT04D4best(NULL)
289 , fhTot4DT04D4best(NULL)
290 , fhCluSizeSigT0D4best(NULL)
291 , fhCluSizeSigT4D4best(NULL)
292 , fhChiDT04D4best(NULL)
293 , fhDT24DT04D4best(NULL)
294 , fhDTD4DT04D4best(NULL)
295 , fhX0DT04D4best(NULL)
296 , fhY0DT04D4best(NULL)
297 , fhTISDT04D4best(NULL)
298 , fhDTMul4D4best(NULL)
305 , fhDTMul0D4best(NULL)
312 , fhChi04D4sbest(NULL)
315 , fhDigiMul0D4sbest(NULL)
316 , fhDigiMul4D4sbest(NULL)
317 , fhCluMul04D4sbest(NULL)
318 , fhDXDY04D4sbest(NULL)
319 , fhDXDT04D4sbest(NULL)
320 , fhDYDT04D4sbest(NULL)
321 , fhDistDT04D4sbest(NULL)
322 , fhTexpDT04D4sbest(NULL)
323 , fhCluSize0DT04D4sbest(NULL)
324 , fhCluSize4DT04D4sbest(NULL)
325 , fhTot0DT04D4sbest(NULL)
326 , fhTot4DT04D4sbest(NULL)
327 , fhChiDT04D4sbest(NULL)
328 , fhDT24DT04D4sbest(NULL)
329 , fhDTD4DT04D4sbest(NULL)
330 , fhX0DT04D4sbest(NULL)
331 , fhY0DT04D4sbest(NULL)
332 , fhDTMul4D4sbest(NULL)
333 , fhDTX4D4sbest(NULL)
334 , fhDTY4D4sbest(NULL)
335 , fhDXX4D4sbest(NULL)
336 , fhDXY4D4sbest(NULL)
337 , fhDYX4D4sbest(NULL)
338 , fhDYY4D4sbest(NULL)
339 , fhDTMul0D4sbest(NULL)
340 , fhDTX0D4sbest(NULL)
341 , fhDTY0D4sbest(NULL)
342 , fhDXX0D4sbest(NULL)
343 , fhDXY0D4sbest(NULL)
344 , fhDYX0D4sbest(NULL)
345 , fhDYY0D4sbest(NULL)
347 , fhNMatch24sel(NULL)
358 , fhXYSel2D4best(NULL)
361 , fhXYSel2D4sel(NULL)
387 , fhDutChi_Found(NULL)
388 , fhDutChi_Missed(NULL)
389 , fhDutChi_Match(NULL)
390 , fhDutXY_Found(NULL)
391 , fhDutXY_Missed(NULL)
392 , fhDutDTLH_Found(NULL)
393 , fhDutDTLH_Missed(NULL)
394 , fhDutMul_Found(NULL)
395 , fhDutMul_Missed(NULL)
396 , fhDutTIS_Found(NULL)
397 , fhDutTIS_Missed(NULL)
398 , fhDutTIR_Found(NULL)
399 , fhDutTIR_Missed(NULL)
400 , fhDutVel_Found(NULL)
401 , fhDutVel_Missed(NULL)
402 , fhDutDTLH_CluSize(NULL)
403 , fhDutDTLH_Tot(NULL)
404 , fhDutDTLH_Mul(NULL)
405 , fhDutDTLH_TIS(NULL)
406 , fhDutDTLH_Missed_TIS(NULL)
407 , fhDutDTLH_DDH_Found(NULL)
408 , fhDutDTLH_DD_Found(NULL)
409 , fhDutDTLH_DD_Missed(NULL)
413 , fhNMergedMCEvents(NULL)
414 , fhAccTrackMul(NULL)
415 , fhAccRefTrackMul(NULL)
416 , fhAccPrimTrackMul(NULL)
417 , fhAccTrackPointMul(NULL)
418 , fhAccRefTrackPointMul(NULL)
419 , fhAccRndmTrackPointMul(NULL)
420 , fhAccRefTrackAcceptance(NULL)
421 , fhAccRefTrackAcceptanceEfficiency(NULL)
422 , fhAccRefTrackAcceptancePurity(NULL)
423 , fhAccRefTrackMulCentrality(NULL)
424 , fhAccRefTracksProcSpec(NULL)
425 , fhSelMCTrackEfficiency(NULL)
426 , fhSelMCTrackMatchEfficiency(NULL)
427 , fhSelMCTrackMatchPurity(NULL)
428 , fhSelMCTrackDutHitMatchNNMul(NULL)
429 , fhSelMCTrackDutHitMatchAccNNMul(NULL)
430 , fhSelEfficiency(NULL)
432 , fhSelRefTrackShare(NULL)
433 , fhSelRefTrackProcSpec(NULL)
434 , fhSelMatchEfficiency(NULL)
435 , fhSelMatchPurity(NULL)
436 , fhResX04HitExp(NULL)
437 , fhResX04ExpMC(NULL)
438 , fhResX04HitMC(NULL)
439 , fhResY04HitExp(NULL)
440 , fhResY04ExpMC(NULL)
441 , fhResY04HitMC(NULL)
442 , fhResT04HitExp(NULL)
443 , fhResT04ExpMC(NULL)
444 , fhResT04HitMC(NULL)
445 , fhNTracksPerMRefHit(NULL)
446 , fhNTracksPerSel2Hit(NULL)
447 , fhNTracksPerDutHit(NULL)
448 , fhNTracksPerSelMRefHit(NULL)
449 , fhNTracksPerSelSel2Hit(NULL)
450 , fhNTracksPerSelDutHit(NULL)
451 , fhSelTrklEfficiency(NULL)
452 , fhSelTrklPurity(NULL)
453 , fhSelTrklRefTrackShare(NULL)
454 , fhSelTrklRefTrackProcSpec(NULL)
455 , fhSelTrklMatchEfficiency(NULL)
456 , fhSelTrklMatchPurity(NULL)
457 , fhDutResX_Hit_Trk(NULL)
458 , fhDutResX_Trk_MC(NULL)
459 , fhDutResX_Hit_MC(NULL)
460 , fhDutResY_Hit_Trk(NULL)
461 , fhDutResY_Trk_MC(NULL)
462 , fhDutResY_Hit_MC(NULL)
463 , fhDutResT_Hit_Trk(NULL)
464 , fhDutResT_Trk_MC(NULL)
465 , fhDutResT_Hit_MC(NULL)
466 , fhSelHitTupleEfficiencyTIS(NULL)
467 , fhSelTrklEfficiencyTIS(NULL)
468 , fhSelMCTrackEfficiencyTIS(NULL)
469 , fhSelHitTupleMatchEfficiencyTIS(NULL)
470 , fhSelTrklMatchEfficiencyTIS(NULL)
471 , fhSelMCTrackMatchEfficiencyTIS(NULL)
472 , fhSelHitTupleResidualTTIS(NULL)
473 , fhSelTrklResidualTTIS(NULL)
474 , fhSelMCTrackResidualTTIS(NULL)
475 , fhSelHitTupleDutCluSizeTIS(NULL)
476 , fhSelTrklDutCluSizeTIS(NULL)
477 , fhSelMCTrackDutCluSizeTIS(NULL)
484 , fhAccRefTrackResT(NULL)
485 , fhAccRefTrackResX(NULL)
486 , fhAccRefTrackResY(NULL)
487 , fhAccRefTrackResTx(NULL)
488 , fhAccRefTrackResTy(NULL)
489 , fhAccRefTrackResV(NULL)
490 , fhAccRefTrackResN(NULL)
491 , fhAccRefTrackShare(NULL)
492 , fhRecRefTrackEfficiency(NULL)
493 , fhRecRndmTrackEfficiency(NULL)
494 , fhRecRefTrackGhostShare(NULL)
495 , fhRecRefTrackCloneShare(NULL)
496 , fhRecRndmTrackGhostShare(NULL)
497 , fhRecRndmTrackCloneShare(NULL)
498 , fhDomTracksProcSpec()
499 , fhDomTracksProcMat()
500 , fhRndmTracksProcSpec()
501 , fhRndmTracksProcMat()
502 , fhCounterAccTrackMul()
503 , fhCounterAccRefTrackMul()
504 , fhCounterAccRndmTrackMul()
505 , fhCounterAccDomTrackMul()
506 , fhCounterRecRefTrackEfficiencyPassed()
507 , fhCounterRecRefTrackEfficiencyTotal()
508 , fhCounterRecRefTrackPurityPassed()
509 , fhCounterRefTrackMulHitMul()
510 , fhCounterRefTrackLocalXY()
511 , fhCounterRefTrackMulCell()
512 , fhCounterHitMulCell()
513 , fhSelTrklFitRedChiSq(NULL)
514 , fhSelTrklDutHitMatchNNMul(NULL)
515 , fhSelTrklDutHitMatchAccNNMul(NULL)
516 , fhSelHitTupleDutHitMatchMul(NULL)
517 , fhSelHitTupleDutHitMatchAccMul(NULL)
518 , fhSelTypeNNChiSq(NULL)
519 , fhSelTypeNNResidualT(NULL)
520 , fhSelTypeNNResidualX(NULL)
521 , fhSelTypeNNResidualY(NULL)
522 , fhSelTypeAccNNChiSq(NULL)
523 , fhSelTypeAccNNResidualT(NULL)
524 , fhSelTypeAccNNResidualX(NULL)
525 , fhSelTypeAccNNResidualY(NULL)
526 , fhGoodSelTypeNNPureChiSq(NULL)
527 , fhGoodSelTypeNNAllChiSq(NULL)
528 , fhTrklNofHitsRate(NULL)
529 , fhTrklDetHitRate(NULL)
530 , fhTrklNofHitsRateInSpill(NULL)
531 , fhTrklDetHitRateInSpill(NULL)
534 , fCalParFileName(
"")
535 , fCalOutFileName(
"./tofAnaTestBeam.hst.root")
537 , fhDTD4DT04D4Off(NULL)
540 , fhDTTexpD4Off(NULL)
541 , fhCluSize0DT04D4Off(NULL)
542 , fhCluSize4DT04D4Off(NULL)
543 , fhTot0DT04D4Off(NULL)
544 , fhTot4DT04D4Off(NULL)
545 , fhSelTypeNNResidualT_Width(NULL)
546 , fhSelTypeNNResidualX_Width(NULL)
547 , fhSelTypeNNResidualY_Width(NULL)
548 , fhSelHitTupleResidualXYT_Width(NULL)
605 , fEnableMatchPosScaling(kTRUE)
608 , fTrackletTools(NULL)
609 , fbMonteCarloComparison(kFALSE)
610 , fbPointsInInputFile(kFALSE)
611 , fbTracksInInputFile(kFALSE)
612 , fMCEventHeader(NULL)
618 , fTofHitPointMatches(NULL)
619 , fTofHitAccTrackMatches(NULL)
620 , fTofTrackletAccTrackMatches(NULL)
621 , fTofAccTrackTrackletMatches(NULL)
622 , fTofAccTrackPointMatches(NULL)
624 , fCurrentModuleNodePath()
625 , fiCurrentModuleType(-1)
626 , fiCurrentModuleIndex(-1)
627 , fiCurrentCounterIndex(-1)
628 , fCounterModuleNodes()
630 , fdGhostTrackHitQuota(0.7)
631 , fbDelayMCPoints(kFALSE)
632 , fbAttachDutHitToTracklet(kFALSE)
633 , fbBestSelTrackletOnly(kFALSE)
634 , fbUseSigCalib(kFALSE)
640 , fiMinMCRefTrackPoints(3)
641 , fiMaxMCRefTracks(1)
666 LOG(info) << Form(
"Position Scaling for Matching enabled ");
668 LOG(info) << Form(
"Position Scaling for Matching not enabled ");
677 LOG(WARNING) << Form(
678 "no FindTracks instance found, use TShift = %8.3f, Sel2Toff = %8.3f",
687 "Set time offsets D: %7.1f, 4: %7.1f, D4: %7.1f, Sel24: %7.1f",
697 LOG(info) <<
" CbmTofAnaTestbeam => Get the digi parameters for tof";
700 FairRunAna* ana = FairRunAna::Instance();
701 FairRuntimeDb* rtdb = ana->GetRuntimeDb();
710 <<
" geometrically known detector cells, looking for type "
713 Double_t dDutXmin = 1.E300;
714 Double_t dDutXmax = -1.E300;
742 LOG(info) << Form(
" DutId 0x%08x ", cellId) <<
" got cell " << smtype
743 <<
", " << smodule <<
", " << module <<
", x-size "
746 <<
", Xmin " << dDutXmin <<
", Xmax " << dDutXmax;
751 Double_t dDutDx = (dDutXmax - dDutXmin) / (
fiDutNch - 1);
752 LOG(info) <<
"CbmTofAnaTestbeam::LoadGeometry Dut = " <<
fiDut <<
" with "
753 <<
fiDutNch <<
" channels in x- direction from " << dDutXmin
754 <<
" to " << dDutXmax <<
", dx = " << dDutDx;
757 LOG(error) <<
"Dut inconsistent " <<
fiDut <<
", " <<
fiDutNch;
762 LOG(error) <<
"Could not retrieve module nodes from TGeoManager!";
773 for (Int_t iEvent = 0; iEvent <
fEventsColl->GetEntriesFast(); iEvent++) {
775 LOG(debug) <<
"Process event " << iEvent <<
" with "
806 new ((*fTofHitsColl)[iNbHits])
CbmTofHit(*tHit);
810 new ((*fTofDigiMatchColl)[iNbHits])
CbmMatch(*tMatch);
845 <<
" requested hits";
854 LOG(info) <<
"CbmTofAnaTestbeam::Exec : "
856 <<
" spills processed.";
863 LOG(info) <<
"Finish up with " <<
fEvents <<
" analyzed events in "
867 TH1* tCurrentHistogram(NULL);
897 auto const& CounterID = CounterModuleNode.first;
900 if (tCurrentHistogram->GetEntries()) {
901 tCurrentHistogram->LabelsDeflate(
"X");
902 tCurrentHistogram->LabelsDeflate(
"Y");
903 tCurrentHistogram->LabelsOption(
"<d",
"X");
904 tCurrentHistogram->LabelsOption(
"<v",
"Y");
905 tCurrentHistogram->Scale(1. / tCurrentHistogram->GetEntries());
909 if (tCurrentHistogram->GetEntries()) {
910 tCurrentHistogram->LabelsDeflate(
"X");
911 tCurrentHistogram->LabelsDeflate(
"Y");
912 tCurrentHistogram->LabelsOption(
"<d",
"X");
913 tCurrentHistogram->LabelsOption(
"<v",
"Y");
914 tCurrentHistogram->Scale(1. / tCurrentHistogram->GetEntries());
918 if (tCurrentHistogram->GetEntries()) {
919 tCurrentHistogram->LabelsDeflate(
"X");
920 tCurrentHistogram->LabelsDeflate(
"Y");
921 tCurrentHistogram->LabelsOption(
"<d",
"X");
922 tCurrentHistogram->LabelsOption(
"<v",
"Y");
923 tCurrentHistogram->Scale(1. / tCurrentHistogram->GetEntries());
927 if (tCurrentHistogram->GetEntries()) {
928 tCurrentHistogram->LabelsDeflate(
"X");
929 tCurrentHistogram->LabelsDeflate(
"Y");
930 tCurrentHistogram->LabelsOption(
"<d",
"X");
931 tCurrentHistogram->LabelsOption(
"<v",
"Y");
932 tCurrentHistogram->Scale(1. / tCurrentHistogram->GetEntries());
946 FairRootManager* fManager = FairRootManager::Instance();
948 fEventsColl =
dynamic_cast<TClonesArray*
>(fManager->GetObject(
"Event"));
950 fEventsColl =
dynamic_cast<TClonesArray*
>(fManager->GetObject(
"CbmEvent"));
953 LOG(info) <<
"CbmEvent not found in input file, assume eventwise input";
958 LOG(error) << GetName() <<
": No digi input!";
966 fTofDigisColl = (TClonesArray*) fManager->GetObject(
"CbmTofDigi");
969 fTofDigisColl = (TClonesArray*) fManager->GetObject(
"TofCalDigi");
973 <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the TofDigi "
974 "TClonesArray!!! ... continuing with incomplete input ";
978 fTofHitsColl = (TClonesArray*) fManager->GetObject(
"TofHit");
980 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
981 "TofHit TClonesArray!!!";
987 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
988 "Match TClonesArray!!!";
993 fTofTrackColl = (TClonesArray*) fManager->GetObject(
"TofTracks");
995 LOG(info) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
996 "TofTracklet TClonesArray!!!";
1002 LOG(info) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
1003 "TofTrbHeader Object";
1009 LOG(error) << GetName() <<
": No input digis!";
1012 LOG(info) <<
"DigiManager has Tof Digis";
1017 dynamic_cast<CbmMCEventList*
>(fManager->GetObject(
"MCEventList."));
1021 dynamic_cast<CbmMCEventList*
>(fManager->GetObject(
"EventList."));
1029 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not "
1030 "retrieve branch \"(MC)EventList.\" for MC comparison.";
1038 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1039 "CbmMCDataManager for MC comparison.";
1045 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1046 "branch \"MCEventHeader.\" for MC comparison.";
1051 dynamic_cast<TClonesArray*
>(fManager->GetObject(
"TofPointTB"));
1057 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not "
1058 "retrieve branch \"TofPoint\" for MC comparison.";
1064 dynamic_cast<TClonesArray*
>(fManager->GetObject(
"TofHitMatch"));
1066 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1067 "branch \"TofHitMatch\" for MC comparison.";
1072 dynamic_cast<TClonesArray*
>(fManager->GetObject(
"TofAccMCTracks"));
1077 fManager->GetObject(
"TofAccMCTrackPointMatch"));
1080 <<
"CbmTofAnaTestbeam::RegisterInputs => Could not retrieve branch "
1081 "\"TofAccMCTrackPointMatch\" for MC comparison.";
1086 dynamic_cast<TClonesArray*
>(fManager->GetObject(
"TofHitTrackMatch"));
1089 <<
"CbmTofAnaTestbeam::RegisterInputs => Could not retrieve branch "
1090 "\"TofHitTrackMatch\" for MC comparison.";
1096 dynamic_cast<TClonesArray*
>(fManager->GetObject(
"TofTrackMatch"));
1099 <<
"CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1100 "branch \"TofTrackMatch\" for MC comparison.";
1105 fManager->GetObject(
"TofAccMCTrackMatch"));
1108 <<
"CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1109 "branch \"TofAccMCTrackMatch\" for MC comparison.";
1116 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not "
1117 "retrieve branch \"MCTrack\" for MC comparison.";
1141 <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the TofDigi "
1142 "TClonesArray!!! ... continuing with incomplete input ";
1148 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
1149 "TofHit TClonesArray!!!";
1156 (TClonesArray*) fManager->GetObject(
"TofCalDigiMatch");
1158 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
1159 "Match TClonesArray!!!";
1165 LOG(info) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
1166 "TofTracklet TClonesArray!!!";
1173 LOG(error) << GetName() <<
": No input digis!";
1176 LOG(info) <<
"DigiManager has Tof Digis";
1185 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => MC comparison not "
1186 "compatible with 'CbmEvent' processing!!!";
1196 Bool_t isSimulation = kFALSE;
1197 LOG(info) <<
"CbmTofAnaTestbeam::InitParameters - Geometry, Mapping, ... ";
1199 FairRun* ana = FairRun::Instance();
1200 FairRuntimeDb* rtdb = ana->GetRuntimeDb();
1203 if (
k14a > iGeoVersion) {}
1207 LOG(error) <<
"CbmTofAnaTestbeam::InitParameters => Could not obtain the "
1214 LOG(error) <<
"CbmTofAnaTestbeam::InitParameters => Could not obtain the "
1215 "CbmTofDigiBdfPar ";
1228 rtdb->initContainers(ana->GetRunId());
1230 LOG(info) <<
"CbmTofAnaTestbeam::InitParameter: currently "
1236 <<
"CbmTofAnaTestbeam::InitParameter: set beam ref to default (sep14) ";
1242 LOG(info) << Form(
"CbmTofAnaTestbeam::InitParameter BeamRef = %d, %d, 0x%08x",
1251 LOG(info) <<
"CbmTofAnaTestbeam::InitParameter: Chi2 limits initialized to "
1261 LOG(error) <<
"CbmTofAnaTestBeam::LoadCalParameter: "
1266 LOG(info) <<
"CbmTofAnaTestBeam::LoadCalParameter: "
1270 (TProfile*) gDirectory->FindObjectAny(Form(
"hDTD4DT04D4best_pfx_px"));
1271 if (NULL == fhtmp) {
1276 LOG(info) <<
"Histo hDTD4DT04D4best_pfx_px not found => Chi2Lim = "
1281 (TProfile*) gDirectory->FindObjectAny(Form(
"hDTX4D4best_pfx_px"));
1282 if (NULL == fhtmpx) {
1283 LOG(info) <<
" Histo " << Form(
"hDTX4D4best_pfx_px") <<
" not found. ";
1287 (TProfile*) gDirectory->FindObjectAny(Form(
"hDTY4D4best_pfx_px"));
1288 if (NULL == fhtmpy) {
1289 LOG(info) <<
" Histo " << Form(
"hDTY4D4best_pfx_px") <<
" not found. ";
1293 (TProfile*) gDirectory->FindObjectAny(Form(
"hTexpDT04D4best_pfx_px"));
1294 if (NULL == fhtmpt) {
1295 LOG(info) <<
" Histo " << Form(
"hTexpDT04D4best_pfx_px") <<
" not found. ";
1298 TProfile* fhtmpcs0 =
1299 (TProfile*) gDirectory->FindObjectAny(Form(
"hCluSize0DT04D4best_pfx_px"));
1300 if (NULL == fhtmpcs0) {
1301 LOG(info) <<
" Histo " << Form(
"hCluSize0DT04D4best_pfx_px")
1305 TProfile* fhtmpcs4 =
1306 (TProfile*) gDirectory->FindObjectAny(Form(
"hCluSize4DT04D4best_pfx_px"));
1307 if (NULL == fhtmpcs4) {
1308 LOG(info) <<
" Histo " << Form(
"hCluSize4DT04D4best_pfx_px")
1312 TProfile* fhtmptot0 =
1313 (TProfile*) gDirectory->FindObjectAny(Form(
"hTot0DT04D4best_pfx_px"));
1314 if (NULL == fhtmptot0) {
1315 LOG(info) <<
" Histo " << Form(
"hTot0DT04D4best_pfx_px") <<
" not found. ";
1318 TProfile* fhtmptot4 =
1319 (TProfile*) gDirectory->FindObjectAny(Form(
"hTot4DT04D4best_pfx_px"));
1320 if (NULL == fhtmptot4) {
1321 LOG(info) <<
" Histo " << Form(
"hTot4DT04D4best_pfx_px") <<
" not found. ";
1325 (TH1D*) gDirectory->FindObjectAny(Form(
"hSelTypeNNResidualT_Width"));
1327 (TH1D*) gDirectory->FindObjectAny(Form(
"hSelTypeNNResidualX_Width"));
1329 (TH1D*) gDirectory->FindObjectAny(Form(
"hSelTypeNNResidualY_Width"));
1331 (TH1D*) gDirectory->FindObjectAny(Form(
"hSelHitTupleResidualXYT_Width"));
1333 TH2D* fh2tmp = (TH2D*) gDirectory->FindObjectAny(Form(
"hDistDT04D4best"));
1334 if (NULL != fh2tmp)
fdHitDistAv = fh2tmp->GetMean(1);
1336 LOG(info) <<
"CbmTofAnaTestBeam::LoadCalParameter: average distance Dut - "
1337 "Ref initialized to "
1342 if (NULL != fhtmpx)
fhDTX4D4Off = (TH1D*) fhtmpx->Clone();
1343 if (NULL != fhtmpy)
fhDTY4D4Off = (TH1D*) fhtmpy->Clone();
1344 if (NULL != fhtmpt)
fhDTTexpD4Off = (TH1D*) fhtmpt->Clone();
1351 if (NULL == fhtmpstnnrt) {
1352 LOG(info) <<
" Histo " << Form(
"hSelTypeNNResidualT_Width")
1362 new TH1F(Form(
"hSelTypeNNResidualT_Width"),
1363 Form(
"Sel-DUT ResiT Width vs SelType ; SelType ; RMS(T) (ns)"),
1373 if (NULL == fhtmpstnnrx) {
1374 LOG(info) <<
" Histo " << Form(
"hSelTypeNNResidualX_Width")
1384 new TH1F(Form(
"hSelTypeNNResidualX_Width"),
1385 Form(
"Sel-DUT ResiX Width vs SelType ; SelType ; RMS(X) (cm)"),
1395 if (NULL == fhtmpstnnry) {
1396 LOG(info) <<
" Histo " << Form(
"hSelTypeNNResidualY_Width")
1406 new TH1F(Form(
"hSelTypeNNResidualY_Width"),
1407 Form(
"Sel-DUT ResiY Width vs SelType ; SelType ; RMS(Y) (cm)"),
1417 if (NULL == fhtmphtrxyt) {
1418 LOG(info) <<
" Histo " << Form(
"hSelHitTupleResidualXYT_Width")
1428 Form(
"hSelHitTupleResidualXYT_Width"),
1429 Form(
"Sel hit tuple Resi XYT Width; X/Y/T [] ; RMS(X/Y/T) (cm/cm/ns)"),
1451 Double_t XDMAX = 300.;
1452 Double_t YDMAX = 300.;
1453 Double_t TDMAX = 1000.;
1454 Double_t DTMAX = 1.;
1455 Double_t DXMAX = 10.;
1456 Double_t DYMAX = 10.;
1466 Double_t TISmax = 11.;
1467 Double_t TISnbins = 110.;
1469 new TH1F(
"hRate_all",
"Event Rate; Rate (Hz); t (sec)", 1000, 0, 100);
1471 new TH1I(
"tof_trb_trigger_pattern",
"CTS trigger pattern", 16, 0, 16);
1473 new TH1I(
"tof_trb_trigger_types",
"CTS trigger types", 16, 0, 16);
1475 new TH1I(
"tof_trb_time_in_spill",
"Time in Spill", TISnbins, 0, TISmax);
1477 new TH1F(
"TIS_all",
"Time in Spill (all); t (sec)", TISnbins, 0, TISmax);
1479 new TH1F(
"TIS_sel",
"Time in Spill (sel); t (sec)", TISnbins, 0, TISmax);
1481 new TH1F(
"TIS_sel1",
"Time in Spill (sel1); t (sec)", TISnbins, 0, TISmax);
1483 new TH1F(
"TIS_sel2",
"Time in Spill (sel2); t (sec)", TISnbins, 0, TISmax);
1486 Double_t TIRmax = 1800.;
1487 Double_t TIRnbins = 18000.;
1489 new TH1F(
"TIR_all",
"Time in Run (all); t (sec)", TIRnbins, 0, TIRmax);
1491 new TH1F(
"TIR_sel",
"Time in Run (sel); t (sec)", TIRnbins, 0, TIRmax);
1493 new TH1F(
"TIR_sel1",
"Time in Run (sel1); t (sec)", TIRnbins, 0, TIRmax);
1495 new TH1F(
"TIR_sel2",
"Time in Run (sel2); t (sec)", TIRnbins, 0, TIRmax);
1497 Double_t TISmax2 = 11.;
1498 Double_t TISnbins2 = 110.;
1500 "Time in Spill (Nhit); t (sec); N_{hit}",
1508 "Time in Spill (Ntrk); t (sec); N_{trk}",
1517 new TH1F(
"hDTLH_all",
1518 "Time to last hit in Dut(all); log( #DeltaT (ns)); counts",
1523 new TH1F(
"hDTLH_sel",
1524 "Time to last hit in Dut(sel); log( #DeltaT (ns)); counts",
1529 new TH1F(
"hDTLH_sel1",
1530 "Time to last hit in Dut(sel1); log( #DeltaT (ns)); counts",
1535 new TH1F(
"hDTLH_sel2",
1536 "Time to last hit in Dut(sel2); log( #DeltaT (ns)); counts",
1541 "Time to last hit strip matching Dut(sel1); strip ; "
1542 "Channel-PredictedChannel",
1551 Form(
"Multiplicity in Beam Reference counter ; Mul ()"),
1556 Form(
"hDTD4"), Form(
"reference time ; #Delta tD4 (ns)"), 101, -100., 100.);
1560 for (Int_t iDet = 0; iDet < iNbDet; iDet++) {
1562 new TH2F(Form(
"hXY_SmT%d", iDet),
1563 Form(
"XY Position correlation of Det# %d; X[cm]; Y [cm]", iDet),
1572 fhEtaPhi =
new TH2F(Form(
"hEtaPhi"),
1573 Form(
"Reconstructed Tof Hits; #phi (degree) ; #eta"),
1581 fhXX2 =
new TH2F(Form(
"hXX2"),
1582 Form(
"Plastic position correlation; XPla0; XPla1"),
1589 fhYY2 =
new TH2F(Form(
"hYY2"),
1590 Form(
"Plastic position correlation; YPla0; YPla1"),
1597 fhDT2 =
new TH1F(Form(
"hDT2"),
1598 Form(
"Plastic time difference; TPla0 - TPla1 (ns)"),
1603 for (Int_t iDet = 0; iDet < 2; iDet++) {
1604 fhXX02[iDet] =
new TH2F(Form(
"hXX02_%d", iDet),
1605 Form(
"X Position correlation; X0; X2"),
1612 fhYY02[iDet] =
new TH2F(Form(
"hYY02_%d", iDet),
1613 Form(
"Y Position correlation; Y0; Y2"),
1622 const Double_t HTMAX = 100.;
1623 const Double_t HYMAX = 40.;
1625 new TH3F(Form(
"hDutDXDYDT"),
1626 Form(
"Hits distances; #DeltaX [cm]; #DeltaY [cm]; #DeltaT [ns]"),
1637 new TH3F(Form(
"hRefDXDYDT"),
1638 Form(
"Hits distances; #DeltaX [cm]; #DeltaY [cm]; #DeltaT [ns]"),
1649 fhXX04 =
new TH2F(Form(
"hXX04"),
1650 Form(
"X Position correlation; X0 [cm]; X4 [cm]"),
1657 fhYY04 =
new TH2F(Form(
"hYY04"),
1658 Form(
"Y Position correlation; Y0 [cm]; Y4 [cm]"),
1665 fhXY04 =
new TH2F(Form(
"hXY04"),
1666 Form(
"X Position correlation; X0 [cm]; Y4 [cm]"),
1673 fhYX04 =
new TH2F(Form(
"hYX04"),
1674 Form(
"Y Position correlation; Y0 [cm]; X4 [cm]"),
1681 fhTT04 =
new TH2F(Form(
"hTT04"),
1682 Form(
"Time correlation; T0 [ns]; T0 - T4 [ns]"),
1689 fhDXDY04 =
new TH2F(Form(
"hDXDY04"),
1690 Form(
"position correlation; #Delta x [cm]; #DeltaY [cm]"),
1698 new TH2F(Form(
"hDXDT04"),
1699 Form(
"Time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1707 new TH2F(Form(
"hDYDT04"),
1708 Form(
"Time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1716 Form(
"hChi04"), Form(
"Matching Chi2; #chi; Nhits"), 100, 0.,
fdChi2Lim);
1718 Form(
"Matching Chi2S24; #chi; Nhits"),
1723 Form(
"Matching Sel24; #Delta x [cm]; Nhits"),
1728 Form(
"Matching Sel24; #Delta y [cm]; Nhits"),
1733 Form(
"Matching Sel24; #Delta t_{cor} [ns]; Nhits"),
1738 Form(
"Matching Sel24; #Delta t [ns]; Nhits"),
1744 Form(
"local position 0; x [cm]; y [cm]"),
1752 Form(
"local position 4; x [cm]; y [cm]"),
1760 Form(
"local x position 0-4; x0 [cm]; x4 [cm]"),
1768 Form(
"local y position 0-4; y0 [cm]; y4 [cm]"),
1776 Form(
"local position Sel2; x [cm]; y [cm]"),
1784 Form(
"predicted position 0; x [cm]; y [cm]"),
1792 Form(
"selected position 4; x [cm]; y [cm]"),
1800 Form(
"selected position Sel2; x [cm]; y [cm]"),
1809 new TH2F(Form(
"hDXDY04best"),
1810 Form(
"position correlation; #Delta x [cm]; #DeltaY [cm]"),
1818 new TH2F(Form(
"hDXDT04best"),
1819 Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1827 new TH2F(Form(
"hDYDT04best"),
1828 Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1837 new TH2F(Form(
"hX0DT04best"),
1838 Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1846 new TH2F(Form(
"hY0DT04best"),
1847 Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1856 Form(
"hChi04best"), Form(
"matching chi2; #chi; Nhits"), 100, 0.,
fdChi2Lim);
1858 Form(
"Number of digis in cluster; N_{digi}; "),
1863 Form(
"Number of digis in cluster; N_{digi}; "),
1869 Form(
"Time - Chi correlation; #chi; #DeltaT [ns]"),
1878 new TH2F(Form(
"hDXDY04D4best"),
1879 Form(
"position correlation; #Delta x [cm]; #DeltaY [cm]"),
1887 new TH2F(Form(
"hDXDT04D4best"),
1888 Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1896 new TH2F(Form(
"hDYDT04D4best"),
1897 Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1905 new TH2F(Form(
"hDistDT04D4best"),
1906 Form(
"time - distance correlation; Dist [cm]; #DeltaT [ns]"),
1914 Form(
"hTexpDT04D4best"),
1915 Form(
"measured - expected time - correlation; Texp [ns]; #DeltaT [ns]"),
1923 new TH2F(Form(
"hCluSize0DT04D4best"),
1924 Form(
"time - CluSize correlation; M_{strips} ; #DeltaT [ns]"),
1932 new TH2F(Form(
"hCluSize4DT04D4best"),
1933 Form(
"time - CluSize correlation; M_{strips} ; #DeltaT [ns]"),
1941 Form(
"hCluSizeSigT0D4best"),
1942 Form(
"time spread - CluSize correlation; M_{strips} ; #sigma_{T} [ns]"),
1950 Form(
"hCluSizeSigT4D4best"),
1951 Form(
"time spread - CluSize correlation; M_{strips} ; #sigma_{T} [ns]"),
1959 new TH2F(Form(
"hTot0DT04D4best"),
1960 Form(
"time - Tot correlation; ln TOT0 ; #DeltaT [ns]"),
1968 new TH2F(Form(
"hTot4DT04D4best"),
1969 Form(
"time - Tot correlation; ln TOT4 ; #DeltaT [ns]"),
1978 new TH2F(Form(
"hX0DT04D4best"),
1979 Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1987 new TH2F(Form(
"hY0DT04D4best"),
1988 Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1997 new TH2F(Form(
"hTISDT04D4best"),
1998 Form(
"time - TIS; time in spill [s]; #DeltaT [ns]"),
2007 Form(
"matching chi2; #chi; Nhits"),
2012 new TH1F(Form(
"hTofD4best"), Form(
"tof D4; t [ns]; Counts"), 100, 0., 50.);
2014 Form(
"hVelD4best"), Form(
"vel D4; v [cm/ns]; Counts"), 100, 0., 50.);
2017 new TH2F(Form(
"hDigiMul0D4best"),
2018 Form(
"Number of digis in cluster; Mul0; N_{strips}; "),
2026 new TH2F(Form(
"hDigiMul4D4best"),
2027 Form(
"Number of digis in cluster; Mul4; N_{strips}; "),
2035 new TH2F(Form(
"hCluSize04D4best"),
2036 Form(
"cluster multiplicity ; CluSize0; CluSize4"),
2044 Form(
"cluster size correlation ; Mul0; Mul4"),
2052 Form(
"strip multiplicity ; StrMul0; StrMul4"),
2060 new TH2F(Form(
"hCluMulTSig0D4best"),
2061 Form(
"time spread - cluster multiplicity ; Mul0; #sigma_{T} (ns)"),
2069 new TH2F(Form(
"hCluMulTSig4D4best"),
2070 Form(
"time spread - cluster multiplicity ; Mul4; #sigma_{T} (ns)"),
2078 new TH2F(Form(
"hCluMulTrel0D4best"),
2079 Form(
"arrrival time - cluster multiplicity ; Mul0; T_{rel} (ns)"),
2087 new TH2F(Form(
"hCluMulTrel4D4best"),
2088 Form(
"arrival time - cluster multiplicity ; Mul4; T_{rel} (ns)"),
2096 new TH2F(Form(
"hCluSizeTrel0D4best"),
2097 Form(
"arrrival time - cluster size ; CluSize0; T_{rel} (ns)"),
2105 new TH2F(Form(
"hCluSizeTrel4D4best"),
2106 Form(
"arrival time - cluster size ; CluSize4; T_{rel} (ns)"),
2115 new TH2F(Form(
"hChiDT04D4best"),
2116 Form(
"Time - position correlation; #chi; #DeltaT [ns]"),
2123 Double_t dtscal = 5.;
2126 Form(
"hDTD4DT04D4best"),
2127 Form(
"Time - velocity correlation; #DeltaTD4 [ns]; #DeltaT04 [ns]"),
2138 Form(
"hDTMul4D4best"),
2139 Form(
"MRef Time - Multiplicity correlation; Mul4 ; #DeltaT04 [ns]"),
2147 new TH2F(Form(
"hDTX4D4best"),
2148 Form(
"MRef Time - position correlation; X4 [cm]; #DeltaT04 [ns]"),
2156 new TH2F(Form(
"hDTY4D4best"),
2157 Form(
"MRef Time - position correlation; Y4 [cm]; #DeltaT04 [ns]"),
2165 new TH2F(Form(
"hDXX4D4best"),
2166 Form(
"MRef DX - position correlation; X4 [cm]; #DeltaX04 [cm]"),
2174 new TH2F(Form(
"hDXY4D4best"),
2175 Form(
"MRef DX - position correlation; Y4 [cm]; #DeltaX04 [cm]"),
2183 new TH2F(Form(
"hDYX4D4best"),
2184 Form(
"MRef DY - position correlation; X4 [cm]; #DeltaY04 [cm]"),
2192 new TH2F(Form(
"hDYY4D4best"),
2193 Form(
"MRef DY - position correlation; Y4 [cm]; #DeltaY04 [cm]"),
2202 new TH2F(Form(
"hDTMul0D4best"),
2203 Form(
"Dut Time - Multiplicity correlation; Mul0 ; #DeltaT04 [ns]"),
2211 new TH2F(Form(
"hDTX0D4best"),
2212 Form(
"Dut Time - position correlation; X0 [cm]; #DeltaT04 [ns]"),
2220 new TH2F(Form(
"hDTY0D4best"),
2221 Form(
"Dut Time - position correlation; Y0 [cm]; #DeltaT04 [ns]"),
2229 new TH2F(Form(
"hDXX0D4best"),
2230 Form(
"Dut DX - position correlation; X0 [cm]; #DeltaX04 [cm]"),
2238 new TH2F(Form(
"hDXY0D4best"),
2239 Form(
"Dut DX - position correlation; Y0 [cm]; #DeltaX04 [cm]"),
2247 new TH2F(Form(
"hDYX0D4best"),
2248 Form(
"Dut DY - position correlation; X0 [cm]; #DeltaY04 [cm]"),
2256 new TH2F(Form(
"hDYY0D4best"),
2257 Form(
"Dut DY - position correlation; Y0 [cm]; #DeltaY04 [cm]"),
2267 new TH2F(Form(
"hX0DT04D4sbest"),
2268 Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
2276 new TH2F(Form(
"hY0DT04D4sbest"),
2277 Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
2286 new TH2F(Form(
"hDXDY04D4sbest"),
2287 Form(
"position correlation; #Delta x [cm]; #DeltaY [cm]"),
2295 new TH2F(Form(
"hDXDT04D4sbest"),
2296 Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
2304 new TH2F(Form(
"hDYDT04D4sbest"),
2305 Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
2313 new TH2F(Form(
"hDistDT04D4sbest"),
2314 Form(
"time - distance correlation; Dist [cm]; #DeltaT [ns]"),
2322 Form(
"hTexpDT04D4sbest"),
2323 Form(
"measured - expected time - correlation; Texp [ns]; #DeltaT [ns]"),
2331 new TH2F(Form(
"hCluSize0DT04D4sbest"),
2332 Form(
"time - CluSize correlation; N_{strips} ; #DeltaT [ns]"),
2340 new TH2F(Form(
"hCluSize4DT04D4sbest"),
2341 Form(
"time - CluSize correlation; N_{strips} ; #DeltaT [ns]"),
2349 new TH2F(Form(
"hTot0DT04D4sbest"),
2350 Form(
"time - Tot correlation; ln TOT0 ; #DeltaT [ns]"),
2358 new TH2F(Form(
"hTot4DT04D4sbest"),
2359 Form(
"time - Tot correlation; ln TOT4 ; #DeltaT [ns]"),
2368 Form(
"matching chi2; #chi; Nhits"),
2373 new TH1F(Form(
"hTofD4sbest"), Form(
"tof D4; t [ns]; Counts"), 100, 0., 50.);
2375 Form(
"hVelD4sbest"), Form(
"vel D4; v [cm/ns]; Counts"), 100, 0., 50.);
2378 Form(
"Number of digis in cluster; N_{digi}; "),
2383 Form(
"Number of digis in cluster; N_{digi}; "),
2388 Form(
"cluster multiplicity ; Mul0; Mul4"),
2397 new TH2F(Form(
"hChiDT04D4sbest"),
2398 Form(
"Time - position correlation; #chi; #DeltaT [ns]"),
2407 Form(
"hDTD4DT04D4sbest"),
2408 Form(
"Time - velocity correlation; #DeltaTD4 [ns]; #DeltaT04 [ns]"),
2417 new TH2F(Form(
"hDTMul4D4sbest"),
2418 Form(
"Time - Multiplicity correlation; Mul4 ; #DeltaT04 [ns]"),
2426 new TH2F(Form(
"hDTX4D4sbest"),
2427 Form(
"Time - position correlation; X4 [cm]; #DeltaT04 [ns]"),
2435 new TH2F(Form(
"hDTY4D4sbest"),
2436 Form(
"Time - position correlation; Y4 [cm]; #DeltaT04 [ns]"),
2444 new TH2F(Form(
"hDXX4D4sbest"),
2445 Form(
"DX - position correlation; X4 [cm]; #DeltaX04 [cm]"),
2453 new TH2F(Form(
"hDXY4D4sbest"),
2454 Form(
"DX - position correlation; Y4 [cm]; #DeltaX04 [cm]"),
2462 new TH2F(Form(
"hDYX4D4sbest"),
2463 Form(
"DY - position correlation; X4 [cm]; #DeltaY04 [cm]"),
2471 new TH2F(Form(
"hDYY4D4sbest"),
2472 Form(
"DY - position correlation; Y4 [cm]; #DeltaY04 [cm]"),
2481 new TH2F(Form(
"hDTMul0D4sbest"),
2482 Form(
"Time - Multiplicity correlation; Mul0 ; #DeltaT04 [ns]"),
2490 new TH2F(Form(
"hDTX0D4sbest"),
2491 Form(
"Time - position correlation; X0 [cm]; #DeltaT04 [ns]"),
2499 new TH2F(Form(
"hDTY0D4sbest"),
2500 Form(
"Time - position correlation; Y0 [cm]; #DeltaT04 [ns]"),
2508 new TH2F(Form(
"hDXX0D4sbest"),
2509 Form(
"DX - position correlation; X0 [cm]; #DeltaX04 [cm]"),
2517 new TH2F(Form(
"hDXY0D4sbest"),
2518 Form(
"DX - position correlation; Y0 [cm]; #DeltaX04 [cm]"),
2526 new TH2F(Form(
"hDYX0D4sbest"),
2527 Form(
"DY - position correlation; X0 [cm]; #DeltaY04 [cm]"),
2535 new TH2F(Form(
"hDYY0D4sbest"),
2536 Form(
"DY - position correlation; Y0 [cm]; #DeltaY04 [cm]"),
2545 Form(
"Number of Matched Hit pairs 0-4; NMatched"),
2551 Form(
"Number of Matched Hit pairs 0-4; NMatched"),
2557 Form(
"Number of Matched Hit pairs 0-4; NMatched"),
2563 Form(
"Time difference BRef - MrpcRef; #DeltaTD4 (ns)"),
2569 Form(
"Time difference BRef - MrpcRef; #DeltaTD4 (ns)"),
2575 new TH2F(Form(
"hDT04DX0_1"),
2576 Form(
"Time - position correlation; #DeltaX0 [cm]; #DeltaT04 [ns]"),
2584 new TH2F(Form(
"hDT04DY0_1"),
2585 Form(
"Time - position correlation; #DeltaY0 [cm]; #DeltaT04 [ns]"),
2593 new TH2F(Form(
"hDT04DT0_1"),
2594 Form(
"Time - time correlation; #DeltaT0 [ns]; #DeltaT04 [ns]"),
2603 new TH2F(Form(
"hDT04DX4_1"),
2604 Form(
"Time - position correlation; #DeltaX4 [cm]; #DeltaT04 [ns]"),
2612 new TH2F(Form(
"hDT04DY4_1"),
2613 Form(
"Time - position correlation; #DeltaY4 [cm]; #DeltaT04 [ns]"),
2621 new TH2F(Form(
"hDT04DT4_1"),
2622 Form(
"Time - time correlation; #DeltaT4 [ns]; #DeltaT04 [ns]"),
2631 new TH2F(Form(
"hDT04DX0_2"),
2632 Form(
"Time - position correlation; #DeltaX0 [cm]; #DeltaT04 [ns]"),
2640 new TH2F(Form(
"hDT04DY0_2"),
2641 Form(
"Time - position correlation; #DeltaY0 [cm]; #DeltaT04 [ns]"),
2649 new TH2F(Form(
"hDT04DT0_2"),
2650 Form(
"Time - time correlation; #DeltaT0 [ns]; #DeltaT04 [ns]"),
2659 new TH2F(Form(
"hDT04DX4_2"),
2660 Form(
"Time - position correlation; #DeltaX4 [cm]; #DeltaT04 [ns]"),
2668 new TH2F(Form(
"hDT04DY4_2"),
2669 Form(
"Time - position correlation; #DeltaY4 [cm]; #DeltaT04 [ns]"),
2677 new TH2F(Form(
"hDT04DT4_2"),
2678 Form(
"Time - time correlation; #DeltaT4 [ns]; #DeltaT04 [ns]"),
2688 fhDutPullX =
new TH1F(Form(
"hDutPullX_Sm_%03d", iDutId),
2689 Form(
"hDutPullX_Sm_%03d; #DeltaX", iDutId),
2693 fhDutPullXB =
new TH1F(Form(
"hDutPullXB_Sm_%03d", iDutId),
2694 Form(
"hDutPullXB_Sm_%03d; #DeltaX", iDutId),
2698 fhDutPullY =
new TH1F(Form(
"hDutPullY_Sm_%03d", iDutId),
2699 Form(
"hDutPullY_Sm_%03d; #DeltaY", iDutId),
2703 fhDutPullYB =
new TH1F(Form(
"hDutPullYB_Sm_%03d", iDutId),
2704 Form(
"hDutPullYB_Sm_%03d; #DeltaY", iDutId),
2708 fhDutPullZ =
new TH1F(Form(
"hDutPullZ_Sm_%03d", iDutId),
2709 Form(
"hDutPullZ_Sm_%03d; #DeltaZ", iDutId),
2713 fhDutPullT =
new TH1F(Form(
"hDutPullT_Sm_%03d", iDutId),
2714 Form(
"hDutPullT_Sm_%03d; #DeltaT", iDutId),
2718 fhDutPullTB =
new TH1F(Form(
"hDutPullTB_Sm_%03d", iDutId),
2719 Form(
"hDutPullTB_Sm_%03d; #DeltaT", iDutId),
2725 Form(
"hDutChi_Found_%03d; #chi", iDutId),
2730 Form(
"hDutChi_Missed_%03d; #chi", iDutId),
2736 Form(
"hDutChi_Match_%03d; #chi", iDutId),
2740 Double_t XSIZ = 20.;
2741 Double_t DTSIZ = 0.5;
2744 Form(
"hDutXY_Found_%03d; x(cm); y (cm)", iDutId),
2752 Form(
"hDutXY_Missed_%03d; x(cm); y (cm)", iDutId),
2761 Form(
"hDutDTLH_Found_%03d; log(#DeltaT)", iDutId),
2766 new TH1F(Form(
"hDutDTLH_Missed_%03d", iDutId),
2767 Form(
"hDutDTLH_Missed_%03d; log(#DeltaT)", iDutId),
2772 new TH1F(Form(
"hDutMul_Found_%03d", iDutId),
2773 Form(
"hDutMul_Found_%03d; Hit Multiplicity", iDutId),
2778 new TH1F(Form(
"hDutMul_Missed_%03d", iDutId),
2779 Form(
"hDutMul_Missed_%03d; Hit Multiplicity", iDutId),
2784 new TH2F(Form(
"hDutTIS_Found_%03d", iDutId),
2785 Form(
"hDutTIS_Found_%03d; Time in spill (s)", iDutId),
2793 new TH2F(Form(
"hDutTIS_Missed_%03d", iDutId),
2794 Form(
"hDutTIS_Missed_%03d; Time in spill (s)", iDutId),
2802 new TH2F(Form(
"hDutTIR_Found_%03d", iDutId),
2803 Form(
"hDutTIR_Found_%03d; Time in spill (s)", iDutId),
2811 new TH2F(Form(
"hDutTIR_Missed_%03d", iDutId),
2812 Form(
"hDutTIR_Missed_%03d; Time in spill (s)", iDutId),
2820 new TH1F(Form(
"hDutVel_Found_%03d", iDutId),
2821 Form(
"hDutVel_Found_%03d; velocity (cm/ns)", iDutId),
2826 new TH1F(Form(
"hDutVel_Missed_%03d", iDutId),
2827 Form(
"hDutVel_Missed_%03d; velocity (cm/ns)", iDutId),
2832 new TH2F(Form(
"hDutDTLH_CluSize_%03d", iDutId),
2833 Form(
"hDutDTLH_CluSize_%03d; log(#DeltaT); CluSize", iDutId),
2841 new TH2F(Form(
"hDutDTLH_Tot_%03d", iDutId),
2842 Form(
"hDutDTLH_Tot_%03d; log(#DeltaT); Tot", iDutId),
2850 new TH2F(Form(
"hDutDTLH_Mul_%03d", iDutId),
2851 Form(
"hDutDTLH_Mul_%03d; log(#DeltaT); Mul", iDutId),
2859 new TH2F(Form(
"hDutDTLH_TIS_%03d", iDutId),
2860 Form(
"hDutDTLH_TIS_%03d; log(#DeltaT); TIS (s)", iDutId),
2868 new TH2F(Form(
"hDutDTLH_Missed_TIS_%03d", iDutId),
2869 Form(
"hDutDTLH_Missed_TIS_%03d; log(#DeltaT); TIS (s)", iDutId),
2877 Form(
"hDutDTLH_DDH_Found_%03d", iDutId),
2878 Form(
"hDutDTLH_DDH_Found_%03d; log(#DeltaT); distance to LH (cm)", iDutId),
2886 Form(
"hDutDTLH_DD_Found_%03d", iDutId),
2887 Form(
"hDutDTLH_DD_Found_%03d; log(#DeltaT); distance to LH (cm)", iDutId),
2895 Form(
"hDutDTLH_DD_Missed_%03d", iDutId),
2896 Form(
"hDutDTLH_DD_Missed_%03d; log(#DeltaT); distance to LH (cm)", iDutId),
2904 new TH3F(Form(
"hDutXYDX_%03d", iDutId),
2905 Form(
"hDutXYDT_%03d; x(cm); y (cm); #Deltax (cm)", iDutId),
2916 new TH3F(Form(
"hDutXYDY_%03d", iDutId),
2917 Form(
"hDutXYDT_%03d; x(cm); y (cm); #Deltay (cm)", iDutId),
2928 new TH3F(Form(
"hDutXYDT_%03d", iDutId),
2929 Form(
"hDutXYDT_%03d; x(cm); y (cm); #Deltat (ns)", iDutId),
2942 new TH2F(
"hSelTypeNNChiSq",
2943 "ST NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ",
2952 new TH2F(
"hSelTypeNNResidualT",
2953 "ST NN ResiT vs. ST; sel type ST []; T_{DUT} - T_{ST} [ns]",
2962 new TH2F(
"hSelTypeNNResidualX",
2963 "ST NN ResiX vs. ST; sel type ST []; X_{DUT} - X_{ST} [cm]",
2972 new TH2F(
"hSelTypeNNResidualY",
2973 "ST NN ResiY vs. ST; sel type ST []; Y_{DUT} - Y_{ST} [cm]",
2982 new TH2F(
"hSelTypeAccNNChiSq",
2983 "ST acc NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ",
2992 new TH2F(
"hSelTypeAccNNResidualT",
2993 "ST acc NN ResiT vs. ST; sel type ST []; T_{DUT} - T_{ST} [ns]",
3002 new TH2F(
"hSelTypeAccNNResidualX",
3003 "ST acc NN ResiX vs. ST; sel type ST []; X_{DUT} - X_{ST} [cm]",
3012 new TH2F(
"hSelTypeAccNNResidualY",
3013 "ST acc NN ResiY vs. ST; sel type ST []; Y_{DUT} - Y_{ST} [cm]",
3023 "hSelEfficiency",
"; acc ref MUL []; Sel efficiency []", 50, 0., 50.);
3026 new TEfficiency(
"hSelHitTupleEfficiencyTIS",
3027 "; time in spill [s]; Sel efficiency []",
3033 new TEfficiency(
"hSelMatchEfficiency",
3034 "; acc ref MUL []; Sel match efficiency []",
3040 new TEfficiency(
"hSelHitTupleMatchEfficiencyTIS",
3041 "; time in spill [s]; Sel match efficiency []",
3047 new TH2F(
"hSelHitTupleResidualTTIS",
3048 "; time in spill [s]; T_{hit} - T_{sel} [ns]",
3057 new TH2F(
"hSelHitTupleDutCluSizeTIS",
3058 "; time in spill [s]; cluster size [cells]",
3068 "hSelTrklEfficiency",
"; acc ref MUL []; Sel efficiency []", 50, 0., 50.);
3071 new TEfficiency(
"hSelTrklEfficiencyTIS",
3072 "; time in spill [s]; Sel efficiency []",
3078 new TEfficiency(
"hSelTrklMatchEfficiency",
3079 "; acc ref MUL []; Sel match efficiency []",
3085 new TEfficiency(
"hSelTrklMatchEfficiencyTIS",
3086 "; time in spill [s]; Sel match efficiency []",
3092 new TH2F(
"hSelTrklResidualTTIS",
3093 "; time in spill [s]; T_{hit} - T_{sel} [ns]",
3102 "; time in spill [s]; cluster size [cells]",
3116 "hNMergedMCEvents",
"Merged MC events; events []; ", 10, -0.5, 9.5);
3119 new TH1F(
"hAccTrackMul",
"Acc track mul; MUL []; ", 150, -0.5, 149.5);
3121 "hAccRefTrackMul",
"Acc ref track mul; MUL []; ", 50, -0.5, 49.5);
3123 "hAccPrimTrackMul",
"Acc prim track mul; MUL []; ", 60, -0.5, 59.5);
3125 "Acc track points; points []; ",
3130 "Acc ref track points; points []; ",
3135 "Acc rndm track points; points []; ",
3142 new TH2F(
"hAccRefTrackAcceptance",
3143 "Ref track acceptance; y_{lab} []; p_{t}/m [1/c]",
3152 "hAccRefTrackAcceptanceEfficiency",
3153 "Ref track acceptance efficiency; y_{lab} []; p_{t}/m [1/c]",
3162 new TEfficiency(
"hAccRefTrackAcceptancePurity",
3163 "Ref track acceptance purity; y_{lab} []; p_{t}/m [1/c]",
3172 new TH2F(
"hAccRefTrackMulCentrality",
3173 "Acc ref track mul vs. centrality; b [fm]; MUL []",
3182 "hAccRefTracksProcSpec",
"ref track proc/spec; ; ", 5, 0., 5., 5, 0., 5.);
3188 new TEfficiency(
"hSelMCTrackEfficiency",
3189 "; acc ref MUL []; Sel efficiency []",
3195 new TEfficiency(
"hSelMCTrackMatchEfficiency",
3196 "; acc ref MUL []; Sel match efficiency []",
3202 new TEfficiency(
"hSelMCTrackMatchPurity",
3203 "; acc ref MUL []; Sel match purity []",
3209 "Sel track-hit match mul; MUL []; ",
3215 new TH1F(
"hSelMCTrackDutHitMatchAccNNMul",
3216 "Sel track-hit match acc mul; MUL []; ",
3223 "hSelPurity",
"; acc ref MUL []; Sel purity []", 50, 0., 50.);
3226 new TEfficiency(
"hSelRefTrackShare",
3227 "; acc ref MUL []; Sel ref track share []",
3233 "ST 0 ref track proc/spec; ; ",
3244 "hSelMatchPurity",
"; acc ref MUL []; Sel match purity []", 50, 0., 50.);
3248 new TH2F(
"hResX04HitExp",
3249 "DUT hit-exp residual X; acc ref MUL []; X_{hit} - X_{exp} [cm]",
3258 new TH2F(
"hResX04ExpMC",
3259 "DUT exp-MC residual X; acc ref MUL []; X_{exp} - X_{MC} [cm]",
3268 new TH2F(
"hResX04HitMC",
3269 "DUT hit-MC residual X; acc ref MUL []; X_{hit} - X_{MC} [cm]",
3278 new TH2F(
"hResY04HitExp",
3279 "DUT hit-exp residual Y; acc ref MUL []; Y_{hit} - Y_{exp} [cm]",
3288 new TH2F(
"hResY04ExpMC",
3289 "DUT exp-MC residual Y; acc ref MUL []; Y_{exp} - Y_{MC} [cm]",
3298 new TH2F(
"hResY04HitMC",
3299 "DUT hit-MC residual Y; acc ref MUL []; Y_{hit} - Y_{MC} [cm]",
3308 new TH2F(
"hResT04HitExp",
3309 "DUT hit-exp residual T; acc ref MUL []; T_{hit} - T_{exp} [ns]",
3318 new TH2F(
"hResT04ExpMC",
3319 "DUT exp-MC residual T; acc ref MUL []; T_{exp} - T_{MC} [ns]",
3328 new TH2F(
"hResT04HitMC",
3329 "DUT hit-MC residual T; acc ref MUL []; T_{hit} - T_{MC} [ns]",
3338 "MRef tracks/hit; #tracks/hit []; ",
3344 "Sel2 tracks/hit; #tracks/hit []; ",
3350 "hNTracksPerDutHit",
"DUT tracks/hit; #tracks/hit []; ", 20, -0.5, 19.5);
3353 "MRef sel tracks/hit; #tracks/hit []; ",
3359 "Sel2 sel tracks/hit; #tracks/hit []; ",
3365 "DUT sel tracks/hit; #tracks/hit []; ",
3372 "hSelTrklPurity",
"; acc ref MUL []; Sel purity []", 50, 0., 50.);
3375 new TEfficiency(
"hSelTrklRefTrackShare",
3376 "; acc ref MUL []; Sel ref track share []",
3382 "ST 1 ref track proc/spec; ; ",
3394 new TEfficiency(
"hSelTrklMatchPurity",
3395 "; acc ref MUL []; Sel match purity []",
3402 "DUT hit-trklt residual X; acc ref MUL []; X_{hit} - X_{trklt} [cm]",
3412 "DUT trklt-MC residual X; acc ref MUL []; X_{trklt} - X_{MC} [cm]",
3421 new TH2F(
"hDutResX_Hit_MC",
3422 "DUT hit-MC residual X; acc ref MUL []; X_{hit} - X_{MC} [cm]",
3432 "DUT hit-trklt residual Y; acc ref MUL []; Y_{hit} - Y_{trklt} [cm]",
3442 "DUT trklt-MC residual Y; acc ref MUL []; Y_{trklt} - Y_{MC} [cm]",
3451 new TH2F(
"hDutResY_Hit_MC",
3452 "DUT hit-MC residual Y; acc ref MUL []; Y_{hit} - Y_{MC} [cm]",
3462 "DUT hit-trklt residual T; acc ref MUL []; T_{hit} - T_{trklt} [ns]",
3472 "DUT trklt-MC residual T; acc ref MUL []; T_{trklt} - T_{MC} [ns]",
3481 new TH2F(
"hDutResT_Hit_MC",
3482 "DUT hit-MC residual T; acc ref MUL []; T_{hit} - T_{MC} [ns]",
3492 new TEfficiency(
"hSelMCTrackEfficiencyTIS",
3493 "; time in spill [s]; Sel efficiency []",
3499 new TEfficiency(
"hSelMCTrackMatchEfficiencyTIS",
3500 "; time in spill [s]; Sel match efficiency []",
3506 new TH2F(
"hSelMCTrackResidualTTIS",
3507 "; time in spill [s]; T_{hit} - T_{sel} [ns]",
3516 new TH2F(
"hSelMCTrackDutCluSizeTIS",
3517 "; time in spill [s]; cluster size [cells]",
3528 "PV all reco-MC residual T; acc ref MUL []; T_{reco} - T_{MC} [ns]",
3538 "PV all reco-MC residual X; acc ref MUL []; X_{reco} - X_{MC} [cm]",
3548 "PV all reco-MC residual Y; acc ref MUL []; Y_{reco} - Y_{MC} [cm]",
3558 "PV ref reco-MC residual T; acc ref MUL []; T_{reco} - T_{MC} [ns]",
3568 "PV ref reco-MC residual X; acc ref MUL []; X_{reco} - X_{MC} [cm]",
3578 "PV ref reco-MC residual Y; acc ref MUL []; Y_{reco} - Y_{MC} [cm]",
3588 "ref track-tracklet residual T; acc ref MUL "
3589 "[]; T0_{trklt} - T_{trk} [ns]",
3598 "ref track-tracklet residual X; acc ref MUL "
3599 "[]; X0_{trklt} - X_{trk} [cm]",
3608 "ref track-tracklet residual Y; acc ref MUL "
3609 "[]; Y0_{trklt} - Y_{trk} [cm]",
3618 "ref track-tracklet residual Tx; acc ref MUL "
3619 "[]; Tx0_{trklt} - Tx_{trk} []",
3628 "ref track-tracklet residual Ty; acc ref MUL "
3629 "[]; Ty0_{trklt} - Ty_{trk} []",
3638 "ref track-tracklet residual V; acc ref MUL "
3639 "[]; V0_{trklt} - V_{trk} [cm/ns]",
3649 "ref track-tracklet residual N; acc ref MUL []; N0_{trklt} - N_{trk} []",
3659 "hAccRefTrackShare",
"; acc ref MUL []; acc ref share []", 50, 0., 50.);
3662 new TEfficiency(
"hRecRefTrackEfficiency",
3663 "; acc ref MUL []; acc ref reco eff []",
3669 new TEfficiency(
"hRecRndmTrackEfficiency",
3670 "; acc ref MUL []; acc rndm reco eff []",
3676 new TEfficiency(
"hRecRefTrackGhostShare",
3677 "; acc ref MUL []; acc ref ghost share []",
3683 new TEfficiency(
"hRecRefTrackCloneShare",
3684 "; acc ref MUL []; acc ref clone share []",
3690 new TEfficiency(
"hRecRndmTrackGhostShare",
3691 "; acc ref MUL []; acc rndm ghost share []",
3697 new TEfficiency(
"hRecRndmTrackCloneShare",
3698 "; acc ref MUL []; acc rndm clone share []",
3703 TH1* tCurrentHistogram(NULL);
3706 auto const& CounterID = CounterModuleNode.first;
3708 Int_t iModuleType = std::get<0>(CounterID);
3709 Int_t iModuleIndex = std::get<1>(CounterID);
3710 Int_t iCounterIndex = std::get<2>(CounterID);
3714 tCurrentHistogram =
new TH2F(Form(
"hDomTracksProcSpec_%d_%d_%d",
3718 Form(
"%d-%d-%d dom proc/spec; ; ",
3728 tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
3729 tCurrentHistogram->SetStats(0);
3732 std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
3735 tCurrentHistogram =
new TH2F(Form(
"hDomTracksProcMat_%d_%d_%d",
3739 Form(
"%d-%d-%d dom proc/mat; ; ",
3749 tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
3750 tCurrentHistogram->SetStats(0);
3753 std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
3756 tCurrentHistogram =
new TH2F(Form(
"hRndmTracksProcSpec_%d_%d_%d",
3760 Form(
"%d-%d-%d rndm proc/spec; ; ",
3770 tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
3771 tCurrentHistogram->SetStats(0);
3774 std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
3777 tCurrentHistogram =
new TH2F(Form(
"hRndmTracksProcMat_%d_%d_%d",
3781 Form(
"%d-%d-%d rndm proc/mat; ; ",
3791 tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
3792 tCurrentHistogram->SetStats(0);
3795 std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
3798 tCurrentHistogram =
new TH1F(Form(
"hCounterAccTrackMul_%d_%d_%d",
3802 Form(
"%d-%d-%d acc mul; MUL []; ",
3813 tCurrentHistogram =
new TH1F(Form(
"hCounterAccRefTrackMul_%d_%d_%d",
3817 Form(
"%d-%d-%d acc ref mul; MUL []; ",
3826 std::make_pair(CounterID, tCurrentHistogram));
3829 tCurrentHistogram =
new TH1F(Form(
"hCounterAccRndmTrackMul_%d_%d_%d",
3833 Form(
"%d-%d-%d acc rndm mul; MUL []; ",
3842 std::make_pair(CounterID, tCurrentHistogram));
3845 tCurrentHistogram =
new TH1F(Form(
"hCounterAccDomTrackMul_%d_%d_%d",
3849 Form(
"%d-%d-%d acc dom mul; MUL []; ",
3858 std::make_pair(CounterID, tCurrentHistogram));
3861 tCurrentHistogram =
new TH1F(
3862 Form(
"hCounterRecRefTrackEfficiencyPassed_%d_%d_%d",
3866 Form(
"%d-%d-%d acc ref reco eff; acc ref MUL []; reco efficiency []",
3875 std::make_pair(CounterID, tCurrentHistogram));
3878 tCurrentHistogram =
new TH1F(
3879 Form(
"hCounterRecRefTrackEfficiencyTotal_%d_%d_%d",
3883 Form(
"%d-%d-%d acc ref reco eff; acc ref MUL []; reco efficiency []",
3892 std::make_pair(CounterID, tCurrentHistogram));
3895 tCurrentHistogram =
new TH1F(
3896 Form(
"hCounterRecRefTrackPurityPassed_%d_%d_%d",
3900 Form(
"%d-%d-%d acc ref reco pure; acc ref MUL []; reco purity []",
3909 std::make_pair(CounterID, tCurrentHistogram));
3912 tCurrentHistogram =
new TH2F(
3913 Form(
"hCounterRefTrackMulHitMul_%d_%d_%d",
3917 Form(
"%d-%d-%d acc ref mul/hit mul; acc ref MUL []; hit MUL []",
3929 std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
3933 new TH2F(Form(
"hCounterRefTrackLocalXY_%d_%d_%d",
3937 Form(
"%d-%d-%d acc ref track position; X [cm]; Y [cm]",
3949 std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
3953 new TH2F(Form(
"hCounterRefTrackMulCell_%d_%d_%d",
3957 Form(
"%d-%d-%d cell acc ref mul; strip []; ref track MUL []",
3969 std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
3974 new TH2F(
"hGoodSelTypeNNPureChiSq",
3975 "gST pure NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ",
3984 new TH2F(
"hGoodSelTypeNNAllChiSq",
3985 "gST all NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ",
3996 auto const& CounterID = CounterModuleNode.first;
3998 Int_t iModuleType = std::get<0>(CounterID);
3999 Int_t iModuleIndex = std::get<1>(CounterID);
4000 Int_t iCounterIndex = std::get<2>(CounterID);
4003 TH1* tCurrentHistogram =
4004 new TH2F(Form(
"hCounterHitMulCell_%d_%d_%d",
4008 Form(
"%d-%d-%d cell hit mul; strip []; hit MUL []",
4020 std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
4025 "Sel trkl 3D fit #chi^{2}/4; #chi^{2}/4 []; ",
4030 "Sel trkl-hit match mul; MUL []; ",
4035 new TH1F(
"hSelTrklDutHitMatchAccNNMul",
4036 "Sel trkl-hit match acc mul; MUL []; ",
4042 "Sel hit-hit match mul; MUL []; ",
4047 new TH1F(
"hSelHitTupleDutHitMatchAccMul",
4048 "Sel hit-hit match acc mul; MUL []; ",
4054 Double_t TRange = 600.;
4059 Form(
"hTrklNofHitsRate; Time (s); NofHits "),
4067 Form(
"hTrklDetHitRate; Time (s); DetIndx "),
4076 Double_t TRangeSpill = 10.;
4078 new TH2F(Form(
"hTrklNofHitsRateInSpill"),
4079 Form(
"hTrklNofHitsRateInSpill; Time (s); NofHits "),
4080 (Int_t) TRangeSpill * 10,
4087 new TH2F(Form(
"hTrklDetHitRateInSpill"),
4088 Form(
"hTrklDetHitRateInSpill; Time (s); DetIndx "),
4089 (Int_t) TRangeSpill * 10,
4100 for (Int_t iDet = 0; iDet < iNbDet; iDet++) {
4101 fhLHTime[iDet] =
new TH2D(Form(
"hLHTime_Det%d", iDet),
4102 Form(
"hLHTime_Det%d ; x (cm); y (cm) ", iDet),
4109 fvLHit[iDet].resize(iNbins * iNbins);
4110 for (
size_t iBin = 0; iBin <
fvLHit[iDet].size(); iBin++)
4111 fvLHit[iDet][iBin] = NULL;
4124 std::set<Int_t> DutHitSet;
4126 for (Int_t iHitInd = 0; iHitInd <
fTofHitsColl->GetEntries(); iHitInd++) {
4130 if (
fiDutAddr == iDetId) { DutHitSet.emplace(iHitInd); }
4138 TGeoNode* tNode(NULL);
4139 TGeoMedium* tMedium(NULL);
4140 TGeoMaterial* tMaterial(NULL);
4142 const char* cMaterialName;
4151 Int_t iNAccPrimTracks(0);
4153 for (Int_t iTrack = 0; iTrack <
fAccTracks->GetEntriesFast(); iTrack++) {
4159 tNode = gGeoManager->FindNode(tAccTrack->
GetStartX(),
4162 tMedium = tNode->GetMedium();
4163 tMaterial = tMedium->GetMaterial();
4167 if (0 == std::strcmp(
"target", cMaterialName)) {
4170 if (fiMinMCRefTrackPoints <= tAccTrackPointMatch->GetNofLinks()) {
4199 Int_t iBRefHitInd(-1);
4200 Int_t iMRefHitInd(-1);
4201 Int_t iSel2HitInd(-1);
4203 Bool_t bGoodTrackSel(kFALSE);
4210 for (UInt_t uChannel = 0; uChannel < 16; uChannel++) {
4211 if (uTriggerPattern & (0x1 << uChannel)) {
4221 Int_t iNbTofHits, iNbTofTracks;
4249 Int_t iNbMatchedHits = 0;
4250 Int_t iNbMaxMatch = 500;
4253 Double_t Chi2List[iNbMaxMatch];
4257 pChi2Hit1[0] = NULL;
4258 pChi2Hit2[0] = NULL;
4262 for (Int_t iSel = 0; iSel <
iNSel; iSel++) {
4263 BSel[iSel] = kFALSE;
4265 Double_t dDTD4 = 0.;
4268 Double_t dMul0 = 0.;
4269 Double_t dMul4 = 0.;
4270 Double_t dMulS2 = 0.;
4271 Double_t dStrMul0 = 0.;
4272 Double_t dStrMul4 = 0.;
4273 Double_t dMulD = 0.;
4274 Double_t dM4Max = 1;
4276 Double_t dM0Max = 100;
4278 Double_t dMDMax = 1;
4280 Double_t hitpos1[3], hitpos2[3], hitpos3[3], hitpos4[3];
4281 Double_t hitpos1_local[3], hitpos2_local[3], hitpos3_local[3],
4283 std::vector<CbmTofHit*> vDiaHit;
4284 Double_t DDiaAvLim = 0.2;
4285 Double_t dMulDAv = 0;
4295 Int_t iBeamRefMul = iNbTofHits / 4;
4296 if (iBeamRefMul > 0) {
4300 dMulD = (Double_t) iBeamRefMul;
4302 iBRefHitInd = iNbTofHits - 1;
4308 Double_t vdTimes[iBeamRefMul];
4310 vdTimes[iLast] = 1.E300;
4311 for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
4313 if (NULL == pHit)
continue;
4316 if (pHit->
GetTime() < vdTimes[iLast]) {
4317 if (iLast < iBeamRefMul) { iLast++; }
4319 for (iT = 0; iT < iLast; iT++)
4320 if (pHit->
GetTime() < vdTimes[iT])
break;
4321 for (Int_t iL = iLast; iL > iT; iL--)
4322 vdTimes[iL] = vdTimes[iL - 1];
4323 vdTimes[iT] = pHit->
GetTime();
4332 for (Int_t iHit = 0; iHit < iLast; iHit++) {
4333 dTDia += vdTimes[iHit];
4335 dTDia /= (Double_t) iLast;
4336 dMulD = (Double_t) iLast;
4337 Double_t hitPos[3] = {3 * 0.};
4338 Double_t hitPosErr[3] = {3 * 1.};
4346 new ((*fTofHitsColl)[iNbTofHits])
4352 iBRefHitInd = iNbTofHits;
4358 for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
4360 if (NULL == pHit)
continue;
4365 std::map<UInt_t, UInt_t>::iterator it =
fDetIdMap.find(iDetId);
4386 vDiaHit.resize(dMulD);
4387 vDiaHit[dMulD - 1] = pHit;
4391 iBRefHitInd = iHitInd;
4396 for (Int_t iDiaHit = 0; iDiaHit < dMulD; iDiaHit++) {
4397 if (vDiaHit[iDiaHit] != pDia) {
4398 if (TMath::Abs(vDiaHit[iDiaHit]->GetTime() -
dTDia) < DDiaAvLim) {
4400 (
dTDia * dMulDAv + vDiaHit[iDiaHit]->GetTime()) / (dMulDAv + 1);
4410 "Diamond mul %3.0f, mulAv %3.0f, time: %6.2e", dMulD, dMulDAv,
dTDia)
4411 << Form(
", inspect Dut 0x%08x, Ref 0x%08x, Sel2 0x%08x, Sel3 0x%08x ",
4418 if (iNbTofHits > 5) {
4427 vector<CbmTofHit*> vDutHit;
4428 vector<CbmTofHit*> vRefHit;
4431 for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
4433 if (NULL == pHit)
continue;
4440 LOG(debug) << Form(
"process %d.(%d) Tof hit 0x%08x, Ind %d, x = %6.1f, y = "
4441 "%6.1f, z=%6.1f, t=%10.1f",
4452 LOG(debug) <<
"NULL Channel Pointer for ChId " << Form(
" 0x%08x ", iChId);
4457 if (
static_cast<UInt_t
>(iDetInd) <
fhXYPos.size())
4462 Double_t dTheta = TMath::ATan(
4465 Double_t dEta = -TMath::Log(TMath::Tan(dTheta * 0.5));
4471 LOG(debug2) <<
"process iDetId " << Form(
" 0x%08x ", iDetId)
4472 << Form(
", Muls %4.0f, %4.0f, %4.0f", dMulD, dMul0, dMul4);
4477 vDutHit.push_back(pHit);
4484 Double_t xPos1 = pHit->
GetX();
4485 Double_t yPos1 = pHit->
GetY();
4486 Double_t zPos1 = pHit->
GetZ();
4487 Double_t tof1 = pHit->
GetTime();
4488 Double_t dzscal = 1.;
4490 for (Int_t iHitInd2 = 0; iHitInd2 < iNbTofHits; iHitInd2++) {
4491 if (iHitInd2 != iHitInd) {
4493 if (NULL == pHit2)
continue;
4509 Double_t xPos2 = dzscal * pHit2->
GetX();
4510 Double_t yPos2 = dzscal * pHit2->
GetY();
4511 Double_t tof2 = pHit2->
GetTime();
4512 Double_t dTcor = 0.;
4517 Double_t Chi2Match =
4521 if (Chi2Match > 1.E8)
continue;
4524 LOG(debug2) <<
" Chi2 "
4525 << Form(
" %f %f %f %f %f %f ",
4532 << Form(
" -> %f ", Chi2Match);
4533 LOG(debug2) <<
" Chi2 "
4534 << Form(
" %f %f %f %f %f %f ",
4541 << Form(
" -> %f ", Chi2Match);
4544 if (iNbMatchedHits == iNbMaxMatch)
4545 iNbMatchedHits = iNbMaxMatch - 1;
4546 LOG(debug) << Form(
"match %d (%f): %2d. - %2d. Tof hit 0x%08x "
4547 "with 0x%08x, DeltaT = %f ns",
4556 fhDXDY04->Fill(xPos1 - xPos2, yPos1 - yPos2);
4561 for (Int_t iM = 0; iM < iNbMatchedHits; iM++) {
4562 if (Chi2Match < Chi2List[iM]) {
4564 LOG(debug) << Form(
" fill Chi2 %3d (%3d), %12.1f, %12.1f: "
4565 "HitInd %3d, %3d, Ids 0x%08x, 0x%08x",
4575 for (Int_t iMM = iNbMatchedHits; iMM >= iM; iMM--) {
4576 Chi2List[iMM] = Chi2List[iMM - 1];
4577 pChi2Hit1[iMM] = pChi2Hit1[iMM - 1];
4578 pChi2Hit2[iMM] = pChi2Hit2[iMM - 1];
4581 Chi2List[iM] = Chi2Match;
4582 pChi2Hit1[iM] = pHit;
4583 pChi2Hit2[iM] = pHit2;
4584 Chi2List[iNbMatchedHits] = 1.E8;
4586 if (Chi2Match == Chi2List[iM - 1]) {
4587 LOG(debug) << Form(
"same Chi2?: M %d, Mul0 %3.0f, HitInd "
4588 "%d, %d, Ids 0x%p, 0x%p - 0x%p, 0x%p",
4598 LOG(debug) << pChi2Hit1[iM - 1]->
ToString();
4619 vRefHit.push_back(pHit);
4628 LOG(debug2) <<
"Process BeamRef Hit with " << pHit <<
", " << pDia;
4629 if (pHit != pDia)
continue;
4631 Double_t dDDia = 0.;
4632 for (Int_t iHitInd1 = 0; iHitInd1 < iNbTofHits; iHitInd1++)
4633 if (iHitInd1 != iHitInd) {
4635 if (pHit1 == NULL)
continue;
4647 LOG(debug) << Form(
"DDia %f", dDDia);
4648 if (dDDia == 0.)
continue;
4651 Double_t zPos1 = pHit->
GetZ();
4652 for (Int_t iHitInd2 = 0; iHitInd2 < iNbTofHits; iHitInd2++)
4653 if (iHitInd2 != iHitInd) {
4655 if (pHit2 == NULL)
continue;
4660 if (NULL == fChannelInfo2) {
4661 LOG(debug) <<
"Invalid Channel Pointer for ChId2 "
4662 << Form(
" 0x%08x ", iChId2);
4665 LOG(debug2) << Form(
"TDia %f, THit %f",
dTDia, pHit2->
GetTime());
4672 LOG(debug) << Form(
"dDTD4 %8.4e, min: %8.4e", dDTD4,
dDTD4Min);
4678 LOG(debug1) << Form(
"Valid Mrpc hit 0x%08x", iChId2);
4680 gGeoManager->FindNode(fChannelInfo2->
GetX(),
4681 fChannelInfo2->
GetY(),
4682 fChannelInfo2->
GetZ());
4683 Double_t hitpos[3], hitpos_local[3];
4684 hitpos[0] = pHit2->
GetX();
4685 hitpos[1] = pHit2->
GetY();
4686 hitpos[2] = pHit2->
GetZ();
4687 gGeoManager->GetCurrentNode();
4688 gGeoManager->MasterToLocal(hitpos, hitpos_local);
4691 && TMath::Abs(dDTD4) < TMath::Abs(
dDTD4Min)) {
4695 iMRefHitInd = iHitInd2;
4697 LOG(debug1) << Form(
"accept Mrpc, look for Sel2 %d, 0x%08x",
4704 Double_t dzscal = 1.;
4705 Double_t xPos2 = pHit2->
GetX();
4706 Double_t yPos2 = pHit2->
GetY();
4707 Double_t zPos2 = pHit2->
GetZ();
4708 Double_t tof2 = pHit2->
GetTime();
4709 Double_t dTcor = 0.;
4710 Double_t xPos3B = 0.;
4711 Double_t yPos3B = 0.;
4712 Double_t tof3B = 0.;
4719 for (Int_t iHitInd3 = 0; iHitInd3 < iNbTofHits; iHitInd3++) {
4720 LOG(debug2) << Form(
"inspect %d. Sel2, Ind %d, Ind2 %d ",
4726 if (iHitInd3 != iHitInd2) {
4728 if (pHit3 == NULL)
continue;
4732 if (NULL == fChannelInfo3) {
4733 LOG(debug) <<
"Invalid Channel Pointer for ChId3 "
4734 << Form(
" 0x%08x ", iChId3);
4738 << Form(
"inspect %d. Sel2 0x%08x", iHitInd3, iDetId3);
4744 << Form(
"found Sel2 0x%08x, z-info: %7.1f, %7.1f",
4752 gGeoManager->FindNode(fChannelInfo3->
GetX(),
4753 fChannelInfo3->
GetY(),
4754 fChannelInfo3->
GetZ());
4755 hitpos3[0] = pHit3->
GetX();
4756 hitpos3[1] = pHit3->
GetY();
4757 hitpos3[2] = pHit3->
GetZ();
4758 gGeoManager->GetCurrentNode();
4759 gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
4763 dzscal = zPos2 / pHit3->
GetZ();
4764 Double_t xPos3 = dzscal * pHit3->
GetX();
4765 Double_t yPos3 = dzscal * pHit3->
GetY();
4766 Double_t tof3 = pHit3->
GetTime();
4768 Double_t Chi2Match =
4769 TMath::Power((xPos3 - xPos2) /
GetSHTSigX(), 2.)
4770 + TMath::Power((yPos3 - yPos2) /
GetSHTSigY(), 2.)
4771 + TMath::Power((tof3 - tof2 - dTcor -
fdSel2TOff)
4777 << Form(
"valid Sel2 0x%08x with Chi2 %7.1f, "
4778 "%7.1f, %7.1f, %7.1f, %7.1f, %7.1f",
4787 if (Chi2Match < Chi2Max) {
4791 Chi2Max = Chi2Match;
4794 iSel2HitInd = iHitInd3;
4797 "better Sel2 0x%08x with Chi2 %7.1f, x %7.1f, "
4798 "Deltax %7.1f, y %7.1f, Deltay %7.1f",
4837 if (
fDetIdMap.size() > 3 && dMulD > 0) {
4838 Double_t dDTLEvt = dTAv -
dTLEvt;
4843 LOG(info) <<
"StartSpillTime for " <<
iNspills
4844 << Form(
". spill set to %f ns after %7.4f s, at event %d with "
4845 "MulD %2.0f, MulDet %d, DTLE %7.4f s ",
4857 LOG(debug) <<
"SpillStartTime not available, abort Anatestbeam ";
4861 if (dMul0 > dM0Max || dMul4 > dM4Max || dMulD > dMDMax || dMulS2 > dM4Max) {
4863 LOG(debug) << Form(
"<D> Muls %4.0f, %4.0f, %4.0f, %4.0f, Matches %d",
4873 Double_t dDutTMean = 0.;
4874 Double_t dDutTMean2 = 0.;
4875 Int_t iNDutHits = vDutHit.size();
4876 for (Int_t
i = 0;
i < iNDutHits;
i++) {
4877 dDutTMean += vDutHit[
i]->GetTime();
4878 dDutTMean2 += vDutHit[
i]->GetTime() * vDutHit[
i]->GetTime();
4880 dDutTMean /= (Double_t) vDutHit.size();
4881 dDutTMean2 /= (Double_t) vDutHit.size();
4882 Double_t dDutTSig = TMath::Sqrt(dDutTMean2 - dDutTMean * dDutTMean);
4884 Double_t dRefTMean = 0.;
4885 Double_t dRefTMean2 = 0.;
4886 Int_t iNRefHits = vRefHit.size();
4887 for (Int_t
i = 0;
i < iNRefHits;
i++) {
4888 dRefTMean += vRefHit[
i]->GetTime();
4889 dRefTMean2 += vRefHit[
i]->GetTime() * vRefHit[
i]->GetTime();
4891 dRefTMean /= (Double_t) vRefHit.size();
4892 dRefTMean2 /= (Double_t) vRefHit.size();
4893 Double_t dRefTSig = TMath::Sqrt(dRefTMean2 - dRefTMean * dRefTMean);
4896 for (Int_t
i = 0;
i < iNDutHits - 1;
i++) {
4897 for (Int_t j =
i + 1; j < iNDutHits; j++) {
4898 fhDutDXDYDT->Fill(vDutHit[j]->GetX() - vDutHit[
i]->GetX(),
4899 vDutHit[j]->GetY() - vDutHit[
i]->GetY(),
4900 vDutHit[j]->GetTime() - vDutHit[
i]->GetTime());
4903 for (Int_t
i = 0;
i < iNRefHits - 1;
i++) {
4904 for (Int_t j =
i + 1; j < iNRefHits; j++) {
4905 fhRefDXDYDT->Fill(vRefHit[j]->GetX() - vRefHit[
i]->GetX(),
4906 vRefHit[j]->GetY() - vRefHit[
i]->GetY(),
4907 vRefHit[j]->GetTime() - vRefHit[
i]->GetTime());
4921 " FoundMatches: %d with first chi2s = %12.1f, %12.1f, %12.1f, %12.1f",
4927 << Form(
", Muls %4.0f, %4.0f, %4.0f", dMulD, dMul0, dMul4);
4941 LOG(debug) << Form(
" Found valid selector ");
4954 Double_t dTimeSinceLastDutHit = 0.;
4967 gGeoManager->GetCurrentNode();
4968 gGeoManager->MasterToLocal(hitpos1, hitpos1_local);
4970 fhXY0D4sel->Fill(hitpos1_local[0], hitpos1_local[1]);
4974 if (iDutCh < 0 || iDutCh >
fiDutNch - 1) {
4975 LOG(debug) <<
"Predicted ch " << iDutCh
4976 <<
" from x = " << hitpos1_local[0]
4978 if (iDutCh < 0) iDutCh = 0;
4983 for (Int_t iDutChtest = iDutCh; iDutChtest < iDutCh + 1;
4985 if (iDutChtest < 0) iDutChtest = 0;
4990 std::list<CbmTofHit*>::iterator itL =
4995 for (Int_t
i = 0;
i < iNDutHits;
i++) {
4997 <<
"Inspect " <<
i <<
" for address match "
4998 << (*itL)->GetAddress() <<
" - " << vDutHit[
i]->GetAddress();
4999 if ((*itL)->GetAddress() == vDutHit[
i]->GetAddress()) {
5001 <<
"iDutCh hit was added to DTLH from Mul " << iNDutHits;
5007 dTimeSinceLastDutHit = TMath::Max(
5008 0., TMath::Log10(pHitRef->
GetTime() - (*itL)->GetTime()));
5011 dTimeSinceLastDutHit =
5016 " DTLH for iDutCh %02d Mul %03d: %6.1f from size %lu, ref %12.0f ",
5019 dTimeSinceLastDutHit,
5038 hitpos2[0] = pHitRef->
GetX();
5039 hitpos2[1] = pHitRef->
GetY();
5040 hitpos2[2] = pHitRef->
GetZ();
5041 gGeoManager->GetCurrentNode();
5042 gGeoManager->MasterToLocal(hitpos2, hitpos2_local);
5043 fhXY4D4sel->Fill(hitpos2_local[0], hitpos2_local[1]);
5045 if (NULL != pHitSel2) {
5050 gGeoManager->FindNode(
5051 fChannelInfo3->
GetX(), fChannelInfo3->
GetY(), fChannelInfo3->
GetZ());
5052 hitpos3[0] = pHitSel2->
GetX();
5053 hitpos3[1] = pHitSel2->
GetY();
5054 hitpos3[2] = pHitSel2->
GetZ();
5055 gGeoManager->GetCurrentNode();
5056 gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
5073 Int_t iMatchedRealTrackLink(-1);
5074 std::set<Int_t> RealTrackLinkSet;
5080 Int_t iNSelHitTupleHits(3);
5089 for (Int_t iMRefHitTrackLink = 0;
5090 iMRefHitTrackLink < tMRefHitTrackMatch->
GetNofLinks();
5091 iMRefHitTrackLink++) {
5092 tSelHitTupleTrackMatch.
AddLink(
5093 tMRefHitTrackMatch->
GetLink(iMRefHitTrackLink));
5096 for (Int_t iSel2HitTrackLink = 0;
5097 iSel2HitTrackLink < tSel2HitTrackMatch->
GetNofLinks();
5098 iSel2HitTrackLink++) {
5099 tSelHitTupleTrackMatch.
AddLink(
5100 tSel2HitTrackMatch->
GetLink(iSel2HitTrackLink));
5103 for (Int_t iBRefHitTrackLink = 0;
5104 iBRefHitTrackLink < tBRefHitTrackMatch->
GetNofLinks();
5105 iBRefHitTrackLink++) {
5106 tSelHitTupleTrackMatch.
AddLink(
5107 tBRefHitTrackMatch->
GetLink(iBRefHitTrackLink));
5110 const CbmLink& tSelHitTupleMatchedTrackLink =
5112 Double_t dSelHitTupleMaxTrackLinkWeight =
5113 tSelHitTupleMatchedTrackLink.
GetWeight();
5115 for (Int_t iSelHitTupleTrackLink = 0;
5116 iSelHitTupleTrackLink < tSelHitTupleTrackMatch.
GetNofLinks();
5117 iSelHitTupleTrackLink++) {
5118 const CbmLink& tSelHitTupleTrackLink =
5119 tSelHitTupleTrackMatch.
GetLink(iSelHitTupleTrackLink);
5121 if (dSelHitTupleMaxTrackLinkWeight
5123 && -1 < tSelHitTupleTrackLink.
GetIndex()) {
5124 iMatchedRealTrackLink = tSelHitTupleTrackLink.
GetIndex();
5125 RealTrackLinkSet.emplace(tSelHitTupleTrackLink.
GetIndex());
5129 Int_t iNTrueTupleHits =
5130 static_cast<Int_t
>(dSelHitTupleMaxTrackLinkWeight);
5147 if (-1 < iMatchedRealTrackLink) {
5150 bGoodTrackSel = kTRUE;
5160 if (bGoodTrackSel) {
5161 TGeoNode* tNode(NULL);
5162 TGeoMedium* tMedium(NULL);
5163 TGeoMaterial* tMaterial(NULL);
5165 const char* cMaterialName;
5167 const char* cSelRefTrackPdgName;
5168 const char* cSelRefTrackProcessName;
5170 Bool_t bSelRefTrack(kFALSE);
5172 for (
auto const& iTrack : RealTrackLinkSet) {
5178 tNode = gGeoManager->FindNode(
5180 tMedium = tNode->GetMedium();
5181 tMaterial = tMedium->GetMaterial();
5185 if (0 == std::strcmp(
"target", cMaterialName)
5186 && fiMinMCRefTrackPoints <= tTrackPointMatch->GetNofLinks()) {
5187 bSelRefTrack = kTRUE;
5191 cSelRefTrackProcessName);
5198 cSelRefTrackProcessName, cSelRefTrackPdgName, 1.);
5207 if (iNbMatchedHits > 0) {
5209 LOG(debug) << Form(
"best match D4 (%d): 0x%p, 0x%p in ch 0x%08x, 0x%08x: "
5210 "%12.1f < %12.1f ?",
5219 if (NULL != pHitSel2) {
5223 pHit1 = pChi2Hit1[0];
5224 pHit2 = pChi2Hit2[0];
5226 if (pHit2 != pHitRef) {
5227 LOG(debug) <<
" selector hit does not match reference hit for best "
5230 << Form(
", ref found in Addr 0x%08x ",
5232 for (iM0 = 1; iM0 < iNbMatchedHits; iM0++) {
5233 if (pHitRef == pChi2Hit2[iM0]) {
5234 LOG(debug) <<
" found reference hit for best match, chi2new "
5236 pHit1 = pChi2Hit1[iM0];
5237 pHit2 = pChi2Hit2[iM0];
5241 if (iM0 == iNbMatchedHits) {
5242 LOG(debug) << Form(
"no valid match in %d hits for Addr 0x%08x found ",
5245 if (gLogger->IsLogNeeded(fair::Severity::debug1))
5246 LOG(fatal) <<
"Check for consistency!";
5264 Double_t xPos1 = pHit1->
GetX();
5265 Double_t yPos1 = pHit1->
GetY();
5266 Double_t zPos1 = pHit1->
GetZ();
5267 Double_t tof1 = pHit1->
GetTime();
5268 Double_t dzscal = 1.;
5271 Double_t xPos2 = dzscal * pHit2->
GetX();
5272 Double_t yPos2 = dzscal * pHit2->
GetY();
5273 Double_t tof2 = pHit2->
GetTime();
5276 TMath::Sqrt(TMath::Power(pHit1->
GetX() - pHit2->
GetX(), 2)
5277 + TMath::Power(pHit1->
GetY() - pHit2->
GetY(), 2)
5278 + TMath::Power(pHit1->
GetZ() - pHit2->
GetZ(), 2));
5282 Double_t dCluSize0 = digiMatch1->
GetNofLinks() / 2.;
5286 Double_t dCluSize4 = digiMatch2->
GetNofLinks() / 2.;
5290 gGeoManager->FindNode(
5291 fChannelInfo2->
GetX(), fChannelInfo2->
GetY(), fChannelInfo2->
GetZ());
5293 hitpos2[0] = pHit2->
GetX();
5294 hitpos2[1] = pHit2->
GetY();
5295 hitpos2[2] = pHit2->
GetZ();
5300 gGeoManager->MasterToLocal(hitpos2, hitpos2_local);
5303 Double_t dInvVel = dTofD4 / pHitRef->
GetR();
5304 Double_t dDTexp = dDist * dInvVel;
5308 Double_t dTot0 = 0.;
5311 for (Int_t iLink = 0; iLink < digiMatch0->
GetNofLinks();
5316 dTot0 += pDig0->
GetTot();
5317 LOG(debug1) << Form(
" dTot of hit 0x%08x: digind %d add %f -> sum %f",
5327 Double_t dTot4 = 0.;
5330 for (Int_t iLink = 0; iLink < digiMatch4->
GetNofLinks();
5336 dTot4 += pDig0->
GetTot();
5337 LOG(debug1) << Form(
" dTot of hit 0x%08x: digind %d add %f -> sum %f",
5345 Double_t dTcor = 0.;
5372 Double_t dToD = (tof1 - tof2 - dTcor -
fdDTMean);
5376 Bool_t bGoodSelDutMatch(kFALSE);
5382 if (bGoodTrackSel) {
5386 Double_t dSelHitTupleMaxTrackLinkWeight =
5390 for (Int_t iSelHitTupleTrackLink = 0;
5391 iSelHitTupleTrackLink < tSelHitTupleTrackMatch.
GetNofLinks();
5392 iSelHitTupleTrackLink++) {
5393 const CbmLink& tSelHitTupleTrackLink =
5394 tSelHitTupleTrackMatch.
GetLink(iSelHitTupleTrackLink);
5396 if (dSelHitTupleMaxTrackLinkWeight
5398 for (Int_t iDutHitTrackLink = 0;
5399 iDutHitTrackLink < tDutHitTrackMatch->
GetNofLinks();
5400 iDutHitTrackLink++) {
5401 const CbmLink& tDutHitTrackLink =
5402 tDutHitTrackMatch->
GetLink(iDutHitTrackLink);
5404 if (tSelHitTupleTrackLink == tDutHitTrackLink) {
5405 bGoodSelDutMatch = kTRUE;
5411 if (bGoodSelDutMatch) {
break; }
5414 if (bGoodSelDutMatch) {
5440 LOG(fatal) <<
"inconsistent Dut - type " << iDut
5445 LOG(debug) <<
"Inconsistent Dut strip #: " << iCh
5446 <<
" != " << iDutCh;
5447 fhDTLH_DStrip->Fill((Double_t) iCh, (Double_t)(iCh - iDutCh));
5451 fhXX04->Fill(xPos1, xPos2);
5452 fhYY04->Fill(yPos1, yPos2);
5453 fhXY04->Fill(xPos1, yPos2);
5454 fhYX04->Fill(yPos1, xPos2);
5455 fhTT04->Fill(tof1, tof1 - tof2);
5480 if (dInvVel > 0.)
fhVelD4best->Fill(1. / dInvVel);
5486 fhXY4D4best->Fill(hitpos2_local[0], hitpos2_local[1]);
5498 for (Int_t iLink = 0; iLink < digiMatch2->
GetNofLinks();
5505 " dTot of hit 0x%08x: digind %d add %f -> sum %f",
5519 for (Int_t iLink = 0; iLink < digiMatch0->
GetNofLinks();
5525 LOG(debug1) << Form(
5526 " dTot of hit 0x%08x: digind %d add %f -> sum %f",
5544 gGeoManager->FindNode(
5545 fChannelInfo1->
GetX(), fChannelInfo1->
GetY(), fChannelInfo1->
GetZ());
5547 hitpos1[0] = pHit1->
GetX();
5548 hitpos1[1] = pHit1->
GetY();
5549 hitpos1[2] = pHit1->
GetZ();
5551 gGeoManager->GetCurrentNode();
5552 gGeoManager->MasterToLocal(hitpos1, hitpos1_local);
5554 fhXY0D4best->Fill(hitpos1_local[0], hitpos1_local[1]);
5555 fhXX04D4best->Fill(hitpos1_local[0], hitpos2_local[0]);
5556 fhYY04D4best->Fill(hitpos1_local[1], hitpos2_local[1]);
5581 if (bGoodTrackSel) {
5582 if (bGoodSelDutMatch) {
5615 Int_t iFileIndex = tDutHitPointLink.
GetFile();
5616 Int_t iEventIndex = tDutHitPointLink.
GetEntry();
5617 Int_t iArrayIndex = tDutHitPointLink.
GetIndex();
5619 if (-1 < iFileIndex && -1 < iEventIndex && -1 < iArrayIndex) {
5620 Double_t dMCEventStartTime(0.);
5623 tDutHitMatchedPoint =
5644 xPos2 - tDutHitMatchedPoint->GetX() +
fdDXMean);
5646 xPos1 - tDutHitMatchedPoint->GetX());
5650 yPos2 - tDutHitMatchedPoint->GetY() +
fdDYMean);
5652 yPos1 - tDutHitMatchedPoint->GetY());
5657 if (pHit1->
GetZ() < pHit2->
GetZ()) { dSign = -1.; }
5658 Double_t dDutMCPointDelay(0.);
5659 Double_t dMRefMCPointDelay(0.);
5676 tof2 + dSign * dDTexp - tDutHitMatchedPoint->GetTime()
5678 - dMRefMCPointDelay);
5680 tof1 - tDutHitMatchedPoint->GetTime()
5682 - dDutMCPointDelay);
5687 if (iNbMatchedHits > 1) {
5689 " Matches>1: %d with first chi2s = %12.1f, %12.1f, %12.1f, %12.1f",
5696 for (Int_t iM = 0; iM < iNbMatchedHits; iM++) {
5698 " Match: %d (%d) with ids = 0x%08x, 0x%08x - 0x%08x, 0x%08x",
5705 if (pChi2Hit1[iM] != pHit1 && pChi2Hit2[iM] != pHit2) {
5707 LOG(debug) << Form(
" second best match D4 at %d (%d): chi2 %f ",
5712 if (Chi2List[iM] > 1.E3)
break;
5714 pHit3 = pChi2Hit1[iM];
5715 pHit4 = pChi2Hit2[iM];
5727 gGeoManager->FindNode(fChannelInfo4->
GetX(),
5728 fChannelInfo4->
GetY(),
5729 fChannelInfo4->
GetZ());
5731 hitpos4[0] = pChi2Hit2[iM]->
GetX();
5732 hitpos4[1] = pChi2Hit2[iM]->
GetY();
5733 hitpos4[2] = pChi2Hit2[iM]->
GetZ();
5737 gGeoManager->MasterToLocal(hitpos4, hitpos4_local);
5739 if (TMath::Abs(hitpos4_local[1])
5745 dzscal = zPos1 / pChi2Hit1[iM]->
GetZ();
5746 Double_t xPos3 = dzscal * pChi2Hit1[iM]->
GetX();
5747 Double_t yPos3 = dzscal * pChi2Hit1[iM]->
GetY();
5748 Double_t tof3 = pChi2Hit1[iM]->
GetTime();
5751 dzscal = zPos1 / pChi2Hit2[iM]->
GetZ();
5752 Double_t xPos4 = dzscal * pChi2Hit2[iM]->
GetX();
5753 Double_t yPos4 = dzscal * pChi2Hit2[iM]->
GetY();
5754 Double_t tof4 = pChi2Hit2[iM]->
GetTime();
5757 TMath::Sqrt(TMath::Power(pHit3->
GetX() - pHit4->
GetX(), 2)
5758 + TMath::Power(pHit3->
GetY() - pHit4->
GetY(), 2)
5759 + TMath::Power(pHit3->
GetZ() - pHit4->
GetZ(), 2));
5771 Double_t dInvVel4 = dTofD44 / pHitRef->
GetR();
5772 Double_t dDTexp4 = dDist34 * dInvVel4;
5773 Double_t dTcor4 = 0.;
5787 Double_t dToD34 = (tof3 - tof4 - dTcor4 -
fdDTMean);
5790 if (dInvVel4 > 0.)
fhVelD4sbest->Fill(1000. / dInvVel4);
5809 for (Int_t iLink = 0; iLink < digiMatch4->
GetNofLinks();
5814 dTot4 += pDig0->
GetTot();
5816 << Form(
" dTot4 of hit 0x%08x: digind %d add %f -> sum %f",
5830 Double_t dTot3 = 0.;
5832 for (Int_t iLink = 0; iLink < digiMatch3->
GetNofLinks();
5837 dTot3 += pDig0->
GetTot();
5839 << Form(
" dTot of hit 0x%08x: digind %d add %f -> sum %f",
5853 gGeoManager->FindNode(fChannelInfo3->
GetX(),
5854 fChannelInfo3->
GetY(),
5855 fChannelInfo3->
GetZ());
5857 hitpos3[0] = pChi2Hit1[iM]->
GetX();
5858 hitpos3[1] = pChi2Hit1[iM]->
GetY();
5859 hitpos3[2] = pChi2Hit1[iM]->
GetZ();
5861 gGeoManager->GetCurrentNode();
5862 gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
5865 fhDTY0D4sbest->Fill(hitpos3_local[1], tof4 - tof4 - dTcor4);
5879 fhDT04DX0_2->Fill(hitpos1_local[0] - hitpos3_local[0], dToD34);
5880 fhDT04DY0_2->Fill(hitpos1_local[1] - hitpos3_local[1], dToD34);
5883 fhDT04DX4_2->Fill(hitpos2_local[0] - hitpos4_local[0], dToD34);
5884 fhDT04DY4_2->Fill(hitpos2_local[1] - hitpos4_local[1], dToD34);
5887 fhDT04DX0_1->Fill(hitpos1_local[0] - hitpos3_local[0], dToD);
5888 fhDT04DY0_1->Fill(hitpos1_local[1] - hitpos3_local[1], dToD);
5891 fhDT04DX4_1->Fill(hitpos2_local[0] - hitpos4_local[0], dToD);
5892 fhDT04DY4_1->Fill(hitpos2_local[1] - hitpos4_local[1], dToD);
5927 Int_t iSelHitTupleDutHitMatchMul(0);
5928 Int_t iSelHitTupleDutHitMatchAccMul(0);
5930 for (Int_t iMatch = 0; iMatch < iNbMatchedHits; iMatch++) {
5931 if (pHitRef == pChi2Hit2[iMatch]) {
5932 iSelHitTupleDutHitMatchMul++;
5934 if (
fdChi2Lim > Chi2List[iMatch]) { iSelHitTupleDutHitMatchAccMul++; }
5938 if (iSelHitTupleDutHitMatchMul) {
5942 if (iSelHitTupleDutHitMatchAccMul) {
5955 Double_t hitpos[3], hitpos_local[3];
5985 Bool_t bSelTrackletFound(kFALSE);
5986 Int_t iBestTrklFitIndex(-1);
5987 Double_t dBestTrklFitRedChiSq(1.E300);
5993 LOG(debug) << Form(
"Tracklet analysis of %d tracklets from %d stations",
5998 if (dMul0 <= dM0Max && dMul4 <= dM4Max && dMulD <= dMDMax
5999 && dMulS2 <= dM4Max)
6000 if (iNbTofTracks > 0) {
6007 gGeoManager->FindNode(
6009 gGeoManager->GetCurrentNode();
6012 LOG(debug) << Form(
"Tracklet analysis of %d tracks and %d Dut Hits ",
6014 (
int) vDutHit.size());
6016 std::vector<std::map<Double_t, Int_t>>
6018 std::vector<std::map<Double_t, Int_t>>
6021 vTrkMap.resize(vDutHit.size());
6022 vHitMap.resize(iNbTofTracks);
6024 std::multimap<Double_t, std::pair<Int_t, Int_t>>
6025 RedChiSqTrackletDutHitPair;
6026 std::map<Int_t, std::pair<Int_t, Double_t>>
6027 TrackletMatchedDutHitRedChiSq;
6029 for (Int_t iTrk = 0; iTrk < iNbTofTracks; iTrk++) {
6031 if (NULL == pTrk)
continue;
6033 if (dBestTrklFitRedChiSq > pTrk->
GetChiSq()) {
6034 dBestTrklFitRedChiSq = pTrk->
GetChiSq();
6035 iBestTrklFitIndex = iTrk;
6039 for (Int_t iTrk = 0; iTrk < iNbTofTracks;
6042 if (NULL == pTrk)
continue;
6045 for (Int_t iTH = 0; iTH < pTrk->
GetNofHits();
6056 for (Int_t iTH = 0; iTH < pTrk->
GetNofHits();
6166 if (fChi2LimFit < pTrk->GetChiSq()) {
continue; }
6169 if (iTrk != iBestTrklFitIndex) {
continue; }
6176 LOG(fatal) <<
"DUT hit found already attached to a tracklet in "
6177 "'AttachDutHitToTracklet' mode!";
6180 Int_t iSelTrklDutHitMatchMul(0);
6181 Int_t iSelTrklDutHitMatchAccMul(0);
6183 Double_t dXex = pTrk->
GetFitX(dDutzPos);
6184 Double_t dYex = pTrk->
GetFitY(dDutzPos);
6185 Double_t dTex = pTrk->
GetFitT(dDutzPos);
6187 for (
auto const& iHit : DutHitSet) {
6191 Double_t dRedChiSq =
6194 + TMath::Power(TMath::Abs(dXex - tHit->
GetX()) /
GetSigX(1),
6196 + TMath::Power(TMath::Abs(dYex - tHit->
GetY()) /
GetSigY(1),
6200 RedChiSqTrackletDutHitPair.emplace(dRedChiSq,
6201 std::make_pair(iTrk, iHit));
6204 iSelTrklDutHitMatchMul++;
6206 if (dRedChiSq <
fSIGLIM) { iSelTrklDutHitMatchAccMul++; }
6210 if (iSelTrklDutHitMatchMul) {
6214 if (iSelTrklDutHitMatchAccMul) {
6223 bSelTrackletFound = kTRUE;
6236 for (
auto itChi2Map = RedChiSqTrackletDutHitPair.cbegin();
6237 itChi2Map != RedChiSqTrackletDutHitPair.cend();) {
6238 Double_t dRedChiSq = itChi2Map->first;
6239 Int_t iUsedTracklet = itChi2Map->second.first;
6240 Int_t iUsedHit = itChi2Map->second.second;
6242 TrackletMatchedDutHitRedChiSq.emplace(
6243 iUsedTracklet, std::make_pair(iUsedHit, dRedChiSq));
6245 Bool_t bFoundNextUniqueMatch(kFALSE);
6247 for (
auto itSubMap = ++itChi2Map;
6248 itSubMap != RedChiSqTrackletDutHitPair.cend();) {
6249 Int_t iTracklet = itSubMap->second.first;
6254 if (iUsedTracklet == iTracklet)
6256 itSubMap = RedChiSqTrackletDutHitPair.erase(itSubMap);
6258 if (!bFoundNextUniqueMatch) {
6259 itChi2Map = itSubMap;
6260 bFoundNextUniqueMatch = kTRUE;
6267 if (!bFoundNextUniqueMatch) {
6268 itChi2Map = RedChiSqTrackletDutHitPair.cend();
6277 for (Int_t iTrk = 0; iTrk < iNbTofTracks;
6280 if (NULL == pTrk)
continue;
6284 if (fChi2LimFit < pTrk->GetChiSq()) {
continue; }
6287 if (iTrk != iBestTrklFitIndex) {
continue; }
6291 Double_t dDelTLH = 11.;
6293 hitpos[0] = pTrk->
GetFitX(dDutzPos);
6294 hitpos[1] = pTrk->
GetFitY(dDutzPos);
6295 hitpos[2] = dDutzPos;
6299 gGeoManager->MasterToLocal(hitpos, hitpos_local);
6308 Double_t LHpos[3], LHpos_local[3];
6310 if (
fhLHTime.size() >
static_cast<size_t>(iDet)) {
6312 fhLHTime[iDet]->FindBin(hitpos_local[0], hitpos_local[1]);
6316 || iBin >
fhLHTime[iDet]->GetNbinsX()
6318 LOG(debug) <<
"Invalid bin number for reading fhLHTime, det "
6319 << iDet <<
": " << iBin <<
", " << dTLH;
6322 pLHit =
fvLHit[iDet][iBinA];
6324 if (NULL != pLHit) {
6325 dTLH =
fhLHTime[iDet]->GetBinContent(iBin);
6327 LOG(fatal) <<
" LHTime mismatch for Det " << iDet <<
", Bin "
6329 << Form(
": %f - %f = %f",
6335 Int_t iNbinsX = (Int_t)
fhLHTime[iDet]->GetNbinsX();
6337 Double_t dTLLH = dTLH;
6338 Int_t iRow = iBin / iNbinsX + 1;
6339 Int_t iCol = iBin % iNbinsX;
6342 if (
fhLHTime[iDet]->GetBinContent(iBin - 1) > dTLLH) {
6343 pLLHit =
fvLHit[iDet][iBinA - 1];
6347 for (Int_t iBLL = iBin - iNbinsX - 1;
6348 iBLL < iBin - iNbinsX + 1;
6350 if (
fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
6351 pLLHit =
fvLHit[iDet][iBLL - 1];
6356 if (iRow < iNbinsX - 1) {
6357 for (Int_t iBLL = iBin + iNbinsX - 1;
6358 iBLL < iBin + iNbinsX + 1;
6360 if (
fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
6361 pLLHit =
fvLHit[iDet][iBLL - 1];
6367 if (iCol < iNbinsX - 1) {
6368 if (
fhLHTime[iDet]->GetBinContent(iBin + 1) > dTLLH) {
6369 pLLHit =
fvLHit[iDet][iBin];
6373 for (Int_t iBLL = iBin - iNbinsX + 1;
6374 iBLL < iBin - iNbinsX + 2;
6376 if (
fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
6377 pLLHit =
fvLHit[iDet][iBLL - 1];
6382 if (iRow < iNbinsX - 1) {
6383 for (Int_t iBLL = iBin + iNbinsX + 1;
6384 iBLL < iBin + iNbinsX + 2;
6386 if (
fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
6387 pLLHit =
fvLHit[iDet][iBLL - 1];
6399 dDelTLH = TMath::Log10(pTrk->
GetFitT(dDutzPos) - dTLH);
6406 LHpos[0] = pLHit->
GetX();
6407 LHpos[1] = pLHit->
GetY();
6408 LHpos[2] = pLHit->
GetZ();
6409 gGeoManager->MasterToLocal(LHpos, LHpos_local);
6413 " expect hit at %f in %d. spill got TLH = %f, DelT %f for "
6414 "Det %d at x %6.2f, y %6.2f, bin %d from x %6.2f, y %6.2f",
6428 " Trkl with %d hits expect Dut hit at %f in %d. spill after "
6429 "TLH = %f, LogDelT %f for Det %d in Bin %d at x %6.2f, y %6.2f",
6441 Bool_t bGoodSelTracklet(kFALSE);
6442 Bool_t bGoodSelTrackletDutMatch(kFALSE);
6444 auto itDutHitMatch = TrackletMatchedDutHitRedChiSq.find(iTrk);
6448 if (dTt > 0.) dVel = 1. / dTt;
6454 Int_t iMatchedRealTrackLink(-1);
6455 std::set<Int_t> RealTrackLinkSet;
6462 Double_t dSelTrackletMaxTrackLinkWeight = tLink.
GetWeight();
6464 for (Int_t iSelTrackletTrackLink = 0;
6465 iSelTrackletTrackLink
6467 iSelTrackletTrackLink++) {
6468 const CbmLink& tSelTrackletTrackLink =
6469 tTrackletAccTrackMatch->
GetLink(iSelTrackletTrackLink);
6471 if (dSelTrackletMaxTrackLinkWeight
6473 && -1 < tSelTrackletTrackLink.
GetIndex()) {
6474 iMatchedRealTrackLink = tSelTrackletTrackLink.
GetIndex();
6475 RealTrackLinkSet.emplace(
6486 if (-1 < iMatchedRealTrackLink) {
6490 bGoodSelTracklet = kTRUE;
6498 if (bGoodSelTracklet) {
6499 TGeoNode* tNode(NULL);
6500 TGeoMedium* tMedium(NULL);
6501 TGeoMaterial* tMaterial(NULL);
6503 const char* cMaterialName;
6505 const char* cSelRefTrackPdgName;
6506 const char* cSelRefTrackProcessName;
6508 Bool_t bSelRefTrack(kFALSE);
6510 for (
auto const& iTrack : RealTrackLinkSet) {
6516 tNode = gGeoManager->FindNode(tTrack->
GetStartX(),
6519 tMedium = tNode->GetMedium();
6520 tMaterial = tMedium->GetMaterial();
6524 if (0 == std::strcmp(
"target", cMaterialName)
6527 bSelRefTrack = kTRUE;
6532 cSelRefTrackProcessName);
6539 cSelRefTrackProcessName, cSelRefTrackPdgName, 1.);
6545 if (itDutHitMatch != TrackletMatchedDutHitRedChiSq.end()) {
6546 Int_t iDutHitIndex = itDutHitMatch->second.first;
6552 for (Int_t iSelTrackletTrackLink = 0;
6553 iSelTrackletTrackLink
6555 iSelTrackletTrackLink++) {
6556 const CbmLink& tSelTrackletTrackLink =
6557 tTrackletAccTrackMatch->
GetLink(
6558 iSelTrackletTrackLink);
6560 if (dSelTrackletMaxTrackLinkWeight
6562 for (Int_t iDutHitTrackLink = 0;
6565 iDutHitTrackLink++) {
6566 const CbmLink& tDutHitTrackLink =
6567 tDutHitTrackMatch->
GetLink(iDutHitTrackLink);
6569 if (tSelTrackletTrackLink == tDutHitTrackLink) {
6570 bGoodSelTrackletDutMatch = kTRUE;
6576 if (bGoodSelTrackletDutMatch) {
break; }
6579 if (bGoodSelTrackletDutMatch) {
6581 1, 3. * itDutHitMatch->second.second);
6585 1, 3. * itDutHitMatch->second.second);
6598 && itDutHitMatch != TrackletMatchedDutHitRedChiSq.end()
6599 && itDutHitMatch->second.second <
fSIGLIM)) {
6601 " Event %d : process complete Trkl %d, HMul %d, iDet %d ",
6609 Int_t iDutHitIndex(-1);
6611 iDutHitIndex = itDutHitMatch->second.first;
6621 LOG(WARNING) <<
"Dut not found in full length track";
6642 Double_t dDXB = pTrk->
GetXdif(
6647 Double_t dDYB = pTrk->
GetYdif(
6653 Double_t dDTB = pTrk->
GetTdif(
6668 if (NULL != digiMatch)
6670 for (Int_t iLink = 0; iLink < digiMatch->
GetNofLinks();
6680 if (pDig0->
GetTot() > dTot) {
6689 LOG(error) <<
"no Tof Digis";
6691 LOG(error) <<
"no Tof Digi Match";
6704 fhDutXYDX->Fill(hitpos_local[0], hitpos_local[1], dDX);
6705 fhDutXYDY->Fill(hitpos_local[0], hitpos_local[1], dDY);
6706 fhDutXYDT->Fill(hitpos_local[0], hitpos_local[1], dDTB);
6715 if (bGoodSelTracklet) {
6716 if (bGoodSelTrackletDutMatch) {
6742 iDutHitIndex,
fiDutAddr, tDutHitPointer, dDutHitChi);
6748 const CbmLink& tDutHitPointLink =
6752 Int_t iFileIndex = tDutHitPointLink.
GetFile();
6753 Int_t iEventIndex = tDutHitPointLink.
GetEntry();
6754 Int_t iArrayIndex = tDutHitPointLink.
GetIndex();
6756 if (-1 < iFileIndex && -1 < iEventIndex && -1 < iArrayIndex) {
6757 Double_t dMCEventStartTime(0.);
6760 tDutHitMatchedPoint =
6775 - tDutHitMatchedPoint->GetX());
6784 - tDutHitMatchedPoint->GetY());
6794 - tDutHitMatchedPoint->GetTime()
6795 - dMCEventStartTime);
6798 - tDutHitMatchedPoint->GetTime()
6799 - dMCEventStartTime);
6835 if (NULL != pLHit) {
6839 Double_t dTot0 = 0.;
6842 && NULL != digiMatch0) {
6843 for (Int_t iLink = 0; iLink < digiMatch0->
GetNofLinks();
6848 dTot0 += pDig0->
GetTot();
6857 Double_t dDDH = TMath::Sqrt(
6858 TMath::Power(hitpos_local[0] - LHpos_local[0], 2.)
6859 + TMath::Power(hitpos_local[1] - LHpos_local[1], 2.));
6862 hitpos[0] = pTrk->
GetFitX(dDutzPos);
6863 hitpos[1] = pTrk->
GetFitY(dDutzPos);
6864 hitpos[2] = dDutzPos;
6865 gGeoManager->MasterToLocal(hitpos, hitpos_local);
6866 Double_t dDD = TMath::Sqrt(
6867 TMath::Power(hitpos_local[0] - LHpos_local[0], 2.)
6868 + TMath::Power(hitpos_local[1] - LHpos_local[1], 2.));
6881 && itDutHitMatch != TrackletMatchedDutHitRedChiSq.end()
6882 && !(itDutHitMatch->second.second <
fSIGLIM)) {
6903 && itDutHitMatch == TrackletMatchedDutHitRedChiSq.end())) {
6906 " Missed hit at %f, TLH = %f, LogDelT %f for Det %d at x "
6907 "%6.2f, y %6.2f, bin %d from x %6.2f, y %6.2f",
6927 Int_t iGet4 = ((Int_t) hitpos_local[0] + 16) % 8 + 1;
6933 if (NULL != pLHit) {
6934 LHpos[0] = pLHit->
GetX();
6935 LHpos[1] = pLHit->
GetY();
6936 LHpos[2] = pLHit->
GetZ();
6937 gGeoManager->MasterToLocal(LHpos, LHpos_local);
6938 Double_t dDD = TMath::Sqrt(
6939 TMath::Power(hitpos_local[0] - LHpos_local[0], 2.)
6940 + TMath::Power(hitpos_local[1] - LHpos_local[1], 2.));
6954 for (
auto itChi2Map = TrackletMatchedDutHitRedChiSq.cbegin();
6955 itChi2Map != TrackletMatchedDutHitRedChiSq.cend();) {
6956 Double_t dRedChiSq = itChi2Map->second.second;
6961 itChi2Map = TrackletMatchedDutHitRedChiSq.erase(itChi2Map);
6972 for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
6974 if (NULL == pHit)
continue;
6984 hitpos[0] = pHit->
GetX();
6985 hitpos[1] = pHit->
GetY();
6986 hitpos[2] = pHit->
GetZ();
6987 gGeoManager->MasterToLocal(hitpos, hitpos_local);
6989 if (
static_cast<size_t>(iDet) >=
fhLHTime.size()) {
6990 LOG(WARNING) <<
" LHdeb: invalid iDet index " << iDet <<
" of "
6996 fhLHTime[iDet]->FindBin(hitpos_local[0], hitpos_local[1]);
6997 Int_t iBinA = iBin - 1;
7000 "Insert Dut hit for Det %d, Bin %d, x %f, y %f, poi ",
7008 || iBin >
fhLHTime[iDet]->GetNbinsX()
7010 LOG(debug) <<
"Invalid bin number for fhLHTime, det " << iDet
7018 if (NULL !=
fvLHit[iDet][iBinA]) {
7024 fvLHit[iDet][iBinA]->Delete();
7030 LOG(info) << Form(
"Store hit 0x%08x at x %6.3f, y %6.3f, bin %d, "
7031 "time %f in det Id 0x%08x, #%d",
7045 if (bSelTrackletFound) {
7056 std::map<std::tuple<Int_t, Int_t, Int_t>, std::map<Int_t, Int_t>>
7059 for (Int_t iHit = 0; iHit <
fTofHitsColl->GetEntries(); iHit++) {
7067 CounterNCellHits[std::make_tuple(iModuleType, iModuleIndex, iCounterIndex)]
7091 if (dMul0 <= dM0Max && dMul4 <= dM4Max && dMulD <= dMDMax
7092 && dMulS2 <= dM4Max) {
7093 std::vector<Int_t> RefTrackSet;
7095 TGeoNode* tNode(NULL);
7096 TGeoMedium* tMedium(NULL);
7097 TGeoMaterial* tMaterial(NULL);
7099 const char* cMaterialName;
7101 std::multimap<Double_t, std::pair<Int_t, Int_t>>
7102 RedChiSqTrackDutHitPair;
7103 std::map<Int_t, std::pair<Int_t, Double_t>> TrackMatchedDutHitRedChiSq;
7104 Int_t iSelMCTrack(-1);
7105 Int_t iSelMCTrackDutHitMatchMul(0);
7106 Int_t iSelMCTrackDutHitMatchAccMul(0);
7108 for (Int_t iTrack = 0; iTrack <
fAccTracks->GetEntriesFast();
7115 tNode = gGeoManager->FindNode(tAccTrack->
GetStartX(),
7118 tMedium = tNode->GetMedium();
7119 tMaterial = tMedium->GetMaterial();
7123 if (0 == std::strcmp(
"target", cMaterialName)
7124 && fiMinMCRefTrackPoints <= tAccTrackPointMatch->GetNofLinks()) {
7126 for (Int_t iPoint = 0; iPoint < tAccTrackPointMatch->
GetNofLinks();
7131 Int_t iFileIndex = tLink.
GetFile();
7132 Int_t iEventIndex = tLink.
GetEntry();
7133 Int_t iArrayIndex = tLink.
GetIndex();
7135 Double_t dMCEventStartTime(0.);
7150 Int_t iModuleIndex =
7152 Int_t iCounterIndex =
7157 for (
auto const& iHit : DutHitSet) {
7161 Double_t dRedChiSq =
7162 (TMath::Power(TMath::Abs(tPoint->GetTime()
7167 + TMath::Power(TMath::Abs(tPoint->GetX() - tHit->
GetX())
7170 + TMath::Power(TMath::Abs(tPoint->GetY() - tHit->
GetY())
7175 RedChiSqTrackDutHitPair.emplace(dRedChiSq,
7176 std::make_pair(iTrack, iHit));
7179 RefTrackSet.push_back(iTrack);
7190 if (RefTrackSet.size()) {
7191 iSelMCTrack = RefTrackSet.at(gRandom->Integer(RefTrackSet.size()));
7195 for (
auto const& Chi2MapElement : RedChiSqTrackDutHitPair) {
7196 Double_t dRedChiSq = Chi2MapElement.first;
7197 Int_t iTrackIndex = Chi2MapElement.second.first;
7199 if (iTrackIndex == iSelMCTrack) {
7200 iSelMCTrackDutHitMatchMul++;
7202 if (dRedChiSq <
fdMCSIGLIM) { iSelMCTrackDutHitMatchAccMul++; }
7206 if (iSelMCTrackDutHitMatchMul) {
7210 if (iSelMCTrackDutHitMatchAccMul) {
7222 for (
auto itChi2Map = RedChiSqTrackDutHitPair.cbegin();
7223 itChi2Map != RedChiSqTrackDutHitPair.cend();) {
7224 Double_t dRedChiSq = itChi2Map->first;
7225 Int_t iUsedTrack = itChi2Map->second.first;
7226 Int_t iUsedHit = itChi2Map->second.second;
7228 TrackMatchedDutHitRedChiSq.emplace(
7229 iUsedTrack, std::make_pair(iUsedHit, dRedChiSq));
7231 Bool_t bFoundNextUniqueMatch(kFALSE);
7233 for (
auto itSubMap = ++itChi2Map;
7234 itSubMap != RedChiSqTrackDutHitPair.cend();) {
7235 Int_t iTrack = itSubMap->second.first;
7240 if (iUsedTrack == iTrack)
7242 itSubMap = RedChiSqTrackDutHitPair.erase(itSubMap);
7244 if (!bFoundNextUniqueMatch) {
7245 itChi2Map = itSubMap;
7246 bFoundNextUniqueMatch = kTRUE;
7253 if (!bFoundNextUniqueMatch) {
7254 itChi2Map = RedChiSqTrackDutHitPair.cend();
7259 if (-1 < iSelMCTrack) {
7260 auto itDutHitMatch = TrackMatchedDutHitRedChiSq.find(iSelMCTrack);
7262 if (itDutHitMatch != TrackMatchedDutHitRedChiSq.end()) {
7263 Double_t dRedChiSq = itDutHitMatch->second.second;
7264 Int_t iDutHit = itDutHitMatch->second.first;
7273 Double_t dMCEventStartTime(0.);
7276 for (Int_t iPoint = 0; iPoint < tTrackPointMatch->
GetNofLinks();
7280 Int_t iFileIndex = tLink.
GetFile();
7281 Int_t iEventIndex = tLink.
GetEntry();
7282 Int_t iArrayIndex = tLink.
GetIndex();
7297 Int_t iModuleIndex =
7299 Int_t iCounterIndex =
7309 Bool_t bGoodSelDutMatch(kFALSE);
7313 for (Int_t iDutHitTrackLink = 0;
7314 iDutHitTrackLink < tDutHitTrackMatch->
GetNofLinks();
7315 iDutHitTrackLink++) {
7316 const CbmLink& tDutHitTrackLink =
7317 tDutHitTrackMatch->
GetLink(iDutHitTrackLink);
7319 if (tDutHitTrackLink.
GetIndex() == iSelMCTrack) {
7320 bGoodSelDutMatch = kTRUE;
7325 if (bGoodSelDutMatch) {
7335 2, tHit->
GetTime() - tPoint->GetTime() - dMCEventStartTime);
7341 2, tHit->
GetTime() - tPoint->GetTime() - dMCEventStartTime);
7349 if (bGoodSelDutMatch) {
7359 tHit->
GetTime() - tPoint->GetTime()
7360 - dMCEventStartTime);
7367 2, tHit->
GetTime() - tPoint->GetTime() - dMCEventStartTime);
7384 for (
auto itChi2Map = TrackMatchedDutHitRedChiSq.cbegin();
7385 itChi2Map != TrackMatchedDutHitRedChiSq.cend();) {
7386 Double_t dRedChiSq = itChi2Map->second.second;
7391 itChi2Map = TrackMatchedDutHitRedChiSq.erase(itChi2Map);
7417 FairMCEventHeader* tMCEventHeader(NULL);
7418 Double_t dMCEventStartTime(0.);
7425 tMCEventHeader =
dynamic_cast<FairMCEventHeader*
>(
7438 - dMCEventStartTime);
7447 TGeoNode* tNode(NULL);
7448 TGeoMedium* tMedium(NULL);
7449 TGeoMaterial* tMaterial(NULL);
7451 const char* cPdgName;
7452 const char* cMaterialName;
7453 const char* cProcessName;
7455 Double_t dLocalTrackStart[3] = {0., 0., 0.};
7456 Double_t dGlobalTrackStart[3] = {0., 0., 0.};
7457 Double_t dLocalPoint[3] = {0., 0., 0.};
7458 Double_t dGlobalPoint[3] = {0., 0., 0.};
7460 std::map<std::tuple<Int_t, Int_t, Int_t>, Int_t> CounterNAccTracks;
7461 std::map<std::tuple<Int_t, Int_t, Int_t>, Int_t> CounterNAccRefTracks;
7462 std::map<std::tuple<Int_t, Int_t, Int_t>, Int_t> CounterNAccRndmTracks;
7463 std::map<std::tuple<Int_t, Int_t, Int_t>, Int_t> CounterNAccDomTracks;
7464 std::map<std::tuple<Int_t, Int_t, Int_t>, Int_t> CounterNRecRefTracks;
7465 std::map<std::tuple<Int_t, Int_t, Int_t>, Int_t> CounterNPureRefTracks;
7467 std::map<std::tuple<Int_t, Int_t, Int_t>, std::map<Int_t, Int_t>>
7468 CounterNCellAccRefTracks;
7471 Double_t dRefPVRecoT(0.);
7472 Double_t dRefPVRecoX(0.);
7473 Double_t dRefPVRecoY(0.);
7474 Int_t iRefPVRecoN(0);
7476 for (Int_t iTrack = 0; iTrack <
fAccTracks->GetEntriesFast(); iTrack++) {
7477 Bool_t bIsAccRefTrack(kFALSE);
7483 CbmMatch* tAccTrackTrackletMatch(NULL);
7485 tAccTrackTrackletMatch =
7489 dGlobalTrackStart[0] = tAccTrack->
GetStartX();
7490 dGlobalTrackStart[1] = tAccTrack->
GetStartY();
7491 dGlobalTrackStart[2] = tAccTrack->
GetStartZ();
7493 tNode = gGeoManager->FindNode(
7494 dGlobalTrackStart[0], dGlobalTrackStart[1], dGlobalTrackStart[2]);
7495 tMedium = tNode->GetMedium();
7496 tMaterial = tMedium->GetMaterial();
7506 if (0 == std::strcmp(
"target", cMaterialName)
7507 && fiMinMCRefTrackPoints <= tAccTrackPointMatch->GetNofLinks()) {
7508 bIsAccRefTrack = kTRUE;
7557 - tAccTrack->
GetPx()
7558 / tAccTrack->
GetPz());
7561 - tAccTrack->
GetPy()
7562 / tAccTrack->
GetPz());
7564 1. / tTracklet->
GetTt()
7567 * TMath::Ccgs() * 1.e-9);
7573 Int_t iNTrackletHits = tTracklet->
GetNofHits();
7575 for (Int_t iHit = 0; iHit < tTracklet->
GetNofHits(); iHit++) {
7591 dRefPVRecoT += iRefPVRecoW * tTracklet->
GetFitT(0.);
7592 dRefPVRecoX += iRefPVRecoW * tTracklet->
GetFitX(0.);
7593 dRefPVRecoY += iRefPVRecoW * tTracklet->
GetFitY(0.);
7594 iRefPVRecoN += iRefPVRecoW;
7626 for (Int_t iPoint = 0; iPoint < tAccTrackPointMatch->
GetNofLinks();
7631 Int_t iFileIndex = tLink.
GetFile();
7632 Int_t iEventIndex = tLink.
GetEntry();
7633 Int_t iArrayIndex = tLink.
GetIndex();
7644 Int_t iCounterIndex =
7648 std::make_tuple(iModuleType, iModuleIndex, iCounterIndex);
7650 CounterNAccTracks[CounterID]++;
7653 if (bIsAccRefTrack) {
7654 CounterNAccRefTracks[CounterID]++;
7657 gGeoManager->FindNode(
7659 dGlobalPoint[0] = tPoint->GetX();
7660 dGlobalPoint[1] = tPoint->GetY();
7661 dGlobalPoint[2] = tPoint->GetZ();
7662 gGeoManager->MasterToLocal(dGlobalPoint, dLocalPoint);
7667 Int_t iNCounterCells =
7670 Int_t iCellIndex(-1);
7672 iCellIndex =
static_cast<Int_t
>(
7674 +
static_cast<Double_t
>(iNCounterCells) / 2.);
7676 iCellIndex =
static_cast<Int_t
>(
7678 +
static_cast<Double_t
>(iNCounterCells) / 2.);
7681 CounterNCellAccRefTracks[CounterID][iCellIndex]++;
7687 iModuleIndex, iCounterIndex, 0, 0, iModuleType);
7700 if (-1 < iHitIndex) {
7701 CounterNRecRefTracks[CounterID]++;
7713 for (Int_t iHitTrackLink = 0;
7718 CounterNPureRefTracks[CounterID]++;
7728 tModuleNode->GetMatrix()->MasterToLocal(dGlobalTrackStart,
7731 if (tModuleNode->GetVolume()->Contains(dLocalTrackStart)) {
7734 cProcessName, cMaterialName, 1.);
7736 CounterNAccDomTracks[CounterID]++;
7738 if (!bIsAccRefTrack) {
7740 cProcessName, cPdgName, 1.);
7742 cProcessName, cMaterialName, 1.);
7744 CounterNAccRndmTracks[CounterID]++;
7751 if (0 < iRefPVRecoN) {
7752 dRefPVRecoT /= iRefPVRecoN;
7753 dRefPVRecoX /= iRefPVRecoN;
7754 dRefPVRecoY /= iRefPVRecoN;
7757 dRefPVRecoT - tMCEventHeader->GetT()
7758 - dMCEventStartTime);
7760 dRefPVRecoX - tMCEventHeader->GetX());
7762 dRefPVRecoY - tMCEventHeader->GetY());
7768 std::set<CbmLink> tMatchedAccTracks;
7770 for (Int_t iTracklet = 0; iTracklet <
fTofTrackColl->GetEntriesFast();
7787 dGlobalTrackStart[0] = tAccTrack->
GetStartX();
7788 dGlobalTrackStart[1] = tAccTrack->
GetStartY();
7789 dGlobalTrackStart[2] = tAccTrack->
GetStartZ();
7791 tNode = gGeoManager->FindNode(
7792 dGlobalTrackStart[0], dGlobalTrackStart[1], dGlobalTrackStart[2]);
7793 tMedium = tNode->GetMedium();
7794 tMaterial = tMedium->GetMaterial();
7803 if (0 == std::strcmp(
"target", cMaterialName)
7830 == (tMatchedAccTracks.emplace(1.,
7850 == (tMatchedAccTracks.emplace(1.,
7866 auto const& CounterID = CounterModuleNode.first;
7867 Int_t iModuleType = std::get<0>(CounterID);
7869 Int_t iCounterIndex = std::get<2>(CounterID);
7870 Int_t iNCounterCells =
7875 CounterNAccRefTracks[CounterID]);
7877 CounterNAccRndmTracks[CounterID]);
7879 CounterNAccDomTracks[CounterID]);
7883 CounterNAccRefTracks[CounterID], CounterNRecRefTracks[CounterID]);
7885 CounterNAccRefTracks[CounterID], CounterNAccRefTracks[CounterID]);
7887 CounterNAccRefTracks[CounterID], CounterNPureRefTracks[CounterID]);
7890 Int_t iCounterHitMul(0);
7891 Int_t iCounterRefTrackMul(0);
7893 for (Int_t iCell = 0; iCell < iNCounterCells; iCell++) {
7895 iCell, CounterNCellAccRefTracks[CounterID][iCell]);
7896 iCounterRefTrackMul += CounterNCellAccRefTracks[CounterID][iCell];
7897 iCounterHitMul += CounterNCellHits[CounterID][iCell];
7908 auto const& CounterID = CounterModuleNode.first;
7909 Int_t iModuleType = std::get<0>(CounterID);
7911 Int_t iCounterIndex = std::get<2>(CounterID);
7914 for (Int_t iCell = 0; iCell < iNCounterCells; iCell++) {
7916 iCell, CounterNCellHits[CounterID][iCell]);
7926 LOG(info) <<
"Write ./tofAnaTestBeam.hst.root, mode = " <<
fiCorMode;
7929 TDirectory* oldir = gDirectory;
7937 TH1D* htmp1D = htmp->ProjectionX();
7945 Double_t nx = htmp1D->GetNbinsX();
7946 for (Int_t ix = 1; ix <= nx; ix++) {
7950 LOG(debug2) <<
"Update hDTD4DT04D4best " << ix <<
": "
7951 << htmp1D->GetBinContent(ix) <<
" + "
7953 htmp1D->SetBinContent(ix, dVal);
7956 LOG(WARNING) <<
"Histo fhDTD4DT04D4Off not found ";
7970 TH1D* htmpx1D = htmpx->ProjectionX();
7972 Double_t nx = htmpx1D->GetNbinsX();
7973 for (Int_t ix = 1; ix <= nx; ix++) {
7975 htmpx1D->GetBinContent(ix) +
fhDTX4D4Off->GetBinContent(ix);
7976 LOG(debug1) <<
"Update hDTX4D4best " << ix <<
": "
7977 << htmpx1D->GetBinContent(ix) <<
" + "
7978 <<
fhDTX4D4Off->GetBinContent(ix) <<
" -> " << dVal;
7979 htmpx1D->SetBinContent(ix, dVal);
7982 LOG(WARNING) <<
"Histo fhDTX4D4Off not found ";
7996 TH1D* htmpx1D = htmpx->ProjectionX();
7998 Double_t nx = htmpx1D->GetNbinsX();
7999 for (Int_t ix = 1; ix <= nx; ix++) {
8001 htmpx1D->GetBinContent(ix) +
fhDTY4D4Off->GetBinContent(ix);
8002 LOG(debug1) <<
"Update hDTY4D4best " << ix <<
": "
8003 << htmpx1D->GetBinContent(ix) <<
" + "
8004 <<
fhDTY4D4Off->GetBinContent(ix) <<
" -> " << dVal;
8005 htmpx1D->SetBinContent(ix, dVal);
8008 LOG(WARNING) <<
"Histo fhDTY4D4Off not found ";
8022 TH1D* htmpx1D = htmpx->ProjectionX();
8024 Double_t nx = htmpx1D->GetNbinsX();
8025 for (Int_t ix = 1; ix <= nx; ix++) {
8027 htmpx1D->GetBinContent(ix) +
fhDTTexpD4Off->GetBinContent(ix);
8028 LOG(debug1) <<
"Update hDTTexpD4best " << ix <<
": "
8029 << htmpx1D->GetBinContent(ix) <<
" + "
8031 htmpx1D->SetBinContent(ix, dVal);
8034 LOG(WARNING) <<
"Histo fhDTTexpD4Off not found ";
8048 TH1D* htmpx1D = htmpx->ProjectionX();
8050 Double_t nx = htmpx1D->GetNbinsX();
8051 for (Int_t ix = 1; ix <= nx; ix++) {
8054 LOG(debug1) <<
"Update hCluSize0DT04D4best " << ix <<
": "
8055 << htmpx1D->GetBinContent(ix) <<
" + "
8058 htmpx1D->SetBinContent(ix, dVal);
8061 LOG(WARNING) <<
"Histo fhCluSize0DT04D4Off not found ";
8075 TH1D* htmpx1D = htmpx->ProjectionX();
8077 Double_t nx = htmpx1D->GetNbinsX();
8078 for (Int_t ix = 1; ix <= nx; ix++) {
8081 LOG(debug1) <<
"Update hCluSize4DT04D4best " << ix <<
": "
8082 << htmpx1D->GetBinContent(ix) <<
" + "
8085 htmpx1D->SetBinContent(ix, dVal);
8088 LOG(WARNING) <<
"Histo fhCluSize4DT04D4Off not found ";
8102 TH1D* htmpx1D = htmpx->ProjectionX();
8104 Double_t nx = htmpx1D->GetNbinsX();
8105 for (Int_t ix = 1; ix <= nx; ix++) {
8108 LOG(debug1) <<
"Update hTot0DT04D4best " << ix <<
": "
8109 << htmpx1D->GetBinContent(ix) <<
" + "
8111 htmpx1D->SetBinContent(ix, dVal);
8114 LOG(WARNING) <<
"Histo fhTot0DT04D4Off not found ";
8128 TH1D* htmpx1D = htmpx->ProjectionX();
8130 Double_t nx = htmpx1D->GetNbinsX();
8131 for (Int_t ix = 1; ix <= nx; ix++) {
8134 LOG(debug1) <<
"Update hTot4DT04D4best " << ix <<
": "
8135 << htmpx1D->GetBinContent(ix) <<
" + "
8137 htmpx1D->SetBinContent(ix, dVal);
8140 LOG(WARNING) <<
"Histo fhTot4DT04D4Off not found ";
8153 for (Int_t iSelType = 0; iSelType < 3; iSelType++) {
8161 if (hResidualT->GetEntries() > 100.) {
8162 Double_t dRMS = TMath::Abs(hResidualT->GetRMS());
8170 if (hResidualX->GetEntries() > 100.) {
8171 Double_t dRMS = TMath::Abs(hResidualX->GetRMS());
8179 if (hResidualY->GetEntries() > 100.) {
8180 Double_t dRMS = TMath::Abs(hResidualY->GetRMS());
8202 Double_t dRMS = TMath::Abs(
fhDXSel24->GetRMS());
8208 Double_t dRMS = TMath::Abs(
fhDYSel24->GetRMS());
8214 Double_t dRMS = TMath::Abs(
fhDTSel24->GetRMS());
8245 for (Int_t iDet = 0; iDet < 2; iDet++) {
8254 gDirectory->cd(oldir->GetPath());
8301 Bool_t bFoundTofNode(kFALSE);
8302 TGeoNode* tTofNode(NULL);
8306 TObjArray* tDaughterNodes = gGeoManager->GetTopNode()->GetNodes();
8307 for (Int_t iNode = 0; iNode < tDaughterNodes->GetEntriesFast(); iNode++) {
8308 TGeoNode* tDaughterNode =
8309 dynamic_cast<TGeoNode*
>(tDaughterNodes->At(iNode));
8310 if (TString(tDaughterNode->GetName())
8311 .Contains(
"tof", TString::kIgnoreCase)) {
8312 bFoundTofNode = kTRUE;
8313 tTofNode = tDaughterNode;
8319 if (!bFoundTofNode) {
8320 LOG(error) <<
"Could not retrieve 'tof' node from TGeoManager.";
8331 TObjArray* tDaughterNodes = tMotherNode->GetNodes();
8333 for (Int_t iNode = 0; iNode < tDaughterNodes->GetEntriesFast(); iNode++) {
8334 TGeoNode* tDaughterNode =
8335 dynamic_cast<TGeoNode*
>(tDaughterNodes->At(iNode));
8339 if (TString(tDaughterNode->GetName()).Contains(
"module")) {
8344 boost::regex rgx(
".*_(\\d+)_.*");
8345 boost::cmatch match;
8346 if (boost::regex_search(tDaughterNode->GetName(), match, rgx)) {
8355 else if (TString(tDaughterNode->GetName()).Contains(
"counter")) {
8364 if (0 < tDaughterNode->GetNdaughters()) {
ExpandNode(tDaughterNode); }
8373 auto itPdg =
giPdgMap.find(iPdgCode);
8375 cPdgName = itPdg->second;
8378 LOG(error) <<
"unknown PDG code: " << iPdgCode;
8385 cMaterialName = itMaterial->second;
8387 cMaterialName =
"XXX";
8388 LOG(error) <<
"unknown material: " << cMaterial;
8395 cProcessName = itProcess->second;
8397 cProcessName =
"XXX";
8398 LOG(error) <<
"unknown process: " << cProcess;