CbmRoot
CbmTofAnaTestbeam.cxx
Go to the documentation of this file.
1 // ------------------------------------------------------------------
2 // ----- CbmTofAnaTestbeam -----
3 // ----- Created 12/04/2014 by nh -----
4 // ------------------------------------------------------------------
5 
6 #include "CbmTofAnaTestbeam.h"
7 
8 // TOF Classes and includes
9 #include "CbmEvent.h"
10 #include "CbmMatch.h"
11 #include "CbmTofAddress.h" // in cbmdata/tof
12 #include "CbmTofCell.h" // in tof/TofData
13 #include "CbmTofDetectorId_v12b.h" // in cbmdata/tof
14 #include "CbmTofDetectorId_v14a.h" // in cbmdata/tof
15 #include "CbmTofDigi.h" // in cbmdata/tof
16 #include "CbmTofDigiBdfPar.h" // in tof/TofParam
17 #include "CbmTofDigiPar.h" // in tof/TofParam
18 #include "CbmTofGeoHandler.h" // in tof/TofTools
19 #include "CbmTofHit.h" // in cbmdata/tof
20 #include "CbmTofPoint.h"
21 #include "CbmTofTracklet.h"
22 #include "CbmTofTrackletTools.h"
23 #include "CbmTrackMatchNew.h"
24 #include "CbmVertex.h"
25 
26 #include "CbmDigiManager.h"
28 #include "CbmTofTrackFinderNN.h"
29 
30 #include "TTrbHeader.h"
31 //#include "TMbsMappingTofPar.h"
32 
33 #include "CbmMCDataArray.h"
34 #include "CbmMCDataManager.h"
35 #include "CbmMCDataObject.h"
36 #include "CbmMCEventList.h"
37 #include "CbmMCTrack.h"
38 
39 // CBMroot classes and includes
40 
41 // FAIR classes and includes
42 #include "FairLogger.h"
43 #include "FairMCEventHeader.h"
44 #include "FairRootManager.h"
45 #include "FairRunAna.h"
46 #include "FairRuntimeDb.h"
47 
48 // ROOT Classes and includes
49 #include "Riostream.h"
50 #include "TClonesArray.h"
51 #include "TDirectory.h"
52 #include "TEfficiency.h"
53 #include "TFile.h"
54 #include "TFitResult.h"
55 #include "TGeoManager.h"
56 #include "TGeoPhysicalNode.h"
57 #include "TH1.h"
58 #include "TH2.h"
59 #include "TH3.h"
60 #include "TMCProcess.h"
61 #include "TMath.h"
62 #include "TProfile.h"
63 #include "TROOT.h"
64 #include "TRandom.h"
65 #include "TString.h"
66 
67 // C++ STL
68 #include <boost/lexical_cast.hpp>
69 #include <boost/regex.hpp>
70 
71 using std::cout;
72 using std::endl;
73 using std::vector;
74 
75 const Int_t DetMask = 0x007FFFFF;
76 const Double_t DTDMAX = 6.; // diamond inspection range in ns
77 
78 Double_t dTDia;
79 Double_t dDTD4Min = 1.E8;
80 static Double_t StartAnalysisTime = 0.;
81 static Double_t dTLEvt = 0.;
82 static Double_t StartSpillTime = -100.;
83 
84 Int_t iNspills = 0;
85 
86 static Double_t fdMemoryTime = 1.E12; // memory time in ns
87 
89 
90 static std::vector<TH2D*> fhLHTime;
91 static std::vector<std::vector<CbmTofHit*>> fvLHit;
92 static std::map<UInt_t, UInt_t> fDetIdMap;
93 
94 struct cmp_str {
95  bool operator()(char const* a, char const* b) const {
96  return std::strcmp(a, b) < 0;
97  }
98 };
99 
100 std::map<Int_t, const char*> giPdgMap {// Gauge bosons
101  {22, "#gamma"},
102  // leptons
103  {11, "e^{-}"},
104  {-11, "e^{+}"},
105  {13, "#mu^{-}"},
106  {-13, "#mu^{+}"},
107  // mesons
108  {111, "#pi^{0}"},
109  {211, "#pi^{+}"},
110  {-211, "#pi^{-}"},
111  {221, "#eta"},
112  {130, "#Kappa^{0}_{L}"},
113  {310, "#Kappa^{0}_{S}"},
114  {321, "#Kappa^{+}"},
115  {-321, "#Kappa^{-}"},
116  // baryons
117  {2112, "n"},
118  {-2112, "#bar{n}"},
119  {2212, "p"},
120  {-2212, "#bar{p}"},
121  {3112, "#Sigma^{-}"},
122  {-3112, "#Sigma^{+}"},
123  {3122, "#Lambda"},
124  {-3122, "#bar{#Lambda}"},
125  {3212, "#Sigma^{0}"},
126  {-3212, "#bar{#Sigma^{0}}"},
127  {3222, "#Sigma^{+}"},
128  {-3222, "#Sigma^{-}"},
129  {3312, "#Xi^{-}"},
130  {-3312, "#Xi^{+}"},
131  {3322, "#Xi^{0}"},
132  {-3322, "#bar{#Xi^{0}}"},
133  {3334, "#Omega^{-}"},
134  {-3334, "#Omega^{+}"},
135  // fragments
136  {1000010020, "d"},
137  {1000010030, "t"},
138  {1000020040, "#alpha"},
139  // dummy
140  {0, "Geant"}};
141 
142 std::map<const char*, const char*, cmp_str> gcMaterialMap {
143  {"RPCgas", "gas"},
144  {"RPCgas_noact", "gas"},
145  {"RPCglass", "glass"},
146  {"air", "air"},
147  {"aluminium", "box"},
148  {"carbon", "pcb"},
149  {"targetMaterial", "target"},
150  {"silicon", "diamond"}};
151 
152 std::map<const char*, const char*, cmp_str> gcProcessMap {
153  {"Compton scattering", "Compton"},
154  {"Decay", "Decay"},
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"}};
162 
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);
166 
167 //___________________________________________________________________
168 //
169 // CbmTofAnaTestbeam
170 //
171 // Task for analysis of Testbeam data
172 //
173 // ------------------------------------------------------------------
175  : CbmTofAnaTestbeam("TestbeamAnalysis", 0) {
176  cout << "CbmTofTests: Task started " << endl;
177 }
178 // ------------------------------------------------------------------
179 
180 // ------------------------------------------------------------------
181 CbmTofAnaTestbeam::CbmTofAnaTestbeam(const char* name, Int_t verbose)
182  : FairTask(name, verbose)
183  , fEvents(0)
184  , fGeoHandler(new CbmTofGeoHandler())
185  , fTofId(NULL)
186  , fChannelInfo(NULL)
187  , fChannelInfoRef(NULL)
188  , fChannelInfoDut(NULL)
189  , fChannelInfoSel2(NULL)
190  , fMbsMappingPar(NULL)
191  , iNbSmTot(0)
192  , fvTypeSmOffs()
193  , iNbRpcTot(0)
194  , fvSmRpcOffs()
195  , iNbChTot(0)
196  , fvRpcChOffs()
197  , fDigiPar(NULL)
198  , fDigiBdfPar(NULL)
199  , fTofDigisColl(NULL)
200  , fTofHitsColl(NULL)
201  , fTofDigiMatchColl(NULL)
202  , fTofTrackColl(NULL)
203  , fEventsColl(NULL)
204  , fTofDigisCollIn(NULL)
205  , fTofHitsCollIn(NULL)
206  , fTofDigiMatchCollIn(NULL)
207  , fTofTrackCollIn(NULL)
208  , fTrbHeader(NULL)
209  , fdDXMean(0.)
210  , fdDYMean(0.)
211  , fdDTMean(0.)
212  , fdDXWidth(0.)
213  , fdDYWidth(0.)
214  , fdDTWidth(0.)
215  , fhTriggerPattern(NULL)
216  , fhTriggerType(NULL)
217  , fhTimeInSpill(NULL)
218  , fhRate_all(NULL)
219  , fhTIS_all(NULL)
220  , fhTIS_sel(NULL)
221  , fhTIS_sel1(NULL)
222  , fhTIS_sel2(NULL)
223  , fhTIR_all(NULL)
224  , fhTIR_sel(NULL)
225  , fhTIR_sel1(NULL)
226  , fhTIR_sel2(NULL)
227  , fhTIS_Nhit(NULL)
228  , fhTIS_Ntrk(NULL)
229  , fhDTLH_all(NULL)
230  , fhDTLH_sel(NULL)
231  , fhDTLH_sel1(NULL)
232  , fhDTLH_sel2(NULL)
233  , fhDTLH_DStrip(NULL)
234  , fhDT2(NULL)
235  , fhXX2(NULL)
236  , fhYY2(NULL)
237  , fhNMatch04(NULL)
238  , fhXX04(NULL)
239  , fhYY04(NULL)
240  , fhXY04(NULL)
241  , fhYX04(NULL)
242  , fhTT04(NULL)
243  , fhDutDXDYDT(NULL)
244  , fhRefDXDYDT(NULL)
245  , fhChi04(NULL)
246  , fhChiSel24(NULL)
247  , fhDXSel24(NULL)
248  , fhDYSel24(NULL)
249  , fhDTSel24(NULL)
250  , fhDXDY04(NULL)
251  , fhDXDT04(NULL)
252  , fhDYDT04(NULL)
253  , fhTofSel24(NULL)
254  , fhNMatch04sel(NULL)
255  , fhChi04best(NULL)
256  , fhDigiMul0best(NULL)
257  , fhDigiMul4best(NULL)
258  , fhDXDY04best(NULL)
259  , fhDXDT04best(NULL)
260  , fhDYDT04best(NULL)
261  , fhChiDT04best(NULL)
262  , fhDT24DT04best(NULL)
263  , fhDTD4DT04best(NULL)
264  , fhX0DT04best(NULL)
265  , fhY0DT04best(NULL)
266  , fhNMatchD4sel(NULL)
267  , fhChi04D4best(NULL)
268  , fhTofD4best(NULL)
269  , fhVelD4best(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)
299  , fhDTX4D4best(NULL)
300  , fhDTY4D4best(NULL)
301  , fhDXX4D4best(NULL)
302  , fhDXY4D4best(NULL)
303  , fhDYX4D4best(NULL)
304  , fhDYY4D4best(NULL)
305  , fhDTMul0D4best(NULL)
306  , fhDTX0D4best(NULL)
307  , fhDTY0D4best(NULL)
308  , fhDXX0D4best(NULL)
309  , fhDXY0D4best(NULL)
310  , fhDYX0D4best(NULL)
311  , fhDYY0D4best(NULL)
312  , fhChi04D4sbest(NULL)
313  , fhTofD4sbest(NULL)
314  , fhVelD4sbest(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)
346  , fhNMatch24(NULL)
347  , fhNMatch24sel(NULL)
348  , fhDT24sel(NULL)
349  , fhChi24(NULL)
350  , fhXY24(NULL)
351  , fhDXDY24(NULL)
352  , fhDXDT24(NULL)
353  , fhDYDT24(NULL)
354  , fhXY0D4best(NULL)
355  , fhXY4D4best(NULL)
356  , fhXX04D4best(NULL)
357  , fhYY04D4best(NULL)
358  , fhXYSel2D4best(NULL)
359  , fhXY0D4sel(NULL)
360  , fhXY4D4sel(NULL)
361  , fhXYSel2D4sel(NULL)
362  , fhDTD4sel(NULL)
363  , fhTofD4sel(NULL)
364  , fhBRefMul(NULL)
365  , fhDTD4(NULL)
366  , fhXYPos()
367  , fhEtaPhi(NULL)
368  , fhDT04DX0_1(NULL)
369  , fhDT04DY0_1(NULL)
370  , fhDT04DT0_1(NULL)
371  , fhDT04DX4_1(NULL)
372  , fhDT04DY4_1(NULL)
373  , fhDT04DT4_1(NULL)
374  , fhDT04DX0_2(NULL)
375  , fhDT04DY0_2(NULL)
376  , fhDT04DT0_2(NULL)
377  , fhDT04DX4_2(NULL)
378  , fhDT04DY4_2(NULL)
379  , fhDT04DT4_2(NULL)
380  , fhDutPullX(NULL)
381  , fhDutPullXB(NULL)
382  , fhDutPullY(NULL)
383  , fhDutPullYB(NULL)
384  , fhDutPullZ(NULL)
385  , fhDutPullT(NULL)
386  , fhDutPullTB(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)
410  , fhDutXYDX(NULL)
411  , fhDutXYDY(NULL)
412  , fhDutXYDT(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)
431  , fhSelPurity(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)
478  , fhPVResTAll(NULL)
479  , fhPVResXAll(NULL)
480  , fhPVResYAll(NULL)
481  , fhPVResTRef(NULL)
482  , fhPVResXRef(NULL)
483  , fhPVResYRef(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)
532  , fStart()
533  , fStop()
534  , fCalParFileName("")
535  , fCalOutFileName("./tofAnaTestBeam.hst.root")
536  , fCalParFile(NULL)
537  , fhDTD4DT04D4Off(NULL)
538  , fhDTX4D4Off(NULL)
539  , fhDTY4D4Off(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)
549  , fdMulDMax(0.)
550  , fdSpillDuration(20.)
551  , fdSpillBreak(0.9)
552  , fdDTDia(0.)
553  , fdDTD4MAX(0.)
554  , fdMul0Max(0.)
555  , fdMul4Max(0.)
556  , fdCh4Sel(0.)
557  , fdDCh4Sel(0.)
558  , fdPosY4Sel(0.)
559  , fdPosY4SelOff(0.)
560  , fdChS2Sel(0.)
561  , fdDChS2Sel(0.)
562  , fdPosYS2Sel(0.)
563  , fdPosYS2SelOff(0.)
564  , fdSel2TOff(0.)
565  , fdHitDistMin(0.)
566  , fdHitDistAv(1.)
567  , fdTOffD4(0.)
568  , fdTShift(0.)
569  , fdChi2Lim(0.)
570  , fdChi2Lim2(0.)
571  , fdDutX(0.)
572  , fdDutDX(100.)
573  , fdDutY(0.)
574  , fdDutDY(100.)
575  , fiCorMode(0)
576  , fiDutAddr(0)
577  , fiMrpcRefAddr(0)
578  , fiMrpcSel2Addr(0)
579  , fiMrpcSel3Addr(0)
580  , fiBeamRefAddr(0)
581  , fiDut(0)
582  , fiDutSm(0)
583  , fiDutRpc(0)
584  , fiMrpcRef(0)
585  , fiMrpcRefSm(0)
586  , fiMrpcRefRpc(0)
587  , fiMrpcSel2(-1)
588  , fiMrpcSel2Sm(0)
589  , fiMrpcSel2Rpc(0)
590  , fiMrpcSel3(0)
591  , fiMrpcSel3Sm(0)
592  , fiMrpcSel3Rpc(0)
593  , fiPlaSelect(0)
594  , fiBeamRefSmType(0)
595  , fiBeamRefSmId(0)
596  , fiBeamRefRpc(0)
597  , fiDutNch(0)
598  , fiReqTrg(-1)
599  , fChi2LimFit(100.)
600  , fR0LimFit(0.)
601  , fSIGLIM(3.)
602  , fSIGT(100.)
603  , fSIGX(1.)
604  , fSIGY(1.)
605  , fEnableMatchPosScaling(kTRUE)
606  , fFindTracks(NULL)
607  , fClusterizer(NULL)
608  , fTrackletTools(NULL)
609  , fbMonteCarloComparison(kFALSE)
610  , fbPointsInInputFile(kFALSE)
611  , fbTracksInInputFile(kFALSE)
612  , fMCEventHeader(NULL)
613  , fMCEventList(NULL)
614  , fAccTracks(NULL)
615  , fTofPointsTB(NULL)
616  , fTofPoints(NULL)
617  , fMCTracks(NULL)
618  , fTofHitPointMatches(NULL)
619  , fTofHitAccTrackMatches(NULL)
620  , fTofTrackletAccTrackMatches(NULL)
621  , fTofAccTrackTrackletMatches(NULL)
622  , fTofAccTrackPointMatches(NULL)
623  , fCurrentNodePath()
624  , fCurrentModuleNodePath()
625  , fiCurrentModuleType(-1)
626  , fiCurrentModuleIndex(-1)
627  , fiCurrentCounterIndex(-1)
628  , fCounterModuleNodes()
629  , fiNAccRefTracks(0)
630  , fdGhostTrackHitQuota(0.7)
631  , fbDelayMCPoints(kFALSE)
632  , fbAttachDutHitToTracklet(kFALSE)
633  , fbBestSelTrackletOnly(kFALSE)
634  , fbUseSigCalib(kFALSE)
635  , fiAnaMode(0)
636  , fdMCSIGLIM(3.)
637  , fdMCSIGT(100.)
638  , fdMCSIGX(1.)
639  , fdMCSIGY(1.)
640  , fiMinMCRefTrackPoints(3)
641  , fiMaxMCRefTracks(1)
642 
643 {}
644 // ------------------------------------------------------------------
645 
646 // ------------------------------------------------------------------
648  // Destructor
649 }
650 // ------------------------------------------------------------------
651 /************************************************************************************/
652 // FairTasks inherited functions
654  if (kFALSE == RegisterInputs()) return kFATAL;
655 
656  // fTofId = new ( CbmTofDetectorId )CbmTofDetectorId_v14a();
657  if (kFALSE == InitParameters()) return kFATAL;
658 
659  if (kFALSE == LoadGeometry()) return kFATAL;
660 
661  if (kFALSE == LoadCalParameter()) return kFATAL;
662 
663  if (kFALSE == CreateHistos()) return kFATAL;
664 
666  LOG(info) << Form("Position Scaling for Matching enabled ");
667  else
668  LOG(info) << Form("Position Scaling for Matching not enabled ");
669 
672  fTrackletTools = new CbmTofTrackletTools(); // initialize tools
673 
674  if (NULL == fFindTracks) {
675  //fdTShift += fChannelInfoDut->GetZ()/30.; // in ns
676  //if ( NULL != fChannelInfoSel2 ) fdSel2TOff += fChannelInfoSel2->GetZ()/30.;
677  LOG(WARNING) << Form(
678  "no FindTracks instance found, use TShift = %8.3f, Sel2Toff = %8.3f",
679  fdTShift,
680  fdSel2TOff);
681  } else { // reinitialize Offsets
686  LOG(info) << Form(
687  "Set time offsets D: %7.1f, 4: %7.1f, D4: %7.1f, Sel24: %7.1f",
690  fdTShift,
691  fdSel2TOff);
692  }
693  return kSUCCESS;
694 }
695 
697  LOG(info) << " CbmTofAnaTestbeam => Get the digi parameters for tof";
698  return;
699  // Get Base Container
700  FairRunAna* ana = FairRunAna::Instance();
701  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
702 
703  fDigiPar = (CbmTofDigiPar*) (rtdb->getContainer("CbmTofDigiPar"));
704 
705  fDigiBdfPar = (CbmTofDigiBdfPar*) (rtdb->getContainer("CbmTofDigiBdfPar"));
706 }
707 
709  LOG(info) << "Geometry starting for " << fDigiPar->GetNrOfModules()
710  << " geometrically known detector cells, looking for type "
711  << fiDut;
712  fiDutNch = 0;
713  Double_t dDutXmin = 1.E300;
714  Double_t dDutXmax = -1.E300;
715  fChannelInfoDut = NULL;
716  for (Int_t icell = 0; icell < fDigiPar->GetNrOfModules(); ++icell) {
717 
718  Int_t cellId =
719  fDigiPar->GetCellId(icell); // cellId is assigned in CbmTofCreateDigiPar
720  fChannelInfo = fDigiPar->GetCell(cellId);
721  /*
722  Int_t smodule = fGeoHandler->GetSMType(cellId); // FIXME - wrong inline functions!!!
723  Int_t smtype = fGeoHandler->GetSModule(cellId); // FIXME
724  Int_t module = fGeoHandler->GetCounter(cellId);
725  */
726  Int_t smtype = CbmTofAddress::GetSmType(cellId);
727  Int_t smodule = CbmTofAddress::GetSmId(cellId);
728  Int_t module = CbmTofAddress::GetRpcId(cellId);
729  /*
730  LOG(debug3) <<Form(" Id 0x%08x ",cellId)
731  << " got cell " << smtype << ", " << smodule << ", " << module
732  << ", x-size "<< fChannelInfo->GetSizex()
733  << ", y-size "<< fChannelInfo->GetSizey()
734  ;
735  */
736  if (smtype == fiDut && smodule == fiDutSm && module == fiDutRpc) {
737  fiDutNch++;
738  if (fChannelInfo->GetX() > dDutXmax) dDutXmax = fChannelInfo->GetX();
739  if (fChannelInfo->GetX() < dDutXmin) dDutXmin = fChannelInfo->GetX();
740  if (fiDutNch == 1) {
742  LOG(info) << Form(" DutId 0x%08x ", cellId) << " got cell " << smtype
743  << ", " << smodule << ", " << module << ", x-size "
744  << fChannelInfoDut->GetSizex() << ", y-size "
745  << fChannelInfoDut->GetSizey() << ", # " << fiDutNch
746  << ", Xmin " << dDutXmin << ", Xmax " << dDutXmax;
747  }
748  }
749  }
750  if (fiDutNch > 0) {
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;
755 
756  } else {
757  LOG(error) << "Dut inconsistent " << fiDut << ", " << fiDutNch;
758  return kFALSE;
759  }
760 
761  if (!FindModuleNodes()) {
762  LOG(error) << "Could not retrieve module nodes from TGeoManager!";
763  return kFALSE;
764  }
765 
766  return kTRUE;
767 }
768 
769 void CbmTofAnaTestbeam::Exec(Option_t* opt) {
770  if (!fEventsColl) {
771  ExecEvent(opt);
772  } else {
773  for (Int_t iEvent = 0; iEvent < fEventsColl->GetEntriesFast(); iEvent++) {
774  CbmEvent* tEvent = dynamic_cast<CbmEvent*>(fEventsColl->At(iEvent));
775  LOG(debug) << "Process event " << iEvent << " with "
776  << tEvent->GetNofData(ECbmDataType::kTofHit) << " hits from "
777  << tEvent->GetNofData(ECbmDataType::kTofDigi) << ", "
778  << tEvent->GetNofData(ECbmDataType::kTofCalDigi) << " digis ";
779 
780  if (fTofDigisColl) fTofDigisColl->Clear("C");
781  //if(fTofDigisColl) fTofDigisColl->Delete();
782  if (fTofHitsColl) fTofHitsColl->Clear("C");
783  if (fTofDigiMatchColl) fTofDigiMatchColl->Clear("C");
784  if (fTofTrackColl) fTofTrackColl->Clear("C");
785 
786  Int_t iNbDigi = 0;
787  /*
788  assert ( fTofDigisColl );
789  for (Int_t iDigi = 0; iDigi < tEvent->GetNofData(ECbmDataType::kTofCalDigi); iDigi++)
790  {
791  Int_t iDigiIndex = static_cast<Int_t>(tEvent->GetIndex(ECbmDataType::kTofCalDigi, iDigi));
792  const CbmTofDigi* tDigi = fDigiMan->Get<CbmTofDigi>(iDigiIndex);
793 // CbmTofDigi* tDigi = dynamic_cast<CbmTofDigi*>(fTofDigisCollIn->At(iDigiIndex));
794  assert (tDigi);
795  //LOG(INFO) << "Copy TofDigi " << iDigi << " from " << iDigiIndex << " to " << iNbDigi;
796  //new((*fTofDigisColl)[iNbDigi++]) CbmTofDigi(*tDigi); // does not work for tDigi, since no TObject
797  }
798  */
799  Int_t iNbHits = 0;
800  for (Int_t iHit = 0; iHit < tEvent->GetNofData(ECbmDataType::kTofHit);
801  iHit++) {
802  Int_t iHitIndex =
803  static_cast<Int_t>(tEvent->GetIndex(ECbmDataType::kTofHit, iHit));
804  CbmTofHit* tHit =
805  dynamic_cast<CbmTofHit*>(fTofHitsCollIn->At(iHitIndex));
806  new ((*fTofHitsColl)[iNbHits]) CbmTofHit(*tHit);
807 
808  CbmMatch* tMatch =
809  dynamic_cast<CbmMatch*>(fTofDigiMatchCollIn->At(iHitIndex));
810  new ((*fTofDigiMatchColl)[iNbHits]) CbmMatch(*tMatch);
811 
812  iNbHits++;
813  }
814 
815  Int_t iNbTrks = 0;
816  for (Int_t iTrk = 0; iTrk < tEvent->GetNofData(ECbmDataType::kTofTrack);
817  iTrk++) {
818  Int_t iTrkIndex =
819  static_cast<Int_t>(tEvent->GetIndex(ECbmDataType::kTofTrack, iTrk));
820  CbmTofTracklet* tTrk =
821  dynamic_cast<CbmTofTracklet*>(fTofTrackCollIn->At(iTrkIndex));
822  new ((*fTofTrackColl)[iNbTrks++]) CbmTofTracklet(*tTrk);
823  }
824 
825  ExecEvent(opt);
826 
827  if (iNbDigi)
829  ->Delete(); //Clear("C"); // Clear causes memory leak, FIXME
830  if (iNbHits) fTofHitsColl->Clear("C");
831  if (iNbHits) fTofDigiMatchColl->Delete(); //Clear("C");
832  if (iNbTrks) fTofTrackColl->Delete(); //Clear("C");
833  }
834  }
835 }
836 
837 
838 void CbmTofAnaTestbeam::ExecEvent(Option_t* /*option*/) {
839  // Task execution
840  if (NULL != fFindTracks && fdMemoryTime == 0.) {
841  if (!fFindTracks->InspectEvent()) return;
842 
843  LOG(debug) << "=> New event with " << fFindTracks->GetNStationsFired()
844  << " fired stations for " << fFindTracks->GetMinNofHits()
845  << " requested hits";
846  }
847  fStart.Set();
848  FillHistos();
849  fStop.Set();
850 
851 
852  // if( 0 < fEvents )
853  if (0 == (fEvents % 100000) && 0 < fEvents) {
854  LOG(info) << "CbmTofAnaTestbeam::Exec : "
855  << "event " << fEvents << " in " << iNspills
856  << " spills processed.";
857  }
858  fEvents += 1;
859 }
860 
862  // Normalisations
863  LOG(info) << "Finish up with " << fEvents << " analyzed events in "
864  << iNspills << " spills ";
865 
867  TH1* tCurrentHistogram(NULL);
868 
869  if (fhAccRefTracksProcSpec->GetEntries()) {
870  fhAccRefTracksProcSpec->LabelsDeflate("X");
871  fhAccRefTracksProcSpec->LabelsDeflate("Y");
872  fhAccRefTracksProcSpec->LabelsOption("<d", "X");
873  fhAccRefTracksProcSpec->LabelsOption("<v", "Y");
874  fhAccRefTracksProcSpec->Scale(1. / fhAccRefTracksProcSpec->GetEntries());
875  }
876 
877  if (fhSelRefTrackProcSpec->GetEntries()) {
878  fhSelRefTrackProcSpec->LabelsDeflate("X");
879  fhSelRefTrackProcSpec->LabelsDeflate("Y");
880  fhSelRefTrackProcSpec->LabelsOption("<d", "X");
881  fhSelRefTrackProcSpec->LabelsOption("<v", "Y");
882  fhSelRefTrackProcSpec->Scale(1. / fhSelRefTrackProcSpec->GetEntries());
883  }
884 
886  if (fhSelTrklRefTrackProcSpec->GetEntries()) {
887  fhSelTrklRefTrackProcSpec->LabelsDeflate("X");
888  fhSelTrklRefTrackProcSpec->LabelsDeflate("Y");
889  fhSelTrklRefTrackProcSpec->LabelsOption("<d", "X");
890  fhSelTrklRefTrackProcSpec->LabelsOption("<v", "Y");
892  1. / fhSelTrklRefTrackProcSpec->GetEntries());
893  }
894  }
895 
896  for (auto const& CounterModuleNode : fCounterModuleNodes) {
897  auto const& CounterID = CounterModuleNode.first;
898 
899  tCurrentHistogram = fhDomTracksProcSpec.at(CounterID);
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());
906  }
907 
908  tCurrentHistogram = fhDomTracksProcMat.at(CounterID);
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());
915  }
916 
917  tCurrentHistogram = fhRndmTracksProcSpec.at(CounterID);
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());
924  }
925 
926  tCurrentHistogram = fhRndmTracksProcMat.at(CounterID);
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());
933  }
934  }
935  }
936 
937 
938  WriteHistos();
939  // Prevent them from being sucked in by the CbmHadronAnalysis WriteHistograms method
940  DeleteHistos();
941 }
942 
943 /************************************************************************************/
944 // Functions common for all clusters approximations
946  FairRootManager* fManager = FairRootManager::Instance();
947 
948  fEventsColl = dynamic_cast<TClonesArray*>(fManager->GetObject("Event"));
949  if (NULL == fEventsColl)
950  fEventsColl = dynamic_cast<TClonesArray*>(fManager->GetObject("CbmEvent"));
951 
952  if (NULL == fEventsColl)
953  LOG(info) << "CbmEvent not found in input file, assume eventwise input";
954 
956  fDigiMan->Init();
958  LOG(error) << GetName() << ": No digi input!";
959  return kFALSE;
960  }
961 
962 
963  if (!fEventsColl) {
964 
965  if (NULL == fTofDigisColl)
966  fTofDigisColl = (TClonesArray*) fManager->GetObject("CbmTofDigi");
967 
968  if (NULL == fTofDigisColl)
969  fTofDigisColl = (TClonesArray*) fManager->GetObject("TofCalDigi");
970 
971  if (NULL == fTofDigisColl) {
972  LOG(WARNING)
973  << "CbmTofAnaTestbeam::RegisterInputs => Could not get the TofDigi "
974  "TClonesArray!!! ... continuing with incomplete input ";
975  // return kFALSE;
976  } // if( NULL == fTofDigisColl)
977 
978  fTofHitsColl = (TClonesArray*) fManager->GetObject("TofHit");
979  if (NULL == fTofHitsColl) {
980  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not get the "
981  "TofHit TClonesArray!!!";
982  return kFALSE;
983  } // if( NULL == fTofHitsColl)
984 
985  fTofDigiMatchColl = (TClonesArray*) fManager->GetObject("TofCalDigiMatch");
986  if (NULL == fTofDigiMatchColl) {
987  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not get the "
988  "Match TClonesArray!!!";
989  return kFALSE;
990  } // if( NULL == fTofDigiMatchColl)
991 
992 
993  fTofTrackColl = (TClonesArray*) fManager->GetObject("TofTracks");
994  if (NULL == fTofTrackColl) {
995  LOG(info) << "CbmTofAnaTestbeam::RegisterInputs => Could not get the "
996  "TofTracklet TClonesArray!!!";
997  // return kFALSE;
998  } // if( NULL == fTofHitsColl)
999 
1000  fTrbHeader = (TTrbHeader*) fManager->GetObject("TofTrbHeader.");
1001  if (NULL == fTrbHeader) {
1002  LOG(info) << "CbmTofAnaTestbeam::RegisterInputs => Could not get the "
1003  "TofTrbHeader Object";
1004  }
1005 
1007  fDigiMan->Init();
1009  LOG(error) << GetName() << ": No input digis!";
1010  //return kFALSE;
1011  } else
1012  LOG(info) << "DigiManager has Tof Digis";
1013 
1014  if (fbMonteCarloComparison) {
1015  // The input data arrays correspond to a timeslice.
1016  fMCEventList =
1017  dynamic_cast<CbmMCEventList*>(fManager->GetObject("MCEventList."));
1018  if (!fMCEventList) {
1019  // The input data arrays correspond to a reconstructed event.
1020  fMCEventList =
1021  dynamic_cast<CbmMCEventList*>(fManager->GetObject("EventList."));
1022 
1023  // TODO: For the time being, the following check prevents the MC comparison code
1024  // from being executed when ordinary event-by-event input is being processed.
1025  // Without a MC event list at hand (as is the case in event-based mode) it is
1026  // not straightforward to find the position of the MC event header in the
1027  // input chain.
1028  if (!fMCEventList) {
1029  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not "
1030  "retrieve branch \"(MC)EventList.\" for MC comparison.";
1031  return kFALSE;
1032  }
1033  }
1034 
1035  CbmMCDataManager* tMCManager =
1036  dynamic_cast<CbmMCDataManager*>(fManager->GetObject("MCDataManager"));
1037  if (!tMCManager) {
1038  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1039  "CbmMCDataManager for MC comparison.";
1040  return kFALSE;
1041  }
1042 
1043  fMCEventHeader = tMCManager->GetObject("MCEventHeader.");
1044  if (!fMCEventHeader) {
1045  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1046  "branch \"MCEventHeader.\" for MC comparison.";
1047  return kFALSE;
1048  }
1049 
1050  fTofPointsTB =
1051  dynamic_cast<TClonesArray*>(fManager->GetObject("TofPointTB"));
1052  if (fTofPointsTB) {
1053  fbPointsInInputFile = kTRUE;
1054  } else {
1055  fTofPoints = tMCManager->InitBranch("TofPoint");
1056  if (!fTofPoints) {
1057  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not "
1058  "retrieve branch \"TofPoint\" for MC comparison.";
1059  return kFALSE;
1060  }
1061  }
1062 
1064  dynamic_cast<TClonesArray*>(fManager->GetObject("TofHitMatch"));
1065  if (!fTofHitPointMatches) {
1066  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1067  "branch \"TofHitMatch\" for MC comparison.";
1068  return kFALSE;
1069  }
1070 
1071  fAccTracks =
1072  dynamic_cast<TClonesArray*>(fManager->GetObject("TofAccMCTracks"));
1073  if (fAccTracks) {
1074  fbTracksInInputFile = kTRUE;
1075 
1076  fTofAccTrackPointMatches = dynamic_cast<TClonesArray*>(
1077  fManager->GetObject("TofAccMCTrackPointMatch"));
1078  if (!fTofAccTrackPointMatches) {
1079  LOG(error)
1080  << "CbmTofAnaTestbeam::RegisterInputs => Could not retrieve branch "
1081  "\"TofAccMCTrackPointMatch\" for MC comparison.";
1082  return kFALSE;
1083  }
1084 
1086  dynamic_cast<TClonesArray*>(fManager->GetObject("TofHitTrackMatch"));
1087  if (!fTofHitAccTrackMatches) {
1088  LOG(error)
1089  << "CbmTofAnaTestbeam::RegisterInputs => Could not retrieve branch "
1090  "\"TofHitTrackMatch\" for MC comparison.";
1091  return kFALSE;
1092  }
1093 
1094  if (fTofTrackColl) {
1096  dynamic_cast<TClonesArray*>(fManager->GetObject("TofTrackMatch"));
1098  LOG(error)
1099  << "CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1100  "branch \"TofTrackMatch\" for MC comparison.";
1101  return kFALSE;
1102  }
1103 
1104  fTofAccTrackTrackletMatches = dynamic_cast<TClonesArray*>(
1105  fManager->GetObject("TofAccMCTrackMatch"));
1107  LOG(error)
1108  << "CbmTofAnaTestbeam::RegisterInputs => Could not retrieve "
1109  "branch \"TofAccMCTrackMatch\" for MC comparison.";
1110  return kFALSE;
1111  }
1112  }
1113  } else {
1114  fMCTracks = tMCManager->InitBranch("MCTrack");
1115  if (!fMCTracks) {
1116  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not "
1117  "retrieve branch \"MCTrack\" for MC comparison.";
1118  return kFALSE;
1119  }
1120  }
1121  }
1122 
1123  } else {
1124  if (NULL == fTofDigisCollIn)
1125  fTofDigisCollIn = (TClonesArray*) fManager->GetObject("TofCalDigi");
1126  /*
1127  if( NULL == fTofDigisCollIn)
1128  fTofDigisCollIn = (TClonesArray *) fManager->GetObject("CbmTofDigi");
1129 
1130  if( NULL == fTofDigisCollIn)
1131  fTofDigisCollIn = (TClonesArray *) fManager->GetObject("CbmTofDigi");
1132 
1133  if( NULL == fTofDigisCollIn)
1134  fTofDigisCollIn = (TClonesArray *) fManager->GetObject("TofDigiExp");
1135 
1136  if( NULL == fTofDigisCollIn)
1137  fTofDigisCollIn = (TClonesArray *) fManager->GetObject("TofDigi");
1138  */
1139  if (NULL == fTofDigisCollIn) {
1140  LOG(WARNING)
1141  << "CbmTofAnaTestbeam::RegisterInputs => Could not get the TofDigi "
1142  "TClonesArray!!! ... continuing with incomplete input ";
1143  //return kFALSE;
1144  } // if( NULL == fTofDigisColl)
1145 
1146  fTofHitsCollIn = (TClonesArray*) fManager->GetObject("TofHit");
1147  if (NULL == fTofHitsCollIn) {
1148  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not get the "
1149  "TofHit TClonesArray!!!";
1150  return kFALSE;
1151  } // if( NULL == fTofHitsColl)
1152 
1153  fTofDigiMatchCollIn = (TClonesArray*) fManager->GetObject("TofDigiMatch");
1154  if (NULL == fTofDigiMatchCollIn) {
1156  (TClonesArray*) fManager->GetObject("TofCalDigiMatch");
1157  if (NULL == fTofDigiMatchCollIn) {
1158  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => Could not get the "
1159  "Match TClonesArray!!!";
1160  }
1161  } // if( NULL == fTofDigiMatchColl)
1162 
1163  fTofTrackCollIn = (TClonesArray*) fManager->GetObject("TofTracks");
1164  if (NULL == fTofTrackCollIn) {
1165  LOG(info) << "CbmTofAnaTestbeam::RegisterInputs => Could not get the "
1166  "TofTracklet TClonesArray!!!";
1167  // return kFALSE;
1168  } // if( NULL == fTofHitsColl)
1169 
1171  fDigiMan->Init();
1173  LOG(error) << GetName() << ": No input digis!";
1174  return kFALSE;
1175  } else
1176  LOG(info) << "DigiManager has Tof Digis";
1177 
1178  // Create work Arrays
1179  fTofDigisColl = new TClonesArray("CbmTofDigi", 100);
1180  fTofDigiMatchColl = new TClonesArray("CbmMatch", 100);
1181  fTofHitsColl = new TClonesArray("CbmTofHit", 100);
1182  fTofTrackColl = new TClonesArray("CbmTofTracklet", 100);
1183 
1184  if (fbMonteCarloComparison) {
1185  LOG(error) << "CbmTofAnaTestbeam::RegisterInputs => MC comparison not "
1186  "compatible with 'CbmEvent' processing!!!";
1187  fbMonteCarloComparison = kFALSE;
1188  }
1189  }
1190  return kTRUE;
1191 }
1192 /************************************************************************************/
1194 
1195  // Initialize the TOF GeoHandler
1196  Bool_t isSimulation = kFALSE;
1197  LOG(info) << "CbmTofAnaTestbeam::InitParameters - Geometry, Mapping, ... ";
1198  // Get Base Container
1199  FairRun* ana = FairRun::Instance();
1200  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
1201 
1202  Int_t iGeoVersion = fGeoHandler->Init(isSimulation);
1203  if (k14a > iGeoVersion) {}
1204 
1205  fDigiPar = (CbmTofDigiPar*) (rtdb->getContainer("CbmTofDigiPar"));
1206  if (0 == fDigiPar) {
1207  LOG(error) << "CbmTofAnaTestbeam::InitParameters => Could not obtain the "
1208  "CbmTofDigiPar ";
1209  return kFALSE;
1210  }
1211 
1212  fDigiBdfPar = (CbmTofDigiBdfPar*) (rtdb->getContainer("CbmTofDigiBdfPar"));
1213  if (0 == fDigiBdfPar) {
1214  LOG(error) << "CbmTofAnaTestbeam::InitParameters => Could not obtain the "
1215  "CbmTofDigiBdfPar ";
1216  return kFALSE;
1217  }
1218 
1219  // Mapping parameter
1220  /*
1221  fMbsMappingPar = (TMbsMappingTofPar*) (rtdb->getContainer("TMbsMappingTofPar"));
1222  if( 0 == fMbsMappingPar )
1223  {
1224  LOG(error)<<"CbmTofAnaTestBeam::InitParameters => Could not obtain the TMbsMappingTofPar ";
1225  return kFALSE;
1226  }
1227  */
1228  rtdb->initContainers(ana->GetRunId());
1229 
1230  LOG(info) << "CbmTofAnaTestbeam::InitParameter: currently "
1231  << fDigiPar->GetNrOfModules() << " digi cells ";
1232 
1233  // set defaults for backward compatibility to sep14
1234  if (0 == fiBeamRefAddr) {
1235  LOG(info)
1236  << "CbmTofAnaTestbeam::InitParameter: set beam ref to default (sep14) ";
1237  fiBeamRefSmType = 5;
1238  fiBeamRefSmId = 1;
1239  fiBeamRefAddr =
1241  }
1242  LOG(info) << Form("CbmTofAnaTestbeam::InitParameter BeamRef = %d, %d, 0x%08x",
1244  fiBeamRefSmId,
1245  fiBeamRefAddr);
1246 
1247  if (0 == fdDTD4MAX) fdDTD4MAX = DTDMAX;
1248 
1249  if (0. == fdChi2Lim) fdChi2Lim = 10.;
1250  if (0. == fdChi2Lim2) fdChi2Lim2 = fdChi2Lim;
1251  LOG(info) << "CbmTofAnaTestbeam::InitParameter: Chi2 limits initialized to "
1252  << fdChi2Lim << " and " << fdChi2Lim2;
1253  return kTRUE;
1254 }
1255 /************************************************************************************/
1257  if (fCalParFileName.IsNull()) return kTRUE;
1258 
1259  fCalParFile = new TFile(fCalParFileName, "");
1260  if (NULL == fCalParFile) {
1261  LOG(error) << "CbmTofAnaTestBeam::LoadCalParameter: "
1262  << "file " << fCalParFileName << " does not exist ";
1263  return kTRUE;
1264  }
1265 
1266  LOG(info) << "CbmTofAnaTestBeam::LoadCalParameter: "
1267  << "read from file " << fCalParFileName;
1268 
1269  TProfile* fhtmp =
1270  (TProfile*) gDirectory->FindObjectAny(Form("hDTD4DT04D4best_pfx_px"));
1271  if (NULL == fhtmp) {
1272  if (!fbUseSigCalib) {
1273  fdChi2Lim = fdChi2Lim * 100.;
1274  fdChi2Lim2 = fdChi2Lim2 * 100.;
1275  }
1276  LOG(info) << "Histo hDTD4DT04D4best_pfx_px not found => Chi2Lim = "
1277  << fdChi2Lim;
1278  }
1279 
1280  TProfile* fhtmpx =
1281  (TProfile*) gDirectory->FindObjectAny(Form("hDTX4D4best_pfx_px"));
1282  if (NULL == fhtmpx) {
1283  LOG(info) << " Histo " << Form("hDTX4D4best_pfx_px") << " not found. ";
1284  }
1285 
1286  TProfile* fhtmpy =
1287  (TProfile*) gDirectory->FindObjectAny(Form("hDTY4D4best_pfx_px"));
1288  if (NULL == fhtmpy) {
1289  LOG(info) << " Histo " << Form("hDTY4D4best_pfx_px") << " not found. ";
1290  }
1291 
1292  TProfile* fhtmpt =
1293  (TProfile*) gDirectory->FindObjectAny(Form("hTexpDT04D4best_pfx_px"));
1294  if (NULL == fhtmpt) {
1295  LOG(info) << " Histo " << Form("hTexpDT04D4best_pfx_px") << " not found. ";
1296  }
1297 
1298  TProfile* fhtmpcs0 =
1299  (TProfile*) gDirectory->FindObjectAny(Form("hCluSize0DT04D4best_pfx_px"));
1300  if (NULL == fhtmpcs0) {
1301  LOG(info) << " Histo " << Form("hCluSize0DT04D4best_pfx_px")
1302  << " not found. ";
1303  }
1304 
1305  TProfile* fhtmpcs4 =
1306  (TProfile*) gDirectory->FindObjectAny(Form("hCluSize4DT04D4best_pfx_px"));
1307  if (NULL == fhtmpcs4) {
1308  LOG(info) << " Histo " << Form("hCluSize4DT04D4best_pfx_px")
1309  << " not found. ";
1310  }
1311 
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. ";
1316  }
1317 
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. ";
1322  }
1323 
1324  TH1D* fhtmpstnnrt =
1325  (TH1D*) gDirectory->FindObjectAny(Form("hSelTypeNNResidualT_Width"));
1326  TH1D* fhtmpstnnrx =
1327  (TH1D*) gDirectory->FindObjectAny(Form("hSelTypeNNResidualX_Width"));
1328  TH1D* fhtmpstnnry =
1329  (TH1D*) gDirectory->FindObjectAny(Form("hSelTypeNNResidualY_Width"));
1330  TH1D* fhtmphtrxyt =
1331  (TH1D*) gDirectory->FindObjectAny(Form("hSelHitTupleResidualXYT_Width"));
1332 
1333  TH2D* fh2tmp = (TH2D*) gDirectory->FindObjectAny(Form("hDistDT04D4best"));
1334  if (NULL != fh2tmp) fdHitDistAv = fh2tmp->GetMean(1);
1335  if (fdHitDistAv <= 0.) fdHitDistAv = 1.;
1336  LOG(info) << "CbmTofAnaTestBeam::LoadCalParameter: average distance Dut - "
1337  "Ref initialized to "
1338  << Form("%5.1f", fdHitDistAv) << " cm ";
1339 
1340  gROOT->cd();
1341  if (NULL != fhtmp) fhDTD4DT04D4Off = (TH1D*) fhtmp->Clone();
1342  if (NULL != fhtmpx) fhDTX4D4Off = (TH1D*) fhtmpx->Clone();
1343  if (NULL != fhtmpy) fhDTY4D4Off = (TH1D*) fhtmpy->Clone();
1344  if (NULL != fhtmpt) fhDTTexpD4Off = (TH1D*) fhtmpt->Clone();
1345  if (NULL != fhtmpcs0) fhCluSize0DT04D4Off = (TH1D*) fhtmpcs0->Clone();
1346  if (NULL != fhtmpcs4) fhCluSize4DT04D4Off = (TH1D*) fhtmpcs4->Clone();
1347  if (NULL != fhtmptot0) fhTot0DT04D4Off = (TH1D*) fhtmptot0->Clone();
1348  if (NULL != fhtmptot4) fhTot4DT04D4Off = (TH1D*) fhtmptot4->Clone();
1349 
1350 
1351  if (NULL == fhtmpstnnrt) {
1352  LOG(info) << " Histo " << Form("hSelTypeNNResidualT_Width")
1353  << " not found. ";
1354  } else {
1355  if (fbUseSigCalib) {
1356  fhSelTypeNNResidualT_Width = (TH1D*) fhtmpstnnrt->Clone();
1357  }
1358  }
1359 
1360  if (NULL == fhSelTypeNNResidualT_Width) {
1362  new TH1F(Form("hSelTypeNNResidualT_Width"),
1363  Form("Sel-DUT ResiT Width vs SelType ; SelType ; RMS(T) (ns)"),
1364  3,
1365  0,
1366  3);
1367 
1368  fhSelTypeNNResidualT_Width->SetBinContent(1, fdDTWidth);
1369  fhSelTypeNNResidualT_Width->SetBinContent(2, fSIGT);
1370  fhSelTypeNNResidualT_Width->SetBinContent(3, fdMCSIGT);
1371  }
1372 
1373  if (NULL == fhtmpstnnrx) {
1374  LOG(info) << " Histo " << Form("hSelTypeNNResidualX_Width")
1375  << " not found. ";
1376  } else {
1377  if (fbUseSigCalib) {
1378  fhSelTypeNNResidualX_Width = (TH1D*) fhtmpstnnrx->Clone();
1379  }
1380  }
1381 
1382  if (NULL == fhSelTypeNNResidualX_Width) {
1384  new TH1F(Form("hSelTypeNNResidualX_Width"),
1385  Form("Sel-DUT ResiX Width vs SelType ; SelType ; RMS(X) (cm)"),
1386  3,
1387  0,
1388  3);
1389 
1390  fhSelTypeNNResidualX_Width->SetBinContent(1, fdDXWidth);
1391  fhSelTypeNNResidualX_Width->SetBinContent(2, fSIGX);
1392  fhSelTypeNNResidualX_Width->SetBinContent(3, fdMCSIGX);
1393  }
1394 
1395  if (NULL == fhtmpstnnry) {
1396  LOG(info) << " Histo " << Form("hSelTypeNNResidualY_Width")
1397  << " not found. ";
1398  } else {
1399  if (fbUseSigCalib) {
1400  fhSelTypeNNResidualY_Width = (TH1D*) fhtmpstnnry->Clone();
1401  }
1402  }
1403 
1404  if (NULL == fhSelTypeNNResidualY_Width) {
1406  new TH1F(Form("hSelTypeNNResidualY_Width"),
1407  Form("Sel-DUT ResiY Width vs SelType ; SelType ; RMS(Y) (cm)"),
1408  3,
1409  0,
1410  3);
1411 
1412  fhSelTypeNNResidualY_Width->SetBinContent(1, fdDYWidth);
1413  fhSelTypeNNResidualY_Width->SetBinContent(2, fSIGY);
1414  fhSelTypeNNResidualY_Width->SetBinContent(3, fdMCSIGY);
1415  }
1416 
1417  if (NULL == fhtmphtrxyt) {
1418  LOG(info) << " Histo " << Form("hSelHitTupleResidualXYT_Width")
1419  << " not found. ";
1420  } else {
1421  if (fbUseSigCalib) {
1422  fhSelHitTupleResidualXYT_Width = (TH1D*) fhtmphtrxyt->Clone();
1423  }
1424  }
1425 
1426  if (NULL == fhSelHitTupleResidualXYT_Width) {
1427  fhSelHitTupleResidualXYT_Width = new TH1F(
1428  Form("hSelHitTupleResidualXYT_Width"),
1429  Form("Sel hit tuple Resi XYT Width; X/Y/T [] ; RMS(X/Y/T) (cm/cm/ns)"),
1430  3,
1431  0,
1432  3);
1433 
1434  fhSelHitTupleResidualXYT_Width->SetBinContent(1, fdDXWidth);
1435  fhSelHitTupleResidualXYT_Width->SetBinContent(2, fdDYWidth);
1436  fhSelHitTupleResidualXYT_Width->SetBinContent(3, fdDTWidth);
1437  }
1438 
1439  fCalParFile->Close();
1440  // fhDTD4DT04D4Off->Draw();
1441 
1442  if (fdDCh4Sel == 0.) fdDCh4Sel = 1000.; // open default window
1443  if (fdPosY4Sel == 0.) fdPosY4Sel = 10.; // open default window
1444 
1445  return kTRUE;
1446 }
1447 /************************************************************************************/
1448 // ------------------------------------------------------------------
1450  // Create histogramms
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.;
1457  /* Double_t XMAX=100.;*/
1458  /* Double_t YMAX=100.;*/
1459 
1460  TDirectory* oldir =
1461  gDirectory; // <= To prevent histos from being sucked in by the param file of the TRootManager!
1462  gROOT
1463  ->cd(); // <= To prevent histos from being sucked in by the param file of the TRootManager !
1464 
1465  // define histos here
1466  Double_t TISmax = 11.; //fdSpillDuration;
1467  Double_t TISnbins = 110.; //50.;
1468  fhRate_all =
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);
1472  fhTriggerType =
1473  new TH1I("tof_trb_trigger_types", "CTS trigger types", 16, 0, 16);
1474  fhTimeInSpill =
1475  new TH1I("tof_trb_time_in_spill", "Time in Spill", TISnbins, 0, TISmax);
1476  fhTIS_all =
1477  new TH1F("TIS_all", "Time in Spill (all); t (sec)", TISnbins, 0, TISmax);
1478  fhTIS_sel =
1479  new TH1F("TIS_sel", "Time in Spill (sel); t (sec)", TISnbins, 0, TISmax);
1480  fhTIS_sel1 =
1481  new TH1F("TIS_sel1", "Time in Spill (sel1); t (sec)", TISnbins, 0, TISmax);
1482  fhTIS_sel2 =
1483  new TH1F("TIS_sel2", "Time in Spill (sel2); t (sec)", TISnbins, 0, TISmax);
1484 
1485 
1486  Double_t TIRmax = 1800.; // Run duration
1487  Double_t TIRnbins = 18000.;
1488  fhTIR_all =
1489  new TH1F("TIR_all", "Time in Run (all); t (sec)", TIRnbins, 0, TIRmax);
1490  fhTIR_sel =
1491  new TH1F("TIR_sel", "Time in Run (sel); t (sec)", TIRnbins, 0, TIRmax);
1492  fhTIR_sel1 =
1493  new TH1F("TIR_sel1", "Time in Run (sel1); t (sec)", TIRnbins, 0, TIRmax);
1494  fhTIR_sel2 =
1495  new TH1F("TIR_sel2", "Time in Run (sel2); t (sec)", TIRnbins, 0, TIRmax);
1496 
1497  Double_t TISmax2 = 11.;
1498  Double_t TISnbins2 = 110.;
1499  fhTIS_Nhit = new TH2F("TIS_Nhit",
1500  "Time in Spill (Nhit); t (sec); N_{hit}",
1501  TISnbins2,
1502  0,
1503  TISmax2,
1504  25,
1505  0,
1506  50);
1507  fhTIS_Ntrk = new TH2F("TIS_Ntrk",
1508  "Time in Spill (Ntrk); t (sec); N_{trk}",
1509  TISnbins2,
1510  0,
1511  TISmax2,
1512  10,
1513  0,
1514  10);
1515 
1516  fhDTLH_all =
1517  new TH1F("hDTLH_all",
1518  "Time to last hit in Dut(all); log( #DeltaT (ns)); counts",
1519  100.,
1520  0.,
1521  12.);
1522  fhDTLH_sel =
1523  new TH1F("hDTLH_sel",
1524  "Time to last hit in Dut(sel); log( #DeltaT (ns)); counts",
1525  100.,
1526  0.,
1527  12.);
1528  fhDTLH_sel1 =
1529  new TH1F("hDTLH_sel1",
1530  "Time to last hit in Dut(sel1); log( #DeltaT (ns)); counts",
1531  100.,
1532  0.,
1533  12.);
1534  fhDTLH_sel2 =
1535  new TH1F("hDTLH_sel2",
1536  "Time to last hit in Dut(sel2); log( #DeltaT (ns)); counts",
1537  100.,
1538  0.,
1539  12.);
1540  fhDTLH_DStrip = new TH2F("hDTLH_DStrip",
1541  "Time to last hit strip matching Dut(sel1); strip ; "
1542  "Channel-PredictedChannel",
1543  32,
1544  0,
1545  31,
1546  7.,
1547  -3.5,
1548  3.5);
1549 
1550  fhBRefMul = new TH1F(Form("hBRefMul"),
1551  Form("Multiplicity in Beam Reference counter ; Mul ()"),
1552  50,
1553  0.,
1554  50.);
1555  fhDTD4 = new TH1F(
1556  Form("hDTD4"), Form("reference time ; #Delta tD4 (ns)"), 101, -100., 100.);
1557 
1558  Int_t iNbDet = fDigiBdfPar->GetNbDet(); //fMbsMappingPar->GetNbMappedDet();
1559  fhXYPos.resize(iNbDet);
1560  for (Int_t iDet = 0; iDet < iNbDet; iDet++) {
1561  fhXYPos[iDet] =
1562  new TH2F(Form("hXY_SmT%d", iDet),
1563  Form("XY Position correlation of Det# %d; X[cm]; Y [cm]", iDet),
1564  100,
1565  -YDMAX / 2.,
1566  YDMAX / 2.,
1567  100,
1568  -YDMAX,
1569  0.);
1570  }
1571 
1572  fhEtaPhi = new TH2F(Form("hEtaPhi"),
1573  Form("Reconstructed Tof Hits; #phi (degree) ; #eta"),
1574  200,
1575  -20.,
1576  20.,
1577  200,
1578  1.,
1579  1.7);
1580 
1581  fhXX2 = new TH2F(Form("hXX2"),
1582  Form("Plastic position correlation; XPla0; XPla1"),
1583  100,
1584  -XDMAX,
1585  XDMAX,
1586  100,
1587  -XDMAX,
1588  XDMAX);
1589  fhYY2 = new TH2F(Form("hYY2"),
1590  Form("Plastic position correlation; YPla0; YPla1"),
1591  100,
1592  -YDMAX,
1593  YDMAX,
1594  100,
1595  -YDMAX,
1596  YDMAX);
1597  fhDT2 = new TH1F(Form("hDT2"),
1598  Form("Plastic time difference; TPla0 - TPla1 (ns)"),
1599  100,
1600  -1.,
1601  1.);
1602 
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"),
1606  100,
1607  -YDMAX,
1608  YDMAX,
1609  100,
1610  -YDMAX,
1611  YDMAX);
1612  fhYY02[iDet] = new TH2F(Form("hYY02_%d", iDet),
1613  Form("Y Position correlation; Y0; Y2"),
1614  100,
1615  -YDMAX,
1616  YDMAX,
1617  100,
1618  -YDMAX,
1619  YDMAX);
1620  }
1621 
1622  const Double_t HTMAX = 100.;
1623  const Double_t HYMAX = 40.;
1624  fhDutDXDYDT =
1625  new TH3F(Form("hDutDXDYDT"),
1626  Form("Hits distances; #DeltaX [cm]; #DeltaY [cm]; #DeltaT [ns]"),
1627  101,
1628  -HYMAX,
1629  HYMAX,
1630  101,
1631  -HYMAX,
1632  HYMAX,
1633  101,
1634  -HTMAX,
1635  HTMAX);
1636  fhRefDXDYDT =
1637  new TH3F(Form("hRefDXDYDT"),
1638  Form("Hits distances; #DeltaX [cm]; #DeltaY [cm]; #DeltaT [ns]"),
1639  101,
1640  -HYMAX,
1641  HYMAX,
1642  101,
1643  -HYMAX,
1644  HYMAX,
1645  101,
1646  -HTMAX,
1647  HTMAX);
1648 
1649  fhXX04 = new TH2F(Form("hXX04"),
1650  Form("X Position correlation; X0 [cm]; X4 [cm]"),
1651  500,
1652  -YDMAX,
1653  YDMAX,
1654  500,
1655  -YDMAX,
1656  YDMAX);
1657  fhYY04 = new TH2F(Form("hYY04"),
1658  Form("Y Position correlation; Y0 [cm]; Y4 [cm]"),
1659  500,
1660  -YDMAX,
1661  YDMAX,
1662  500,
1663  -YDMAX,
1664  YDMAX);
1665  fhXY04 = new TH2F(Form("hXY04"),
1666  Form("X Position correlation; X0 [cm]; Y4 [cm]"),
1667  500,
1668  -YDMAX,
1669  YDMAX,
1670  500,
1671  -YDMAX,
1672  YDMAX);
1673  fhYX04 = new TH2F(Form("hYX04"),
1674  Form("Y Position correlation; Y0 [cm]; X4 [cm]"),
1675  500,
1676  -YDMAX,
1677  YDMAX,
1678  500,
1679  -YDMAX,
1680  YDMAX);
1681  fhTT04 = new TH2F(Form("hTT04"),
1682  Form("Time correlation; T0 [ns]; T0 - T4 [ns]"),
1683  100,
1684  -TDMAX,
1685  TDMAX,
1686  100,
1687  -1.,
1688  1.);
1689  fhDXDY04 = new TH2F(Form("hDXDY04"),
1690  Form("position correlation; #Delta x [cm]; #DeltaY [cm]"),
1691  100,
1692  -DXMAX,
1693  DXMAX,
1694  100,
1695  -DYMAX,
1696  DYMAX);
1697  fhDXDT04 =
1698  new TH2F(Form("hDXDT04"),
1699  Form("Time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1700  100,
1701  -DXMAX,
1702  DXMAX,
1703  100,
1704  -DTMAX,
1705  DTMAX);
1706  fhDYDT04 =
1707  new TH2F(Form("hDYDT04"),
1708  Form("Time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1709  100,
1710  -DYMAX,
1711  DYMAX,
1712  100,
1713  -DTMAX,
1714  DTMAX);
1715  fhChi04 = new TH1F(
1716  Form("hChi04"), Form("Matching Chi2; #chi; Nhits"), 100, 0., fdChi2Lim);
1717  fhChiSel24 = new TH1F(Form("hChiSel24"),
1718  Form("Matching Chi2S24; #chi; Nhits"),
1719  100,
1720  0.,
1721  fdChi2Lim2);
1722  fhDXSel24 = new TH1F(Form("hDXSel24"),
1723  Form("Matching Sel24; #Delta x [cm]; Nhits"),
1724  100,
1725  -10.,
1726  10.);
1727  fhDYSel24 = new TH1F(Form("hDYSel24"),
1728  Form("Matching Sel24; #Delta y [cm]; Nhits"),
1729  100,
1730  -10.,
1731  10.);
1732  fhDTSel24 = new TH1F(Form("hDTSel24"),
1733  Form("Matching Sel24; #Delta t_{cor} [ns]; Nhits"),
1734  100,
1735  -1.,
1736  1.);
1737  fhTofSel24 = new TH1F(Form("hTofSel24"),
1738  Form("Matching Sel24; #Delta t [ns]; Nhits"),
1739  100,
1740  -10.,
1741  10.);
1742  Int_t iNbinXY = 34;
1743  fhXY0D4best = new TH2F(Form("hXY0D4best"),
1744  Form("local position 0; x [cm]; y [cm]"),
1745  iNbinXY,
1746  -17.,
1747  17.,
1748  iNbinXY,
1749  -17.,
1750  17.);
1751  fhXY4D4best = new TH2F(Form("hXY4D4best"),
1752  Form("local position 4; x [cm]; y [cm]"),
1753  iNbinXY,
1754  -17.,
1755  17.,
1756  iNbinXY,
1757  -17.,
1758  17.);
1759  fhXX04D4best = new TH2F(Form("hXX04D4best"),
1760  Form("local x position 0-4; x0 [cm]; x4 [cm]"),
1761  iNbinXY,
1762  -17.,
1763  17.,
1764  iNbinXY,
1765  -17.,
1766  17.);
1767  fhYY04D4best = new TH2F(Form("hYY04D4best"),
1768  Form("local y position 0-4; y0 [cm]; y4 [cm]"),
1769  iNbinXY,
1770  -17.,
1771  17.,
1772  iNbinXY,
1773  -17.,
1774  17.);
1775  fhXYSel2D4best = new TH2F(Form("hXYSel2D4best"),
1776  Form("local position Sel2; x [cm]; y [cm]"),
1777  iNbinXY,
1778  -17.,
1779  17.,
1780  iNbinXY,
1781  -17.,
1782  17.);
1783  fhXY0D4sel = new TH2F(Form("hXY0D4sel"),
1784  Form("predicted position 0; x [cm]; y [cm]"),
1785  iNbinXY,
1786  -17.,
1787  17.,
1788  iNbinXY,
1789  -17.,
1790  17.);
1791  fhXY4D4sel = new TH2F(Form("hXY4D4sel"),
1792  Form("selected position 4; x [cm]; y [cm]"),
1793  iNbinXY,
1794  -17.,
1795  17.,
1796  iNbinXY,
1797  -17.,
1798  17.);
1799  fhXYSel2D4sel = new TH2F(Form("hXYSel2D4sel"),
1800  Form("selected position Sel2; x [cm]; y [cm]"),
1801  iNbinXY,
1802  -17.,
1803  17.,
1804  iNbinXY,
1805  -17.,
1806  17.);
1807 
1808  fhDXDY04best =
1809  new TH2F(Form("hDXDY04best"),
1810  Form("position correlation; #Delta x [cm]; #DeltaY [cm]"),
1811  100,
1812  -DXMAX,
1813  DXMAX,
1814  100,
1815  -DYMAX,
1816  DYMAX);
1817  fhDXDT04best =
1818  new TH2F(Form("hDXDT04best"),
1819  Form("time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1820  100,
1821  -DXMAX,
1822  DXMAX,
1823  100,
1824  -DTMAX,
1825  DTMAX);
1826  fhDYDT04best =
1827  new TH2F(Form("hDYDT04best"),
1828  Form("time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1829  100,
1830  -DYMAX,
1831  DYMAX,
1832  100,
1833  -DTMAX,
1834  DTMAX);
1835 
1836  fhX0DT04best =
1837  new TH2F(Form("hX0DT04best"),
1838  Form("time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1839  100,
1840  -50.,
1841  50.,
1842  100,
1843  -DTMAX,
1844  DTMAX);
1845  fhY0DT04best =
1846  new TH2F(Form("hY0DT04best"),
1847  Form("time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1848  100,
1849  -50.,
1850  50.,
1851  100,
1852  -DTMAX,
1853  DTMAX);
1854 
1855  fhChi04best = new TH1F(
1856  Form("hChi04best"), Form("matching chi2; #chi; Nhits"), 100, 0., fdChi2Lim);
1857  fhDigiMul0best = new TH1F(Form("hDigiMul0best"),
1858  Form("Number of digis in cluster; N_{digi}; "),
1859  40,
1860  0.,
1861  40.);
1862  fhDigiMul4best = new TH1F(Form("hDigiMul4best"),
1863  Form("Number of digis in cluster; N_{digi}; "),
1864  40,
1865  0.,
1866  40.);
1867 
1868  fhChiDT04best = new TH2F(Form("hChiDT04best"),
1869  Form("Time - Chi correlation; #chi; #DeltaT [ns]"),
1870  100,
1871  0.,
1872  100.,
1873  100,
1874  -DTMAX,
1875  DTMAX);
1876 
1877  fhDXDY04D4best =
1878  new TH2F(Form("hDXDY04D4best"),
1879  Form("position correlation; #Delta x [cm]; #DeltaY [cm]"),
1880  100,
1881  -DXMAX,
1882  DXMAX,
1883  100,
1884  -DYMAX,
1885  DYMAX);
1886  fhDXDT04D4best =
1887  new TH2F(Form("hDXDT04D4best"),
1888  Form("time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1889  100,
1890  -DXMAX,
1891  DXMAX,
1892  100,
1893  -DTMAX,
1894  DTMAX);
1895  fhDYDT04D4best =
1896  new TH2F(Form("hDYDT04D4best"),
1897  Form("time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1898  100,
1899  -DYMAX,
1900  DYMAX,
1901  100,
1902  -DTMAX,
1903  DTMAX);
1905  new TH2F(Form("hDistDT04D4best"),
1906  Form("time - distance correlation; Dist [cm]; #DeltaT [ns]"),
1907  100,
1908  fdHitDistMin,
1909  fdHitDistMin + 30.,
1910  100,
1911  -DTMAX,
1912  DTMAX);
1913  fhTexpDT04D4best = new TH2F(
1914  Form("hTexpDT04D4best"),
1915  Form("measured - expected time - correlation; Texp [ns]; #DeltaT [ns]"),
1916  100,
1917  0.,
1918  1.,
1919  100,
1920  -DTMAX,
1921  DTMAX);
1923  new TH2F(Form("hCluSize0DT04D4best"),
1924  Form("time - CluSize correlation; M_{strips} ; #DeltaT [ns]"),
1925  20,
1926  0.5,
1927  20.5,
1928  100,
1929  -DTMAX,
1930  DTMAX);
1932  new TH2F(Form("hCluSize4DT04D4best"),
1933  Form("time - CluSize correlation; M_{strips} ; #DeltaT [ns]"),
1934  20,
1935  0.5,
1936  20.5,
1937  100,
1938  -DTMAX,
1939  DTMAX);
1940  fhCluSizeSigT0D4best = new TH2F(
1941  Form("hCluSizeSigT0D4best"),
1942  Form("time spread - CluSize correlation; M_{strips} ; #sigma_{T} [ns]"),
1943  20,
1944  0.5,
1945  20.5,
1946  100,
1947  0.,
1948  DTMAX / 5.);
1949  fhCluSizeSigT4D4best = new TH2F(
1950  Form("hCluSizeSigT4D4best"),
1951  Form("time spread - CluSize correlation; M_{strips} ; #sigma_{T} [ns]"),
1952  20,
1953  0.5,
1954  20.5,
1955  100,
1956  0.,
1957  DTMAX / 5.);
1959  new TH2F(Form("hTot0DT04D4best"),
1960  Form("time - Tot correlation; ln TOT0 ; #DeltaT [ns]"),
1961  100,
1962  -2.5,
1963  3.0,
1964  100,
1965  -DTMAX,
1966  DTMAX);
1968  new TH2F(Form("hTot4DT04D4best"),
1969  Form("time - Tot correlation; ln TOT4 ; #DeltaT [ns]"),
1970  100,
1971  -2.5,
1972  3.0,
1973  100,
1974  -DTMAX,
1975  DTMAX);
1976 
1977  fhX0DT04D4best =
1978  new TH2F(Form("hX0DT04D4best"),
1979  Form("time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1980  100,
1981  -50.,
1982  50.,
1983  100,
1984  -DTMAX,
1985  DTMAX);
1986  fhY0DT04D4best =
1987  new TH2F(Form("hY0DT04D4best"),
1988  Form("time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1989  100,
1990  -50.,
1991  50.,
1992  100,
1993  -DTMAX,
1994  DTMAX);
1995 
1996  fhTISDT04D4best =
1997  new TH2F(Form("hTISDT04D4best"),
1998  Form("time - TIS; time in spill [s]; #DeltaT [ns]"),
1999  TISnbins,
2000  0.,
2001  TISmax,
2002  100,
2003  -DTMAX,
2004  DTMAX);
2005 
2006  fhChi04D4best = new TH1F(Form("hChi04D4best"),
2007  Form("matching chi2; #chi; Nhits"),
2008  100,
2009  0.,
2010  fdChi2Lim);
2011  fhTofD4best =
2012  new TH1F(Form("hTofD4best"), Form("tof D4; t [ns]; Counts"), 100, 0., 50.);
2013  fhVelD4best = new TH1F(
2014  Form("hVelD4best"), Form("vel D4; v [cm/ns]; Counts"), 100, 0., 50.);
2015 
2017  new TH2F(Form("hDigiMul0D4best"),
2018  Form("Number of digis in cluster; Mul0; N_{strips}; "),
2019  40,
2020  0.,
2021  40.,
2022  40,
2023  0.,
2024  40.);
2026  new TH2F(Form("hDigiMul4D4best"),
2027  Form("Number of digis in cluster; Mul4; N_{strips}; "),
2028  40,
2029  0.,
2030  40.,
2031  40,
2032  0.,
2033  40.);
2035  new TH2F(Form("hCluSize04D4best"),
2036  Form("cluster multiplicity ; CluSize0; CluSize4"),
2037  40,
2038  0.,
2039  40.,
2040  40,
2041  0.,
2042  40.);
2043  fhCluMul04D4best = new TH2F(Form("hCluMul04D4best"),
2044  Form("cluster size correlation ; Mul0; Mul4"),
2045  40,
2046  0.,
2047  40.,
2048  20,
2049  0.,
2050  20.);
2051  fhStrMul04D4best = new TH2F(Form("hStrMul04D4best"),
2052  Form("strip multiplicity ; StrMul0; StrMul4"),
2053  50,
2054  0.,
2055  50.,
2056  50,
2057  0.,
2058  50.);
2060  new TH2F(Form("hCluMulTSig0D4best"),
2061  Form("time spread - cluster multiplicity ; Mul0; #sigma_{T} (ns)"),
2062  50,
2063  0.,
2064  50.,
2065  100,
2066  0.,
2067  200.);
2069  new TH2F(Form("hCluMulTSig4D4best"),
2070  Form("time spread - cluster multiplicity ; Mul4; #sigma_{T} (ns)"),
2071  50,
2072  0.,
2073  50.,
2074  100,
2075  0.,
2076  200.);
2078  new TH2F(Form("hCluMulTrel0D4best"),
2079  Form("arrrival time - cluster multiplicity ; Mul0; T_{rel} (ns)"),
2080  50,
2081  0.,
2082  50.,
2083  99,
2084  -10.,
2085  10.);
2087  new TH2F(Form("hCluMulTrel4D4best"),
2088  Form("arrival time - cluster multiplicity ; Mul4; T_{rel} (ns)"),
2089  50,
2090  0.,
2091  50.,
2092  99,
2093  -10.,
2094  10.);
2096  new TH2F(Form("hCluSizeTrel0D4best"),
2097  Form("arrrival time - cluster size ; CluSize0; T_{rel} (ns)"),
2098  30,
2099  0.,
2100  30.,
2101  99,
2102  -10.,
2103  10.);
2105  new TH2F(Form("hCluSizeTrel4D4best"),
2106  Form("arrival time - cluster size ; CluSize4; T_{rel} (ns)"),
2107  30,
2108  0.,
2109  30.,
2110  99,
2111  -10.,
2112  10.);
2113 
2114  fhChiDT04D4best =
2115  new TH2F(Form("hChiDT04D4best"),
2116  Form("Time - position correlation; #chi; #DeltaT [ns]"),
2117  100,
2118  0.,
2119  100.,
2120  100,
2121  -DTMAX,
2122  DTMAX);
2123  Double_t dtscal = 5.;
2124  if (fdChi2Lim > 100.) dtscal *= 2.;
2125  fhDTD4DT04D4best = new TH2F(
2126  Form("hDTD4DT04D4best"),
2127  Form("Time - velocity correlation; #DeltaTD4 [ns]; #DeltaT04 [ns]"),
2128  100,
2129  -DTMAX * 6.,
2130  DTMAX * 6.,
2131  500,
2132  -DTMAX * dtscal,
2133  DTMAX * dtscal);
2134 
2135  /* Double_t dXMAX=30.;*/
2136  /* Double_t dYMAX=20.;*/
2137  fhDTMul4D4best = new TH2F(
2138  Form("hDTMul4D4best"),
2139  Form("MRef Time - Multiplicity correlation; Mul4 ; #DeltaT04 [ns]"),
2140  20,
2141  0.,
2142  20.,
2143  100,
2144  -DTMAX,
2145  DTMAX);
2146  fhDTX4D4best =
2147  new TH2F(Form("hDTX4D4best"),
2148  Form("MRef Time - position correlation; X4 [cm]; #DeltaT04 [ns]"),
2149  50,
2150  -17.,
2151  17.,
2152  100,
2153  -DTMAX,
2154  DTMAX);
2155  fhDTY4D4best =
2156  new TH2F(Form("hDTY4D4best"),
2157  Form("MRef Time - position correlation; Y4 [cm]; #DeltaT04 [ns]"),
2158  50,
2159  -15.,
2160  15.,
2161  100,
2162  -DTMAX,
2163  DTMAX);
2164  fhDXX4D4best =
2165  new TH2F(Form("hDXX4D4best"),
2166  Form("MRef DX - position correlation; X4 [cm]; #DeltaX04 [cm]"),
2167  50,
2168  -17.,
2169  17.,
2170  50,
2171  -10.,
2172  10.);
2173  fhDXY4D4best =
2174  new TH2F(Form("hDXY4D4best"),
2175  Form("MRef DX - position correlation; Y4 [cm]; #DeltaX04 [cm]"),
2176  50,
2177  -15.,
2178  15.,
2179  50,
2180  -10.,
2181  10.);
2182  fhDYX4D4best =
2183  new TH2F(Form("hDYX4D4best"),
2184  Form("MRef DY - position correlation; X4 [cm]; #DeltaY04 [cm]"),
2185  50,
2186  -17.,
2187  17.,
2188  50,
2189  -10.,
2190  10.);
2191  fhDYY4D4best =
2192  new TH2F(Form("hDYY4D4best"),
2193  Form("MRef DY - position correlation; Y4 [cm]; #DeltaY04 [cm]"),
2194  50,
2195  -15.,
2196  15.,
2197  50,
2198  -10.,
2199  10.);
2200 
2201  fhDTMul0D4best =
2202  new TH2F(Form("hDTMul0D4best"),
2203  Form("Dut Time - Multiplicity correlation; Mul0 ; #DeltaT04 [ns]"),
2204  40,
2205  0.,
2206  40.,
2207  100,
2208  -DTMAX,
2209  DTMAX);
2210  fhDTX0D4best =
2211  new TH2F(Form("hDTX0D4best"),
2212  Form("Dut Time - position correlation; X0 [cm]; #DeltaT04 [ns]"),
2213  50,
2214  -17.,
2215  17.,
2216  100,
2217  -DTMAX,
2218  DTMAX);
2219  fhDTY0D4best =
2220  new TH2F(Form("hDTY0D4best"),
2221  Form("Dut Time - position correlation; Y0 [cm]; #DeltaT04 [ns]"),
2222  50,
2223  -15.,
2224  15.,
2225  100,
2226  -DTMAX,
2227  DTMAX);
2228  fhDXX0D4best =
2229  new TH2F(Form("hDXX0D4best"),
2230  Form("Dut DX - position correlation; X0 [cm]; #DeltaX04 [cm]"),
2231  50,
2232  -17.,
2233  17.,
2234  50,
2235  -15.,
2236  15.);
2237  fhDXY0D4best =
2238  new TH2F(Form("hDXY0D4best"),
2239  Form("Dut DX - position correlation; Y0 [cm]; #DeltaX04 [cm]"),
2240  50,
2241  -15.,
2242  15.,
2243  50,
2244  -15.,
2245  15.);
2246  fhDYX0D4best =
2247  new TH2F(Form("hDYX0D4best"),
2248  Form("Dut DY - position correlation; X0 [cm]; #DeltaY04 [cm]"),
2249  50,
2250  -17.,
2251  17.,
2252  50,
2253  -15.,
2254  15.);
2255  fhDYY0D4best =
2256  new TH2F(Form("hDYY0D4best"),
2257  Form("Dut DY - position correlation; Y0 [cm]; #DeltaY04 [cm]"),
2258  50,
2259  -15.,
2260  15.,
2261  50,
2262  -15.,
2263  15.);
2264 
2265 
2266  fhX0DT04D4sbest =
2267  new TH2F(Form("hX0DT04D4sbest"),
2268  Form("time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
2269  100,
2270  -50.,
2271  50.,
2272  100,
2273  -DTMAX,
2274  DTMAX);
2275  fhY0DT04D4sbest =
2276  new TH2F(Form("hY0DT04D4sbest"),
2277  Form("time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
2278  100,
2279  -50.,
2280  50.,
2281  100,
2282  -DTMAX,
2283  DTMAX);
2284 
2285  fhDXDY04D4sbest =
2286  new TH2F(Form("hDXDY04D4sbest"),
2287  Form("position correlation; #Delta x [cm]; #DeltaY [cm]"),
2288  100,
2289  -DXMAX,
2290  DXMAX,
2291  100,
2292  -DYMAX,
2293  DYMAX);
2294  fhDXDT04D4sbest =
2295  new TH2F(Form("hDXDT04D4sbest"),
2296  Form("time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
2297  100,
2298  -DXMAX,
2299  DXMAX,
2300  100,
2301  -DTMAX,
2302  DTMAX);
2303  fhDYDT04D4sbest =
2304  new TH2F(Form("hDYDT04D4sbest"),
2305  Form("time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
2306  100,
2307  -DYMAX,
2308  DYMAX,
2309  100,
2310  -DTMAX,
2311  DTMAX);
2313  new TH2F(Form("hDistDT04D4sbest"),
2314  Form("time - distance correlation; Dist [cm]; #DeltaT [ns]"),
2315  100,
2316  fdHitDistMin,
2317  fdHitDistMin + 30.,
2318  100,
2319  -DTMAX,
2320  DTMAX);
2321  fhTexpDT04D4sbest = new TH2F(
2322  Form("hTexpDT04D4sbest"),
2323  Form("measured - expected time - correlation; Texp [ns]; #DeltaT [ns]"),
2324  100,
2325  0.,
2326  6.,
2327  100,
2328  -DTMAX,
2329  DTMAX);
2331  new TH2F(Form("hCluSize0DT04D4sbest"),
2332  Form("time - CluSize correlation; N_{strips} ; #DeltaT [ns]"),
2333  20,
2334  0.5,
2335  20.5,
2336  100,
2337  -DTMAX,
2338  DTMAX);
2340  new TH2F(Form("hCluSize4DT04D4sbest"),
2341  Form("time - CluSize correlation; N_{strips} ; #DeltaT [ns]"),
2342  20,
2343  0.5,
2344  20.5,
2345  100,
2346  -DTMAX,
2347  DTMAX);
2349  new TH2F(Form("hTot0DT04D4sbest"),
2350  Form("time - Tot correlation; ln TOT0 ; #DeltaT [ns]"),
2351  100,
2352  6.5,
2353  9.5,
2354  100,
2355  -DTMAX,
2356  DTMAX);
2358  new TH2F(Form("hTot4DT04D4sbest"),
2359  Form("time - Tot correlation; ln TOT4 ; #DeltaT [ns]"),
2360  100,
2361  6.5,
2362  9.5,
2363  100,
2364  -DTMAX,
2365  DTMAX);
2366 
2367  fhChi04D4sbest = new TH1F(Form("hChi04D4sbest"),
2368  Form("matching chi2; #chi; Nhits"),
2369  100,
2370  0.,
2371  fdChi2Lim);
2372  fhTofD4sbest =
2373  new TH1F(Form("hTofD4sbest"), Form("tof D4; t [ns]; Counts"), 100, 0., 50.);
2374  fhVelD4sbest = new TH1F(
2375  Form("hVelD4sbest"), Form("vel D4; v [cm/ns]; Counts"), 100, 0., 50.);
2376 
2377  fhDigiMul0D4sbest = new TH1F(Form("hDigiMul0D4sbest"),
2378  Form("Number of digis in cluster; N_{digi}; "),
2379  20,
2380  0.,
2381  20.);
2382  fhDigiMul4D4sbest = new TH1F(Form("hDigiMul4D4sbest"),
2383  Form("Number of digis in cluster; N_{digi}; "),
2384  20,
2385  0.,
2386  20.);
2387  fhCluMul04D4sbest = new TH2F(Form("hCluMul04D4sbest"),
2388  Form("cluster multiplicity ; Mul0; Mul4"),
2389  10,
2390  0.,
2391  10.,
2392  10,
2393  0.,
2394  10.);
2395 
2397  new TH2F(Form("hChiDT04D4sbest"),
2398  Form("Time - position correlation; #chi; #DeltaT [ns]"),
2399  100,
2400  0.,
2401  100.,
2402  100,
2403  -DTMAX,
2404  DTMAX);
2405 
2406  fhDTD4DT04D4sbest = new TH2F(
2407  Form("hDTD4DT04D4sbest"),
2408  Form("Time - velocity correlation; #DeltaTD4 [ns]; #DeltaT04 [ns]"),
2409  100,
2410  -DTMAX * 6.,
2411  DTMAX * 6.,
2412  100,
2413  -DTMAX,
2414  DTMAX);
2415 
2416  fhDTMul4D4sbest =
2417  new TH2F(Form("hDTMul4D4sbest"),
2418  Form("Time - Multiplicity correlation; Mul4 ; #DeltaT04 [ns]"),
2419  10,
2420  0.,
2421  10.,
2422  100,
2423  -DTMAX,
2424  DTMAX);
2425  fhDTX4D4sbest =
2426  new TH2F(Form("hDTX4D4sbest"),
2427  Form("Time - position correlation; X4 [cm]; #DeltaT04 [ns]"),
2428  50,
2429  -15.,
2430  15.,
2431  100,
2432  -DTMAX,
2433  DTMAX);
2434  fhDTY4D4sbest =
2435  new TH2F(Form("hDTY4D4sbest"),
2436  Form("Time - position correlation; Y4 [cm]; #DeltaT04 [ns]"),
2437  50,
2438  -15.,
2439  15.,
2440  100,
2441  -DTMAX,
2442  DTMAX);
2443  fhDXX4D4sbest =
2444  new TH2F(Form("hDXX4D4sbest"),
2445  Form("DX - position correlation; X4 [cm]; #DeltaX04 [cm]"),
2446  50,
2447  -15.,
2448  15.,
2449  50,
2450  -10.,
2451  10.);
2452  fhDXY4D4sbest =
2453  new TH2F(Form("hDXY4D4sbest"),
2454  Form("DX - position correlation; Y4 [cm]; #DeltaX04 [cm]"),
2455  50,
2456  -15.,
2457  15.,
2458  50,
2459  -10.,
2460  10.);
2461  fhDYX4D4sbest =
2462  new TH2F(Form("hDYX4D4sbest"),
2463  Form("DY - position correlation; X4 [cm]; #DeltaY04 [cm]"),
2464  50,
2465  -15.,
2466  15.,
2467  50,
2468  -10.,
2469  10.);
2470  fhDYY4D4sbest =
2471  new TH2F(Form("hDYY4D4sbest"),
2472  Form("DY - position correlation; Y4 [cm]; #DeltaY04 [cm]"),
2473  50,
2474  -15.,
2475  15.,
2476  50,
2477  -10.,
2478  10.);
2479 
2480  fhDTMul0D4sbest =
2481  new TH2F(Form("hDTMul0D4sbest"),
2482  Form("Time - Multiplicity correlation; Mul0 ; #DeltaT04 [ns]"),
2483  10,
2484  0.,
2485  10.,
2486  100,
2487  -DTMAX,
2488  DTMAX);
2489  fhDTX0D4sbest =
2490  new TH2F(Form("hDTX0D4sbest"),
2491  Form("Time - position correlation; X0 [cm]; #DeltaT04 [ns]"),
2492  50,
2493  -17.,
2494  17.,
2495  100,
2496  -DTMAX,
2497  DTMAX);
2498  fhDTY0D4sbest =
2499  new TH2F(Form("hDTY0D4sbest"),
2500  Form("Time - position correlation; Y0 [cm]; #DeltaT04 [ns]"),
2501  50,
2502  -15.,
2503  15.,
2504  100,
2505  -DTMAX,
2506  DTMAX);
2507  fhDXX0D4sbest =
2508  new TH2F(Form("hDXX0D4sbest"),
2509  Form("DX - position correlation; X0 [cm]; #DeltaX04 [cm]"),
2510  50,
2511  -17.,
2512  17.,
2513  50,
2514  -15.,
2515  15.);
2516  fhDXY0D4sbest =
2517  new TH2F(Form("hDXY0D4sbest"),
2518  Form("DX - position correlation; Y0 [cm]; #DeltaX04 [cm]"),
2519  50,
2520  -15.,
2521  15.,
2522  50,
2523  -15.,
2524  15.);
2525  fhDYX0D4sbest =
2526  new TH2F(Form("hDYX0D4sbest"),
2527  Form("DY - position correlation; X0 [cm]; #DeltaY04 [cm]"),
2528  50,
2529  -17.,
2530  17.,
2531  50,
2532  -15.,
2533  15.);
2534  fhDYY0D4sbest =
2535  new TH2F(Form("hDYY0D4sbest"),
2536  Form("DY - position correlation; Y0 [cm]; #DeltaY04 [cm]"),
2537  50,
2538  -15.,
2539  15.,
2540  50,
2541  -15.,
2542  15.);
2543 
2544  fhNMatch04 = new TH1F(Form("hNMatch04"),
2545  Form("Number of Matched Hit pairs 0-4; NMatched"),
2546  50,
2547  0.,
2548  50.);
2549 
2550  fhNMatch04sel = new TH1F(Form("hNMatch04sel"),
2551  Form("Number of Matched Hit pairs 0-4; NMatched"),
2552  50,
2553  0.,
2554  50.);
2555 
2556  fhNMatchD4sel = new TH1F(Form("hNMatchD4sel"),
2557  Form("Number of Matched Hit pairs 0-4; NMatched"),
2558  50,
2559  0.,
2560  50.);
2561 
2562  fhDTD4sel = new TH1F(Form("hDTD4sel"),
2563  Form("Time difference BRef - MrpcRef; #DeltaTD4 (ns)"),
2564  100,
2565  -DTDMAX,
2566  DTDMAX);
2567 
2568  fhTofD4sel = new TH1F(Form("hTofD4sel"),
2569  Form("Time difference BRef - MrpcRef; #DeltaTD4 (ns)"),
2570  100,
2571  -DTDMAX,
2572  DTDMAX);
2573 
2574  fhDT04DX0_1 =
2575  new TH2F(Form("hDT04DX0_1"),
2576  Form("Time - position correlation; #DeltaX0 [cm]; #DeltaT04 [ns]"),
2577  50,
2578  -25.,
2579  25.,
2580  100,
2581  -DTMAX,
2582  DTMAX);
2583  fhDT04DY0_1 =
2584  new TH2F(Form("hDT04DY0_1"),
2585  Form("Time - position correlation; #DeltaY0 [cm]; #DeltaT04 [ns]"),
2586  50,
2587  -25.,
2588  25.,
2589  100,
2590  -DTMAX,
2591  DTMAX);
2592  fhDT04DT0_1 =
2593  new TH2F(Form("hDT04DT0_1"),
2594  Form("Time - time correlation; #DeltaT0 [ns]; #DeltaT04 [ns]"),
2595  50,
2596  -5.,
2597  5.,
2598  100,
2599  -DTMAX,
2600  DTMAX);
2601 
2602  fhDT04DX4_1 =
2603  new TH2F(Form("hDT04DX4_1"),
2604  Form("Time - position correlation; #DeltaX4 [cm]; #DeltaT04 [ns]"),
2605  50,
2606  -10.,
2607  10.,
2608  100,
2609  -DTMAX,
2610  DTMAX);
2611  fhDT04DY4_1 =
2612  new TH2F(Form("hDT04DY4_1"),
2613  Form("Time - position correlation; #DeltaY4 [cm]; #DeltaT04 [ns]"),
2614  50,
2615  -15.,
2616  15.,
2617  100,
2618  -DTMAX,
2619  DTMAX);
2620  fhDT04DT4_1 =
2621  new TH2F(Form("hDT04DT4_1"),
2622  Form("Time - time correlation; #DeltaT4 [ns]; #DeltaT04 [ns]"),
2623  50,
2624  -5.,
2625  5.,
2626  100,
2627  -DTMAX,
2628  DTMAX);
2629 
2630  fhDT04DX0_2 =
2631  new TH2F(Form("hDT04DX0_2"),
2632  Form("Time - position correlation; #DeltaX0 [cm]; #DeltaT04 [ns]"),
2633  50,
2634  -25.,
2635  25.,
2636  100,
2637  -DTMAX,
2638  DTMAX);
2639  fhDT04DY0_2 =
2640  new TH2F(Form("hDT04DY0_2"),
2641  Form("Time - position correlation; #DeltaY0 [cm]; #DeltaT04 [ns]"),
2642  50,
2643  -25.,
2644  25.,
2645  100,
2646  -DTMAX,
2647  DTMAX);
2648  fhDT04DT0_2 =
2649  new TH2F(Form("hDT04DT0_2"),
2650  Form("Time - time correlation; #DeltaT0 [ns]; #DeltaT04 [ns]"),
2651  50,
2652  -5.,
2653  5.,
2654  100,
2655  -DTMAX,
2656  DTMAX);
2657 
2658  fhDT04DX4_2 =
2659  new TH2F(Form("hDT04DX4_2"),
2660  Form("Time - position correlation; #DeltaX4 [cm]; #DeltaT04 [ns]"),
2661  50,
2662  -10.,
2663  10.,
2664  100,
2665  -DTMAX,
2666  DTMAX);
2667  fhDT04DY4_2 =
2668  new TH2F(Form("hDT04DY4_2"),
2669  Form("Time - position correlation; #DeltaY4 [cm]; #DeltaT04 [ns]"),
2670  50,
2671  -15.,
2672  15.,
2673  100,
2674  -DTMAX,
2675  DTMAX);
2676  fhDT04DT4_2 =
2677  new TH2F(Form("hDT04DT4_2"),
2678  Form("Time - time correlation; #DeltaT4 [ns]; #DeltaT04 [ns]"),
2679  50,
2680  -5.,
2681  5.,
2682  100,
2683  -DTMAX,
2684  DTMAX);
2685 
2686  // Dut histos
2687  Int_t iDutId = fiDut * 100 + fiDutSm * 10 + fiDutRpc;
2688  fhDutPullX = new TH1F(Form("hDutPullX_Sm_%03d", iDutId),
2689  Form("hDutPullX_Sm_%03d; #DeltaX", iDutId),
2690  100,
2691  -10.,
2692  10.);
2693  fhDutPullXB = new TH1F(Form("hDutPullXB_Sm_%03d", iDutId),
2694  Form("hDutPullXB_Sm_%03d; #DeltaX", iDutId),
2695  100,
2696  -10.,
2697  10.);
2698  fhDutPullY = new TH1F(Form("hDutPullY_Sm_%03d", iDutId),
2699  Form("hDutPullY_Sm_%03d; #DeltaY", iDutId),
2700  100,
2701  -10.,
2702  10.);
2703  fhDutPullYB = new TH1F(Form("hDutPullYB_Sm_%03d", iDutId),
2704  Form("hDutPullYB_Sm_%03d; #DeltaY", iDutId),
2705  100,
2706  -10.,
2707  10.);
2708  fhDutPullZ = new TH1F(Form("hDutPullZ_Sm_%03d", iDutId),
2709  Form("hDutPullZ_Sm_%03d; #DeltaZ", iDutId),
2710  100,
2711  -200.,
2712  200.);
2713  fhDutPullT = new TH1F(Form("hDutPullT_Sm_%03d", iDutId),
2714  Form("hDutPullT_Sm_%03d; #DeltaT", iDutId),
2715  100,
2716  -0.5,
2717  0.5);
2718  fhDutPullTB = new TH1F(Form("hDutPullTB_Sm_%03d", iDutId),
2719  Form("hDutPullTB_Sm_%03d; #DeltaT", iDutId),
2720  150,
2721  -0.75,
2722  0.75);
2723 
2724  fhDutChi_Found = new TH1F(Form("hDutChi_Found_%03d", iDutId),
2725  Form("hDutChi_Found_%03d; #chi", iDutId),
2726  50,
2727  0.,
2728  10.);
2729  fhDutChi_Missed = new TH1F(Form("hDutChi_Missed_%03d", iDutId),
2730  Form("hDutChi_Missed_%03d; #chi", iDutId),
2731  50,
2732  0.,
2733  10.);
2734 
2735  fhDutChi_Match = new TH1F(Form("hDutChi_Match_%03d", iDutId),
2736  Form("hDutChi_Match_%03d; #chi", iDutId),
2737  50,
2738  0.,
2739  10.);
2740  Double_t XSIZ = 20.;
2741  Double_t DTSIZ = 0.5;
2742  Int_t Nbins = 40.;
2743  fhDutXY_Found = new TH2F(Form("hDutXY_Found_%03d", iDutId),
2744  Form("hDutXY_Found_%03d; x(cm); y (cm)", iDutId),
2745  Nbins,
2746  -XSIZ,
2747  XSIZ,
2748  Nbins,
2749  -XSIZ,
2750  XSIZ);
2751  fhDutXY_Missed = new TH2F(Form("hDutXY_Missed_%03d", iDutId),
2752  Form("hDutXY_Missed_%03d; x(cm); y (cm)", iDutId),
2753  Nbins,
2754  -XSIZ,
2755  XSIZ,
2756  Nbins,
2757  -XSIZ,
2758  XSIZ);
2759 
2760  fhDutDTLH_Found = new TH1F(Form("hDutDTLH_Found_%03d", iDutId),
2761  Form("hDutDTLH_Found_%03d; log(#DeltaT)", iDutId),
2762  50,
2763  0.,
2764  12.);
2766  new TH1F(Form("hDutDTLH_Missed_%03d", iDutId),
2767  Form("hDutDTLH_Missed_%03d; log(#DeltaT)", iDutId),
2768  50,
2769  0.,
2770  12.);
2771  fhDutMul_Found =
2772  new TH1F(Form("hDutMul_Found_%03d", iDutId),
2773  Form("hDutMul_Found_%03d; Hit Multiplicity", iDutId),
2774  32,
2775  0.,
2776  32.);
2777  fhDutMul_Missed =
2778  new TH1F(Form("hDutMul_Missed_%03d", iDutId),
2779  Form("hDutMul_Missed_%03d; Hit Multiplicity", iDutId),
2780  32,
2781  0.,
2782  32.);
2783  fhDutTIS_Found =
2784  new TH2F(Form("hDutTIS_Found_%03d", iDutId),
2785  Form("hDutTIS_Found_%03d; Time in spill (s)", iDutId),
2786  TISnbins,
2787  0,
2788  TISmax,
2789  9,
2790  0,
2791  9);
2792  fhDutTIS_Missed =
2793  new TH2F(Form("hDutTIS_Missed_%03d", iDutId),
2794  Form("hDutTIS_Missed_%03d; Time in spill (s)", iDutId),
2795  TISnbins,
2796  0,
2797  TISmax,
2798  9,
2799  0,
2800  9);
2801  fhDutTIR_Found =
2802  new TH2F(Form("hDutTIR_Found_%03d", iDutId),
2803  Form("hDutTIR_Found_%03d; Time in spill (s)", iDutId),
2804  TIRnbins,
2805  0,
2806  TIRmax,
2807  9,
2808  0,
2809  9);
2810  fhDutTIR_Missed =
2811  new TH2F(Form("hDutTIR_Missed_%03d", iDutId),
2812  Form("hDutTIR_Missed_%03d; Time in spill (s)", iDutId),
2813  TIRnbins,
2814  0,
2815  TIRmax,
2816  9,
2817  0,
2818  9);
2819  fhDutVel_Found =
2820  new TH1F(Form("hDutVel_Found_%03d", iDutId),
2821  Form("hDutVel_Found_%03d; velocity (cm/ns)", iDutId),
2822  50,
2823  0.,
2824  50.);
2825  fhDutVel_Missed =
2826  new TH1F(Form("hDutVel_Missed_%03d", iDutId),
2827  Form("hDutVel_Missed_%03d; velocity (cm/ns)", iDutId),
2828  50,
2829  0.,
2830  50.);
2832  new TH2F(Form("hDutDTLH_CluSize_%03d", iDutId),
2833  Form("hDutDTLH_CluSize_%03d; log(#DeltaT); CluSize", iDutId),
2834  50,
2835  0.,
2836  12.,
2837  10,
2838  1.,
2839  11.);
2840  fhDutDTLH_Tot =
2841  new TH2F(Form("hDutDTLH_Tot_%03d", iDutId),
2842  Form("hDutDTLH_Tot_%03d; log(#DeltaT); Tot", iDutId),
2843  50,
2844  0.,
2845  12.,
2846  50,
2847  0.,
2848  20.);
2849  fhDutDTLH_Mul =
2850  new TH2F(Form("hDutDTLH_Mul_%03d", iDutId),
2851  Form("hDutDTLH_Mul_%03d; log(#DeltaT); Mul", iDutId),
2852  50,
2853  0.,
2854  12.,
2855  30,
2856  0.,
2857  30.);
2858  fhDutDTLH_TIS =
2859  new TH2F(Form("hDutDTLH_TIS_%03d", iDutId),
2860  Form("hDutDTLH_TIS_%03d; log(#DeltaT); TIS (s)", iDutId),
2861  50,
2862  0.,
2863  12.,
2864  TISnbins,
2865  0,
2866  TISmax);
2868  new TH2F(Form("hDutDTLH_Missed_TIS_%03d", iDutId),
2869  Form("hDutDTLH_Missed_TIS_%03d; log(#DeltaT); TIS (s)", iDutId),
2870  50,
2871  0.,
2872  12.,
2873  TISnbins,
2874  0,
2875  TISmax);
2876  fhDutDTLH_DDH_Found = new TH2F(
2877  Form("hDutDTLH_DDH_Found_%03d", iDutId),
2878  Form("hDutDTLH_DDH_Found_%03d; log(#DeltaT); distance to LH (cm)", iDutId),
2879  50,
2880  0.,
2881  12.,
2882  40,
2883  0.,
2884  4.);
2885  fhDutDTLH_DD_Found = new TH2F(
2886  Form("hDutDTLH_DD_Found_%03d", iDutId),
2887  Form("hDutDTLH_DD_Found_%03d; log(#DeltaT); distance to LH (cm)", iDutId),
2888  50,
2889  0.,
2890  12.,
2891  40,
2892  0.,
2893  4.);
2894  fhDutDTLH_DD_Missed = new TH2F(
2895  Form("hDutDTLH_DD_Missed_%03d", iDutId),
2896  Form("hDutDTLH_DD_Missed_%03d; log(#DeltaT); distance to LH (cm)", iDutId),
2897  50,
2898  0.,
2899  12.,
2900  40,
2901  0.,
2902  4.);
2903  fhDutXYDX =
2904  new TH3F(Form("hDutXYDX_%03d", iDutId),
2905  Form("hDutXYDT_%03d; x(cm); y (cm); #Deltax (cm)", iDutId),
2906  Nbins,
2907  -XSIZ,
2908  XSIZ,
2909  Nbins,
2910  -XSIZ,
2911  XSIZ,
2912  Nbins,
2913  -2.,
2914  2.);
2915  fhDutXYDY =
2916  new TH3F(Form("hDutXYDY_%03d", iDutId),
2917  Form("hDutXYDT_%03d; x(cm); y (cm); #Deltay (cm)", iDutId),
2918  Nbins,
2919  -XSIZ,
2920  XSIZ,
2921  Nbins,
2922  -XSIZ,
2923  XSIZ,
2924  Nbins,
2925  -2.,
2926  2.);
2927  fhDutXYDT =
2928  new TH3F(Form("hDutXYDT_%03d", iDutId),
2929  Form("hDutXYDT_%03d; x(cm); y (cm); #Deltat (ns)", iDutId),
2930  Nbins,
2931  -XSIZ,
2932  XSIZ,
2933  Nbins,
2934  -XSIZ,
2935  XSIZ,
2936  Nbins,
2937  -DTSIZ,
2938  DTSIZ);
2939 
2940 
2942  new TH2F("hSelTypeNNChiSq",
2943  "ST NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ",
2944  3,
2945  0,
2946  3,
2947  1000,
2948  0.,
2949  100.);
2950 
2952  new TH2F("hSelTypeNNResidualT",
2953  "ST NN ResiT vs. ST; sel type ST []; T_{DUT} - T_{ST} [ns]",
2954  3,
2955  0,
2956  3,
2957  3001,
2958  -1.5,
2959  1.5);
2960 
2962  new TH2F("hSelTypeNNResidualX",
2963  "ST NN ResiX vs. ST; sel type ST []; X_{DUT} - X_{ST} [cm]",
2964  3,
2965  0,
2966  3,
2967  801,
2968  -4.,
2969  4.);
2970 
2972  new TH2F("hSelTypeNNResidualY",
2973  "ST NN ResiY vs. ST; sel type ST []; Y_{DUT} - Y_{ST} [cm]",
2974  3,
2975  0,
2976  3,
2977  3001,
2978  -15.,
2979  15.);
2980 
2982  new TH2F("hSelTypeAccNNChiSq",
2983  "ST acc NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ",
2984  3,
2985  0,
2986  3,
2987  1000,
2988  0.,
2989  100.);
2990 
2992  new TH2F("hSelTypeAccNNResidualT",
2993  "ST acc NN ResiT vs. ST; sel type ST []; T_{DUT} - T_{ST} [ns]",
2994  3,
2995  0,
2996  3,
2997  3001,
2998  -1.5,
2999  1.5);
3000 
3002  new TH2F("hSelTypeAccNNResidualX",
3003  "ST acc NN ResiX vs. ST; sel type ST []; X_{DUT} - X_{ST} [cm]",
3004  3,
3005  0,
3006  3,
3007  801,
3008  -4.,
3009  4.);
3010 
3012  new TH2F("hSelTypeAccNNResidualY",
3013  "ST acc NN ResiY vs. ST; sel type ST []; Y_{DUT} - Y_{ST} [cm]",
3014  3,
3015  0,
3016  3,
3017  3001,
3018  -15.,
3019  15.);
3020 
3021 
3022  fhSelEfficiency = new TEfficiency(
3023  "hSelEfficiency", "; acc ref MUL []; Sel efficiency []", 50, 0., 50.);
3024 
3026  new TEfficiency("hSelHitTupleEfficiencyTIS",
3027  "; time in spill [s]; Sel efficiency []",
3028  TISnbins,
3029  0.,
3030  TISmax);
3031 
3033  new TEfficiency("hSelMatchEfficiency",
3034  "; acc ref MUL []; Sel match efficiency []",
3035  50,
3036  0.,
3037  50.);
3038 
3040  new TEfficiency("hSelHitTupleMatchEfficiencyTIS",
3041  "; time in spill [s]; Sel match efficiency []",
3042  TISnbins,
3043  0.,
3044  TISmax);
3045 
3047  new TH2F("hSelHitTupleResidualTTIS",
3048  "; time in spill [s]; T_{hit} - T_{sel} [ns]",
3049  TISnbins,
3050  0.,
3051  TISmax,
3052  301,
3053  -1.5,
3054  1.5);
3055 
3057  new TH2F("hSelHitTupleDutCluSizeTIS",
3058  "; time in spill [s]; cluster size [cells]",
3059  TISnbins,
3060  0.,
3061  TISmax,
3062  20,
3063  0.5,
3064  20.5);
3065 
3066 
3067  fhSelTrklEfficiency = new TEfficiency(
3068  "hSelTrklEfficiency", "; acc ref MUL []; Sel efficiency []", 50, 0., 50.);
3069 
3071  new TEfficiency("hSelTrklEfficiencyTIS",
3072  "; time in spill [s]; Sel efficiency []",
3073  TISnbins,
3074  0.,
3075  TISmax);
3076 
3078  new TEfficiency("hSelTrklMatchEfficiency",
3079  "; acc ref MUL []; Sel match efficiency []",
3080  50,
3081  0.,
3082  50.);
3083 
3085  new TEfficiency("hSelTrklMatchEfficiencyTIS",
3086  "; time in spill [s]; Sel match efficiency []",
3087  TISnbins,
3088  0.,
3089  TISmax);
3090 
3092  new TH2F("hSelTrklResidualTTIS",
3093  "; time in spill [s]; T_{hit} - T_{sel} [ns]",
3094  TISnbins,
3095  0.,
3096  TISmax,
3097  301,
3098  -1.5,
3099  1.5);
3100 
3101  fhSelTrklDutCluSizeTIS = new TH2F("hSelTrklDutCluSizeTIS",
3102  "; time in spill [s]; cluster size [cells]",
3103  TISnbins,
3104  0.,
3105  TISmax,
3106  20,
3107  0.5,
3108  20.5);
3109 
3110 
3111  if (fbMonteCarloComparison) {
3112  Int_t iNCounters(fCounterModuleNodes.size());
3113 
3114 
3115  fhNMergedMCEvents = new TH1F(
3116  "hNMergedMCEvents", "Merged MC events; events []; ", 10, -0.5, 9.5);
3117 
3118  fhAccTrackMul =
3119  new TH1F("hAccTrackMul", "Acc track mul; MUL []; ", 150, -0.5, 149.5);
3120  fhAccRefTrackMul = new TH1F(
3121  "hAccRefTrackMul", "Acc ref track mul; MUL []; ", 50, -0.5, 49.5);
3122  fhAccPrimTrackMul = new TH1F(
3123  "hAccPrimTrackMul", "Acc prim track mul; MUL []; ", 60, -0.5, 59.5);
3124  fhAccTrackPointMul = new TH1F("hAccTrackPointMul",
3125  "Acc track points; points []; ",
3126  iNCounters,
3127  -0.5,
3128  iNCounters - 0.5);
3129  fhAccRefTrackPointMul = new TH1F("hAccRefTrackPointMul",
3130  "Acc ref track points; points []; ",
3131  iNCounters,
3132  -0.5,
3133  iNCounters - 0.5);
3134  fhAccRndmTrackPointMul = new TH1F("hAccRndmTrackPointMul",
3135  "Acc rndm track points; points []; ",
3136  iNCounters,
3137  -0.5,
3138  iNCounters - 0.5);
3139 
3140 
3142  new TH2F("hAccRefTrackAcceptance",
3143  "Ref track acceptance; y_{lab} []; p_{t}/m [1/c]",
3144  42,
3145  -1.,
3146  6.,
3147  30,
3148  0.,
3149  2.5);
3150 
3151  fhAccRefTrackAcceptanceEfficiency = new TEfficiency(
3152  "hAccRefTrackAcceptanceEfficiency",
3153  "Ref track acceptance efficiency; y_{lab} []; p_{t}/m [1/c]",
3154  42,
3155  -1.,
3156  6.,
3157  30,
3158  0.,
3159  2.5);
3160 
3162  new TEfficiency("hAccRefTrackAcceptancePurity",
3163  "Ref track acceptance purity; y_{lab} []; p_{t}/m [1/c]",
3164  42,
3165  -1.,
3166  6.,
3167  30,
3168  0.,
3169  2.5);
3170 
3172  new TH2F("hAccRefTrackMulCentrality",
3173  "Acc ref track mul vs. centrality; b [fm]; MUL []",
3174  20,
3175  0.,
3176  20.,
3177  50,
3178  -0.5,
3179  49.5);
3180 
3181  fhAccRefTracksProcSpec = new TH2F(
3182  "hAccRefTracksProcSpec", "ref track proc/spec; ; ", 5, 0., 5., 5, 0., 5.);
3183  fhAccRefTracksProcSpec->SetCanExtend(TH1::kAllAxes);
3184  fhAccRefTracksProcSpec->SetStats(0);
3185 
3186 
3188  new TEfficiency("hSelMCTrackEfficiency",
3189  "; acc ref MUL []; Sel efficiency []",
3190  50,
3191  0.,
3192  50.);
3193 
3195  new TEfficiency("hSelMCTrackMatchEfficiency",
3196  "; acc ref MUL []; Sel match efficiency []",
3197  50,
3198  0.,
3199  50.);
3200 
3202  new TEfficiency("hSelMCTrackMatchPurity",
3203  "; acc ref MUL []; Sel match purity []",
3204  50,
3205  0.,
3206  50.);
3207 
3208  fhSelMCTrackDutHitMatchNNMul = new TH1F("hSelMCTrackDutHitMatchNNMul",
3209  "Sel track-hit match mul; MUL []; ",
3210  30,
3211  0.5,
3212  30.5);
3213 
3215  new TH1F("hSelMCTrackDutHitMatchAccNNMul",
3216  "Sel track-hit match acc mul; MUL []; ",
3217  30,
3218  0.5,
3219  30.5);
3220 
3221 
3222  fhSelPurity = new TEfficiency(
3223  "hSelPurity", "; acc ref MUL []; Sel purity []", 50, 0., 50.);
3224 
3226  new TEfficiency("hSelRefTrackShare",
3227  "; acc ref MUL []; Sel ref track share []",
3228  50,
3229  0.5,
3230  50.5);
3231 
3232  fhSelRefTrackProcSpec = new TH2F("hSelRefTrackProcSpec",
3233  "ST 0 ref track proc/spec; ; ",
3234  5,
3235  0.,
3236  5.,
3237  5,
3238  0.,
3239  5.);
3240  fhSelRefTrackProcSpec->SetCanExtend(TH1::kAllAxes);
3241  fhSelRefTrackProcSpec->SetStats(0);
3242 
3243  fhSelMatchPurity = new TEfficiency(
3244  "hSelMatchPurity", "; acc ref MUL []; Sel match purity []", 50, 0., 50.);
3245 
3246 
3247  fhResX04HitExp =
3248  new TH2F("hResX04HitExp",
3249  "DUT hit-exp residual X; acc ref MUL []; X_{hit} - X_{exp} [cm]",
3250  50,
3251  0.,
3252  50.,
3253  801,
3254  -4.,
3255  4.);
3256 
3257  fhResX04ExpMC =
3258  new TH2F("hResX04ExpMC",
3259  "DUT exp-MC residual X; acc ref MUL []; X_{exp} - X_{MC} [cm]",
3260  50,
3261  0.,
3262  50.,
3263  801,
3264  -4.,
3265  4.);
3266 
3267  fhResX04HitMC =
3268  new TH2F("hResX04HitMC",
3269  "DUT hit-MC residual X; acc ref MUL []; X_{hit} - X_{MC} [cm]",
3270  50,
3271  0.,
3272  50.,
3273  801,
3274  -4.,
3275  4.);
3276 
3277  fhResY04HitExp =
3278  new TH2F("hResY04HitExp",
3279  "DUT hit-exp residual Y; acc ref MUL []; Y_{hit} - Y_{exp} [cm]",
3280  50,
3281  0.,
3282  50.,
3283  3001,
3284  -15.,
3285  15.);
3286 
3287  fhResY04ExpMC =
3288  new TH2F("hResY04ExpMC",
3289  "DUT exp-MC residual Y; acc ref MUL []; Y_{exp} - Y_{MC} [cm]",
3290  50,
3291  0.,
3292  50.,
3293  3001,
3294  -15.,
3295  15.);
3296 
3297  fhResY04HitMC =
3298  new TH2F("hResY04HitMC",
3299  "DUT hit-MC residual Y; acc ref MUL []; Y_{hit} - Y_{MC} [cm]",
3300  50,
3301  0.,
3302  50.,
3303  3001,
3304  -15.,
3305  15.);
3306 
3307  fhResT04HitExp =
3308  new TH2F("hResT04HitExp",
3309  "DUT hit-exp residual T; acc ref MUL []; T_{hit} - T_{exp} [ns]",
3310  50,
3311  0.,
3312  50.,
3313  3001,
3314  -1.5,
3315  1.5);
3316 
3317  fhResT04ExpMC =
3318  new TH2F("hResT04ExpMC",
3319  "DUT exp-MC residual T; acc ref MUL []; T_{exp} - T_{MC} [ns]",
3320  50,
3321  0.,
3322  50.,
3323  3001,
3324  -1.5,
3325  1.5);
3326 
3327  fhResT04HitMC =
3328  new TH2F("hResT04HitMC",
3329  "DUT hit-MC residual T; acc ref MUL []; T_{hit} - T_{MC} [ns]",
3330  50,
3331  0.,
3332  50.,
3333  3001,
3334  -1.5,
3335  1.5);
3336 
3337  fhNTracksPerMRefHit = new TH1F("hNTracksPerMRefHit",
3338  "MRef tracks/hit; #tracks/hit []; ",
3339  20,
3340  -0.5,
3341  19.5);
3342 
3343  fhNTracksPerSel2Hit = new TH1F("hNTracksPerSel2Hit",
3344  "Sel2 tracks/hit; #tracks/hit []; ",
3345  20,
3346  -0.5,
3347  19.5);
3348 
3349  fhNTracksPerDutHit = new TH1F(
3350  "hNTracksPerDutHit", "DUT tracks/hit; #tracks/hit []; ", 20, -0.5, 19.5);
3351 
3352  fhNTracksPerSelMRefHit = new TH1F("hNTracksPerSelMRefHit",
3353  "MRef sel tracks/hit; #tracks/hit []; ",
3354  20,
3355  -0.5,
3356  19.5);
3357 
3358  fhNTracksPerSelSel2Hit = new TH1F("hNTracksPerSelSel2Hit",
3359  "Sel2 sel tracks/hit; #tracks/hit []; ",
3360  20,
3361  -0.5,
3362  19.5);
3363 
3364  fhNTracksPerSelDutHit = new TH1F("hNTracksPerSelDutHit",
3365  "DUT sel tracks/hit; #tracks/hit []; ",
3366  20,
3367  -0.5,
3368  19.5);
3369 
3370 
3371  fhSelTrklPurity = new TEfficiency(
3372  "hSelTrklPurity", "; acc ref MUL []; Sel purity []", 50, 0., 50.);
3373 
3375  new TEfficiency("hSelTrklRefTrackShare",
3376  "; acc ref MUL []; Sel ref track share []",
3377  50,
3378  0.5,
3379  50.5);
3380 
3381  fhSelTrklRefTrackProcSpec = new TH2F("hSelTrklRefTrackProcSpec",
3382  "ST 1 ref track proc/spec; ; ",
3383  5,
3384  0.,
3385  5.,
3386  5,
3387  0.,
3388  5.);
3389  fhSelTrklRefTrackProcSpec->SetCanExtend(TH1::kAllAxes);
3390  fhSelTrklRefTrackProcSpec->SetStats(0);
3391 
3392 
3394  new TEfficiency("hSelTrklMatchPurity",
3395  "; acc ref MUL []; Sel match purity []",
3396  50,
3397  0.,
3398  50.);
3399 
3400  fhDutResX_Hit_Trk = new TH2F(
3401  "hDutResX_Hit_Trk",
3402  "DUT hit-trklt residual X; acc ref MUL []; X_{hit} - X_{trklt} [cm]",
3403  50,
3404  0.,
3405  50.,
3406  801,
3407  -4.,
3408  4.);
3409 
3410  fhDutResX_Trk_MC = new TH2F(
3411  "hDutResX_Trk_MC",
3412  "DUT trklt-MC residual X; acc ref MUL []; X_{trklt} - X_{MC} [cm]",
3413  50,
3414  0.,
3415  50.,
3416  801,
3417  -4.,
3418  4.);
3419 
3421  new TH2F("hDutResX_Hit_MC",
3422  "DUT hit-MC residual X; acc ref MUL []; X_{hit} - X_{MC} [cm]",
3423  50,
3424  0.,
3425  50.,
3426  801,
3427  -4.,
3428  4.);
3429 
3430  fhDutResY_Hit_Trk = new TH2F(
3431  "hDutResY_Hit_Trk",
3432  "DUT hit-trklt residual Y; acc ref MUL []; Y_{hit} - Y_{trklt} [cm]",
3433  50,
3434  0.,
3435  50.,
3436  3001,
3437  -15.,
3438  15.);
3439 
3440  fhDutResY_Trk_MC = new TH2F(
3441  "hDutResY_Trk_MC",
3442  "DUT trklt-MC residual Y; acc ref MUL []; Y_{trklt} - Y_{MC} [cm]",
3443  50,
3444  0.,
3445  50.,
3446  3001,
3447  -15.,
3448  15.);
3449 
3451  new TH2F("hDutResY_Hit_MC",
3452  "DUT hit-MC residual Y; acc ref MUL []; Y_{hit} - Y_{MC} [cm]",
3453  50,
3454  0.,
3455  50.,
3456  3001,
3457  -15.,
3458  15.);
3459 
3460  fhDutResT_Hit_Trk = new TH2F(
3461  "hDutResT_Hit_Trk",
3462  "DUT hit-trklt residual T; acc ref MUL []; T_{hit} - T_{trklt} [ns]",
3463  50,
3464  0.,
3465  50.,
3466  3001,
3467  -1.5,
3468  1.5);
3469 
3470  fhDutResT_Trk_MC = new TH2F(
3471  "hDutResT_Trk_MC",
3472  "DUT trklt-MC residual T; acc ref MUL []; T_{trklt} - T_{MC} [ns]",
3473  50,
3474  0.,
3475  50.,
3476  3001,
3477  -1.5,
3478  1.5);
3479 
3481  new TH2F("hDutResT_Hit_MC",
3482  "DUT hit-MC residual T; acc ref MUL []; T_{hit} - T_{MC} [ns]",
3483  50,
3484  0.,
3485  50.,
3486  3001,
3487  -1.5,
3488  1.5);
3489 
3490 
3492  new TEfficiency("hSelMCTrackEfficiencyTIS",
3493  "; time in spill [s]; Sel efficiency []",
3494  TISnbins,
3495  0.,
3496  TISmax);
3497 
3499  new TEfficiency("hSelMCTrackMatchEfficiencyTIS",
3500  "; time in spill [s]; Sel match efficiency []",
3501  TISnbins,
3502  0.,
3503  TISmax);
3504 
3506  new TH2F("hSelMCTrackResidualTTIS",
3507  "; time in spill [s]; T_{hit} - T_{sel} [ns]",
3508  TISnbins,
3509  0.,
3510  TISmax,
3511  301,
3512  -1.5,
3513  1.5);
3514 
3516  new TH2F("hSelMCTrackDutCluSizeTIS",
3517  "; time in spill [s]; cluster size [cells]",
3518  TISnbins,
3519  0.,
3520  TISmax,
3521  20,
3522  0.5,
3523  20.5);
3524 
3525 
3526  fhPVResTAll = new TH2F(
3527  "hPVResTAll",
3528  "PV all reco-MC residual T; acc ref MUL []; T_{reco} - T_{MC} [ns]",
3529  50,
3530  0.,
3531  50.,
3532  3001,
3533  -1.5,
3534  1.5);
3535 
3536  fhPVResXAll = new TH2F(
3537  "hPVResXAll",
3538  "PV all reco-MC residual X; acc ref MUL []; X_{reco} - X_{MC} [cm]",
3539  50,
3540  0.,
3541  50.,
3542  801,
3543  -4.,
3544  4.);
3545 
3546  fhPVResYAll = new TH2F(
3547  "hPVResYAll",
3548  "PV all reco-MC residual Y; acc ref MUL []; Y_{reco} - Y_{MC} [cm]",
3549  50,
3550  0.,
3551  50.,
3552  2001,
3553  -10.,
3554  10.);
3555 
3556  fhPVResTRef = new TH2F(
3557  "hPVResTRef",
3558  "PV ref reco-MC residual T; acc ref MUL []; T_{reco} - T_{MC} [ns]",
3559  50,
3560  0.,
3561  50.,
3562  3001,
3563  -1.5,
3564  1.5);
3565 
3566  fhPVResXRef = new TH2F(
3567  "hPVResXRef",
3568  "PV ref reco-MC residual X; acc ref MUL []; X_{reco} - X_{MC} [cm]",
3569  50,
3570  0.,
3571  50.,
3572  801,
3573  -4.,
3574  4.);
3575 
3576  fhPVResYRef = new TH2F(
3577  "hPVResYRef",
3578  "PV ref reco-MC residual Y; acc ref MUL []; Y_{reco} - Y_{MC} [cm]",
3579  50,
3580  0.,
3581  50.,
3582  2001,
3583  -10.,
3584  10.);
3585 
3586 
3587  fhAccRefTrackResT = new TH2F("hAccRefTrackResT",
3588  "ref track-tracklet residual T; acc ref MUL "
3589  "[]; T0_{trklt} - T_{trk} [ns]",
3590  50,
3591  0.,
3592  50.,
3593  3001,
3594  -1.5,
3595  1.5);
3596 
3597  fhAccRefTrackResX = new TH2F("hAccRefTrackResX",
3598  "ref track-tracklet residual X; acc ref MUL "
3599  "[]; X0_{trklt} - X_{trk} [cm]",
3600  50,
3601  0.,
3602  50.,
3603  801,
3604  -4.,
3605  4.);
3606 
3607  fhAccRefTrackResY = new TH2F("hAccRefTrackResY",
3608  "ref track-tracklet residual Y; acc ref MUL "
3609  "[]; Y0_{trklt} - Y_{trk} [cm]",
3610  50,
3611  0.,
3612  50.,
3613  2001,
3614  -10.,
3615  10.);
3616 
3617  fhAccRefTrackResTx = new TH2F("hAccRefTrackResTx",
3618  "ref track-tracklet residual Tx; acc ref MUL "
3619  "[]; Tx0_{trklt} - Tx_{trk} []",
3620  50,
3621  0.,
3622  50.,
3623  201,
3624  -1.,
3625  1.);
3626 
3627  fhAccRefTrackResTy = new TH2F("hAccRefTrackResTy",
3628  "ref track-tracklet residual Ty; acc ref MUL "
3629  "[]; Ty0_{trklt} - Ty_{trk} []",
3630  50,
3631  0.,
3632  50.,
3633  201,
3634  -1.,
3635  1.);
3636 
3637  fhAccRefTrackResV = new TH2F("hAccRefTrackResV",
3638  "ref track-tracklet residual V; acc ref MUL "
3639  "[]; V0_{trklt} - V_{trk} [cm/ns]",
3640  50,
3641  0.,
3642  50.,
3643  101,
3644  -5.,
3645  5.);
3646 
3647  fhAccRefTrackResN = new TH2F(
3648  "hAccRefTrackResN",
3649  "ref track-tracklet residual N; acc ref MUL []; N0_{trklt} - N_{trk} []",
3650  50,
3651  0.,
3652  50.,
3653  11,
3654  -5.5,
3655  5.5);
3656 
3657 
3658  fhAccRefTrackShare = new TEfficiency(
3659  "hAccRefTrackShare", "; acc ref MUL []; acc ref share []", 50, 0., 50.);
3660 
3662  new TEfficiency("hRecRefTrackEfficiency",
3663  "; acc ref MUL []; acc ref reco eff []",
3664  50,
3665  0.,
3666  50.);
3667 
3669  new TEfficiency("hRecRndmTrackEfficiency",
3670  "; acc ref MUL []; acc rndm reco eff []",
3671  50,
3672  0.,
3673  50.);
3674 
3676  new TEfficiency("hRecRefTrackGhostShare",
3677  "; acc ref MUL []; acc ref ghost share []",
3678  50,
3679  0.,
3680  50.);
3681 
3683  new TEfficiency("hRecRefTrackCloneShare",
3684  "; acc ref MUL []; acc ref clone share []",
3685  50,
3686  0.,
3687  50.);
3688 
3690  new TEfficiency("hRecRndmTrackGhostShare",
3691  "; acc ref MUL []; acc rndm ghost share []",
3692  50,
3693  0.,
3694  50.);
3695 
3697  new TEfficiency("hRecRndmTrackCloneShare",
3698  "; acc ref MUL []; acc rndm clone share []",
3699  50,
3700  0.,
3701  50.);
3702 
3703  TH1* tCurrentHistogram(NULL);
3704 
3705  for (auto const& CounterModuleNode : fCounterModuleNodes) {
3706  auto const& CounterID = CounterModuleNode.first;
3707 
3708  Int_t iModuleType = std::get<0>(CounterID);
3709  Int_t iModuleIndex = std::get<1>(CounterID);
3710  Int_t iCounterIndex = std::get<2>(CounterID);
3711  Int_t iNCounterCells = fDigiBdfPar->GetNbChan(iModuleType, iCounterIndex);
3712 
3713 
3714  tCurrentHistogram = new TH2F(Form("hDomTracksProcSpec_%d_%d_%d",
3715  iModuleType,
3716  iModuleIndex,
3717  iCounterIndex),
3718  Form("%d-%d-%d dom proc/spec; ; ",
3719  iModuleType,
3720  iModuleIndex,
3721  iCounterIndex),
3722  5,
3723  0.,
3724  5.,
3725  5,
3726  0.,
3727  5.);
3728  tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
3729  tCurrentHistogram->SetStats(0);
3730 
3731  fhDomTracksProcSpec.insert(
3732  std::make_pair(CounterID, dynamic_cast<TH2*>(tCurrentHistogram)));
3733 
3734 
3735  tCurrentHistogram = new TH2F(Form("hDomTracksProcMat_%d_%d_%d",
3736  iModuleType,
3737  iModuleIndex,
3738  iCounterIndex),
3739  Form("%d-%d-%d dom proc/mat; ; ",
3740  iModuleType,
3741  iModuleIndex,
3742  iCounterIndex),
3743  5,
3744  0.,
3745  5.,
3746  5,
3747  0.,
3748  5.);
3749  tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
3750  tCurrentHistogram->SetStats(0);
3751 
3752  fhDomTracksProcMat.insert(
3753  std::make_pair(CounterID, dynamic_cast<TH2*>(tCurrentHistogram)));
3754 
3755 
3756  tCurrentHistogram = new TH2F(Form("hRndmTracksProcSpec_%d_%d_%d",
3757  iModuleType,
3758  iModuleIndex,
3759  iCounterIndex),
3760  Form("%d-%d-%d rndm proc/spec; ; ",
3761  iModuleType,
3762  iModuleIndex,
3763  iCounterIndex),
3764  5,
3765  0.,
3766  5.,
3767  5,
3768  0.,
3769  5.);
3770  tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
3771  tCurrentHistogram->SetStats(0);
3772 
3773  fhRndmTracksProcSpec.insert(
3774  std::make_pair(CounterID, dynamic_cast<TH2*>(tCurrentHistogram)));
3775 
3776 
3777  tCurrentHistogram = new TH2F(Form("hRndmTracksProcMat_%d_%d_%d",
3778  iModuleType,
3779  iModuleIndex,
3780  iCounterIndex),
3781  Form("%d-%d-%d rndm proc/mat; ; ",
3782  iModuleType,
3783  iModuleIndex,
3784  iCounterIndex),
3785  5,
3786  0.,
3787  5.,
3788  5,
3789  0.,
3790  5.);
3791  tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
3792  tCurrentHistogram->SetStats(0);
3793 
3794  fhRndmTracksProcMat.insert(
3795  std::make_pair(CounterID, dynamic_cast<TH2*>(tCurrentHistogram)));
3796 
3797 
3798  tCurrentHistogram = new TH1F(Form("hCounterAccTrackMul_%d_%d_%d",
3799  iModuleType,
3800  iModuleIndex,
3801  iCounterIndex),
3802  Form("%d-%d-%d acc mul; MUL []; ",
3803  iModuleType,
3804  iModuleIndex,
3805  iCounterIndex),
3806  100,
3807  -0.5,
3808  99.5);
3809 
3810  fhCounterAccTrackMul.insert(std::make_pair(CounterID, tCurrentHistogram));
3811 
3812 
3813  tCurrentHistogram = new TH1F(Form("hCounterAccRefTrackMul_%d_%d_%d",
3814  iModuleType,
3815  iModuleIndex,
3816  iCounterIndex),
3817  Form("%d-%d-%d acc ref mul; MUL []; ",
3818  iModuleType,
3819  iModuleIndex,
3820  iCounterIndex),
3821  50,
3822  -0.5,
3823  49.5);
3824 
3825  fhCounterAccRefTrackMul.insert(
3826  std::make_pair(CounterID, tCurrentHistogram));
3827 
3828 
3829  tCurrentHistogram = new TH1F(Form("hCounterAccRndmTrackMul_%d_%d_%d",
3830  iModuleType,
3831  iModuleIndex,
3832  iCounterIndex),
3833  Form("%d-%d-%d acc rndm mul; MUL []; ",
3834  iModuleType,
3835  iModuleIndex,
3836  iCounterIndex),
3837  50,
3838  -0.5,
3839  49.5);
3840 
3841  fhCounterAccRndmTrackMul.insert(
3842  std::make_pair(CounterID, tCurrentHistogram));
3843 
3844 
3845  tCurrentHistogram = new TH1F(Form("hCounterAccDomTrackMul_%d_%d_%d",
3846  iModuleType,
3847  iModuleIndex,
3848  iCounterIndex),
3849  Form("%d-%d-%d acc dom mul; MUL []; ",
3850  iModuleType,
3851  iModuleIndex,
3852  iCounterIndex),
3853  50,
3854  -0.5,
3855  49.5);
3856 
3857  fhCounterAccDomTrackMul.insert(
3858  std::make_pair(CounterID, tCurrentHistogram));
3859 
3860 
3861  tCurrentHistogram = new TH1F(
3862  Form("hCounterRecRefTrackEfficiencyPassed_%d_%d_%d",
3863  iModuleType,
3864  iModuleIndex,
3865  iCounterIndex),
3866  Form("%d-%d-%d acc ref reco eff; acc ref MUL []; reco efficiency []",
3867  iModuleType,
3868  iModuleIndex,
3869  iCounterIndex),
3870  50,
3871  0.,
3872  50.);
3873 
3875  std::make_pair(CounterID, tCurrentHistogram));
3876 
3877 
3878  tCurrentHistogram = new TH1F(
3879  Form("hCounterRecRefTrackEfficiencyTotal_%d_%d_%d",
3880  iModuleType,
3881  iModuleIndex,
3882  iCounterIndex),
3883  Form("%d-%d-%d acc ref reco eff; acc ref MUL []; reco efficiency []",
3884  iModuleType,
3885  iModuleIndex,
3886  iCounterIndex),
3887  50,
3888  0.,
3889  50.);
3890 
3892  std::make_pair(CounterID, tCurrentHistogram));
3893 
3894 
3895  tCurrentHistogram = new TH1F(
3896  Form("hCounterRecRefTrackPurityPassed_%d_%d_%d",
3897  iModuleType,
3898  iModuleIndex,
3899  iCounterIndex),
3900  Form("%d-%d-%d acc ref reco pure; acc ref MUL []; reco purity []",
3901  iModuleType,
3902  iModuleIndex,
3903  iCounterIndex),
3904  50,
3905  0.,
3906  50.);
3907 
3909  std::make_pair(CounterID, tCurrentHistogram));
3910 
3911 
3912  tCurrentHistogram = new TH2F(
3913  Form("hCounterRefTrackMulHitMul_%d_%d_%d",
3914  iModuleType,
3915  iModuleIndex,
3916  iCounterIndex),
3917  Form("%d-%d-%d acc ref mul/hit mul; acc ref MUL []; hit MUL []",
3918  iModuleType,
3919  iModuleIndex,
3920  iCounterIndex),
3921  50,
3922  -0.5,
3923  49.5,
3924  30,
3925  -0.5,
3926  29.5);
3927 
3929  std::make_pair(CounterID, dynamic_cast<TH2*>(tCurrentHistogram)));
3930 
3931 
3932  tCurrentHistogram =
3933  new TH2F(Form("hCounterRefTrackLocalXY_%d_%d_%d",
3934  iModuleType,
3935  iModuleIndex,
3936  iCounterIndex),
3937  Form("%d-%d-%d acc ref track position; X [cm]; Y [cm]",
3938  iModuleType,
3939  iModuleIndex,
3940  iCounterIndex),
3941  2 * iNbinXY + 1,
3942  -17.,
3943  17.,
3944  2 * iNbinXY + 1,
3945  -17.,
3946  17.);
3947 
3948  fhCounterRefTrackLocalXY.insert(
3949  std::make_pair(CounterID, dynamic_cast<TH2*>(tCurrentHistogram)));
3950 
3951 
3952  tCurrentHistogram =
3953  new TH2F(Form("hCounterRefTrackMulCell_%d_%d_%d",
3954  iModuleType,
3955  iModuleIndex,
3956  iCounterIndex),
3957  Form("%d-%d-%d cell acc ref mul; strip []; ref track MUL []",
3958  iModuleType,
3959  iModuleIndex,
3960  iCounterIndex),
3961  iNCounterCells,
3962  0,
3963  iNCounterCells,
3964  10,
3965  -0.5,
3966  9.5);
3967 
3968  fhCounterRefTrackMulCell.insert(
3969  std::make_pair(CounterID, dynamic_cast<TH2*>(tCurrentHistogram)));
3970  }
3971 
3972 
3974  new TH2F("hGoodSelTypeNNPureChiSq",
3975  "gST pure NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ",
3976  3,
3977  0,
3978  3,
3979  1000,
3980  0.,
3981  100.);
3982 
3984  new TH2F("hGoodSelTypeNNAllChiSq",
3985  "gST all NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ",
3986  3,
3987  0,
3988  3,
3989  1000,
3990  0.,
3991  100.);
3992  }
3993 
3994 
3995  for (auto const& CounterModuleNode : fCounterModuleNodes) {
3996  auto const& CounterID = CounterModuleNode.first;
3997 
3998  Int_t iModuleType = std::get<0>(CounterID);
3999  Int_t iModuleIndex = std::get<1>(CounterID);
4000  Int_t iCounterIndex = std::get<2>(CounterID);
4001  Int_t iNCounterCells = fDigiBdfPar->GetNbChan(iModuleType, iCounterIndex);
4002 
4003  TH1* tCurrentHistogram =
4004  new TH2F(Form("hCounterHitMulCell_%d_%d_%d",
4005  iModuleType,
4006  iModuleIndex,
4007  iCounterIndex),
4008  Form("%d-%d-%d cell hit mul; strip []; hit MUL []",
4009  iModuleType,
4010  iModuleIndex,
4011  iCounterIndex),
4012  iNCounterCells,
4013  0,
4014  iNCounterCells,
4015  10,
4016  -0.5,
4017  9.5);
4018 
4019  fhCounterHitMulCell.insert(
4020  std::make_pair(CounterID, dynamic_cast<TH2*>(tCurrentHistogram)));
4021  }
4022 
4023 
4024  fhSelTrklFitRedChiSq = new TH1F("hSelTrklFitRedChiSq",
4025  "Sel trkl 3D fit #chi^{2}/4; #chi^{2}/4 []; ",
4026  1000,
4027  0.,
4028  10.);
4029  fhSelTrklDutHitMatchNNMul = new TH1F("hSelTrklDutHitMatchNNMul",
4030  "Sel trkl-hit match mul; MUL []; ",
4031  30,
4032  0.5,
4033  30.5);
4035  new TH1F("hSelTrklDutHitMatchAccNNMul",
4036  "Sel trkl-hit match acc mul; MUL []; ",
4037  30,
4038  0.5,
4039  30.5);
4040 
4041  fhSelHitTupleDutHitMatchMul = new TH1F("hSelHitTupleDutHitMatchMul",
4042  "Sel hit-hit match mul; MUL []; ",
4043  30,
4044  0.5,
4045  30.5);
4047  new TH1F("hSelHitTupleDutHitMatchAccMul",
4048  "Sel hit-hit match acc mul; MUL []; ",
4049  30,
4050  0.5,
4051  30.5);
4052 
4053  // rate histos
4054  Double_t TRange = 600.; //in seconds
4055  Double_t NStations = 10.;
4056  if (NULL != fFindTracks) NStations = fFindTracks->GetNStations();
4057 
4058  fhTrklNofHitsRate = new TH2F(Form("hTrklNofHitsRate"),
4059  Form("hTrklNofHitsRate; Time (s); NofHits "),
4060  (Int_t) TRange,
4061  0.,
4062  TRange,
4063  10,
4064  1.,
4065  11.);
4066  fhTrklDetHitRate = new TH2F(Form("hTrklDetHitRate"),
4067  Form("hTrklDetHitRate; Time (s); DetIndx "),
4068  (Int_t) TRange,
4069  0.,
4070  TRange,
4071  NStations,
4072  0.,
4073  NStations);
4074 
4075  // spill histos
4076  Double_t TRangeSpill = 10.; //in seconds
4078  new TH2F(Form("hTrklNofHitsRateInSpill"),
4079  Form("hTrklNofHitsRateInSpill; Time (s); NofHits "),
4080  (Int_t) TRangeSpill * 10,
4081  0.,
4082  TRangeSpill,
4083  10,
4084  1.,
4085  11.);
4087  new TH2F(Form("hTrklDetHitRateInSpill"),
4088  Form("hTrklDetHitRateInSpill; Time (s); DetIndx "),
4089  (Int_t) TRangeSpill * 10,
4090  0.,
4091  TRangeSpill,
4092  NStations,
4093  0.,
4094  NStations);
4095 
4096  if (fdMemoryTime > 0.) { // book histograms for memory effects
4097  fhLHTime.resize(iNbDet);
4098  fvLHit.resize(iNbDet);
4099  Int_t iNbins = 32; // corresponds to 2x2 cm^2 regions
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),
4103  iNbins,
4104  -16.,
4105  16.,
4106  iNbins,
4107  -16.,
4108  16.);
4109  fvLHit[iDet].resize(iNbins * iNbins);
4110  for (size_t iBin = 0; iBin < fvLHit[iDet].size(); iBin++)
4111  fvLHit[iDet][iBin] = NULL;
4112  }
4113  }
4114 
4115  gDirectory->cd(
4116  oldir
4117  ->GetPath()); // <= To prevent histos from being sucked in by the param file of the TRootManager!
4118 
4119  return kTRUE;
4120 }
4121 
4122 // ------------------------------------------------------------------
4124  std::set<Int_t> DutHitSet;
4125 
4126  for (Int_t iHitInd = 0; iHitInd < fTofHitsColl->GetEntries(); iHitInd++) {
4127  CbmTofHit* pHit = (CbmTofHit*) fTofHitsColl->At(iHitInd);
4128  Int_t iDetId = (pHit->GetAddress() & DetMask);
4129 
4130  if (fiDutAddr == iDetId) { DutHitSet.emplace(iHitInd); }
4131  }
4132 
4133 
4134  if (fbMonteCarloComparison) {
4135  if (fbTracksInInputFile) {
4136  fiNAccRefTracks = 0;
4137 
4138  TGeoNode* tNode(NULL);
4139  TGeoMedium* tMedium(NULL);
4140  TGeoMaterial* tMaterial(NULL);
4141 
4142  const char* cMaterialName;
4143 
4144  fhAccTrackMul->Fill(fAccTracks->GetEntriesFast());
4145 
4146  // Determine the number of reference tracks in the reconstructed event
4147  // as a function of which several QA observables are studied. A reference
4148  // track must originate from the target (not necessarily from the primary
4149  // vertex) and intersect the active planes of at least 'fiMinMCRefTrackPoints'
4150  // different counters.
4151  Int_t iNAccPrimTracks(0);
4152 
4153  for (Int_t iTrack = 0; iTrack < fAccTracks->GetEntriesFast(); iTrack++) {
4154  CbmMCTrack* tAccTrack =
4155  dynamic_cast<CbmMCTrack*>(fAccTracks->At(iTrack));
4156  CbmMatch* tAccTrackPointMatch =
4157  dynamic_cast<CbmMatch*>(fTofAccTrackPointMatches->At(iTrack));
4158 
4159  tNode = gGeoManager->FindNode(tAccTrack->GetStartX(),
4160  tAccTrack->GetStartY(),
4161  tAccTrack->GetStartZ());
4162  tMedium = tNode->GetMedium();
4163  tMaterial = tMedium->GetMaterial();
4164 
4165  GetMaterialName(tMaterial->GetName(), cMaterialName);
4166 
4167  if (0 == std::strcmp("target", cMaterialName)) {
4168  iNAccPrimTracks++;
4169 
4170  if (fiMinMCRefTrackPoints <= tAccTrackPointMatch->GetNofLinks()) {
4171  fiNAccRefTracks++;
4172  }
4173  }
4174  }
4175 
4177  fhAccPrimTrackMul->Fill(iNAccPrimTracks);
4178  }
4179  }
4180 
4181 
4182  // Constants, TODO => put as parameter !!!
4183 
4184  // Declare variables outside the loop
4185  CbmTofHit* pHit;
4186  CbmTofHit* pLHit;
4187  CbmTofHit* pHit1;
4188  CbmTofHit* pHit2;
4189  CbmTofHit* pHit3;
4190  CbmTofHit* pHit4;
4191  CbmTofHit* pHitRef = NULL; // May be used uninitialized later, to check!
4192  CbmTofHit* pHitSel2 = NULL;
4193  CbmTofHit* pDia;
4194  CbmTofCell* fChannelInfo1;
4195  CbmTofCell* fChannelInfo2;
4196  CbmTofCell* fChannelInfo3;
4197  CbmTofCell* fChannelInfo4;
4198 
4199  Int_t iBRefHitInd(-1);
4200  Int_t iMRefHitInd(-1);
4201  Int_t iSel2HitInd(-1);
4202  CbmTrackMatchNew tSelHitTupleTrackMatch;
4203  Bool_t bGoodTrackSel(kFALSE);
4204 
4205  // Trb System
4206  if (NULL != fTrbHeader) {
4207  if (fiReqTrg > -1)
4208  if (!fTrbHeader->TriggerFired(fiReqTrg)) return kFALSE;
4209  UInt_t uTriggerPattern = fTrbHeader->GetTriggerPattern();
4210  for (UInt_t uChannel = 0; uChannel < 16; uChannel++) {
4211  if (uTriggerPattern & (0x1 << uChannel)) {
4212  fhTriggerPattern->Fill(uChannel);
4213  }
4214  }
4217  }
4218 
4219 
4220  /* Int_t iNbTofDigis;*/
4221  Int_t iNbTofHits, iNbTofTracks;
4222 
4223  // iNbTofDigis = fTofDigisColl->GetEntriesFast();
4224  iNbTofHits = fTofHitsColl->GetEntries();
4225 
4226  /*
4227  LOG(info)<<Form("CbmTofAnaTestbeam::FillHistos for %d digis and %d Tof hits",iNbTofDigis,iNbTofHits)
4228  ;
4229  */
4230  // Digis info
4231  /*
4232  Double_t dTotalDataSize = 0;
4233  if( kTRUE == fDigiBdfPar->UseExpandedDigi() )
4234  {
4235  CbmTofDigiExp *pDigi;
4236  for( Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++ )
4237  {
4238  pDigi = (CbmTofDigiExp*) fTofDigisColl->At( iDigInd );
4239 
4240  Int_t iSmType = pDigi->GetType();
4241  Int_t iSm = pDigi->GetSm();
4242  Int_t iRpc = pDigi->GetRpc();
4243  Int_t iCh = pDigi->GetChannel();
4244 
4245  } // for( Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++ )
4246  } // if( kTRUE == fDigiBdfPar->UseExpandedDigi() )
4247  */
4248  // Hits info
4249  Int_t iNbMatchedHits = 0;
4250  Int_t iNbMaxMatch = 500;
4251  // Double_t Zref=300.;
4252  /* Double_t Chi2MatchMin=1.E8;*/
4253  Double_t Chi2List[iNbMaxMatch];
4254  CbmTofHit* pChi2Hit1[iNbMaxMatch];
4255  CbmTofHit* pChi2Hit2[iNbMaxMatch];
4256  Chi2List[0] = 1.E8;
4257  pChi2Hit1[0] = NULL;
4258  pChi2Hit2[0] = NULL;
4259  pDia = NULL;
4260  Int_t iNSel = 1;
4261  Bool_t BSel[iNSel];
4262  for (Int_t iSel = 0; iSel < iNSel; iSel++) {
4263  BSel[iSel] = kFALSE;
4264  }
4265  Double_t dDTD4 = 0.;
4266  dTDia = 1.E300;
4267  dDTD4Min = 1.E300;
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; // modify
4275  if (fdMul4Max > 0) dM4Max = fdMul4Max;
4276  Double_t dM0Max = 100; // modify
4277  if (fdMul0Max > 0) dM0Max = fdMul0Max;
4278  Double_t dMDMax = 1;
4279  if (fdMulDMax > 0) dMDMax = fdMulDMax;
4280  Double_t hitpos1[3], hitpos2[3], hitpos3[3], hitpos4[3];
4281  Double_t hitpos1_local[3], hitpos2_local[3], hitpos3_local[3],
4282  hitpos4_local[3];
4283  std::vector<CbmTofHit*> vDiaHit;
4284  Double_t DDiaAvLim = 0.2; // average width for fastest diamond hits in ns
4285  Double_t dMulDAv = 0;
4286  Double_t dTAv = 0.;
4287  Double_t dMAv = 0.;
4288  fDetIdMap.clear();
4289 
4290 
4291  if (fiBeamRefAddr
4292  == 0x00055056) // determine reference time from earliest hits (25%)
4293  {
4294  //fTofHitsColl->Sort(); //not sortable!
4295  Int_t iBeamRefMul = iNbTofHits / 4;
4296  if (iBeamRefMul > 0) {
4297  pHit = (CbmTofHit*) fTofHitsColl->At(iNbTofHits - 1);
4298  Int_t iDetId = (pHit->GetAddress() & DetMask);
4299  if (iDetId == fiBeamRefAddr) {
4300  dMulD = (Double_t) iBeamRefMul;
4301  pDia = pHit;
4302  iBRefHitInd = iNbTofHits - 1;
4303  dTDia = pDia->GetTime();
4304  dTAv = dTDia;
4305  dMAv = 1.;
4306  } else {
4307  dTDia = 0.;
4308  Double_t vdTimes[iBeamRefMul];
4309  Int_t iLast = 0;
4310  vdTimes[iLast] = 1.E300;
4311  for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
4312  pHit = (CbmTofHit*) fTofHitsColl->At(iHitInd);
4313  if (NULL == pHit) continue;
4314  iDetId = (pHit->GetAddress() & DetMask);
4315  if (iDetId != fiDutAddr) {
4316  if (pHit->GetTime() < vdTimes[iLast]) { // insert or replace
4317  if (iLast < iBeamRefMul) { iLast++; }
4318  Int_t iT;
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();
4324  }
4325  }
4326  }
4327  /*
4328  LOG(info)<<Form("Sorted %d hits of %d (%d): ", iLast, iBeamRefMul, iNbTofHits);
4329  for(Int_t iT=0; iT<iLast; iT++) LOG(info)<<Form(" %7.2f",vdTimes[iT]);
4330  LOG(info);
4331  */
4332  for (Int_t iHit = 0; iHit < iLast; iHit++) {
4333  dTDia += vdTimes[iHit];
4334  }
4335  dTDia /= (Double_t) iLast;
4336  dMulD = (Double_t) iLast;
4337  Double_t hitPos[3] = {3 * 0.};
4338  Double_t hitPosErr[3] = {3 * 1.};
4339  pDia = new CbmTofHit(fiBeamRefAddr,
4340  hitPos,
4341  hitPosErr, //local detector coordinates
4342  iNbTofHits, // this number is used as reference!!
4343  dTDia,
4344  0, // number of linked digis = 2*CluSize
4345  10); //channel -> Tot
4346  new ((*fTofHitsColl)[iNbTofHits])
4347  CbmTofHit(*pDia); // insert fake hit into TClonesarray
4348  dTAv = dTDia;
4349  dMAv = 1.;
4350  pDia->Delete();
4351  pDia = (CbmTofHit*) fTofHitsColl->At(iNbTofHits);
4352  iBRefHitInd = iNbTofHits;
4353  iNbTofHits++;
4354  }
4355  }
4356  } else
4357  // find diamond reference (BRef)
4358  for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
4359  pHit = (CbmTofHit*) fTofHitsColl->At(iHitInd);
4360  if (NULL == pHit) continue;
4361  Int_t iDetId = (pHit->GetAddress() & DetMask);
4362  dTAv += pHit->GetTime();
4363  dMAv += 1.;
4364 
4365  std::map<UInt_t, UInt_t>::iterator it = fDetIdMap.find(iDetId);
4366  if (it == fDetIdMap.end()) fDetIdMap[iDetId] = fDetIdMap.size();
4367 
4368  /*
4369  Int_t iChId = pHit->GetAddress();
4370  fChannelInfo = fDigiPar->GetCell( iChId );
4371  Int_t iSmType=CbmTofAddress::GetSmType( iDetId );
4372 
4373  if(NULL == fChannelInfo){
4374  LOG(debug) << Form("CbmTofAnaTestbeam::FillHistos: NULL Channel Pointer for ChId 0x%08x ",iChId)
4375  ;
4376  continue;
4377  }
4378  */
4379  /*
4380  LOG(debug) << Form(" BRef 0x%08x == 0x%08x ? ",iDetId,fiBeamRefAddr)
4381  ;
4382  */
4383  if (iDetId
4384  == fiBeamRefAddr) { // diamond hit (or other reference counter)
4385  dMulD++;
4386  vDiaHit.resize(dMulD);
4387  vDiaHit[dMulD - 1] = pHit;
4388  if (pHit->GetTime() < dTDia) {
4389  dTDia = pHit->GetTime();
4390  pDia = pHit;
4391  iBRefHitInd = iHitInd;
4392  }
4393  }
4394  if (dMulD > 0) { // average fastest channels
4395  dMulDAv = 1;
4396  for (Int_t iDiaHit = 0; iDiaHit < dMulD; iDiaHit++) {
4397  if (vDiaHit[iDiaHit] != pDia) { //additional hit found
4398  if (TMath::Abs(vDiaHit[iDiaHit]->GetTime() - dTDia) < DDiaAvLim) {
4399  dTDia =
4400  (dTDia * dMulDAv + vDiaHit[iDiaHit]->GetTime()) / (dMulDAv + 1);
4401  dMulDAv++;
4402  }
4403  }
4404  }
4405  }
4406  } // reaction reference search loop end;
4407  fhBRefMul->Fill(dMulD);
4408  LOG(debug)
4409  << Form(
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 ",
4412  fiDutAddr,
4413  fiMrpcRefAddr,
4415  fiMrpcSel3Addr);
4416  dTAv /= dMAv; //use any hit
4417 
4418  if (iNbTofHits > 5) { // FIXME hard wired constant in code
4419  if (StartAnalysisTime == 0.) {
4420  StartAnalysisTime = dTAv;
4421  dTLEvt = dTAv;
4422  LOG(info) << "StartAnalysisTime from TAv set to " << StartAnalysisTime
4423  << " ns. ";
4424  } // process counter hits, fill Chi2List, check selector
4425  }
4426 
4427  vector<CbmTofHit*> vDutHit;
4428  vector<CbmTofHit*> vRefHit;
4429 
4430  iNbTofHits = fTofHitsColl->GetEntries();
4431  for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
4432  pHit = (CbmTofHit*) fTofHitsColl->At(iHitInd);
4433  if (NULL == pHit) continue;
4434  Int_t iDetId = (pHit->GetAddress() & DetMask);
4435  Int_t iChId = pHit->GetAddress();
4436  fChannelInfo = fDigiPar->GetCell(iChId);
4437  // Int_t iSmType = CbmTofAddress::GetSmType( iDetId ); (VF) not used
4438  Int_t iDetInd = fDigiBdfPar->GetDetInd(
4439  iDetId); //fMbsMappingPar->GetMappedDetInd( pHit->GetAddress());
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",
4442  iHitInd,
4443  iNbTofHits,
4444  iChId,
4445  iDetInd,
4446  pHit->GetX(),
4447  pHit->GetY(),
4448  pHit->GetZ(),
4449  pHit->GetTime());
4450 
4451  if (NULL == fChannelInfo) {
4452  LOG(debug) << "NULL Channel Pointer for ChId " << Form(" 0x%08x ", iChId);
4453  if (iDetId != fiBeamRefAddr)
4454  continue; // exception for software reference
4455  }
4456 
4457  if (static_cast<UInt_t>(iDetInd) < fhXYPos.size())
4458  fhXYPos[iDetInd]->Fill(pHit->GetX(), pHit->GetY());
4459 
4460  Double_t dPhi =
4461  TMath::ATan2(pHit->GetY(), pHit->GetX()) * 180.0 / TMath::Pi();
4462  Double_t dTheta = TMath::ATan(
4463  TMath::Sqrt(pHit->GetX() * pHit->GetX() + pHit->GetY() * pHit->GetY())
4464  / pHit->GetZ());
4465  Double_t dEta = -TMath::Log(TMath::Tan(dTheta * 0.5));
4466  //LOG(info) << "x,y,z->phi: "<< dPhi <<", "<<dTheta<<", "<<dEta;
4467  dPhi += 90.; // FIXME, just for STAR2018
4468  dPhi *= -1.;
4469  fhEtaPhi->Fill(dPhi, dEta);
4470 
4471  LOG(debug2) << "process iDetId " << Form(" 0x%08x ", iDetId)
4472  << Form(", Muls %4.0f, %4.0f, %4.0f", dMulD, dMul0, dMul4);
4473 
4474 
4475  if (fiDutAddr == iDetId) { // Process Dut
4476  dMul0++;
4477  vDutHit.push_back(pHit);
4478 
4479  CbmMatch* digiMatch =
4480  (CbmMatch*) fTofDigiMatchColl->At(fTofHitsColl->IndexOf(pHit));
4481  dStrMul0 += digiMatch->GetNofLinks() / 2.;
4482  //Double_t xPos1=Zref/pHit->GetZ()*pHit->GetX();
4483  //Double_t yPos1=Zref/pHit->GetZ()*pHit->GetY();
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.;
4489 
4490  for (Int_t iHitInd2 = 0; iHitInd2 < iNbTofHits; iHitInd2++) {
4491  if (iHitInd2 != iHitInd) {
4492  pHit2 = (CbmTofHit*) fTofHitsColl->At(iHitInd2);
4493  if (NULL == pHit2) continue;
4494 
4495  Int_t iDetId2 = (pHit2->GetAddress() & DetMask);
4496  Int_t iChId2 = pHit2->GetAddress();
4497  fChannelInfo2 = fDigiPar->GetCell(iChId2);
4498 
4499  if (fiMrpcRefAddr == iDetId2
4500  /*
4501  fiMrpcRef == CbmTofAddress::GetSmType( iDetId2 )
4502  && fiMrpcRefSm == CbmTofAddress::GetSmId( iDetId2 )
4503  && fiMrpcRefRpc == CbmTofAddress::GetRpcId( iDetId2 )
4504  */
4505  ) { // Dut - MrpcRef
4506 
4507  if (fEnableMatchPosScaling) dzscal = zPos1 / pHit2->GetZ();
4508 
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.;
4513  if (fhDTD4DT04D4Off != NULL)
4514  dTcor = (Double_t) fhDTD4DT04D4Off->GetBinContent(
4515  fhDTD4DT04D4Off->FindBin(dTDia - tof2 - fdTShift));
4516 
4517  Double_t Chi2Match =
4518  TMath::Power((xPos1 - xPos2 - fdDXMean) / GetSigX(0), 2.)
4519  + TMath::Power((yPos1 - yPos2 - fdDYMean) / GetSigY(0), 2.)
4520  + TMath::Power((tof1 - tof2 - dTcor - fdDTMean) / GetSigT(0), 2.);
4521  if (Chi2Match > 1.E8) continue;
4522  Chi2Match /= 3;
4523 
4524  LOG(debug2) << " Chi2 "
4525  << Form(" %f %f %f %f %f %f ",
4526  fdDXMean,
4527  GetSigX(0),
4528  fdDYMean,
4529  GetSigY(0),
4530  fdDTMean,
4531  GetSigT(0))
4532  << Form(" -> %f ", Chi2Match);
4533  LOG(debug2) << " Chi2 "
4534  << Form(" %f %f %f %f %f %f ",
4535  xPos1,
4536  xPos2,
4537  yPos1,
4538  yPos2,
4539  tof1,
4540  tof2)
4541  << Form(" -> %f ", Chi2Match);
4542 
4543  iNbMatchedHits++; // count Dut - Ref matches
4544  if (iNbMatchedHits == iNbMaxMatch)
4545  iNbMatchedHits = iNbMaxMatch - 1; //prevent array overflow
4546  LOG(debug) << Form("match %d (%f): %2d. - %2d. Tof hit 0x%08x "
4547  "with 0x%08x, DeltaT = %f ns",
4548  iNbMatchedHits,
4549  Chi2Match,
4550  iHitInd,
4551  iHitInd2,
4552  iChId2,
4553  iChId,
4554  tof1 - tof2 - dTcor - fdDTMean);
4555 
4556  fhDXDY04->Fill(xPos1 - xPos2, yPos1 - yPos2);
4557  fhDXDT04->Fill(xPos1 - xPos2, tof1 - tof2 - dTcor - fdDTMean);
4558  fhDYDT04->Fill(yPos1 - yPos2, tof1 - tof2 - dTcor - fdDTMean);
4559  fhChi04->Fill(Chi2Match);
4560 
4561  for (Int_t iM = 0; iM < iNbMatchedHits; iM++) {
4562  if (Chi2Match < Chi2List[iM]) {
4563 
4564  LOG(debug) << Form(" fill Chi2 %3d (%3d), %12.1f, %12.1f: "
4565  "HitInd %3d, %3d, Ids 0x%08x, 0x%08x",
4566  iM,
4567  iNbMatchedHits,
4568  Chi2Match,
4569  Chi2List[iM],
4570  iHitInd,
4571  iHitInd2,
4572  iChId,
4573  iChId2);
4574 
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];
4579  }
4580 
4581  Chi2List[iM] = Chi2Match;
4582  pChi2Hit1[iM] = pHit;
4583  pChi2Hit2[iM] = pHit2;
4584  Chi2List[iNbMatchedHits] = 1.E8;
4585  if (iM > 0) {
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",
4589  iM,
4590  dMul0,
4591  iHitInd,
4592  iHitInd2,
4593  pHit,
4594  pHit2,
4595  pChi2Hit1[iM - 1],
4596  pChi2Hit2[iM - 1]);
4597  LOG(debug) << pHit->ToString();
4598  LOG(debug) << pChi2Hit1[iM - 1]->ToString();
4599  LOG(debug) << pHit2->ToString();
4600  }
4601  }
4602  break;
4603  }
4604  }
4605  } //fiMrpcRef condition end
4606  if (2 == CbmTofAddress::GetSmType(iDetId2)) { // Plastic
4607  Int_t iSm = CbmTofAddress::GetSmId(iDetId2);
4608  if (iSm < 2) {
4609  fhXX02[iSm]->Fill(pHit->GetX(), dzscal * pHit2->GetX());
4610  fhYY02[iSm]->Fill(pHit->GetY(), dzscal * pHit2->GetY());
4611  }
4612  }
4613  } //iHit2 != iHit condition end
4614  } // iHit2 loop end
4615  } // fiDut condition end
4616 
4617  if (fiMrpcRefAddr == iDetId) {
4618  dMul4++;
4619  vRefHit.push_back(pHit);
4620  CbmMatch* digiMatch =
4621  (CbmMatch*) fTofDigiMatchColl->At(fTofHitsColl->IndexOf(pHit));
4622  dStrMul4 += digiMatch->GetNofLinks() / 2.;
4623  }
4624 
4625  if (fiMrpcSel2Addr == iDetId) { dMulS2++; }
4626 
4627  if (fiBeamRefAddr == iDetId) { // process beam Ref hit
4628  LOG(debug2) << "Process BeamRef Hit with " << pHit << ", " << pDia;
4629  if (pHit != pDia) continue;
4630  if (fdDTDia > 0.) {
4631  Double_t dDDia = 0.;
4632  for (Int_t iHitInd1 = 0; iHitInd1 < iNbTofHits; iHitInd1++)
4633  if (iHitInd1 != iHitInd) {
4634  pHit1 = (CbmTofHit*) fTofHitsColl->At(iHitInd1);
4635  if (pHit1 == NULL) continue;
4636  Int_t iDetId1 = (pHit1->GetAddress() & DetMask);
4637  Int_t iChId1 = pHit1->GetAddress();
4638  fChannelInfo1 = fDigiPar->GetCell(iChId1);
4639  pHit1 = (CbmTofHit*) fTofHitsColl->At(iHitInd1);
4641  && fiBeamRefSmId != CbmTofAddress::GetSmId(iDetId1)
4642  && TMath::Abs(pHit1->GetTime() - dTDia)
4643  < fdDTDia) { // second diamond fired
4644  dDDia = pHit1->GetTime() - dTDia;
4645  }
4646  }
4647  LOG(debug) << Form("DDia %f", dDDia);
4648  if (dDDia == 0.) continue;
4649  } // 2 diamond condition end
4650 
4651  Double_t zPos1 = pHit->GetZ();
4652  for (Int_t iHitInd2 = 0; iHitInd2 < iNbTofHits; iHitInd2++)
4653  if (iHitInd2 != iHitInd) {
4654  pHit2 = (CbmTofHit*) fTofHitsColl->At(iHitInd2);
4655  if (pHit2 == NULL) continue;
4656 
4657  Int_t iDetId2 = (pHit2->GetAddress() & DetMask);
4658  Int_t iChId2 = pHit2->GetAddress();
4659  fChannelInfo2 = fDigiPar->GetCell(iChId2);
4660  if (NULL == fChannelInfo2) {
4661  LOG(debug) << "Invalid Channel Pointer for ChId2 "
4662  << Form(" 0x%08x ", iChId2);
4663  continue;
4664  }
4665  LOG(debug2) << Form("TDia %f, THit %f", dTDia, pHit2->GetTime());
4666 
4667  if (fiMrpcRefAddr == iDetId2 // Beam - Ref coincidence
4668  ) { // Reference RPC hit
4669  dDTD4 = pHit2->GetTime() - dTDia + fdTShift;
4670  fhDTD4->Fill(dDTD4);
4671 
4672  LOG(debug) << Form("dDTD4 %8.4e, min: %8.4e", dDTD4, dDTD4Min);
4673 
4674  if (TMath::Abs(dDTD4) < fdDTD4MAX
4675  && // single selection scheme, selector 0
4676  TMath::Abs(CbmTofAddress::GetChannelId(iChId2) - fdCh4Sel)
4677  < fdDCh4Sel) {
4678  LOG(debug1) << Form("Valid Mrpc hit 0x%08x", iChId2);
4679  /*TGeoNode *fNode=*/ // prepare global->local trafo
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  /*TGeoNode* cNode=*/gGeoManager->GetCurrentNode();
4688  gGeoManager->MasterToLocal(hitpos, hitpos_local);
4689  if (TMath::Abs(hitpos_local[1] - fdPosY4SelOff)
4690  < fdPosY4Sel * fChannelInfo2->GetSizey()
4691  && TMath::Abs(dDTD4) < TMath::Abs(dDTD4Min)) {
4692  BSel[0] = kFALSE; // invalidate previous matches
4693  dDTD4Min = dDTD4;
4694  pHitRef = pHit2;
4695  iMRefHitInd = iHitInd2;
4696  fChannelInfoRef = fChannelInfo2;
4697  LOG(debug1) << Form("accept Mrpc, look for Sel2 %d, 0x%08x",
4698  fiMrpcSel2,
4699  fiMrpcSel2Addr);
4700  if (fiMrpcSel2
4701  < 0) { // assume Mrpctype to be initialized to -1
4702  BSel[0] = kTRUE;
4703  } else { // request presence of coincident fiMrpcSel2 hit!
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.;
4713  // if(fhDTD4DT04D4Off != NULL)
4714  // dTcor=(Double_t)fhDTD4DT04D4Off->GetBinContent(fhDTD4DT04D4Off->FindBin(dTDia-tof2));
4715 
4716  Double_t Chi2Max = fdChi2Lim2;
4717  pHitSel2 = NULL;
4718 
4719  for (Int_t iHitInd3 = 0; iHitInd3 < iNbTofHits; iHitInd3++) {
4720  LOG(debug2) << Form("inspect %d. Sel2, Ind %d, Ind2 %d ",
4721  iHitInd3,
4722  iHitInd,
4723  iHitInd2);
4724 
4725  //if(iHitInd3 != iHitInd && iHitInd3 != iHitInd2)
4726  if (iHitInd3 != iHitInd2) {
4727  pHit3 = (CbmTofHit*) fTofHitsColl->At(iHitInd3);
4728  if (pHit3 == NULL) continue;
4729  Int_t iDetId3 = (pHit3->GetAddress() & DetMask);
4730  Int_t iChId3 = pHit3->GetAddress();
4731  fChannelInfo3 = fDigiPar->GetCell(iChId3);
4732  if (NULL == fChannelInfo3) {
4733  LOG(debug) << "Invalid Channel Pointer for ChId3 "
4734  << Form(" 0x%08x ", iChId3);
4735  continue;
4736  }
4737  LOG(debug2)
4738  << Form("inspect %d. Sel2 0x%08x", iHitInd3, iDetId3);
4739 
4740  if (
4742  == iDetId3) { //CbmTofAddress::GetSmType( iDetId3 )){ // Sel2 RPC hit
4743  LOG(debug1)
4744  << Form("found Sel2 0x%08x, z-info: %7.1f, %7.1f",
4746  dzscal,
4747  zPos1);
4748  if (TMath::Abs(CbmTofAddress::GetChannelId(iChId3)
4749  - fdChS2Sel)
4750  < fdDChS2Sel) {
4751  /*TGeoNode *fNode3= */ // prepare global->local trafo
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  /*TGeoNode* cNode3=*/gGeoManager->GetCurrentNode();
4759  gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
4760  if (TMath::Abs(hitpos3_local[1] - fdPosYS2SelOff)
4761  < fdPosYS2Sel * fChannelInfo3->GetSizey()) {
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();
4767 
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)
4772  / GetSHTSigT(),
4773  2.);
4774 
4775  Chi2Match /= 3;
4776  LOG(debug1)
4777  << Form("valid Sel2 0x%08x with Chi2 %7.1f, "
4778  "%7.1f, %7.1f, %7.1f, %7.1f, %7.1f",
4780  Chi2Match,
4781  Chi2Max,
4782  dzscal,
4783  xPos3,
4784  yPos3,
4785  tof3);
4786 
4787  if (Chi2Match < Chi2Max) {
4788  xPos3B = xPos3;
4789  yPos3B = yPos3;
4790  tof3B = tof3;
4791  Chi2Max = Chi2Match;
4792  BSel[0] = kTRUE;
4793  pHitSel2 = pHit3;
4794  iSel2HitInd = iHitInd3;
4795  fChannelInfoSel2 = fChannelInfo3;
4796  LOG(debug) << Form(
4797  "better Sel2 0x%08x with Chi2 %7.1f, x %7.1f, "
4798  "Deltax %7.1f, y %7.1f, Deltay %7.1f",
4800  Chi2Max,
4801  xPos3B,
4802  xPos3B - xPos2,
4803  yPos3B,
4804  yPos3B - yPos2);
4805  }
4806  }
4807  }
4808  }
4809  }
4810  } // loop over third hit end
4811 
4812 
4813  if (BSel[0]) {
4814  fhChiSel24->Fill(Chi2Max);
4815  fhDXSel24->Fill(xPos3B - xPos2);
4816  fhDYSel24->Fill(yPos3B - yPos2);
4817  fhDTSel24->Fill(tof3B - tof2 - dTcor - fdSel2TOff);
4818  fhTofSel24->Fill(tof3B - tof2 - fdSel2TOff);
4819  }
4820  }
4821  }
4822  }
4823  }
4824  } //LOG(info)<<" TDia="<<dTDia;
4825  } // diamond condition end
4826  } // for( Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++)
4827 
4828 
4829  /*
4830  if( dMulD>0 && dMul4>0 && dMul0>0 && dTDia - StartSpillTime > SpillDuration*1.E9 ) {
4831  Double_t dDTSpill=dTDia-StartSpillTime;
4832  StartSpillTime=dTDia;
4833  */
4834  if (fdSpillBreak == 0.) StartSpillTime = dTAv;
4835 
4836  Double_t dDTSpill = dTAv - StartSpillTime;
4837  if (fDetIdMap.size() > 3 && dMulD > 0) { // FIXME - hardwired constants
4838  Double_t dDTLEvt = dTAv - dTLEvt;
4839  dTLEvt = dTAv;
4840  if (dDTLEvt > fdSpillBreak * 1.E9 && dDTSpill > fdSpillDuration * 1.E9) {
4841  StartSpillTime = dTAv;
4842  iNspills++;
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 ",
4847  dDTSpill / 1.E9,
4848  fEvents,
4849  dMulD,
4850  (Int_t) fDetIdMap.size(),
4851  dDTLEvt / 1.E9);
4852  }
4853  }
4854  Double_t dTIR = (dTAv - StartAnalysisTime) / 1.E9;
4855  fhRate_all->Fill(dTIR, 1. / fhRate_all->GetBinWidth(1));
4856  if (StartSpillTime < 0) {
4857  LOG(debug) << "SpillStartTime not available, abort Anatestbeam ";
4858  return kFALSE;
4859  }
4860  // if(dMul4>dM4Max || dMulD>dMDMax || dMul0>dM0Max)
4861  if (dMul0 > dM0Max || dMul4 > dM4Max || dMulD > dMDMax || dMulS2 > dM4Max) {
4862  BSel[0] = kFALSE;
4863  LOG(debug) << Form("<D> Muls %4.0f, %4.0f, %4.0f, %4.0f, Matches %d",
4864  dMulD,
4865  dMul0,
4866  dMul4,
4867  dMulS2,
4868  iNbMatchedHits);
4869  }
4870 
4871  // Determine average event quantities
4872 
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++) { // loop over Dut Hits
4877  dDutTMean += vDutHit[i]->GetTime();
4878  dDutTMean2 += vDutHit[i]->GetTime() * vDutHit[i]->GetTime();
4879  }
4880  dDutTMean /= (Double_t) vDutHit.size();
4881  dDutTMean2 /= (Double_t) vDutHit.size();
4882  Double_t dDutTSig = TMath::Sqrt(dDutTMean2 - dDutTMean * dDutTMean);
4883 
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++) { // loop over Ref Hits
4888  dRefTMean += vRefHit[i]->GetTime();
4889  dRefTMean2 += vRefHit[i]->GetTime() * vRefHit[i]->GetTime();
4890  }
4891  dRefTMean /= (Double_t) vRefHit.size();
4892  dRefTMean2 /= (Double_t) vRefHit.size();
4893  Double_t dRefTSig = TMath::Sqrt(dRefTMean2 - dRefTMean * dRefTMean);
4894 
4895  // histogram distances
4896  for (Int_t i = 0; i < iNDutHits - 1; i++) { // loop over Dut Hits
4897  for (Int_t j = i + 1; j < iNDutHits; j++) { // loop over Dut Hits
4898  fhDutDXDYDT->Fill(vDutHit[j]->GetX() - vDutHit[i]->GetX(),
4899  vDutHit[j]->GetY() - vDutHit[i]->GetY(),
4900  vDutHit[j]->GetTime() - vDutHit[i]->GetTime());
4901  }
4902  }
4903  for (Int_t i = 0; i < iNRefHits - 1; i++) { // loop over Ref Hits
4904  for (Int_t j = i + 1; j < iNRefHits; j++) { // loop over Ref Hits
4905  fhRefDXDYDT->Fill(vRefHit[j]->GetX() - vRefHit[i]->GetX(),
4906  vRefHit[j]->GetY() - vRefHit[i]->GetY(),
4907  vRefHit[j]->GetTime() - vRefHit[i]->GetTime());
4908  }
4909  }
4910 
4911  // normalisation distributions
4912  fhNMatch04->Fill(iNbMatchedHits);
4913  if (fTrbHeader != NULL)
4915  else
4916  fhTIS_all->Fill((dTAv - StartSpillTime) / 1.E9);
4917 
4918  fhTIR_all->Fill(dTIR);
4919 
4920  LOG(debug) << Form(
4921  " FoundMatches: %d with first chi2s = %12.1f, %12.1f, %12.1f, %12.1f",
4922  iNbMatchedHits,
4923  Chi2List[0],
4924  Chi2List[1],
4925  Chi2List[2],
4926  Chi2List[3])
4927  << Form(", Muls %4.0f, %4.0f, %4.0f", dMulD, dMul0, dMul4);
4928 
4929 
4930  if (BSel[0]) {
4931  fhSelEfficiency->Fill(kTRUE, fiNAccRefTracks);
4932  fhSelHitTupleEfficiencyTIS->Fill(kTRUE, (dTAv - StartSpillTime) / 1.E9);
4933  } else {
4934  fhSelEfficiency->Fill(kFALSE, fiNAccRefTracks);
4935  fhSelHitTupleEfficiencyTIS->Fill(kFALSE, (dTAv - StartSpillTime) / 1.E9);
4936  }
4937 
4938 
4939  // selector 0 distributions
4940  if (BSel[0]) {
4941  LOG(debug) << Form(" Found valid selector ");
4942  fhNMatchD4sel->Fill(iNbMatchedHits); // use as normalisation
4943 
4944  if (fTrbHeader != NULL)
4946  else
4947  fhTIS_sel->Fill((dTAv - StartSpillTime) / 1.E9);
4948  fhTIR_sel->Fill(dTIR);
4949 
4950  fhTofD4sel->Fill(pHitRef->GetTime() - dTDia); // general normalisation
4951  fhDTD4sel->Fill(dDTD4Min); // general normalisation
4952 
4953  Int_t iDutCh = 0;
4954  Double_t dTimeSinceLastDutHit = 0.;
4955 
4956  if (fChannelInfoDut != NULL) {
4957  // Project into Dut reference frame
4958  /*TGeoNode *fNodeDut=*/ // prepare global->local trafo
4959  gGeoManager->FindNode(fChannelInfoDut->GetX(),
4960  fChannelInfoDut->GetY(),
4961  fChannelInfoDut->GetZ());
4962 
4963  hitpos1[0] = fChannelInfoDut->GetZ() / pHitRef->GetZ() * pHitRef->GetX();
4964  hitpos1[1] = fChannelInfoDut->GetZ() / pHitRef->GetZ() * pHitRef->GetY();
4965  hitpos1[2] = fChannelInfoDut->GetZ();
4966 
4967  /*TGeoNode* cNodeDut=*/gGeoManager->GetCurrentNode();
4968  gGeoManager->MasterToLocal(hitpos1, hitpos1_local);
4969  //hitpos1_local[0] -= fiDutNch/2 * fChannelInfoDut->GetSizex();
4970  fhXY0D4sel->Fill(hitpos1_local[0], hitpos1_local[1]);
4971 
4972  iDutCh = TMath::Floor(hitpos1_local[0] / fChannelInfoDut->GetSizex())
4973  + fiDutNch / 2; // FIXME: needs proper calculation
4974  if (iDutCh < 0 || iDutCh > fiDutNch - 1) {
4975  LOG(debug) << "Predicted ch " << iDutCh
4976  << " from x = " << hitpos1_local[0]
4977  << ", Sizex =" << fChannelInfoDut->GetSizex();
4978  if (iDutCh < 0) iDutCh = 0;
4979  if (iDutCh > fiDutNch - 1) iDutCh = fiDutNch - 1;
4980  }
4981  if (NULL != fClusterizer)
4982  if (fClusterizer->fdMemoryTime > 0) {
4983  for (Int_t iDutChtest = iDutCh; iDutChtest < iDutCh + 1;
4984  iDutChtest++) { // test possible strips
4985  if (iDutChtest < 0) iDutChtest = 0;
4986  if (iDutChtest > fiDutNch - 1) iDutChtest = fiDutNch - 1;
4987  if (fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutChtest]
4988  .size()
4989  > 1) {
4990  std::list<CbmTofHit*>::iterator itL =
4991  fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutChtest]
4992  .end();
4993  itL--;
4994  //find out, whether hit was added for current event
4995  for (Int_t i = 0; i < iNDutHits; i++) { // loop over Dut Hits
4996  LOG(debug1)
4997  << "Inspect " << i << " for address match "
4998  << (*itL)->GetAddress() << " - " << vDutHit[i]->GetAddress();
4999  if ((*itL)->GetAddress() == vDutHit[i]->GetAddress()) {
5000  LOG(debug)
5001  << "iDutCh hit was added to DTLH from Mul " << iNDutHits;
5002  itL--;
5003  break; //
5004  }
5005  }
5006  // std::list<CbmTofHit *>::iterator itL=fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutChtest].begin();
5007  dTimeSinceLastDutHit = TMath::Max(
5008  0., TMath::Log10(pHitRef->GetTime() - (*itL)->GetTime()));
5009  break; //leave for-loop
5010  } else
5011  dTimeSinceLastDutHit =
5012  9.9; //generate entry in last bin of histogram
5013  }
5014 
5015  LOG(debug) << Form(
5016  " DTLH for iDutCh %02d Mul %03d: %6.1f from size %lu, ref %12.0f ",
5017  iDutCh,
5018  iNDutHits,
5019  dTimeSinceLastDutHit,
5020  //fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutCh-1].size(),
5021  fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutCh].size(),
5022  //fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutCh+1].size(),
5023  // (*fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutCh-1].begin())->GetTime(),
5024  // (*fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutCh].begin())->GetTime(),
5025  //(*(fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutCh].end())--)->GetTime(),
5026  //(*fClusterizer->fvLastHits[fiDut][fiDutSm][fiDutRpc][iDutCh+1].begin())->GetTime(),
5027  pHitRef->GetTime());
5028  fhDTLH_sel->Fill(dTimeSinceLastDutHit);
5029  }
5030  }
5031 
5032  // Monitor selected Reference Hit position
5033  /*TGeoNode *fNodeRef=*/ // prepare global->local trafo
5034  gGeoManager->FindNode(fChannelInfoRef->GetX(),
5035  fChannelInfoRef->GetY(),
5036  fChannelInfoRef->GetZ());
5037 
5038  hitpos2[0] = pHitRef->GetX();
5039  hitpos2[1] = pHitRef->GetY();
5040  hitpos2[2] = pHitRef->GetZ();
5041  /*TGeoNode* cNodeRef=*/gGeoManager->GetCurrentNode();
5042  gGeoManager->MasterToLocal(hitpos2, hitpos2_local);
5043  fhXY4D4sel->Fill(hitpos2_local[0], hitpos2_local[1]);
5044 
5045  if (NULL != pHitSel2) {
5046  /*Int_t iDetId3 = (pHitSel2->GetAddress() & DetMask);*/
5047  Int_t iChId3 = pHitSel2->GetAddress();
5048  fChannelInfo3 = fDigiPar->GetCell(iChId3);
5049  /*TGeoNode *fNode3=*/ // prepare global->local trafo
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  /*TGeoNode* cNode3=*/gGeoManager->GetCurrentNode();
5056  gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
5057  fhXYSel2D4sel->Fill(hitpos3_local[0], hitpos3_local[1]);
5058 
5059  if (fTrbHeader != NULL)
5061  else
5062  fhTIS_sel2->Fill((dTAv - StartSpillTime) / 1.E9);
5063  fhTIR_sel2->Fill(dTIR);
5064 
5065  if (NULL != fClusterizer)
5066  if (fClusterizer->fdMemoryTime > 0) {
5067  fhDTLH_sel2->Fill(dTimeSinceLastDutHit);
5068  }
5069  }
5070 
5071  if (fbMonteCarloComparison) {
5072  if (fbTracksInInputFile) {
5073  Int_t iMatchedRealTrackLink(-1);
5074  std::set<Int_t> RealTrackLinkSet;
5075 
5076  // A Sel2 counter was defined. Assessing purity for a selector hit tuple
5077  // does not make too much sense if the MRef counter is the only reference
5078  // apart from a BRef (start) counter.
5079  if (pHitSel2) {
5080  Int_t iNSelHitTupleHits(3);
5081 
5082  CbmMatch* tMRefHitTrackMatch =
5083  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iMRefHitInd));
5084  CbmMatch* tSel2HitTrackMatch =
5085  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iSel2HitInd));
5086  CbmMatch* tBRefHitTrackMatch =
5087  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iBRefHitInd));
5088 
5089  for (Int_t iMRefHitTrackLink = 0;
5090  iMRefHitTrackLink < tMRefHitTrackMatch->GetNofLinks();
5091  iMRefHitTrackLink++) {
5092  tSelHitTupleTrackMatch.AddLink(
5093  tMRefHitTrackMatch->GetLink(iMRefHitTrackLink));
5094  }
5095 
5096  for (Int_t iSel2HitTrackLink = 0;
5097  iSel2HitTrackLink < tSel2HitTrackMatch->GetNofLinks();
5098  iSel2HitTrackLink++) {
5099  tSelHitTupleTrackMatch.AddLink(
5100  tSel2HitTrackMatch->GetLink(iSel2HitTrackLink));
5101  }
5102 
5103  for (Int_t iBRefHitTrackLink = 0;
5104  iBRefHitTrackLink < tBRefHitTrackMatch->GetNofLinks();
5105  iBRefHitTrackLink++) {
5106  tSelHitTupleTrackMatch.AddLink(
5107  tBRefHitTrackMatch->GetLink(iBRefHitTrackLink));
5108  }
5109 
5110  const CbmLink& tSelHitTupleMatchedTrackLink =
5111  tSelHitTupleTrackMatch.GetMatchedLink();
5112  Double_t dSelHitTupleMaxTrackLinkWeight =
5113  tSelHitTupleMatchedTrackLink.GetWeight();
5114 
5115  for (Int_t iSelHitTupleTrackLink = 0;
5116  iSelHitTupleTrackLink < tSelHitTupleTrackMatch.GetNofLinks();
5117  iSelHitTupleTrackLink++) {
5118  const CbmLink& tSelHitTupleTrackLink =
5119  tSelHitTupleTrackMatch.GetLink(iSelHitTupleTrackLink);
5120 
5121  if (dSelHitTupleMaxTrackLinkWeight
5122  == tSelHitTupleTrackLink.GetWeight()
5123  && -1 < tSelHitTupleTrackLink.GetIndex()) {
5124  iMatchedRealTrackLink = tSelHitTupleTrackLink.GetIndex();
5125  RealTrackLinkSet.emplace(tSelHitTupleTrackLink.GetIndex());
5126  }
5127  }
5128 
5129  Int_t iNTrueTupleHits =
5130  static_cast<Int_t>(dSelHitTupleMaxTrackLinkWeight);
5131 
5132  // The beam particle track link (-5, -5, -5) cannot add up to the
5133  // weight of track links found in the MRef and Sel2 counters. For
5134  // consistency, it should be counted as a true sel tuple hit, though.
5135  if (5 == fiBeamRefSmType) { iNTrueTupleHits++; }
5136 
5137  tSelHitTupleTrackMatch.SetNofTrueHits(iNTrueTupleHits);
5138  tSelHitTupleTrackMatch.SetNofWrongHits(iNSelHitTupleHits
5139  - iNTrueTupleHits);
5140 
5141  // For a pure sel hit tuple, request a particle track match different
5142  // from a beam or a dark point.
5143  // The case that a noise link and a particle link have the same weight
5144  // and the noise link is - by chance - the matched one is handled here:
5145  // The noise link is ignored while assessing purity if and only if a
5146  // particle link with the same weight exists.
5147  if (-1 < iMatchedRealTrackLink) {
5148  if (1. == tSelHitTupleTrackMatch.GetTrueOverAllHitsRatio()) {
5149  fhSelPurity->Fill(kTRUE, fiNAccRefTracks);
5150  bGoodTrackSel = kTRUE;
5151  } else {
5152  fhSelPurity->Fill(kFALSE, fiNAccRefTracks);
5153  }
5154  } else {
5155  fhSelPurity->Fill(kFALSE, fiNAccRefTracks);
5156  }
5157  }
5158 
5159 
5160  if (bGoodTrackSel) {
5161  TGeoNode* tNode(NULL);
5162  TGeoMedium* tMedium(NULL);
5163  TGeoMaterial* tMaterial(NULL);
5164 
5165  const char* cMaterialName;
5166 
5167  const char* cSelRefTrackPdgName;
5168  const char* cSelRefTrackProcessName;
5169 
5170  Bool_t bSelRefTrack(kFALSE);
5171 
5172  for (auto const& iTrack : RealTrackLinkSet) {
5173  CbmMCTrack* tTrack =
5174  dynamic_cast<CbmMCTrack*>(fAccTracks->At(iTrack));
5175  CbmMatch* tTrackPointMatch =
5176  dynamic_cast<CbmMatch*>(fTofAccTrackPointMatches->At(iTrack));
5177 
5178  tNode = gGeoManager->FindNode(
5179  tTrack->GetStartX(), tTrack->GetStartY(), tTrack->GetStartZ());
5180  tMedium = tNode->GetMedium();
5181  tMaterial = tMedium->GetMaterial();
5182 
5183  GetMaterialName(tMaterial->GetName(), cMaterialName);
5184 
5185  if (0 == std::strcmp("target", cMaterialName)
5186  && fiMinMCRefTrackPoints <= tTrackPointMatch->GetNofLinks()) {
5187  bSelRefTrack = kTRUE;
5188 
5189  GetPdgName(tTrack->GetPdgCode(), cSelRefTrackPdgName);
5190  GetProcessName(TMCProcessName[tTrack->GetGeantProcessId()],
5191  cSelRefTrackProcessName);
5192  }
5193  }
5194 
5195  if (bSelRefTrack) {
5196  fhSelRefTrackShare->Fill(kTRUE, fiNAccRefTracks);
5197  fhSelRefTrackProcSpec->Fill(
5198  cSelRefTrackProcessName, cSelRefTrackPdgName, 1.);
5199  } else {
5200  fhSelRefTrackShare->Fill(kFALSE, fiNAccRefTracks);
5201  }
5202  }
5203  }
5204  }
5205 
5206 
5207  if (iNbMatchedHits > 0) {
5208  // best match
5209  LOG(debug) << Form("best match D4 (%d): 0x%p, 0x%p in ch 0x%08x, 0x%08x: "
5210  "%12.1f < %12.1f ?",
5211  iNbMatchedHits,
5212  pChi2Hit1[0],
5213  pChi2Hit2[0],
5214  pChi2Hit1[0]->GetAddress(),
5215  pChi2Hit2[0]->GetAddress(),
5216  Chi2List[0],
5217  fdChi2Lim);
5218 
5219  if (NULL != pHitSel2) {
5220  fhXYSel2D4best->Fill(hitpos3_local[0], hitpos3_local[1]);
5221  }
5222 
5223  pHit1 = pChi2Hit1[0]; //Dut
5224  pHit2 = pChi2Hit2[0]; //MRpcRef
5225  Int_t iM0 = 0;
5226  if (pHit2 != pHitRef) {
5227  LOG(debug) << " selector hit does not match reference hit for best "
5228  "match, chi2best "
5229  << Chi2List[0]
5230  << Form(", ref found in Addr 0x%08x ",
5231  pHitRef->GetAddress());
5232  for (iM0 = 1; iM0 < iNbMatchedHits; iM0++) {
5233  if (pHitRef == pChi2Hit2[iM0]) {
5234  LOG(debug) << " found reference hit for best match, chi2new "
5235  << Chi2List[iM0];
5236  pHit1 = pChi2Hit1[iM0];
5237  pHit2 = pChi2Hit2[iM0];
5238  break;
5239  }
5240  }
5241  if (iM0 == iNbMatchedHits) {
5242  LOG(debug) << Form("no valid match in %d hits for Addr 0x%08x found ",
5243  iNbMatchedHits,
5244  pHitRef->GetAddress());
5245  if (gLogger->IsLogNeeded(fair::Severity::debug1))
5246  LOG(fatal) << "Check for consistency!";
5247  return 0;
5248  }
5249  }
5250 
5251  // 2019-01-02 chs
5252  // Calibration code was moved here to make the corrected time difference
5253  // 'dToD' between the DUT and MRef counters available also for the
5254  // (else) case that the selected DUT-MRef hit pair does not meet the
5255  // 'fdChi2Lim' criterion for an efficient match.
5256  Int_t iDetId1 = (pHit1->GetAddress() & DetMask);
5257  Int_t iChId1 = pHit1->GetAddress();
5258  fChannelInfo1 = fDigiPar->GetCell(iChId1);
5259 
5260  Int_t iDetId2 = (pHit2->GetAddress() & DetMask);
5261  Int_t iChId2 = pHit2->GetAddress();
5262  fChannelInfo2 = fDigiPar->GetCell(iChId2);
5263 
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.;
5269  if (fEnableMatchPosScaling) dzscal = zPos1 / pHit2->GetZ();
5270 
5271  Double_t xPos2 = dzscal * pHit2->GetX();
5272  Double_t yPos2 = dzscal * pHit2->GetY();
5273  Double_t tof2 = pHit2->GetTime();
5274 
5275  Double_t dDist =
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));
5279 
5280  CbmMatch* digiMatch1 =
5281  (CbmMatch*) fTofDigiMatchColl->At(fTofHitsColl->IndexOf(pHit1));
5282  Double_t dCluSize0 = digiMatch1->GetNofLinks() / 2.;
5283 
5284  CbmMatch* digiMatch2 =
5285  (CbmMatch*) fTofDigiMatchColl->At(fTofHitsColl->IndexOf(pHit2));
5286  Double_t dCluSize4 = digiMatch2->GetNofLinks() / 2.;
5287 
5288  // check for dependence in counter reference frame
5289  /*TGeoNode *fNode=*/ // prepare global->local trafo
5290  gGeoManager->FindNode(
5291  fChannelInfo2->GetX(), fChannelInfo2->GetY(), fChannelInfo2->GetZ());
5292 
5293  hitpos2[0] = pHit2->GetX();
5294  hitpos2[1] = pHit2->GetY();
5295  hitpos2[2] = pHit2->GetZ();
5296 
5297  /* TGeoNode* cNode=*/gGeoManager
5298  ->GetCurrentNode(); // -> Comment to remove warning because set but never used
5299  // if(0) cNode->Print();
5300  gGeoManager->MasterToLocal(hitpos2, hitpos2_local);
5301 
5302  Double_t dTofD4 = fdTOffD4 + dDTD4Min;
5303  Double_t dInvVel = dTofD4 / pHitRef->GetR(); // in ns/cm
5304  Double_t dDTexp = dDist * dInvVel;
5305  Double_t dTMin = fdHitDistAv / 30.; // in ns
5306  CbmMatch* digiMatch0 =
5307  (CbmMatch*) fTofDigiMatchColl->At(fTofHitsColl->IndexOf(pHit1));
5308  Double_t dTot0 = 0.;
5309 
5311  for (Int_t iLink = 0; iLink < digiMatch0->GetNofLinks();
5312  iLink++) { // loop over digis
5313  CbmLink L0 = digiMatch0->GetLink(iLink);
5314  Int_t iDigInd0 = L0.GetIndex();
5315  const CbmTofDigi* pDig0 = fDigiMan->Get<CbmTofDigi>(iDigInd0);
5316  dTot0 += pDig0->GetTot();
5317  LOG(debug1) << Form(" dTot of hit 0x%08x: digind %d add %f -> sum %f",
5318  iDetId1,
5319  iDigInd0,
5320  pDig0->GetTot(),
5321  dTot0);
5322  }
5323  dTot0 /= digiMatch0->GetNofLinks(); // average time over threshold
5324 
5325  CbmMatch* digiMatch4 =
5326  (CbmMatch*) fTofDigiMatchColl->At(fTofHitsColl->IndexOf(pHit2));
5327  Double_t dTot4 = 0.;
5328  // if(NULL != fTofDigisColl)
5330  for (Int_t iLink = 0; iLink < digiMatch4->GetNofLinks();
5331  iLink++) { // loop over digis
5332  CbmLink L0 = digiMatch4->GetLink(iLink);
5333  Int_t iDigInd0 = L0.GetIndex();
5334  const CbmTofDigi* pDig0 = fDigiMan->Get<CbmTofDigi>(iDigInd0);
5335  // CbmTofDigi *pDig0 = (CbmTofDigi*) (fTofDigisColl->At(iDigInd0));
5336  dTot4 += pDig0->GetTot();
5337  LOG(debug1) << Form(" dTot of hit 0x%08x: digind %d add %f -> sum %f",
5338  iDetId1,
5339  iDigInd0,
5340  pDig0->GetTot(),
5341  dTot4);
5342  }
5343  dTot4 /= digiMatch4->GetNofLinks(); // average time over threshold
5344 
5345  Double_t dTcor = 0.;
5346  if (fhDTD4DT04D4Off != NULL)
5347  dTcor += (Double_t) fhDTD4DT04D4Off->GetBinContent(
5348  fhDTD4DT04D4Off->FindBin(-dDTD4Min));
5349  if (fhDTX4D4Off != NULL)
5350  dTcor += (Double_t) fhDTX4D4Off->GetBinContent(
5351  fhDTX4D4Off->FindBin(hitpos2_local[0]));
5352  if (fhDTY4D4Off != NULL)
5353  dTcor += (Double_t) fhDTY4D4Off->GetBinContent(
5354  fhDTY4D4Off->FindBin(hitpos2_local[1]));
5355  if (fhDTTexpD4Off != NULL)
5356  dTcor += (Double_t) fhDTTexpD4Off->GetBinContent(
5357  fhDTTexpD4Off->FindBin(dDTexp - dTMin));
5358  if (fhCluSize0DT04D4Off != NULL)
5359  dTcor += (Double_t) fhCluSize0DT04D4Off->GetBinContent(
5360  fhCluSize0DT04D4Off->FindBin(dCluSize0));
5361  if (fhCluSize4DT04D4Off != NULL)
5362  dTcor += (Double_t) fhCluSize4DT04D4Off->GetBinContent(
5363  fhCluSize4DT04D4Off->FindBin(dCluSize4));
5364  if (fhTot0DT04D4Off != NULL)
5365  dTcor += (Double_t) fhTot0DT04D4Off->GetBinContent(
5366  fhTot0DT04D4Off->FindBin(TMath::Log(dTot0)));
5367  if (fhTot4DT04D4Off != NULL)
5368  dTcor += (Double_t) fhTot4DT04D4Off->GetBinContent(
5369  fhTot4DT04D4Off->FindBin(TMath::Log(dTot4)));
5370 
5371  // dTcor *= dDist/fdHitDistAv;
5372  Double_t dToD = (tof1 - tof2 - dTcor - fdDTMean); //*fdHitDistAv/dDist;
5373  // LOG(info) << "dTcor for "<<-dDTD4<<" from "<<fhDTD4DT04D4Off<<": "<<dTcor;
5374 
5375 
5376  Bool_t bGoodSelDutMatch(kFALSE);
5377 
5378  if (fbMonteCarloComparison) {
5379  Int_t iDutHitInd = fTofHitsColl->IndexOf(pHit1);
5380 
5381  if (fbTracksInInputFile) {
5382  if (bGoodTrackSel) {
5383  CbmMatch* tDutHitTrackMatch =
5384  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iDutHitInd));
5385 
5386  Double_t dSelHitTupleMaxTrackLinkWeight =
5387  (tSelHitTupleTrackMatch.GetMatchedLink()).GetWeight();
5388 
5389 
5390  for (Int_t iSelHitTupleTrackLink = 0;
5391  iSelHitTupleTrackLink < tSelHitTupleTrackMatch.GetNofLinks();
5392  iSelHitTupleTrackLink++) {
5393  const CbmLink& tSelHitTupleTrackLink =
5394  tSelHitTupleTrackMatch.GetLink(iSelHitTupleTrackLink);
5395 
5396  if (dSelHitTupleMaxTrackLinkWeight
5397  == tSelHitTupleTrackLink.GetWeight()) {
5398  for (Int_t iDutHitTrackLink = 0;
5399  iDutHitTrackLink < tDutHitTrackMatch->GetNofLinks();
5400  iDutHitTrackLink++) {
5401  const CbmLink& tDutHitTrackLink =
5402  tDutHitTrackMatch->GetLink(iDutHitTrackLink);
5403 
5404  if (tSelHitTupleTrackLink == tDutHitTrackLink) {
5405  bGoodSelDutMatch = kTRUE;
5406  break;
5407  }
5408  }
5409  }
5410 
5411  if (bGoodSelDutMatch) { break; }
5412  }
5413 
5414  if (bGoodSelDutMatch) {
5415  fhGoodSelTypeNNPureChiSq->Fill(0., 3. * Chi2List[iM0]);
5416  }
5417 
5418  fhGoodSelTypeNNAllChiSq->Fill(0., 3. * Chi2List[iM0]);
5419  }
5420  }
5421  }
5422 
5423 
5424  if (Chi2List[iM0] < fdChi2Lim) {
5425 
5426  fhSelMatchEfficiency->Fill(kTRUE, fiNAccRefTracks);
5427  fhSelHitTupleMatchEfficiencyTIS->Fill(kTRUE,
5428  (dTAv - StartSpillTime) / 1.E9);
5429 
5430  if (fTrbHeader != NULL)
5432  else
5433  fhTIS_sel1->Fill((dTAv - StartSpillTime) / 1.E9);
5434  fhTIR_sel1->Fill(dTIR);
5435 
5436  if (NULL != fClusterizer)
5437  if (fClusterizer->fdMemoryTime > 0) {
5438  Int_t iDut = CbmTofAddress::GetSmType(pHit1->GetAddress());
5439  if (fiDut != iDut)
5440  LOG(fatal) << "inconsistent Dut - type " << iDut
5441  << " != " << fiDut;
5442 
5443  Int_t iCh = CbmTofAddress::GetChannelId(pHit1->GetAddress());
5444  if (iDutCh != iCh)
5445  LOG(debug) << "Inconsistent Dut strip #: " << iCh
5446  << " != " << iDutCh;
5447  fhDTLH_DStrip->Fill((Double_t) iCh, (Double_t)(iCh - iDutCh));
5448  fhDTLH_sel1->Fill(dTimeSinceLastDutHit);
5449  }
5450 
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);
5456 
5457 
5458  fhChi04D4best->Fill(Chi2List[iM0]);
5459 
5460 
5461  fhDigiMul0D4best->Fill(dMul0, dCluSize0);
5462  fhDigiMul4D4best->Fill(dMul4, dCluSize4);
5463 
5464  fhCluSize04D4best->Fill(dCluSize0, dCluSize4);
5465 
5466  fhCluMul04D4best->Fill(dMul0, dMul4);
5467  fhStrMul04D4best->Fill(dStrMul0, dStrMul4);
5468 
5469  fhCluMulTSig0D4best->Fill(dMul0, dDutTSig);
5470  fhCluMulTSig4D4best->Fill(dMul4, dRefTSig);
5471 
5472  fhCluMulTrel0D4best->Fill(dMul0, pHit1->GetTime() - dDutTMean);
5473  fhCluMulTrel4D4best->Fill(dMul4, pHit2->GetTime() - dRefTMean);
5474 
5475  fhCluSizeTrel0D4best->Fill(dCluSize0, pHit1->GetTime() - dDutTMean);
5476  fhCluSizeTrel4D4best->Fill(dCluSize4, pHit2->GetTime() - dRefTMean);
5477 
5478 
5479  fhTofD4best->Fill(dTofD4);
5480  if (dInvVel > 0.) fhVelD4best->Fill(1. / dInvVel);
5481 
5482  fhChiDT04D4best->Fill(Chi2List[iM0], dToD);
5483  fhDTD4DT04D4best->Fill(-dDTD4Min, dToD);
5484  fhDTMul4D4best->Fill(dMul4, dToD);
5485 
5486  fhXY4D4best->Fill(hitpos2_local[0], hitpos2_local[1]);
5487  fhDTX4D4best->Fill(hitpos2_local[0], dToD);
5488  fhDTY4D4best->Fill(hitpos2_local[1], dToD);
5489  fhDXX4D4best->Fill(hitpos2_local[0], xPos1 - xPos2);
5490  fhDXY4D4best->Fill(hitpos2_local[1], xPos1 - xPos2);
5491  fhDYX4D4best->Fill(hitpos2_local[0], yPos1 - yPos2);
5492  fhDYY4D4best->Fill(hitpos2_local[1], yPos1 - yPos2);
5493 
5494  fhCluSize4DT04D4best->Fill(digiMatch2->GetNofLinks() / 2., dToD);
5495 
5496  Double_t dTot = 0.;
5498  for (Int_t iLink = 0; iLink < digiMatch2->GetNofLinks();
5499  iLink++) { // loop over digis
5500  CbmLink L0 = digiMatch2->GetLink(iLink);
5501  Int_t iDigInd0 = L0.GetIndex();
5502  const CbmTofDigi* pDig0 = fDigiMan->Get<CbmTofDigi>(iDigInd0);
5503  dTot += pDig0->GetTot();
5504  LOG(debug) << Form(
5505  " dTot of hit 0x%08x: digind %d add %f -> sum %f",
5506  iDetId2,
5507  iDigInd0,
5508  pDig0->GetTot(),
5509  dTot);
5510  }
5511 
5512  dTot /= digiMatch2->GetNofLinks(); // average time over threshold
5513  fhTot4DT04D4best->Fill(TMath::Log(dTot), dToD);
5514 
5515  fhCluSize0DT04D4best->Fill(digiMatch0->GetNofLinks() / 2., dToD);
5516 
5517  dTot = 0.;
5519  for (Int_t iLink = 0; iLink < digiMatch0->GetNofLinks();
5520  iLink++) { // loop over digis
5521  CbmLink L0 = digiMatch0->GetLink(iLink);
5522  Int_t iDigInd0 = L0.GetIndex();
5523  const CbmTofDigi* pDig0 = fDigiMan->Get<CbmTofDigi>(iDigInd0);
5524  dTot += pDig0->GetTot();
5525  LOG(debug1) << Form(
5526  " dTot of hit 0x%08x: digind %d add %f -> sum %f",
5527  iDetId1,
5528  iDigInd0,
5529  pDig0->GetTot(),
5530  dTot);
5531  }
5532  dTot /= digiMatch0->GetNofLinks(); // average time over threshold
5533  fhTot0DT04D4best->Fill(TMath::Log(dTot), dToD);
5534 
5535  fhCluSizeSigT0D4best->Fill(digiMatch1->GetNofLinks() / 2.,
5536  pHit1->GetTimeError());
5537  fhCluSizeSigT4D4best->Fill(digiMatch2->GetNofLinks() / 2.,
5538  pHit2->GetTimeError());
5539 
5540  fhDTMul0D4best->Fill(dMul0, dToD);
5541 
5542  // check for dependence in counter reference frame
5543  /*TGeoNode *fNode1=*/ // prepare global->local trafo
5544  gGeoManager->FindNode(
5545  fChannelInfo1->GetX(), fChannelInfo1->GetY(), fChannelInfo1->GetZ());
5546 
5547  hitpos1[0] = pHit1->GetX();
5548  hitpos1[1] = pHit1->GetY();
5549  hitpos1[2] = pHit1->GetZ();
5550 
5551  /*TGeoNode* cNode1=*/gGeoManager->GetCurrentNode();
5552  gGeoManager->MasterToLocal(hitpos1, hitpos1_local);
5553 
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]);
5557 
5558  fhDTX0D4best->Fill(hitpos1_local[0], dToD);
5559  fhDTY0D4best->Fill(hitpos1_local[1], dToD);
5560  fhDXX0D4best->Fill(hitpos1_local[0], xPos1 - xPos2);
5561  fhDXY0D4best->Fill(hitpos1_local[1], xPos1 - xPos2);
5562  fhDYX0D4best->Fill(hitpos1_local[0], yPos1 - yPos2);
5563  fhDYY0D4best->Fill(hitpos1_local[1], yPos1 - yPos2);
5564 
5565  fhDXDY04D4best->Fill(xPos1 - xPos2, yPos1 - yPos2);
5566  fhDXDT04D4best->Fill(xPos1 - xPos2, dToD);
5567  fhDYDT04D4best->Fill(yPos1 - yPos2, dToD);
5568  fhDistDT04D4best->Fill(dDist, dToD);
5569  fhTexpDT04D4best->Fill(dDTexp - dTMin, dToD);
5570  fhX0DT04D4best->Fill(hitpos1_local[0], dToD);
5571  fhY0DT04D4best->Fill(hitpos1_local[1], dToD);
5572  if (fTrbHeader != NULL)
5573  fhTISDT04D4best->Fill(fTrbHeader->GetTimeInSpill(), dToD);
5574  else
5575  fhTISDT04D4best->Fill((dTAv - StartSpillTime) / 1.E9, dToD);
5576 
5577  if (fbMonteCarloComparison) {
5578  Int_t iDutHitInd = fTofHitsColl->IndexOf(pHit1);
5579 
5580  if (fbTracksInInputFile) {
5581  if (bGoodTrackSel) {
5582  if (bGoodSelDutMatch) {
5583  fhSelMatchPurity->Fill(kTRUE, fiNAccRefTracks);
5584  } else {
5585  fhSelMatchPurity->Fill(kFALSE, fiNAccRefTracks);
5586  }
5587  }
5588  // uncomment to account for impure selectors in the matching purity calculation
5589  /*
5590  else
5591  {
5592  fhSelMatchPurity->Fill(kFALSE, fiNAccRefTracks);
5593  }
5594 */
5595 
5596  fhNTracksPerSelMRefHit->Fill(
5597  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iMRefHitInd))
5598  ->GetNofLinks());
5599  if (pHitSel2) {
5600  fhNTracksPerSelSel2Hit->Fill(
5601  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iSel2HitInd))
5602  ->GetNofLinks());
5603  }
5604  fhNTracksPerSelDutHit->Fill(
5605  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iDutHitInd))
5606  ->GetNofLinks());
5607  }
5608 
5609 
5610  CbmMatch* tDutHitPointMatch =
5611  dynamic_cast<CbmMatch*>(fTofHitPointMatches->At(iDutHitInd));
5612  const CbmLink& tDutHitPointLink = tDutHitPointMatch->GetMatchedLink();
5613  CbmTofPoint* tDutHitMatchedPoint(NULL);
5614 
5615  Int_t iFileIndex = tDutHitPointLink.GetFile();
5616  Int_t iEventIndex = tDutHitPointLink.GetEntry();
5617  Int_t iArrayIndex = tDutHitPointLink.GetIndex();
5618 
5619  if (-1 < iFileIndex && -1 < iEventIndex && -1 < iArrayIndex) {
5620  Double_t dMCEventStartTime(0.);
5621 
5622  if (fbPointsInInputFile) {
5623  tDutHitMatchedPoint =
5624  dynamic_cast<CbmTofPoint*>(fTofPointsTB->At(iArrayIndex));
5625  } else {
5626  tDutHitMatchedPoint = dynamic_cast<CbmTofPoint*>(
5627  fTofPoints->Get(iFileIndex, iEventIndex, iArrayIndex));
5628 
5629  dMCEventStartTime =
5630  fMCEventList->GetEventTime(iEventIndex, iFileIndex);
5631  }
5632 
5633  // The extrapolation of a hit position in the DUT plane from the
5634  // position of the reference hit in the MRef plane following the
5635  // intercept theorem (fEnableMatchPosScaling) is based on
5636  // two assumptions:
5637  // 1) The track which both DUT and MRef hits are supposed to be
5638  // associated with is a 3D original straight line.
5639  // 2) The global X and Y coordinates of hits in both planes have
5640  // identical signs.
5641 
5642  fhResX04HitExp->Fill(fiNAccRefTracks, xPos1 - xPos2 - fdDXMean);
5644  xPos2 - tDutHitMatchedPoint->GetX() + fdDXMean);
5646  xPos1 - tDutHitMatchedPoint->GetX());
5647 
5648  fhResY04HitExp->Fill(fiNAccRefTracks, yPos1 - yPos2 - fdDYMean);
5650  yPos2 - tDutHitMatchedPoint->GetY() + fdDYMean);
5652  yPos1 - tDutHitMatchedPoint->GetY());
5653 
5655  dToD); // center-adjustable with 'fdDTMean'
5656  Double_t dSign(1.);
5657  if (pHit1->GetZ() < pHit2->GetZ()) { dSign = -1.; }
5658  Double_t dDutMCPointDelay(0.);
5659  Double_t dMRefMCPointDelay(0.);
5660  if (fbDelayMCPoints) {
5661  dDutMCPointDelay =
5662  0.5
5663  * (fChannelInfo1->GetSizey() >= fChannelInfo1->GetSizex()
5664  ? fChannelInfo1->GetSizey()
5665  : fChannelInfo1->GetSizex())
5667  dMRefMCPointDelay =
5668  0.5
5669  * (fChannelInfo2->GetSizey() >= fChannelInfo2->GetSizex()
5670  ? fChannelInfo2->GetSizey()
5671  : fChannelInfo2->GetSizex())
5673  }
5674  fhResT04ExpMC->Fill(
5676  tof2 + dSign * dDTexp - tDutHitMatchedPoint->GetTime()
5677  - dMCEventStartTime
5678  - dMRefMCPointDelay); // center-adjustable with 'fdTOffD4'
5680  tof1 - tDutHitMatchedPoint->GetTime()
5681  - dMCEventStartTime
5682  - dDutMCPointDelay); // TODO: how to adjust?
5683  }
5684  }
5685 
5686 
5687  if (iNbMatchedHits > 1) {
5688  LOG(debug) << Form(
5689  " Matches>1: %d with first chi2s = %12.1f, %12.1f, %12.1f, %12.1f",
5690  iNbMatchedHits,
5691  Chi2List[0],
5692  Chi2List[1],
5693  Chi2List[2],
5694  Chi2List[3]);
5695 
5696  for (Int_t iM = 0; iM < iNbMatchedHits; iM++) {
5697  LOG(debug) << Form(
5698  " Match: %d (%d) with ids = 0x%08x, 0x%08x - 0x%08x, 0x%08x",
5699  iM,
5700  iNbMatchedHits,
5701  pChi2Hit1[iM]->GetAddress(),
5702  pHit1->GetAddress(),
5703  pChi2Hit2[iM]->GetAddress(),
5704  pHit2->GetAddress());
5705  if (pChi2Hit1[iM] != pHit1 && pChi2Hit2[iM] != pHit2) {
5706 
5707  LOG(debug) << Form(" second best match D4 at %d (%d): chi2 %f ",
5708  iM,
5709  iNbMatchedHits,
5710  Chi2List[iM]);
5711 
5712  if (Chi2List[iM] > 1.E3) break; // FIXME hardwired limit !
5713 
5714  pHit3 = pChi2Hit1[iM];
5715  pHit4 = pChi2Hit2[iM];
5716 
5717  /*Int_t iDetId3 = (pHit1->GetAddress() & DetMask);*/
5718  Int_t iChId3 = pHit1->GetAddress();
5719  fChannelInfo3 = fDigiPar->GetCell(iChId3);
5720 
5721  /*Int_t iDetId4 = (pHit4->GetAddress() & DetMask);*/
5722  Int_t iChId4 = pHit4->GetAddress();
5723  fChannelInfo4 = fDigiPar->GetCell(iChId4);
5724 
5725  // check for dependence in counter reference frame
5726  /*TGeoNode *fNode4= */ // prepare global->local trafo
5727  gGeoManager->FindNode(fChannelInfo4->GetX(),
5728  fChannelInfo4->GetY(),
5729  fChannelInfo4->GetZ());
5730 
5731  hitpos4[0] = pChi2Hit2[iM]->GetX();
5732  hitpos4[1] = pChi2Hit2[iM]->GetY();
5733  hitpos4[2] = pChi2Hit2[iM]->GetZ();
5734 
5735  /* cNode=*/gGeoManager
5736  ->GetCurrentNode(); // -> Comment to remove warning because set but never used
5737  gGeoManager->MasterToLocal(hitpos4, hitpos4_local);
5738 
5739  if (TMath::Abs(hitpos4_local[1])
5740  > fdPosY4Sel * fChannelInfo4->GetSizey())
5741  continue;
5742 
5743  fhChi04D4sbest->Fill(Chi2List[iM]);
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();
5749 
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();
5755 
5756  Double_t dDist34 =
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));
5760 
5761  CbmMatch* digiMatch3 =
5762  (CbmMatch*) fTofDigiMatchColl->At(fTofHitsColl->IndexOf(pHit3));
5763  fhDigiMul0D4sbest->Fill(digiMatch3->GetNofLinks() / 2.);
5764  digiMatch4 =
5765  (CbmMatch*) fTofDigiMatchColl->At(fTofHitsColl->IndexOf(pHit4));
5766  fhDigiMul4D4sbest->Fill(digiMatch4->GetNofLinks() / 2.);
5767 
5768  fhCluMul04D4sbest->Fill(dMul0, dMul4);
5769 
5770  Double_t dTofD44 = fdTOffD4 + pHit4->GetTime() - dTDia;
5771  Double_t dInvVel4 = dTofD44 / pHitRef->GetR(); // in ns/cm
5772  Double_t dDTexp4 = dDist34 * dInvVel4;
5773  Double_t dTcor4 = 0.;
5774  if (fhDTD4DT04D4Off != NULL)
5775  dTcor4 = (Double_t) fhDTD4DT04D4Off->GetBinContent(
5776  fhDTD4DT04D4Off->FindBin(dTDia - pHit4->GetTime()));
5777  if (fhDTX4D4Off != NULL)
5778  dTcor4 += (Double_t) fhDTX4D4Off->GetBinContent(
5779  fhDTX4D4Off->FindBin(hitpos4_local[0]));
5780  if (fhDTY4D4Off != NULL)
5781  dTcor4 += (Double_t) fhDTY4D4Off->GetBinContent(
5782  fhDTY4D4Off->FindBin(hitpos4_local[1]));
5783  if (fhDTTexpD4Off != NULL)
5784  dTcor4 += (Double_t) fhDTTexpD4Off->GetBinContent(
5785  fhDTTexpD4Off->FindBin(dDTexp4));
5786 
5787  Double_t dToD34 = (tof3 - tof4 - dTcor4 - fdDTMean);
5788 
5789  fhTofD4sbest->Fill(dTofD44);
5790  if (dInvVel4 > 0.) fhVelD4sbest->Fill(1000. / dInvVel4);
5791 
5792  fhChiDT04D4sbest->Fill(Chi2List[iM], dToD34);
5793 
5794  fhDTD4DT04D4sbest->Fill(dTDia - pHit4->GetTime(), dToD34);
5795  fhDTMul4D4sbest->Fill(dMul4, dToD34);
5796 
5797  fhDTX4D4sbest->Fill(hitpos4_local[0], dToD34);
5798  fhDTY4D4sbest->Fill(hitpos4_local[1], dToD34);
5799  fhDXX4D4sbest->Fill(hitpos4_local[0], xPos3 - xPos4);
5800  fhDXY4D4sbest->Fill(hitpos4_local[1], xPos3 - xPos4);
5801  fhDYX4D4sbest->Fill(hitpos4_local[0], yPos3 - yPos4);
5802  fhDYY4D4sbest->Fill(hitpos4_local[1], yPos3 - yPos4);
5803 
5804  fhCluSize4DT04D4sbest->Fill(digiMatch4->GetNofLinks() / 2.,
5805  dToD34);
5806 
5807  dTot4 = 0.;
5809  for (Int_t iLink = 0; iLink < digiMatch4->GetNofLinks();
5810  iLink++) { // loop over digis
5811  CbmLink L0 = digiMatch4->GetLink(iLink);
5812  Int_t iDigInd0 = L0.GetIndex();
5813  const CbmTofDigi* pDig0 = fDigiMan->Get<CbmTofDigi>(iDigInd0);
5814  dTot4 += pDig0->GetTot();
5815  LOG(debug)
5816  << Form(" dTot4 of hit 0x%08x: digind %d add %f -> sum %f",
5817  iDetId2,
5818  iDigInd0,
5819  pDig0->GetTot(),
5820  dTot4);
5821  }
5822 
5823  dTot4 /=
5824  digiMatch4->GetNofLinks(); // average time over threshold
5825  fhTot4DT04D4sbest->Fill(TMath::Log(dTot4), dToD34);
5826 
5827  fhCluSize0DT04D4sbest->Fill(digiMatch3->GetNofLinks() / 2.,
5828  dToD34);
5829 
5830  Double_t dTot3 = 0.;
5832  for (Int_t iLink = 0; iLink < digiMatch3->GetNofLinks();
5833  iLink++) { // loop over digis
5834  CbmLink L0 = digiMatch3->GetLink(iLink);
5835  Int_t iDigInd0 = L0.GetIndex();
5836  const CbmTofDigi* pDig0 = fDigiMan->Get<CbmTofDigi>(iDigInd0);
5837  dTot3 += pDig0->GetTot();
5838  LOG(debug)
5839  << Form(" dTot of hit 0x%08x: digind %d add %f -> sum %f",
5840  iDetId1,
5841  iDigInd0,
5842  pDig0->GetTot(),
5843  dTot3);
5844  }
5845  dTot3 /=
5846  digiMatch3->GetNofLinks(); // average time over threshold
5847  fhTot0DT04D4sbest->Fill(TMath::Log(dTot3), dToD34);
5848 
5849  fhDTMul0D4sbest->Fill(dMul0, dToD34);
5850 
5851  // check for dependence in counter reference frame
5852  /*TGeoNode *fNode3=*/ // prepare global->local trafo
5853  gGeoManager->FindNode(fChannelInfo3->GetX(),
5854  fChannelInfo3->GetY(),
5855  fChannelInfo3->GetZ());
5856 
5857  hitpos3[0] = pChi2Hit1[iM]->GetX();
5858  hitpos3[1] = pChi2Hit1[iM]->GetY();
5859  hitpos3[2] = pChi2Hit1[iM]->GetZ();
5860 
5861  /*TGeoNode* cNode3=*/gGeoManager->GetCurrentNode();
5862  gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
5863 
5864  fhDTX0D4sbest->Fill(hitpos3_local[0], dToD34);
5865  fhDTY0D4sbest->Fill(hitpos3_local[1], tof4 - tof4 - dTcor4);
5866  fhDXX0D4sbest->Fill(hitpos3_local[0], xPos3 - xPos4);
5867  fhDXY0D4sbest->Fill(hitpos3_local[1], xPos3 - xPos4);
5868  fhDYX0D4sbest->Fill(hitpos3_local[0], yPos3 - yPos4);
5869  fhDYY0D4sbest->Fill(hitpos3_local[1], yPos3 - yPos4);
5870 
5871  fhDXDY04D4sbest->Fill(xPos3 - xPos4, yPos3 - yPos4);
5872  fhDXDT04D4sbest->Fill(xPos3 - xPos4, dToD34);
5873  fhDYDT04D4sbest->Fill(yPos3 - yPos4, dToD34);
5874  fhDistDT04D4sbest->Fill(dDist34, dToD34);
5875  fhTexpDT04D4sbest->Fill(dDTexp4, dToD34);
5876  fhX0DT04D4sbest->Fill(hitpos3_local[0], dToD34);
5877  fhY0DT04D4sbest->Fill(hitpos3_local[1], dToD34);
5878 
5879  fhDT04DX0_2->Fill(hitpos1_local[0] - hitpos3_local[0], dToD34);
5880  fhDT04DY0_2->Fill(hitpos1_local[1] - hitpos3_local[1], dToD34);
5881  fhDT04DT0_2->Fill(tof1 - tof3, dToD34);
5882 
5883  fhDT04DX4_2->Fill(hitpos2_local[0] - hitpos4_local[0], dToD34);
5884  fhDT04DY4_2->Fill(hitpos2_local[1] - hitpos4_local[1], dToD34);
5885  fhDT04DT4_2->Fill(tof2 - tof4, dToD34);
5886 
5887  fhDT04DX0_1->Fill(hitpos1_local[0] - hitpos3_local[0], dToD);
5888  fhDT04DY0_1->Fill(hitpos1_local[1] - hitpos3_local[1], dToD);
5889  fhDT04DT0_1->Fill(tof1 - tof3, dToD);
5890 
5891  fhDT04DX4_1->Fill(hitpos2_local[0] - hitpos4_local[0], dToD);
5892  fhDT04DY4_1->Fill(hitpos2_local[1] - hitpos4_local[1], dToD);
5893  fhDT04DT4_1->Fill(tof2 - tof4, dToD);
5894 
5895  break;
5896  }
5897  }
5898  }
5899 
5900  fhSelTypeAccNNChiSq->Fill(0., 3. * Chi2List[iM0]);
5901  fhSelTypeAccNNResidualT->Fill(0., dToD);
5902  fhSelTypeAccNNResidualX->Fill(0., xPos1 - xPos2 - fdDXMean);
5903  fhSelTypeAccNNResidualY->Fill(0., yPos1 - yPos2 - fdDYMean);
5904 
5905  fhSelTypeNNChiSq->Fill(0., 3. * Chi2List[iM0]);
5906  fhSelTypeNNResidualT->Fill(0., dToD);
5907  fhSelTypeNNResidualX->Fill(0., xPos1 - xPos2 - fdDXMean);
5908  fhSelTypeNNResidualY->Fill(0., yPos1 - yPos2 - fdDYMean);
5909 
5910  fhSelHitTupleResidualTTIS->Fill((dTAv - StartSpillTime) / 1.E9, dToD);
5911  fhSelHitTupleDutCluSizeTIS->Fill((dTAv - StartSpillTime) / 1.E9,
5912  dCluSize0);
5913 
5914  } // fdChi2Lim end
5915  else {
5916  fhSelMatchEfficiency->Fill(kFALSE, fiNAccRefTracks);
5917  fhSelHitTupleMatchEfficiencyTIS->Fill(kFALSE,
5918  (dTAv - StartSpillTime) / 1.E9);
5919 
5920  fhSelTypeNNChiSq->Fill(0., 3. * Chi2List[iM0]);
5921  fhSelTypeNNResidualT->Fill(0., dToD);
5922  fhSelTypeNNResidualX->Fill(0., xPos1 - xPos2 - fdDXMean);
5923  fhSelTypeNNResidualY->Fill(0., yPos1 - yPos2 - fdDYMean);
5924  }
5925 
5926 
5927  Int_t iSelHitTupleDutHitMatchMul(0);
5928  Int_t iSelHitTupleDutHitMatchAccMul(0);
5929 
5930  for (Int_t iMatch = 0; iMatch < iNbMatchedHits; iMatch++) {
5931  if (pHitRef == pChi2Hit2[iMatch]) {
5932  iSelHitTupleDutHitMatchMul++;
5933 
5934  if (fdChi2Lim > Chi2List[iMatch]) { iSelHitTupleDutHitMatchAccMul++; }
5935  }
5936  }
5937 
5938  if (iSelHitTupleDutHitMatchMul) {
5939  fhSelHitTupleDutHitMatchMul->Fill(iSelHitTupleDutHitMatchMul);
5940  }
5941 
5942  if (iSelHitTupleDutHitMatchAccMul) {
5943  fhSelHitTupleDutHitMatchAccMul->Fill(iSelHitTupleDutHitMatchAccMul);
5944  }
5945 
5946  } // end of if(iNbMatchedHits>0)
5947  else {
5948  fhSelMatchEfficiency->Fill(kFALSE, fiNAccRefTracks);
5949  fhSelHitTupleMatchEfficiencyTIS->Fill(kFALSE,
5950  (dTAv - StartSpillTime) / 1.E9);
5951  }
5952  } // BSel[0] condition end
5953 
5954  // Tracklet based analysis
5955  Double_t hitpos[3], hitpos_local[3];
5956 
5957  // DDDDDD for verifying storage concept
5958  /*
5959  if(fFindTracks != NULL && fdMemoryTime > 0.) {
5960  // everything else done -> update hit memory to latest hits
5961  for( Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++)
5962  {
5963  pHit = (CbmTofHit*) fTofHitsColl->At( iHitInd );
5964  if(NULL == pHit) continue;
5965  Int_t iDetId = (pHit->GetAddress() & DetMask);
5966  Int_t iDet=fFindTracks->fMapRpcIdParInd[iDetId];
5967  fChannelInfo = fDigiPar->GetCell(pHit->GetAddress());
5968  gGeoManager->FindNode(fChannelInfo->GetX(),fChannelInfo->GetY(),fChannelInfo->GetZ());
5969  hitpos[0]=pHit->GetX();
5970  hitpos[1]=pHit->GetY();
5971  hitpos[2]=pHit->GetZ();
5972  gGeoManager->MasterToLocal(hitpos, hitpos_local);
5973  Int_t iBin = fhLHTime[iDet]->FindBin( hitpos_local[0], hitpos_local[1] );
5974  fhLHTime[iDet]->SetBinContent(iBin,pHit->GetTime()-2.);
5975  LOG(debug) << Form("Store hit 0x%08x at x %6.3f, y %6.3f, bin %d, time %f in det Id 0x%08x, #%d from x %6.3f, y %6.3f",
5976  pHit->GetAddress(),hitpos_local[0],hitpos_local[1], iBin,
5977  pHit->GetTime(), iDetId, iDet, hitpos[0],hitpos[1] )
5978  ;
5979  }
5980  } //(fdMemoryTime > 0.) end
5981  */
5982 
5983  fhTIS_Nhit->Fill((dTAv - StartSpillTime) / 1.E9, (Double_t) iNbTofHits);
5984  if (NULL != fTofTrackColl && NULL != fFindTracks) {
5985  Bool_t bSelTrackletFound(kFALSE);
5986  Int_t iBestTrklFitIndex(-1);
5987  Double_t dBestTrklFitRedChiSq(1.E300);
5988 
5989  iNbTofTracks = fTofTrackColl->GetEntries();
5990  fhTIS_Ntrk->Fill((dTAv - StartSpillTime) / 1.E9, (Double_t) iNbTofTracks);
5991 
5992  Int_t NStations = fFindTracks->GetNStations();
5993  LOG(debug) << Form("Tracklet analysis of %d tracklets from %d stations",
5994  iNbTofTracks,
5995  NStations);
5996 
5997  // if(dMul4<=dM4Max && dMulD<=dMDMax &&dMulS2<=dM4Max)
5998  if (dMul0 <= dM0Max && dMul4 <= dM4Max && dMulD <= dMDMax
5999  && dMulS2 <= dM4Max)
6000  if (iNbTofTracks > 0) { // Tracklet Analysis
6001  // prepare Dut Hit List
6002 
6003  Int_t iChIdDut =
6005  fChannelInfo = fDigiPar->GetCell(iChIdDut);
6006  /*TGeoNode *fNode=*/ // prepare global->local trafo
6007  gGeoManager->FindNode(
6009  /*TGeoNode* cNode=*/gGeoManager->GetCurrentNode();
6010  Double_t dDutzPos = fChannelInfo->GetZ();
6011 
6012  LOG(debug) << Form("Tracklet analysis of %d tracks and %d Dut Hits ",
6013  iNbTofTracks,
6014  (int) vDutHit.size());
6015 
6016  std::vector<std::map<Double_t, Int_t>>
6017  vTrkMap; //contains the tracks for a given hit
6018  std::vector<std::map<Double_t, Int_t>>
6019  vHitMap; //contains the hits for a given track
6020 
6021  vTrkMap.resize(vDutHit.size());
6022  vHitMap.resize(iNbTofTracks);
6023 
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;
6028 
6029  for (Int_t iTrk = 0; iTrk < iNbTofTracks; iTrk++) {
6030  CbmTofTracklet* pTrk = (CbmTofTracklet*) fTofTrackColl->At(iTrk);
6031  if (NULL == pTrk) continue;
6032 
6033  if (dBestTrklFitRedChiSq > pTrk->GetChiSq()) {
6034  dBestTrklFitRedChiSq = pTrk->GetChiSq();
6035  iBestTrklFitIndex = iTrk;
6036  }
6037  }
6038 
6039  for (Int_t iTrk = 0; iTrk < iNbTofTracks;
6040  iTrk++) { // loop over all Tracklets
6041  CbmTofTracklet* pTrk = (CbmTofTracklet*) fTofTrackColl->At(iTrk);
6042  if (NULL == pTrk) continue;
6043  fhTrklNofHitsRate->Fill((pTrk->GetTime() - StartAnalysisTime) / 1.E9,
6044  pTrk->GetNofHits()); // Monitor tracklet size
6045  for (Int_t iTH = 0; iTH < pTrk->GetNofHits();
6046  iTH++) { // Loop over Tracklet hits
6047  fhTrklDetHitRate->Fill(
6048  (pTrk->GetTime() - StartAnalysisTime) / 1.E9, // Station hit rate
6050  pTrk->GetTofHitPointer(iTH)->GetAddress() & DetMask));
6051  }
6052 
6054  (pTrk->GetTime() - StartSpillTime) / 1.E9,
6055  pTrk->GetNofHits()); // Monitor tracklet size
6056  for (Int_t iTH = 0; iTH < pTrk->GetNofHits();
6057  iTH++) { // Loop over Tracklet hits
6059  (pTrk->GetTime() - StartSpillTime) / 1.E9, // Station hit rate
6061  pTrk->GetTofHitPointer(iTH)->GetAddress() & DetMask));
6062  }
6063 
6064  /*
6065  if (pTrk->GetNofHits() < NStations - 1) continue;
6066 
6067  // Calculate positions and time in Dut plane
6068  Double_t dXex=pTrk->GetFitX(dDutzPos);
6069  Double_t dYex=pTrk->GetFitY(dDutzPos);
6070  Double_t dR=TMath::Sqrt(dXex*dXex + dYex*dYex + dDutzPos*dDutzPos);
6071  Double_t dTex=pTrk->GetFitT(dR);
6072 
6073  for (UInt_t i=0; i<vDutHit.size();i++){ // loop over Dut Hits
6074  Double_t dChi = TMath::Sqrt(TMath::Power(TMath::Abs(dTex-vDutHit[i]->GetTime())/fSIGT,2)
6075  +TMath::Power(TMath::Abs(dXex-vDutHit[i]->GetX())/fSIGX,2)
6076  +TMath::Power(TMath::Abs(dYex-vDutHit[i]->GetY())/fSIGY,2))/3;
6077  LOG(debug1)<<Form(" Inspect track %d, hit %d Chi %6.2f,%6.2f, T %6.2f,%6.2f ",
6078  iTrk,i,dChi,fSIGLIM,dTex,vDutHit[i]->GetTime())
6079  ;
6080 
6081  if(dChi < fSIGLIM) { // acceptable match
6082  if(vHitMap[iTrk].size()>0) {
6083  Int_t iCnt=0;
6084  for ( std::map<Double_t,Int_t>::iterator it=vHitMap[iTrk].begin(); it!=vHitMap[iTrk].end(); it++){
6085  iCnt++;
6086  LOG(debug)<<Form(" HitMap[%d]: cnt %d, check %d, %6.2f > %6.2f ?",iTrk,iCnt, it->second,it->first,dChi)
6087  ;
6088  if(it->first > dChi) {
6089  vHitMap[iTrk].insert(--it,std::pair<Double_t, Int_t>(dChi,i));
6090  LOG(debug)<<Form(" HitMap[%d]: ins at %d: %d, %6.2f ",iTrk,iCnt,it->second,it->first);
6091  break;
6092  }
6093  }
6094  }
6095  else{
6096  vHitMap[iTrk].insert(std::pair<Double_t, Int_t>(dChi,i));
6097  LOG(debug)<<Form(" HitMap[%d]: start %d, %6.2f ",iTrk,i,dChi);
6098  }
6099 
6100  if(vTrkMap[i].size()>0) {
6101  for ( std::map<Double_t,Int_t>::iterator it=vTrkMap[i].begin(); it!=vTrkMap[i].end(); it++){
6102  if(it->first > dChi) {
6103  vTrkMap[i].insert(--it,std::pair<Double_t, Int_t>(dChi,iTrk));
6104  break;
6105  }
6106  }
6107  }
6108  else{
6109  vTrkMap[i].insert(std::pair<Double_t, Int_t>(dChi,iTrk));
6110  }
6111 
6112  } // end of Chi condition
6113  if(vTrkMap[i].size()>0)
6114  LOG(debug1)<<Form(" TrkMap[%d]: best %d, %6.4f ",i,vTrkMap[i].begin()->second,vTrkMap[i].begin()->first)
6115  ;
6116  }
6117  if(vHitMap[iTrk].size()>0)
6118  LOG(debug)<<Form(" HitMap[%d]: best %d, %6.4f ",iTrk,vHitMap[iTrk].begin()->second,vHitMap[iTrk].begin()->first)
6119  ;
6120  } // tracklet loop end
6121 
6122  // inspect assignment results
6123  Int_t iCheck = 1;
6124  while(iCheck-- > 0)
6125  for(Int_t iHit=0; static_cast<UInt_t>(iHit)<vDutHit.size(); iHit++) {
6126  if(vTrkMap[iHit].size()>0){
6127  Int_t iTrk=vTrkMap[iHit].begin()->second; // hit was assigned best to track iTrk
6128  if(vHitMap[iTrk].begin()->second == iHit) { // unique/consistent assignment
6129  LOG(debug)<<Form(" Hit %d -> HitMap[%d]: uni %d, %6.4f ",
6130  iHit,iTrk,vHitMap[iTrk].begin()->second,vHitMap[iTrk].begin()->first)
6131  ;
6132  // remove all other assignments of this hit and this track
6133  for ( std::map<Double_t,Int_t>::iterator it=vTrkMap[iHit].begin()++; it != vTrkMap[iHit].end(); it++){
6134  Int_t iTrk1=it->second;
6135  if(iTrk != iTrk1)
6136  for ( std::map<Double_t,Int_t>::iterator it1=vHitMap[iTrk1].begin()++; it1 != vHitMap[iTrk1].end(); it1++){
6137  if(it1->second == iHit) {
6138  vHitMap[iTrk1].erase(it1);
6139  LOG(debug1)<<Form(" Erase hit %d from HitMap[%d]",iHit,iTrk1);
6140  break;
6141  }
6142  }
6143  }
6144  for ( std::map<Double_t,Int_t>::iterator it=vHitMap[iTrk].begin()++; it != vHitMap[iTrk].end(); it++){
6145  Int_t iHit1=it->second;
6146  if(iHit != iHit1)
6147  for ( std::map<Double_t,Int_t>::iterator it1=vTrkMap[iHit1].begin()++; it1 != vTrkMap[iHit1].end(); it1++){
6148  if(it1->second == iTrk) {
6149  vTrkMap[iHit1].erase(it1);
6150  LOG(debug1)<<Form(" Erase trk %d from TrkMap[%d]",iHit1,iTrk);
6151  break;
6152  }
6153  }
6154  }
6155  }else{ // mismatch, other track fits even better
6156  LOG(debug)<<Form(" Hit %d -> HitMap[%d]: mis %d, %6.4f < %6.4f ",iHit,iTrk,
6157  vHitMap[iTrk].begin()->second,vHitMap[iTrk].begin()->first,vTrkMap[iHit].begin()->first)
6158  ;
6159  }
6160  LOG(debug)<<Form(" Hit %d -> TrkMap.size: %d ",iHit,(int)vTrkMap[iHit].size())
6161  ;
6162 
6163  }
6164  */
6165 
6166  if (fChi2LimFit < pTrk->GetChiSq()) { continue; }
6167 
6168  if (fbBestSelTrackletOnly) {
6169  if (iTrk != iBestTrklFitIndex) { continue; }
6170  }
6171 
6172 
6173  if (NStations == pTrk->GetNofHits()) {
6175  if (pTrk->ContainsAddr(fiDutAddr)) {
6176  LOG(fatal) << "DUT hit found already attached to a tracklet in "
6177  "'AttachDutHitToTracklet' mode!";
6178  }
6179 
6180  Int_t iSelTrklDutHitMatchMul(0);
6181  Int_t iSelTrklDutHitMatchAccMul(0);
6182 
6183  Double_t dXex = pTrk->GetFitX(dDutzPos);
6184  Double_t dYex = pTrk->GetFitY(dDutzPos);
6185  Double_t dTex = pTrk->GetFitT(dDutzPos);
6186 
6187  for (auto const& iHit : DutHitSet) {
6188  CbmTofHit* tHit =
6189  dynamic_cast<CbmTofHit*>(fTofHitsColl->At(iHit));
6190 
6191  Double_t dRedChiSq =
6192  (TMath::Power(TMath::Abs(dTex - tHit->GetTime()) / GetSigT(1),
6193  2)
6194  + TMath::Power(TMath::Abs(dXex - tHit->GetX()) / GetSigX(1),
6195  2)
6196  + TMath::Power(TMath::Abs(dYex - tHit->GetY()) / GetSigY(1),
6197  2))
6198  / 3.;
6199 
6200  RedChiSqTrackletDutHitPair.emplace(dRedChiSq,
6201  std::make_pair(iTrk, iHit));
6202 
6203 
6204  iSelTrklDutHitMatchMul++;
6205 
6206  if (dRedChiSq < fSIGLIM) { iSelTrklDutHitMatchAccMul++; }
6207  }
6208 
6209 
6210  if (iSelTrklDutHitMatchMul) {
6211  fhSelTrklDutHitMatchNNMul->Fill(iSelTrklDutHitMatchMul);
6212  }
6213 
6214  if (iSelTrklDutHitMatchAccMul) {
6215  fhSelTrklDutHitMatchAccNNMul->Fill(iSelTrklDutHitMatchAccMul);
6216  }
6217  }
6218 
6219  // A selector tracklet is considered to be found in a given reconstructed
6220  // event if the event satisfies the specified hit multiplicity criteria
6221  // and at least one reconstructed tracklet comprises hits from
6222  // 'CbmTofFindTracks::fNTofStations' counters.
6223  bSelTrackletFound = kTRUE;
6224  }
6225  }
6226 
6227 
6229  // DUT hits are (if at all) AMBIGUOUSLY matched with selector tracklets
6230  // (possibly multiple tracklets -> one hit) according to a minimum reduced
6231  // chi-square criterion. As the chi-square keys of the map looped over
6232  // below are sorted in ascending order, all other map elements containing
6233  // the corresponding tracklet index can be eliminated. The best match
6234  // (i.e. the lowest chi-square value) has been identified for the tracklet
6235  // by the current map element.
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;
6241 
6242  TrackletMatchedDutHitRedChiSq.emplace(
6243  iUsedTracklet, std::make_pair(iUsedHit, dRedChiSq));
6244 
6245  Bool_t bFoundNextUniqueMatch(kFALSE);
6246 
6247  for (auto itSubMap = ++itChi2Map;
6248  itSubMap != RedChiSqTrackletDutHitPair.cend();) {
6249  Int_t iTracklet = itSubMap->second.first;
6250  // Int_t iHit = itSubMap->second.second; (VF) not used
6251 
6252  // Uncomment the rear part of the following line of code to obtain
6253  // UNIQUE hit-to-tracklet matching.
6254  if (iUsedTracklet == iTracklet) // || iUsedHit == iHit)
6255  {
6256  itSubMap = RedChiSqTrackletDutHitPair.erase(itSubMap);
6257  } else {
6258  if (!bFoundNextUniqueMatch) {
6259  itChi2Map = itSubMap;
6260  bFoundNextUniqueMatch = kTRUE;
6261  }
6262 
6263  ++itSubMap;
6264  }
6265  }
6266 
6267  if (!bFoundNextUniqueMatch) {
6268  itChi2Map = RedChiSqTrackletDutHitPair.cend();
6269  }
6270  }
6271  }
6272 
6273 
6274  // fill tracklet histos
6275  Double_t dTiS =
6276  (dTAv - StartSpillTime) / 1.E9; // Time in Spill of current event
6277  for (Int_t iTrk = 0; iTrk < iNbTofTracks;
6278  iTrk++) { // loop over all Tracklets
6279  CbmTofTracklet* pTrk = (CbmTofTracklet*) fTofTrackColl->At(iTrk);
6280  if (NULL == pTrk) continue;
6281  if (pTrk->GetNofHits() < NStations - 1)
6282  continue; // pick only full & full - 1 tracklets
6283 
6284  if (fChi2LimFit < pTrk->GetChiSq()) { continue; }
6285 
6286  if (fbBestSelTrackletOnly) {
6287  if (iTrk != iBestTrklFitIndex) { continue; }
6288  }
6289 
6290  pLHit = NULL;
6291  Double_t dDelTLH = 11.;
6292  Double_t dTLH = 0.;
6293  hitpos[0] = pTrk->GetFitX(dDutzPos);
6294  hitpos[1] = pTrk->GetFitY(dDutzPos);
6295  hitpos[2] = dDutzPos;
6296  gGeoManager->FindNode(fChannelInfoDut->GetX(),
6297  fChannelInfoDut->GetY(),
6298  fChannelInfoDut->GetZ());
6299  gGeoManager->MasterToLocal(hitpos, hitpos_local);
6300 
6301  // select limited Dut area
6302  if (TMath::Abs(hitpos_local[0] - fdDutX) > fdDutDX
6303  || TMath::Abs(hitpos_local[1] - fdDutY) > fdDutDY)
6304  continue;
6305 
6306  pLHit = NULL;
6307  Int_t iDet = fFindTracks->fMapRpcIdParInd[fiDutAddr];
6308  Double_t LHpos[3], LHpos_local[3];
6309  Int_t iBinA = 0;
6310  if (fhLHTime.size() > static_cast<size_t>(iDet)) {
6311  Int_t iBin =
6312  fhLHTime[iDet]->FindBin(hitpos_local[0], hitpos_local[1]);
6313  iBinA = iBin - 1; // index in pointer array
6314 
6315  if (iBin <= 0
6316  || iBin > fhLHTime[iDet]->GetNbinsX()
6317  * fhLHTime[iDet]->GetNbinsY()) {
6318  LOG(debug) << "Invalid bin number for reading fhLHTime, det "
6319  << iDet << ": " << iBin << ", " << dTLH;
6320  dTLH = 0.;
6321  } else
6322  pLHit = fvLHit[iDet][iBinA]; // pointer to Last Hit object
6323 
6324  if (NULL != pLHit) {
6325  dTLH = fhLHTime[iDet]->GetBinContent(iBin);
6326  if (pLHit->GetTime() != dTLH)
6327  LOG(fatal) << " LHTime mismatch for Det " << iDet << ", Bin "
6328  << iBin
6329  << Form(": %f - %f = %f",
6330  pLHit->GetTime(),
6331  dTLH,
6332  pLHit->GetTime() - dTLH);
6333  if (0) {
6334  // Check whether neighbouring bins contain later hit
6335  Int_t iNbinsX = (Int_t) fhLHTime[iDet]->GetNbinsX();
6336  CbmTofHit* pLLHit = pLHit;
6337  Double_t dTLLH = dTLH;
6338  Int_t iRow = iBin / iNbinsX + 1;
6339  Int_t iCol = iBin % iNbinsX;
6340 
6341  if (iCol > 1) { // check left side
6342  if (fhLHTime[iDet]->GetBinContent(iBin - 1) > dTLLH) {
6343  pLLHit = fvLHit[iDet][iBinA - 1];
6344  dTLLH = pLLHit->GetTime();
6345  }
6346  if (iRow > 1) { // lower neighbbour
6347  for (Int_t iBLL = iBin - iNbinsX - 1;
6348  iBLL < iBin - iNbinsX + 1;
6349  iBLL++) {
6350  if (fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
6351  pLLHit = fvLHit[iDet][iBLL - 1];
6352  dTLLH = pLLHit->GetTime();
6353  }
6354  }
6355  }
6356  if (iRow < iNbinsX - 1) { //upper neighbour
6357  for (Int_t iBLL = iBin + iNbinsX - 1;
6358  iBLL < iBin + iNbinsX + 1;
6359  iBLL++) {
6360  if (fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
6361  pLLHit = fvLHit[iDet][iBLL - 1];
6362  dTLLH = pLLHit->GetTime();
6363  }
6364  }
6365  }
6366  }
6367  if (iCol < iNbinsX - 1) { // check right side
6368  if (fhLHTime[iDet]->GetBinContent(iBin + 1) > dTLLH) {
6369  pLLHit = fvLHit[iDet][iBin];
6370  dTLLH = pLLHit->GetTime();
6371  }
6372  if (iRow > 1) { // lower neighbbour
6373  for (Int_t iBLL = iBin - iNbinsX + 1;
6374  iBLL < iBin - iNbinsX + 2;
6375  iBLL++) {
6376  if (fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
6377  pLLHit = fvLHit[iDet][iBLL - 1];
6378  dTLLH = pLLHit->GetTime();
6379  }
6380  }
6381  }
6382  if (iRow < iNbinsX - 1) { //upper neighbour
6383  for (Int_t iBLL = iBin + iNbinsX + 1;
6384  iBLL < iBin + iNbinsX + 2;
6385  iBLL++) {
6386  if (fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
6387  pLLHit = fvLHit[iDet][iBLL - 1];
6388  dTLLH = pLLHit->GetTime();
6389  }
6390  }
6391  }
6392  }
6393  pLHit = pLLHit;
6394  dTLH = dTLLH;
6395  } // enable/disable neigbor inspection
6396  // TODO: Why was the fitted tracklet time at the origin (and not at the DUT plane) used here before?
6397  // if( dTLH > 0) dDelTLH=TMath::Log10( pTrk->GetTime()-dTLH);
6398  if (dTLH > 0)
6399  dDelTLH = TMath::Log10(pTrk->GetFitT(dDutzPos) - dTLH);
6400  /*
6401  LOG(info)<< "Got LHTime NbinsX: "<<iNbinsX
6402  << ", Bin "<<iBin<<", Row "<<iRow<<", Col "<<iCol
6403  << ": TLH "<<dTLH<<", "<<dTLLH
6404  ;
6405  */
6406  LHpos[0] = pLHit->GetX();
6407  LHpos[1] = pLHit->GetY();
6408  LHpos[2] = pLHit->GetZ();
6409  gGeoManager->MasterToLocal(LHpos, LHpos_local);
6410 
6411  if (0)
6412  LOG(info) << Form(
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",
6415  pTrk->GetTime(),
6416  iNspills,
6417  dTLH,
6418  dDelTLH,
6419  iDet,
6420  hitpos_local[0],
6421  hitpos_local[1],
6422  iBin,
6423  LHpos_local[0],
6424  LHpos_local[1]);
6425  }
6426  if (0)
6427  LOG(info) << Form(
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",
6430  pTrk->GetNofHits(),
6431  pTrk->GetTime(),
6432  iNspills,
6433  dTLH,
6434  dDelTLH,
6435  iDet,
6436  iBinA,
6437  hitpos_local[0],
6438  hitpos_local[1]);
6439  }
6440 
6441  Bool_t bGoodSelTracklet(kFALSE);
6442  Bool_t bGoodSelTrackletDutMatch(kFALSE);
6443 
6444  auto itDutHitMatch = TrackletMatchedDutHitRedChiSq.find(iTrk);
6445 
6446  Double_t dVel = 0.;
6447  Double_t dTt = fTrackletTools->FitTt(pTrk, fiDutAddr);
6448  if (dTt > 0.) dVel = 1. / dTt;
6449 
6450  if (NStations == pTrk->GetNofHits()) {
6452  if (fbMonteCarloComparison) {
6453  if (fbTracksInInputFile) {
6454  Int_t iMatchedRealTrackLink(-1);
6455  std::set<Int_t> RealTrackLinkSet;
6456 
6457  CbmTrackMatchNew* tTrackletAccTrackMatch =
6458  dynamic_cast<CbmTrackMatchNew*>(
6459  fTofTrackletAccTrackMatches->At(iTrk));
6460  const CbmLink& tLink =
6461  tTrackletAccTrackMatch->GetMatchedLink();
6462  Double_t dSelTrackletMaxTrackLinkWeight = tLink.GetWeight();
6463 
6464  for (Int_t iSelTrackletTrackLink = 0;
6465  iSelTrackletTrackLink
6466  < tTrackletAccTrackMatch->GetNofLinks();
6467  iSelTrackletTrackLink++) {
6468  const CbmLink& tSelTrackletTrackLink =
6469  tTrackletAccTrackMatch->GetLink(iSelTrackletTrackLink);
6470 
6471  if (dSelTrackletMaxTrackLinkWeight
6472  == tSelTrackletTrackLink.GetWeight()
6473  && -1 < tSelTrackletTrackLink.GetIndex()) {
6474  iMatchedRealTrackLink = tSelTrackletTrackLink.GetIndex();
6475  RealTrackLinkSet.emplace(
6476  tSelTrackletTrackLink.GetIndex());
6477  }
6478  }
6479 
6480  // For a pure sel tracklet, request a particle track match different
6481  // from a beam or a dark point.
6482  // The case that a noise link and a particle link have the same weight
6483  // and the noise link is - by chance - the matched one is handled here:
6484  // The noise link is ignored while assessing purity if and only if a
6485  // particle link with the same weight exists.
6486  if (-1 < iMatchedRealTrackLink) {
6487  if (1.
6488  == tTrackletAccTrackMatch->GetTrueOverAllHitsRatio()) {
6489  fhSelTrklPurity->Fill(kTRUE, fiNAccRefTracks);
6490  bGoodSelTracklet = kTRUE;
6491  } else {
6492  fhSelTrklPurity->Fill(kFALSE, fiNAccRefTracks);
6493  }
6494  } else {
6495  fhSelTrklPurity->Fill(kFALSE, fiNAccRefTracks);
6496  }
6497 
6498  if (bGoodSelTracklet) {
6499  TGeoNode* tNode(NULL);
6500  TGeoMedium* tMedium(NULL);
6501  TGeoMaterial* tMaterial(NULL);
6502 
6503  const char* cMaterialName;
6504 
6505  const char* cSelRefTrackPdgName;
6506  const char* cSelRefTrackProcessName;
6507 
6508  Bool_t bSelRefTrack(kFALSE);
6509 
6510  for (auto const& iTrack : RealTrackLinkSet) {
6511  CbmMCTrack* tTrack =
6512  dynamic_cast<CbmMCTrack*>(fAccTracks->At(iTrack));
6513  CbmMatch* tTrackPointMatch = dynamic_cast<CbmMatch*>(
6514  fTofAccTrackPointMatches->At(iTrack));
6515 
6516  tNode = gGeoManager->FindNode(tTrack->GetStartX(),
6517  tTrack->GetStartY(),
6518  tTrack->GetStartZ());
6519  tMedium = tNode->GetMedium();
6520  tMaterial = tMedium->GetMaterial();
6521 
6522  GetMaterialName(tMaterial->GetName(), cMaterialName);
6523 
6524  if (0 == std::strcmp("target", cMaterialName)
6526  <= tTrackPointMatch->GetNofLinks()) {
6527  bSelRefTrack = kTRUE;
6528 
6529  GetPdgName(tTrack->GetPdgCode(), cSelRefTrackPdgName);
6531  TMCProcessName[tTrack->GetGeantProcessId()],
6532  cSelRefTrackProcessName);
6533  }
6534  }
6535 
6536  if (bSelRefTrack) {
6539  cSelRefTrackProcessName, cSelRefTrackPdgName, 1.);
6540  } else {
6541  fhSelTrklRefTrackShare->Fill(kFALSE, fiNAccRefTracks);
6542  }
6543 
6544 
6545  if (itDutHitMatch != TrackletMatchedDutHitRedChiSq.end()) {
6546  Int_t iDutHitIndex = itDutHitMatch->second.first;
6547 
6548  CbmMatch* tDutHitTrackMatch = dynamic_cast<CbmMatch*>(
6549  fTofHitAccTrackMatches->At(iDutHitIndex));
6550 
6551 
6552  for (Int_t iSelTrackletTrackLink = 0;
6553  iSelTrackletTrackLink
6554  < tTrackletAccTrackMatch->GetNofLinks();
6555  iSelTrackletTrackLink++) {
6556  const CbmLink& tSelTrackletTrackLink =
6557  tTrackletAccTrackMatch->GetLink(
6558  iSelTrackletTrackLink);
6559 
6560  if (dSelTrackletMaxTrackLinkWeight
6561  == tSelTrackletTrackLink.GetWeight()) {
6562  for (Int_t iDutHitTrackLink = 0;
6563  iDutHitTrackLink
6564  < tDutHitTrackMatch->GetNofLinks();
6565  iDutHitTrackLink++) {
6566  const CbmLink& tDutHitTrackLink =
6567  tDutHitTrackMatch->GetLink(iDutHitTrackLink);
6568 
6569  if (tSelTrackletTrackLink == tDutHitTrackLink) {
6570  bGoodSelTrackletDutMatch = kTRUE;
6571  break;
6572  }
6573  }
6574  }
6575 
6576  if (bGoodSelTrackletDutMatch) { break; }
6577  }
6578 
6579  if (bGoodSelTrackletDutMatch) {
6581  1, 3. * itDutHitMatch->second.second);
6582  }
6583 
6585  1, 3. * itDutHitMatch->second.second);
6586  }
6587  }
6588  }
6589  }
6590  }
6591  }
6592 
6593 
6594  // matched hit found
6595  if ((!fbAttachDutHitToTracklet && pTrk->GetNofHits() == NStations
6596  && pTrk->ContainsAddr(fiDutAddr))
6598  && itDutHitMatch != TrackletMatchedDutHitRedChiSq.end()
6599  && itDutHitMatch->second.second < fSIGLIM)) {
6600  LOG(debug) << Form(
6601  " Event %d : process complete Trkl %d, HMul %d, iDet %d ",
6602  fEvents,
6603  iTrk,
6604  pTrk->GetNofHits(),
6606 
6607  fhSelTrklFitRedChiSq->Fill(pTrk->GetChiSq());
6608 
6609  Int_t iDutHitIndex(-1);
6611  iDutHitIndex = itDutHitMatch->second.first;
6612  // pHit = vDutHit[vHitMap[iTrk].begin()->second];
6613  pHit = dynamic_cast<CbmTofHit*>(fTofHitsColl->At(iDutHitIndex));
6614  } else {
6615  iDutHitIndex =
6616  pTrk->GetTofHitIndex(pTrk->HitIndexOfAddr(fiDutAddr));
6617  pHit = pTrk->HitPointerOfAddr(fiDutAddr);
6618  }
6619 
6620  if (NULL == pHit)
6621  LOG(WARNING) << "Dut not found in full length track";
6622 
6623  //fChannelInfo = fDigiPar->GetCell(pHit->GetAddress());
6624  //gGeoManager->FindNode(fChannelInfo->GetX(),fChannelInfo->GetY(),fChannelInfo->GetZ());
6625  /*
6626  gGeoManager->FindNode(fChannelInfoDut->GetX(),fChannelInfoDut->GetY(),fChannelInfoDut->GetZ());
6627  hitpos[0]=pHit->GetX();
6628  hitpos[1]=pHit->GetY();
6629  hitpos[2]=pHit->GetZ();
6630  gGeoManager->MasterToLocal(hitpos, hitpos_local);
6631  */
6632 
6633  if (
6634  fR0LimFit
6635  > 0.) // consider only tracks originating from interaction point
6636  if (pTrk->GetR0() > fR0LimFit) continue;
6637 
6638  Double_t dDX =
6639  pHit->GetX()
6640  - pTrk->GetFitX(
6641  pHit->GetZ()); // - tPar->GetX() - tPar->GetTx()*dDZ;
6642  Double_t dDXB = pTrk->GetXdif(
6643  fiDutAddr, pHit); // ignore pHit in calc of reference
6644  Double_t dDY =
6645  pHit->GetY()
6646  - pTrk->GetFitY(pHit->GetZ()); // - tPar->GetTy()*dDZ;
6647  Double_t dDYB = pTrk->GetYdif(
6648  fiDutAddr, pHit); // ignore pHit in calc of reference
6649  Double_t dDT =
6650  pHit->GetTime()
6651  - pTrk->GetFitT(
6652  pHit->GetZ()); // pTrk->GetTdif(fStationType[iSt]);
6653  Double_t dDTB = pTrk->GetTdif(
6654  fiDutAddr, pHit); // ignore pHit in calc of reference
6655 
6656  fhDutPullX->Fill(dDX);
6657  fhDutPullXB->Fill(dDXB);
6658  fhDutPullY->Fill(dDY);
6659  fhDutPullYB->Fill(dDYB);
6660  fhDutPullT->Fill(dDT);
6661  fhDutPullTB->Fill(dDTB);
6662  fhDutChi_Found->Fill(pTrk->GetChiSq());
6663 
6664  Int_t iGet4 = -1;
6665  Double_t dTot = 0.;
6666  CbmMatch* digiMatch =
6667  (CbmMatch*) fTofDigiMatchColl->At(iDutHitIndex);
6668  if (NULL != digiMatch)
6670  for (Int_t iLink = 0; iLink < digiMatch->GetNofLinks();
6671  iLink++) { // loop over digis
6672  CbmLink L0 = digiMatch->GetLink(iLink);
6673  Int_t iDigInd0 = L0.GetIndex();
6674  const CbmTofDigi* pDig0 = fDigiMan->Get<CbmTofDigi>(iDigInd0);
6675  if (iGet4 == -1) {
6676  iGet4 = Int_t(pDig0->GetChannel()) % 8 + 1;
6677  dTot = pDig0->GetTot();
6678  } else {
6679  if (iGet4 > 0) {
6680  if (pDig0->GetTot() > dTot) {
6681  iGet4 = Int_t(pDig0->GetChannel()) % 8 + 1;
6682  dTot = pDig0->GetTot();
6683  }
6684  //if ( Int_t(pDig0->GetChannel())%8 + 1 != iGet4 ) iGet4=0;
6685  }
6686  }
6687  }
6688  else
6689  LOG(error) << "no Tof Digis";
6690  else
6691  LOG(error) << "no Tof Digi Match";
6692 
6694  // fhDutChi_Match->Fill(vHitMap[iTrk].begin()->first);
6695  fhDutChi_Match->Fill(itDutHitMatch->second.second);
6696  }
6697  fhDutXY_Found->Fill(hitpos_local[0], hitpos_local[1]);
6698  fhDutDTLH_Found->Fill(dDelTLH);
6699  fhDutMul_Found->Fill(dMul4);
6700  fhDutTIS_Found->Fill(dTiS, iGet4);
6701  fhDutTIR_Found->Fill(dTIR, iGet4);
6702  fhDutVel_Found->Fill(dVel);
6703 
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);
6707 
6709  fhSelTrklMatchEfficiencyTIS->Fill(kTRUE,
6710  (dTAv - StartSpillTime) / 1.E9);
6711 
6712  if (fbMonteCarloComparison) {
6714  if (fbTracksInInputFile) {
6715  if (bGoodSelTracklet) {
6716  if (bGoodSelTrackletDutMatch) {
6717  fhSelTrklMatchPurity->Fill(kTRUE, fiNAccRefTracks);
6718  } else {
6719  fhSelTrklMatchPurity->Fill(kFALSE, fiNAccRefTracks);
6720  }
6721  }
6722  // uncomment to account for impure selectors in the matching purity calculation
6723  /*
6724  else
6725  {
6726  fhSelTrklMatchPurity->Fill(kFALSE, fiNAccRefTracks);
6727  }
6728 */
6729  }
6730  }
6731 
6732 
6733  if (!fbAttachDutHitToTracklet) {
6734  CbmTofHit* tDutHitPointer =
6735  dynamic_cast<CbmTofHit*>(fTofHitsColl->At(iDutHitIndex));
6736  Double_t dDutHitChi = pTrk->GetMatChi2(fiDutAddr);
6737 
6738  pTrk->RemoveTofHitIndex(-1, fiDutAddr, NULL, 0.);
6740  pTrk->SetTime(pTrk->UpdateT0());
6741  pTrk->AddTofHitIndex(
6742  iDutHitIndex, fiDutAddr, tDutHitPointer, dDutHitChi);
6743  pHit = pTrk->HitPointerOfAddr(fiDutAddr);
6744  }
6745 
6746  CbmMatch* tDutHitPointMatch =
6747  dynamic_cast<CbmMatch*>(fTofHitPointMatches->At(iDutHitIndex));
6748  const CbmLink& tDutHitPointLink =
6749  tDutHitPointMatch->GetMatchedLink();
6750  CbmTofPoint* tDutHitMatchedPoint(NULL);
6751 
6752  Int_t iFileIndex = tDutHitPointLink.GetFile();
6753  Int_t iEventIndex = tDutHitPointLink.GetEntry();
6754  Int_t iArrayIndex = tDutHitPointLink.GetIndex();
6755 
6756  if (-1 < iFileIndex && -1 < iEventIndex && -1 < iArrayIndex) {
6757  Double_t dMCEventStartTime(0.);
6758 
6759  if (fbPointsInInputFile) {
6760  tDutHitMatchedPoint =
6761  dynamic_cast<CbmTofPoint*>(fTofPointsTB->At(iArrayIndex));
6762  } else {
6763  tDutHitMatchedPoint = dynamic_cast<CbmTofPoint*>(
6764  fTofPoints->Get(iFileIndex, iEventIndex, iArrayIndex));
6765 
6766  dMCEventStartTime =
6767  fMCEventList->GetEventTime(iEventIndex, iFileIndex);
6768  }
6769 
6770  // fhDutResX_Hit_Trk->Fill(fiNAccRefTracks, pTrk->GetXdif(fiDutAddr, pHit));
6771  fhDutResX_Hit_Trk->Fill(
6772  fiNAccRefTracks, pHit->GetX() - pTrk->GetFitX(pHit->GetZ()));
6774  pTrk->GetFitX(pHit->GetZ())
6775  - tDutHitMatchedPoint->GetX());
6776  fhDutResX_Hit_MC->Fill(
6777  fiNAccRefTracks, pHit->GetX() - tDutHitMatchedPoint->GetX());
6778 
6779  // fhDutResY_Hit_Trk->Fill(fiNAccRefTracks, pTrk->GetYdif(fiDutAddr, pHit));
6780  fhDutResY_Hit_Trk->Fill(
6781  fiNAccRefTracks, pHit->GetY() - pTrk->GetFitY(pHit->GetZ()));
6783  pTrk->GetFitY(pHit->GetZ())
6784  - tDutHitMatchedPoint->GetY());
6785  fhDutResY_Hit_MC->Fill(
6786  fiNAccRefTracks, pHit->GetY() - tDutHitMatchedPoint->GetY());
6787 
6788  // fhDutResT_Hit_Trk->Fill(fiNAccRefTracks, pTrk->GetTdif(fiDutAddr, pHit));
6790  pHit->GetTime()
6791  - pTrk->GetFitT(pHit->GetZ()));
6793  pTrk->GetFitT(pHit->GetZ())
6794  - tDutHitMatchedPoint->GetTime()
6795  - dMCEventStartTime);
6797  pHit->GetTime()
6798  - tDutHitMatchedPoint->GetTime()
6799  - dMCEventStartTime);
6800  }
6801 
6802  if (!fbAttachDutHitToTracklet) {
6804  pTrk->SetTime(pTrk->UpdateT0());
6805  }
6806  }
6807 
6809  fhSelTypeAccNNChiSq->Fill(1, 3. * itDutHitMatch->second.second);
6811  1, pHit->GetTime() - pTrk->GetFitT(pHit->GetZ()));
6813  1, pHit->GetX() - pTrk->GetFitX(pHit->GetZ()));
6815  1, pHit->GetY() - pTrk->GetFitY(pHit->GetZ()));
6816 
6817  fhSelTypeNNChiSq->Fill(1, 3. * itDutHitMatch->second.second);
6818  fhSelTypeNNResidualT->Fill(
6819  1, pHit->GetTime() - pTrk->GetFitT(pHit->GetZ()));
6820  fhSelTypeNNResidualX->Fill(
6821  1, pHit->GetX() - pTrk->GetFitX(pHit->GetZ()));
6822  fhSelTypeNNResidualY->Fill(
6823  1, pHit->GetY() - pTrk->GetFitY(pHit->GetZ()));
6824 
6825  CbmMatch* tDutHitDigiMatch =
6826  dynamic_cast<CbmMatch*>(fTofDigiMatchColl->At(iDutHitIndex));
6827 
6828  fhSelTrklResidualTTIS->Fill((dTAv - StartSpillTime) / 1.E9,
6829  pHit->GetTime()
6830  - pTrk->GetFitT(pHit->GetZ()));
6831  fhSelTrklDutCluSizeTIS->Fill((dTAv - StartSpillTime) / 1.E9,
6832  tDutHitDigiMatch->GetNofLinks() / 2);
6833  }
6834 
6835  if (NULL != pLHit) {
6836 
6837  CbmMatch* digiMatch0 =
6838  (CbmMatch*) fTofDigiMatchColl->At(iDutHitIndex);
6839  Double_t dTot0 = 0.;
6840 
6842  && NULL != digiMatch0) {
6843  for (Int_t iLink = 0; iLink < digiMatch0->GetNofLinks();
6844  iLink++) { // loop over digis
6845  CbmLink L0 = digiMatch0->GetLink(iLink);
6846  Int_t iDigInd0 = L0.GetIndex();
6847  const CbmTofDigi* pDig0 = fDigiMan->Get<CbmTofDigi>(iDigInd0);
6848  dTot0 += pDig0->GetTot();
6849  }
6850  dTot0 /=
6851  digiMatch0->GetNofLinks(); // average time over threshold
6852  }
6853  fhDutDTLH_CluSize->Fill(dDelTLH, digiMatch0->GetNofLinks() / 2.);
6854  fhDutDTLH_Tot->Fill(dDelTLH, dTot0);
6855  fhDutDTLH_Mul->Fill(dDelTLH, (Double_t) vDutHit.size());
6856  fhDutDTLH_TIS->Fill(dDelTLH, dTiS);
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.));
6860  fhDutDTLH_DDH_Found->Fill(dDelTLH, dDDH);
6861 
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.));
6869  fhDutDTLH_DD_Found->Fill(dDelTLH, dDD);
6870 
6871  /*
6872  if( pHit->GetTime()- dTLH > 10.) // debugging check
6873  LOG(info)<< Form("invalid time distance for event %d, hit address 0x%08x",
6874  fEvents, pHit->GetAddress())
6875  ;
6876  */
6877  }
6878  }
6879 
6881  && itDutHitMatch != TrackletMatchedDutHitRedChiSq.end()
6882  && !(itDutHitMatch->second.second < fSIGLIM)) {
6883  pHit = dynamic_cast<CbmTofHit*>(
6884  fTofHitsColl->At(itDutHitMatch->second.first));
6885 
6886  fhSelTypeNNChiSq->Fill(1, 3. * itDutHitMatch->second.second);
6887  fhSelTypeNNResidualT->Fill(
6888  1, pHit->GetTime() - pTrk->GetFitT(pHit->GetZ()));
6889  fhSelTypeNNResidualX->Fill(
6890  1, pHit->GetX() - pTrk->GetFitX(pHit->GetZ()));
6891  fhSelTypeNNResidualY->Fill(
6892  1, pHit->GetY() - pTrk->GetFitY(pHit->GetZ()));
6893 
6895  fhSelTrklMatchEfficiencyTIS->Fill(kFALSE,
6896  (dTAv - StartSpillTime) / 1.E9);
6897  }
6898 
6899  // no match for this track
6900  if ((!fbAttachDutHitToTracklet && pTrk->GetNofHits() == NStations - 1
6901  && !pTrk->ContainsAddr(fiDutAddr))
6903  && itDutHitMatch == TrackletMatchedDutHitRedChiSq.end())) {
6904  if (0)
6905  LOG(info) << Form(
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",
6908  pTrk->GetTime(),
6909  dTLH,
6910  dDelTLH,
6911  iDet,
6912  hitpos_local[0],
6913  hitpos_local[1],
6914  iBinA,
6915  hitpos[0],
6916  hitpos[1]);
6917 
6918  if (
6919  fR0LimFit
6920  > 0.) // consider only tracks originating from interaction point
6921  if (pTrk->GetR0() > fR0LimFit) continue;
6922 
6923  fhSelTrklFitRedChiSq->Fill(pTrk->GetChiSq());
6924  fhDutChi_Missed->Fill(pTrk->GetChiSq());
6925  fhDutXY_Missed->Fill(hitpos_local[0], hitpos_local[1]);
6926  fhDutMul_Missed->Fill(dMul4);
6927  Int_t iGet4 = ((Int_t) hitpos_local[0] + 16) % 8 + 1;
6928  fhDutTIS_Missed->Fill(dTiS, iGet4);
6929  fhDutTIR_Missed->Fill(dTIR, iGet4);
6930  fhDutVel_Missed->Fill(dVel);
6931  fhDutDTLH_Missed->Fill(dDelTLH);
6932  fhDutDTLH_Missed_TIS->Fill(dDelTLH, dTiS);
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.));
6941  fhDutDTLH_DD_Missed->Fill(dDelTLH, dDD);
6942  }
6943 
6945  fhSelTrklMatchEfficiencyTIS->Fill(kFALSE,
6946  (dTAv - StartSpillTime) / 1.E9);
6947  }
6948 
6949  } // end of loop over all tracklets
6950 
6952  // Eliminate all tracklet - DUT hit matches which do not meet the
6953  // specified 'fSIGLIM' criterion. TODO: LEGACY code
6954  for (auto itChi2Map = TrackletMatchedDutHitRedChiSq.cbegin();
6955  itChi2Map != TrackletMatchedDutHitRedChiSq.cend();) {
6956  Double_t dRedChiSq = itChi2Map->second.second;
6957 
6958  if (dRedChiSq < fSIGLIM) {
6959  ++itChi2Map;
6960  } else {
6961  itChi2Map = TrackletMatchedDutHitRedChiSq.erase(itChi2Map);
6962  }
6963  }
6964  }
6965 
6966  } //(iNbTofTracks>0) end
6967 
6968 
6969  /* this is the proper place LHTime filling, move for testing purpose*/
6970  if (fFindTracks != NULL && fdMemoryTime > 0.) {
6971  // everything else done -> update hit memory to latest hits
6972  for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
6973  pHit = (CbmTofHit*) fTofHitsColl->At(iHitInd);
6974  if (NULL == pHit) continue;
6975  Int_t iDetId = (pHit->GetAddress() & DetMask);
6976  if (iDetId != fiDutAddr) continue; // store only Dut Hits
6977 
6978  Int_t iDet = fFindTracks->fMapRpcIdParInd[iDetId];
6979  //fChannelInfo = fDigiPar->GetCell(pHit->GetAddress());
6980  //gGeoManager->FindNode(fChannelInfo->GetX(),fChannelInfo->GetY(),fChannelInfo->GetZ());
6981  gGeoManager->FindNode(fChannelInfoDut->GetX(),
6982  fChannelInfoDut->GetY(),
6983  fChannelInfoDut->GetZ());
6984  hitpos[0] = pHit->GetX();
6985  hitpos[1] = pHit->GetY();
6986  hitpos[2] = pHit->GetZ();
6987  gGeoManager->MasterToLocal(hitpos, hitpos_local);
6988  if (fhLHTime.size() > 0) {
6989  if (static_cast<size_t>(iDet) >= fhLHTime.size()) {
6990  LOG(WARNING) << " LHdeb: invalid iDet index " << iDet << " of "
6991  << fhLHTime.size();
6993  continue;
6994  }
6995  Int_t iBin =
6996  fhLHTime[iDet]->FindBin(hitpos_local[0], hitpos_local[1]);
6997  Int_t iBinA = iBin - 1; // index in pointer array
6998  if (0)
6999  LOG(info) << Form(
7000  "Insert Dut hit for Det %d, Bin %d, x %f, y %f, poi ",
7001  iDet,
7002  iBinA,
7003  hitpos_local[0],
7004  hitpos_local[1])
7005  << fhLHTime[iDet];
7006 
7007  if (iBin <= 0
7008  || iBin > fhLHTime[iDet]->GetNbinsX()
7009  * fhLHTime[iDet]->GetNbinsY()) {
7010  LOG(debug) << "Invalid bin number for fhLHTime, det " << iDet
7011  << ": " << iBin;
7012  } else {
7013  fhLHTime[iDet]->SetBinContent(iBin, pHit->GetTime());
7014  /*
7015  LOG(info)<<"LHit check for "<<iDet<<", "<<iBin
7016  ;
7017  */
7018  if (NULL != fvLHit[iDet][iBinA]) {
7019  /*
7020  LOG(info)<<"LHit "<<fvLHit[iDet][iBinA]->GetName()<<" exists for "<<iDet<<", "<<iBin
7021  <<" at "<< fvLHit[iDet][iBinA] <<" -> delete "
7022  ;
7023  */
7024  fvLHit[iDet][iBinA]->Delete();
7025  //delete fvLHit[iDet][iBinA]; // delete outdated CbmTofHit
7026  }
7027  fvLHit[iDet][iBinA] = new CbmTofHit(*pHit); // put onto heap
7028 
7029  if (0)
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",
7032  fvLHit[iDet][iBinA]->GetAddress(),
7033  hitpos_local[0],
7034  hitpos_local[1],
7035  iBinA,
7036  pHit->GetTime(),
7037  iDetId,
7038  iDet);
7039  }
7040  }
7041  }
7042  } //(fdMemoryTime > 0.) end
7043 
7044 
7045  if (bSelTrackletFound) {
7046  fhSelTrklEfficiency->Fill(kTRUE, fiNAccRefTracks);
7047  fhSelTrklEfficiencyTIS->Fill(kTRUE, (dTAv - StartSpillTime) / 1.E9);
7048  } else {
7049  fhSelTrklEfficiency->Fill(kFALSE, fiNAccRefTracks);
7050  fhSelTrklEfficiencyTIS->Fill(kFALSE, (dTAv - StartSpillTime) / 1.E9);
7051  }
7052 
7053  } // (NULL!=fTofTrackColl && NULL != fFindTracks) end
7054 
7055 
7056  std::map<std::tuple<Int_t, Int_t, Int_t>, std::map<Int_t, Int_t>>
7057  CounterNCellHits;
7058 
7059  for (Int_t iHit = 0; iHit < fTofHitsColl->GetEntries(); iHit++) {
7060  CbmTofHit* tHit = dynamic_cast<CbmTofHit*>(fTofHitsColl->At(iHit));
7061  Int_t iHitAddress = tHit->GetAddress();
7062  Int_t iModuleType = CbmTofAddress::GetSmType(iHitAddress);
7063  Int_t iModuleIndex = CbmTofAddress::GetSmId(iHitAddress);
7064  Int_t iCounterIndex = CbmTofAddress::GetRpcId(iHitAddress);
7065  Int_t iCellIndex = CbmTofAddress::GetChannelId(iHitAddress);
7066 
7067  CounterNCellHits[std::make_tuple(iModuleType, iModuleIndex, iCounterIndex)]
7068  [iCellIndex]++;
7069 
7070  if (fbMonteCarloComparison) {
7071  if (fbTracksInInputFile) {
7072  CbmMatch* tHitTrackMatch =
7073  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iHit));
7074 
7075  if (fiMrpcRefAddr == (iHitAddress & DetMask)) {
7076  fhNTracksPerMRefHit->Fill(tHitTrackMatch->GetNofLinks());
7077  } else if (fiMrpcSel2Addr == (iHitAddress & DetMask)) {
7078  fhNTracksPerSel2Hit->Fill(tHitTrackMatch->GetNofLinks());
7079  } else if (fiDutAddr == (iHitAddress & DetMask)) {
7080  fhNTracksPerDutHit->Fill(tHitTrackMatch->GetNofLinks());
7081  }
7082  }
7083  }
7084  }
7085 
7086 
7087  // MC track selector analysis
7088  if (fbMonteCarloComparison) {
7089  if (fbTracksInInputFile) {
7090  // if(fiMaxMCRefTracks >= fiNAccRefTracks)
7091  if (dMul0 <= dM0Max && dMul4 <= dM4Max && dMulD <= dMDMax
7092  && dMulS2 <= dM4Max) {
7093  std::vector<Int_t> RefTrackSet;
7094 
7095  TGeoNode* tNode(NULL);
7096  TGeoMedium* tMedium(NULL);
7097  TGeoMaterial* tMaterial(NULL);
7098 
7099  const char* cMaterialName;
7100 
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);
7107 
7108  for (Int_t iTrack = 0; iTrack < fAccTracks->GetEntriesFast();
7109  iTrack++) {
7110  CbmMCTrack* tAccTrack =
7111  dynamic_cast<CbmMCTrack*>(fAccTracks->At(iTrack));
7112  CbmMatch* tAccTrackPointMatch =
7113  dynamic_cast<CbmMatch*>(fTofAccTrackPointMatches->At(iTrack));
7114 
7115  tNode = gGeoManager->FindNode(tAccTrack->GetStartX(),
7116  tAccTrack->GetStartY(),
7117  tAccTrack->GetStartZ());
7118  tMedium = tNode->GetMedium();
7119  tMaterial = tMedium->GetMaterial();
7120 
7121  GetMaterialName(tMaterial->GetName(), cMaterialName);
7122 
7123  if (0 == std::strcmp("target", cMaterialName)
7124  && fiMinMCRefTrackPoints <= tAccTrackPointMatch->GetNofLinks()) {
7125  // Scan for a MC track intersection with the DUT counter plane
7126  for (Int_t iPoint = 0; iPoint < tAccTrackPointMatch->GetNofLinks();
7127  iPoint++) {
7128  const CbmLink& tLink = tAccTrackPointMatch->GetLink(iPoint);
7129 
7130  CbmTofPoint* tPoint(NULL);
7131  Int_t iFileIndex = tLink.GetFile();
7132  Int_t iEventIndex = tLink.GetEntry();
7133  Int_t iArrayIndex = tLink.GetIndex();
7134 
7135  Double_t dMCEventStartTime(0.);
7136 
7137  if (fbPointsInInputFile) {
7138  tPoint =
7139  dynamic_cast<CbmTofPoint*>(fTofPointsTB->At(iArrayIndex));
7140  } else {
7141  tPoint = dynamic_cast<CbmTofPoint*>(
7142  fTofPoints->Get(iFileIndex, iEventIndex, iArrayIndex));
7143 
7144  dMCEventStartTime =
7145  fMCEventList->GetEventTime(iEventIndex, iFileIndex);
7146  }
7147 
7148  Int_t iModuleType =
7149  fGeoHandler->GetSMType(tPoint->GetDetectorID());
7150  Int_t iModuleIndex =
7151  fGeoHandler->GetSModule(tPoint->GetDetectorID());
7152  Int_t iCounterIndex =
7153  fGeoHandler->GetCounter(tPoint->GetDetectorID());
7154 
7155  if (fiDut == iModuleType && fiDutSm == iModuleIndex
7156  && fiDutRpc == iCounterIndex) {
7157  for (auto const& iHit : DutHitSet) {
7158  CbmTofHit* tHit =
7159  dynamic_cast<CbmTofHit*>(fTofHitsColl->At(iHit));
7160 
7161  Double_t dRedChiSq =
7162  (TMath::Power(TMath::Abs(tPoint->GetTime()
7163  + dMCEventStartTime
7164  - tHit->GetTime())
7165  / GetSigT(2),
7166  2)
7167  + TMath::Power(TMath::Abs(tPoint->GetX() - tHit->GetX())
7168  / GetSigX(2),
7169  2)
7170  + TMath::Power(TMath::Abs(tPoint->GetY() - tHit->GetY())
7171  / GetSigY(2),
7172  2))
7173  / 3.;
7174 
7175  RedChiSqTrackDutHitPair.emplace(dRedChiSq,
7176  std::make_pair(iTrack, iHit));
7177  }
7178 
7179  RefTrackSet.push_back(iTrack);
7180 
7181  break;
7182  }
7183  }
7184  }
7185  }
7186 
7187 
7188  // Randomly choose a selector MC track from the set of available reference
7189  // MC tracks in the event.
7190  if (RefTrackSet.size()) {
7191  iSelMCTrack = RefTrackSet.at(gRandom->Integer(RefTrackSet.size()));
7192  }
7193 
7194 
7195  for (auto const& Chi2MapElement : RedChiSqTrackDutHitPair) {
7196  Double_t dRedChiSq = Chi2MapElement.first;
7197  Int_t iTrackIndex = Chi2MapElement.second.first;
7198 
7199  if (iTrackIndex == iSelMCTrack) {
7200  iSelMCTrackDutHitMatchMul++;
7201 
7202  if (dRedChiSq < fdMCSIGLIM) { iSelMCTrackDutHitMatchAccMul++; }
7203  }
7204  }
7205 
7206  if (iSelMCTrackDutHitMatchMul) {
7207  fhSelMCTrackDutHitMatchNNMul->Fill(iSelMCTrackDutHitMatchMul);
7208  }
7209 
7210  if (iSelMCTrackDutHitMatchAccMul) {
7211  fhSelMCTrackDutHitMatchAccNNMul->Fill(iSelMCTrackDutHitMatchAccMul);
7212  }
7213 
7214 
7215  // DUT hits are (if at all) AMBIGUOUSLY matched with selector MC tracks
7216  // (possibly multiple tracks -> one hit) according to a minimum reduced
7217  // chi-square criterion. As the chi-square keys of the map looped over
7218  // below are sorted in ascending order, all other map elements containing
7219  // the corresponding MC track index can be eliminated. The best match
7220  // (i.e. the lowest chi-square value) has been identified for the track
7221  // by the current map element.
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;
7227 
7228  TrackMatchedDutHitRedChiSq.emplace(
7229  iUsedTrack, std::make_pair(iUsedHit, dRedChiSq));
7230 
7231  Bool_t bFoundNextUniqueMatch(kFALSE);
7232 
7233  for (auto itSubMap = ++itChi2Map;
7234  itSubMap != RedChiSqTrackDutHitPair.cend();) {
7235  Int_t iTrack = itSubMap->second.first;
7236  //Int_t iHit = itSubMap->second.second; (VF) not used
7237 
7238  // Uncomment the rear part of the following line of code to obtain
7239  // UNIQUE hit-to-track matching.
7240  if (iUsedTrack == iTrack) // || iUsedHit == iHit)
7241  {
7242  itSubMap = RedChiSqTrackDutHitPair.erase(itSubMap);
7243  } else {
7244  if (!bFoundNextUniqueMatch) {
7245  itChi2Map = itSubMap;
7246  bFoundNextUniqueMatch = kTRUE;
7247  }
7248 
7249  ++itSubMap;
7250  }
7251  }
7252 
7253  if (!bFoundNextUniqueMatch) {
7254  itChi2Map = RedChiSqTrackDutHitPair.cend();
7255  }
7256  }
7257 
7258 
7259  if (-1 < iSelMCTrack) {
7260  auto itDutHitMatch = TrackMatchedDutHitRedChiSq.find(iSelMCTrack);
7261 
7262  if (itDutHitMatch != TrackMatchedDutHitRedChiSq.end()) {
7263  Double_t dRedChiSq = itDutHitMatch->second.second;
7264  Int_t iDutHit = itDutHitMatch->second.first;
7265 
7266  // CbmMCTrack* tTrack = dynamic_cast<CbmMCTrack*>(fAccTracks->At(iSelMCTrack)); (VF) not used
7267  CbmMatch* tTrackPointMatch = dynamic_cast<CbmMatch*>(
7268  fTofAccTrackPointMatches->At(iSelMCTrack));
7269  CbmTofHit* tHit =
7270  dynamic_cast<CbmTofHit*>(fTofHitsColl->At(iDutHit));
7271  CbmTofPoint* tPoint(NULL);
7272 
7273  Double_t dMCEventStartTime(0.);
7274 
7275  // Scan for the MC track intersection with the DUT counter plane
7276  for (Int_t iPoint = 0; iPoint < tTrackPointMatch->GetNofLinks();
7277  iPoint++) {
7278  const CbmLink& tLink = tTrackPointMatch->GetLink(iPoint);
7279 
7280  Int_t iFileIndex = tLink.GetFile();
7281  Int_t iEventIndex = tLink.GetEntry();
7282  Int_t iArrayIndex = tLink.GetIndex();
7283 
7284  if (fbPointsInInputFile) {
7285  tPoint =
7286  dynamic_cast<CbmTofPoint*>(fTofPointsTB->At(iArrayIndex));
7287  } else {
7288  tPoint = dynamic_cast<CbmTofPoint*>(
7289  fTofPoints->Get(iFileIndex, iEventIndex, iArrayIndex));
7290 
7291  dMCEventStartTime =
7292  fMCEventList->GetEventTime(iEventIndex, iFileIndex);
7293  }
7294 
7295  Int_t iModuleType =
7296  fGeoHandler->GetSMType(tPoint->GetDetectorID());
7297  Int_t iModuleIndex =
7298  fGeoHandler->GetSModule(tPoint->GetDetectorID());
7299  Int_t iCounterIndex =
7300  fGeoHandler->GetCounter(tPoint->GetDetectorID());
7301 
7302  if (fiDut == iModuleType && fiDutSm == iModuleIndex
7303  && fiDutRpc == iCounterIndex) {
7304  break;
7305  }
7306  }
7307 
7308 
7309  Bool_t bGoodSelDutMatch(kFALSE);
7310  CbmMatch* tDutHitTrackMatch =
7311  dynamic_cast<CbmMatch*>(fTofHitAccTrackMatches->At(iDutHit));
7312 
7313  for (Int_t iDutHitTrackLink = 0;
7314  iDutHitTrackLink < tDutHitTrackMatch->GetNofLinks();
7315  iDutHitTrackLink++) {
7316  const CbmLink& tDutHitTrackLink =
7317  tDutHitTrackMatch->GetLink(iDutHitTrackLink);
7318 
7319  if (tDutHitTrackLink.GetIndex() == iSelMCTrack) {
7320  bGoodSelDutMatch = kTRUE;
7321  break;
7322  }
7323  }
7324 
7325  if (bGoodSelDutMatch) {
7326  fhGoodSelTypeNNPureChiSq->Fill(2, 3. * dRedChiSq);
7327  }
7328 
7329  fhGoodSelTypeNNAllChiSq->Fill(2, 3. * dRedChiSq);
7330 
7331 
7332  if (dRedChiSq < fdMCSIGLIM) {
7333  fhSelTypeAccNNChiSq->Fill(2, 3. * dRedChiSq);
7335  2, tHit->GetTime() - tPoint->GetTime() - dMCEventStartTime);
7336  fhSelTypeAccNNResidualX->Fill(2, tHit->GetX() - tPoint->GetX());
7337  fhSelTypeAccNNResidualY->Fill(2, tHit->GetY() - tPoint->GetY());
7338 
7339  fhSelTypeNNChiSq->Fill(2, 3. * dRedChiSq);
7340  fhSelTypeNNResidualT->Fill(
7341  2, tHit->GetTime() - tPoint->GetTime() - dMCEventStartTime);
7342  fhSelTypeNNResidualX->Fill(2, tHit->GetX() - tPoint->GetX());
7343  fhSelTypeNNResidualY->Fill(2, tHit->GetY() - tPoint->GetY());
7344 
7347  kTRUE, (dTAv - StartSpillTime) / 1.E9);
7348 
7349  if (bGoodSelDutMatch) {
7351  } else {
7353  }
7354 
7355  CbmMatch* tDutHitDigiMatch =
7356  dynamic_cast<CbmMatch*>(fTofDigiMatchColl->At(iDutHit));
7357 
7358  fhSelMCTrackResidualTTIS->Fill((dTAv - StartSpillTime) / 1.E9,
7359  tHit->GetTime() - tPoint->GetTime()
7360  - dMCEventStartTime);
7361  fhSelMCTrackDutCluSizeTIS->Fill((dTAv - StartSpillTime) / 1.E9,
7362  tDutHitDigiMatch->GetNofLinks()
7363  / 2);
7364  } else {
7365  fhSelTypeNNChiSq->Fill(2, 3. * dRedChiSq);
7366  fhSelTypeNNResidualT->Fill(
7367  2, tHit->GetTime() - tPoint->GetTime() - dMCEventStartTime);
7368  fhSelTypeNNResidualX->Fill(2, tHit->GetX() - tPoint->GetX());
7369  fhSelTypeNNResidualY->Fill(2, tHit->GetY() - tPoint->GetY());
7370 
7373  kFALSE, (dTAv - StartSpillTime) / 1.E9);
7374  }
7375  } else {
7378  kFALSE, (dTAv - StartSpillTime) / 1.E9);
7379  }
7380 
7381 
7382  // Eliminate all MC track - DUT hit matches which do not meet the
7383  // specified 'fdMCSIGLIM' criterion. TODO: LEGACY code
7384  for (auto itChi2Map = TrackMatchedDutHitRedChiSq.cbegin();
7385  itChi2Map != TrackMatchedDutHitRedChiSq.cend();) {
7386  Double_t dRedChiSq = itChi2Map->second.second;
7387 
7388  if (dRedChiSq < fdMCSIGLIM) {
7389  ++itChi2Map;
7390  } else {
7391  itChi2Map = TrackMatchedDutHitRedChiSq.erase(itChi2Map);
7392  }
7393  }
7394 
7395 
7397  fhSelMCTrackEfficiencyTIS->Fill(kTRUE,
7398  (dTAv - StartSpillTime) / 1.E9);
7399  } else {
7400  fhSelMCTrackEfficiency->Fill(kFALSE, fiNAccRefTracks);
7401  fhSelMCTrackEfficiencyTIS->Fill(kFALSE,
7402  (dTAv - StartSpillTime) / 1.E9);
7403  }
7404 
7405  } else {
7406  fhSelMCTrackEfficiency->Fill(kFALSE, fiNAccRefTracks);
7407  fhSelMCTrackEfficiencyTIS->Fill(kFALSE, (dTAv - StartSpillTime) / 1.E9);
7408  }
7409  }
7410  }
7411 
7412 
7413  if (fbMonteCarloComparison) {
7414  // Retrieve the original MC event header which provides detailed information
7415  // about the collision parameters in case no event mixing occurred during
7416  // event reconstruction.
7417  FairMCEventHeader* tMCEventHeader(NULL);
7418  Double_t dMCEventStartTime(0.);
7419 
7420  if (1 == fMCEventList->GetNofEvents()) {
7421  Int_t iFileID = fMCEventList->GetFileIdByIndex(0);
7422  Int_t iEventID = fMCEventList->GetEventIdByIndex(0);
7423 
7424  dMCEventStartTime = fMCEventList->GetEventTimeByIndex(0);
7425  tMCEventHeader = dynamic_cast<FairMCEventHeader*>(
7426  fMCEventHeader->Get(iFileID, iEventID));
7427 
7428  fhAccRefTrackMulCentrality->Fill(tMCEventHeader->GetB(), fiNAccRefTracks);
7429  }
7430 
7432 
7433  if (tMCEventHeader && fFindTracks && fFindTracks->InspectEvent()
7434  && fFindTracks->GetVertexT()) {
7435  // collision vertex reconstruction QA
7437  fFindTracks->GetVertexT() - tMCEventHeader->GetT()
7438  - dMCEventStartTime);
7440  fFindTracks->GetVertexX() - tMCEventHeader->GetX());
7442  fFindTracks->GetVertexY() - tMCEventHeader->GetY());
7443  }
7444 
7445 
7446  if (fbTracksInInputFile) {
7447  TGeoNode* tNode(NULL);
7448  TGeoMedium* tMedium(NULL);
7449  TGeoMaterial* tMaterial(NULL);
7450 
7451  const char* cPdgName;
7452  const char* cMaterialName;
7453  const char* cProcessName;
7454 
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.};
7459 
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;
7466 
7467  std::map<std::tuple<Int_t, Int_t, Int_t>, std::map<Int_t, Int_t>>
7468  CounterNCellAccRefTracks;
7469 
7470 
7471  Double_t dRefPVRecoT(0.);
7472  Double_t dRefPVRecoX(0.);
7473  Double_t dRefPVRecoY(0.);
7474  Int_t iRefPVRecoN(0);
7475 
7476  for (Int_t iTrack = 0; iTrack < fAccTracks->GetEntriesFast(); iTrack++) {
7477  Bool_t bIsAccRefTrack(kFALSE);
7478 
7479  CbmMCTrack* tAccTrack =
7480  dynamic_cast<CbmMCTrack*>(fAccTracks->At(iTrack));
7481  CbmMatch* tAccTrackPointMatch =
7482  dynamic_cast<CbmMatch*>(fTofAccTrackPointMatches->At(iTrack));
7483  CbmMatch* tAccTrackTrackletMatch(NULL);
7484  if (fTofTrackColl) {
7485  tAccTrackTrackletMatch =
7486  dynamic_cast<CbmMatch*>(fTofAccTrackTrackletMatches->At(iTrack));
7487  }
7488 
7489  dGlobalTrackStart[0] = tAccTrack->GetStartX();
7490  dGlobalTrackStart[1] = tAccTrack->GetStartY();
7491  dGlobalTrackStart[2] = tAccTrack->GetStartZ();
7492 
7493  tNode = gGeoManager->FindNode(
7494  dGlobalTrackStart[0], dGlobalTrackStart[1], dGlobalTrackStart[2]);
7495  tMedium = tNode->GetMedium();
7496  tMaterial = tMedium->GetMaterial();
7497 
7498  GetPdgName(tAccTrack->GetPdgCode(), cPdgName);
7499  GetMaterialName(tMaterial->GetName(), cMaterialName);
7500  GetProcessName(TMCProcessName[tAccTrack->GetGeantProcessId()],
7501  cProcessName);
7502 
7503  fhAccTrackPointMul->Fill(tAccTrackPointMatch->GetNofLinks());
7504  // XXX: tAccTrack->GetNPoints(ECbmModuleId::kTof)
7505 
7506  if (0 == std::strcmp("target", cMaterialName)
7507  && fiMinMCRefTrackPoints <= tAccTrackPointMatch->GetNofLinks()) {
7508  bIsAccRefTrack = kTRUE;
7509 
7510  fhAccRefTrackShare->Fill(kTRUE, fiNAccRefTracks);
7511 
7512  if (tAccTrack->GetMass()) {
7513  fhAccRefTrackAcceptance->Fill(tAccTrack->GetRapidity(),
7514  tAccTrack->GetPt()
7515  / tAccTrack->GetMass());
7516  }
7517 
7518  fhAccRefTracksProcSpec->Fill(cProcessName, cPdgName, 1.);
7519 
7520  if (fTofTrackColl) {
7521  if (0 < tAccTrackTrackletMatch->GetNofLinks()) {
7523 
7524  if (tAccTrack->GetMass()) {
7526  kTRUE,
7527  tAccTrack->GetRapidity(),
7528  tAccTrack->GetPt() / tAccTrack->GetMass());
7529  }
7530 
7531  CbmTofTracklet* tTracklet =
7532  dynamic_cast<CbmTofTracklet*>(fTofTrackColl->At(
7533  (tAccTrackTrackletMatch->GetMatchedLink()).GetIndex()));
7534 
7535  // The properties of 'CbmTofTrackletParam' (fX, fY, fTx, fTy) describe
7536  // the position and orientation of the tracklet at fZ = 0.
7537  // The MC reference track, however, can - according to its definition -
7538  // originate from the entire target volume, i.e. have an origin in Z
7539  // different from 0. As the track production vertex is just a random
7540  // point on its straight-line trajectory, we are free to choose any
7541  // other location along the track/tracklet for a point-to-point
7542  // comparison between the two 3D straight lines. Since methods
7543  // for tracklet parameter extrapolation along Z are available in
7544  // 'CbmTofTracklet', values are calculated at 'CbmMCTrack::fStartZ'
7545  // for tracklet-track comparison.
7547  tTracklet->GetFitT(tAccTrack->GetStartZ())
7548  - tAccTrack->GetStartT());
7550  tTracklet->GetFitX(tAccTrack->GetStartZ())
7551  - tAccTrack->GetStartX());
7553  tTracklet->GetFitY(tAccTrack->GetStartZ())
7554  - tAccTrack->GetStartY());
7556  tTracklet->GetTrackTx()
7557  - tAccTrack->GetPx()
7558  / tAccTrack->GetPz());
7560  tTracklet->GetTrackTy()
7561  - tAccTrack->GetPy()
7562  / tAccTrack->GetPz());
7564  1. / tTracklet->GetTt()
7565  - tAccTrack->GetP()
7566  / tAccTrack->GetEnergy()
7567  * TMath::Ccgs() * 1.e-9);
7568 
7569  // To compare the number of hits assigned to the tracklet with the
7570  // number of points created by the MC reference track the number
7571  // of diamond hits which have no point equivalent in the MC track
7572  // needs to be subtracted from the number of tracklet hits.
7573  Int_t iNTrackletHits = tTracklet->GetNofHits();
7574 
7575  for (Int_t iHit = 0; iHit < tTracklet->GetNofHits(); iHit++) {
7576  if (5
7578  (tTracklet->GetTofHitPointer(iHit))->GetAddress())) {
7579  iNTrackletHits--;
7580  }
7581  }
7582 
7584  iNTrackletHits
7585  - tAccTrackPointMatch->GetNofLinks());
7586 
7587  Int_t iRefPVRecoW = tTracklet->GetNofHits();
7588 
7589  if (fFindTracks) {
7590  if (iRefPVRecoW >= fFindTracks->GetMinNofHits()) {
7591  dRefPVRecoT += iRefPVRecoW * tTracklet->GetFitT(0.);
7592  dRefPVRecoX += iRefPVRecoW * tTracklet->GetFitX(0.);
7593  dRefPVRecoY += iRefPVRecoW * tTracklet->GetFitY(0.);
7594  iRefPVRecoN += iRefPVRecoW;
7595  }
7596  }
7597  } else {
7599 
7600  if (tAccTrack->GetMass()) {
7602  kFALSE,
7603  tAccTrack->GetRapidity(),
7604  tAccTrack->GetPt() / tAccTrack->GetMass());
7605  }
7606  }
7607  }
7608 
7609  fhAccRefTrackPointMul->Fill(tAccTrackPointMatch->GetNofLinks());
7610  } else {
7611  fhAccRefTrackShare->Fill(kFALSE, fiNAccRefTracks);
7612 
7613  if (fTofTrackColl) {
7614  if (0 < tAccTrackTrackletMatch->GetNofLinks()) {
7616  } else {
7618  }
7619  }
7620 
7621  fhAccRndmTrackPointMul->Fill(tAccTrackPointMatch->GetNofLinks());
7622  }
7623 
7624  // Having a maximum of 1 MC point per track per counter this point loop is
7625  // effectively a loop over counters which the MC track crossed.
7626  for (Int_t iPoint = 0; iPoint < tAccTrackPointMatch->GetNofLinks();
7627  iPoint++) {
7628  const CbmLink& tLink = tAccTrackPointMatch->GetLink(iPoint);
7629 
7630  CbmTofPoint* tPoint(NULL);
7631  Int_t iFileIndex = tLink.GetFile();
7632  Int_t iEventIndex = tLink.GetEntry();
7633  Int_t iArrayIndex = tLink.GetIndex();
7634 
7635  if (fbPointsInInputFile) {
7636  tPoint = dynamic_cast<CbmTofPoint*>(fTofPointsTB->At(iArrayIndex));
7637  } else {
7638  tPoint = dynamic_cast<CbmTofPoint*>(
7639  fTofPoints->Get(iFileIndex, iEventIndex, iArrayIndex));
7640  }
7641 
7642  Int_t iModuleType = fGeoHandler->GetSMType(tPoint->GetDetectorID());
7643  Int_t iModuleIndex = fGeoHandler->GetSModule(tPoint->GetDetectorID());
7644  Int_t iCounterIndex =
7645  fGeoHandler->GetCounter(tPoint->GetDetectorID());
7646 
7647  auto CounterID =
7648  std::make_tuple(iModuleType, iModuleIndex, iCounterIndex);
7649 
7650  CounterNAccTracks[CounterID]++;
7651 
7652  // A MC reference track passed through the current counter.
7653  if (bIsAccRefTrack) {
7654  CounterNAccRefTracks[CounterID]++;
7655 
7656  fChannelInfo = fDigiPar->GetCell(tPoint->GetDetectorID());
7657  gGeoManager->FindNode(
7659  dGlobalPoint[0] = tPoint->GetX();
7660  dGlobalPoint[1] = tPoint->GetY();
7661  dGlobalPoint[2] = tPoint->GetZ();
7662  gGeoManager->MasterToLocal(dGlobalPoint, dLocalPoint);
7663 
7664  fhCounterRefTrackLocalXY[CounterID]->Fill(dLocalPoint[0],
7665  dLocalPoint[1]);
7666 
7667  Int_t iNCounterCells =
7668  fDigiBdfPar->GetNbChan(iModuleType, iCounterIndex);
7669 
7670  Int_t iCellIndex(-1);
7671  if (fChannelInfo->GetSizey() >= fChannelInfo->GetSizex()) {
7672  iCellIndex = static_cast<Int_t>(
7673  dLocalPoint[0] / fChannelInfo->GetSizex()
7674  + static_cast<Double_t>(iNCounterCells) / 2.);
7675  } else {
7676  iCellIndex = static_cast<Int_t>(
7677  dLocalPoint[1] / fChannelInfo->GetSizey()
7678  + static_cast<Double_t>(iNCounterCells) / 2.);
7679  }
7680 
7681  CounterNCellAccRefTracks[CounterID][iCellIndex]++;
7682 
7683  if (fTofTrackColl) {
7684  // A tracklet was constructed for the MC reference track.
7685  if (0 < tAccTrackTrackletMatch->GetNofLinks()) {
7686  Int_t iCounterAddress = CbmTofAddress::GetUniqueAddress(
7687  iModuleIndex, iCounterIndex, 0, 0, iModuleType);
7688 
7689  CbmTofTracklet* tTracklet =
7690  dynamic_cast<CbmTofTracklet*>(fTofTrackColl->At(
7691  (tAccTrackTrackletMatch->GetMatchedLink()).GetIndex()));
7692 
7693  Int_t iHitIndex = tTracklet->HitIndexOfAddr(iCounterAddress);
7694 
7695  // A hit on the current counter was assigned to the tracklet.
7696  // As there is a point created by the MC reference track on this
7697  // counter, the counter is efficient with respect to the MC
7698  // reference track because it provided a hit to the matched
7699  // tracklet where it should provide one.
7700  if (-1 < iHitIndex) {
7701  CounterNRecRefTracks[CounterID]++;
7702 
7703  iHitIndex = tTracklet->GetTofHitIndex(iHitIndex);
7704  CbmMatch* tHitTrackMatch = dynamic_cast<CbmMatch*>(
7705  fTofHitAccTrackMatches->At(iHitIndex));
7706 
7707  // Although the counter detected a hit that is attributed
7708  // to the tracklet matching the MC reference track best it
7709  // is not granted that this hit actually is the true one, i.e.
7710  // contains a link to the MC reference track. If it contains
7711  // a corresponding link, the counter "purely" detected the
7712  // track.
7713  for (Int_t iHitTrackLink = 0;
7714  iHitTrackLink < tHitTrackMatch->GetNofLinks();
7715  iHitTrackLink++) {
7716  if (iTrack
7717  == tHitTrackMatch->GetLink(iHitTrackLink).GetIndex()) {
7718  CounterNPureRefTracks[CounterID]++;
7719  }
7720  }
7721  }
7722  }
7723  }
7724  }
7725 
7726  TGeoPhysicalNode* tModuleNode = fCounterModuleNodes.at(CounterID);
7727 
7728  tModuleNode->GetMatrix()->MasterToLocal(dGlobalTrackStart,
7729  dLocalTrackStart);
7730 
7731  if (tModuleNode->GetVolume()->Contains(dLocalTrackStart)) {
7732  fhDomTracksProcSpec.at(CounterID)->Fill(cProcessName, cPdgName, 1.);
7733  fhDomTracksProcMat.at(CounterID)->Fill(
7734  cProcessName, cMaterialName, 1.);
7735 
7736  CounterNAccDomTracks[CounterID]++;
7737  } else {
7738  if (!bIsAccRefTrack) {
7739  fhRndmTracksProcSpec.at(CounterID)->Fill(
7740  cProcessName, cPdgName, 1.);
7741  fhRndmTracksProcMat.at(CounterID)->Fill(
7742  cProcessName, cMaterialName, 1.);
7743 
7744  CounterNAccRndmTracks[CounterID]++;
7745  }
7746  }
7747  }
7748  }
7749 
7750  if (tMCEventHeader && fFindTracks) {
7751  if (0 < iRefPVRecoN) {
7752  dRefPVRecoT /= iRefPVRecoN;
7753  dRefPVRecoX /= iRefPVRecoN;
7754  dRefPVRecoY /= iRefPVRecoN;
7755 
7757  dRefPVRecoT - tMCEventHeader->GetT()
7758  - dMCEventStartTime);
7760  dRefPVRecoX - tMCEventHeader->GetX());
7762  dRefPVRecoY - tMCEventHeader->GetY());
7763  }
7764  }
7765 
7766 
7767  if (fTofTrackColl) {
7768  std::set<CbmLink> tMatchedAccTracks;
7769 
7770  for (Int_t iTracklet = 0; iTracklet < fTofTrackColl->GetEntriesFast();
7771  iTracklet++) {
7772  CbmTrackMatchNew* tTrackletAccTrackMatch =
7773  dynamic_cast<CbmTrackMatchNew*>(
7774  fTofTrackletAccTrackMatches->At(iTracklet));
7775  const CbmLink& tLink = tTrackletAccTrackMatch->GetMatchedLink();
7776 
7777  // Ignore tracklets which have been matched to a beam or to a dark point
7778  // for which no MC track exists.
7779  // TODO: dedicated QA for such cases
7780  if (-1 < tLink.GetFile() && -1 < tLink.GetEntry()
7781  && -1 < tLink.GetIndex()) {
7782  CbmMCTrack* tAccTrack =
7783  dynamic_cast<CbmMCTrack*>(fAccTracks->At(tLink.GetIndex()));
7784  CbmMatch* tAccTrackPointMatch = dynamic_cast<CbmMatch*>(
7785  fTofAccTrackPointMatches->At(tLink.GetIndex()));
7786 
7787  dGlobalTrackStart[0] = tAccTrack->GetStartX();
7788  dGlobalTrackStart[1] = tAccTrack->GetStartY();
7789  dGlobalTrackStart[2] = tAccTrack->GetStartZ();
7790 
7791  tNode = gGeoManager->FindNode(
7792  dGlobalTrackStart[0], dGlobalTrackStart[1], dGlobalTrackStart[2]);
7793  tMedium = tNode->GetMedium();
7794  tMaterial = tMedium->GetMaterial();
7795 
7796  GetMaterialName(tMaterial->GetName(), cMaterialName);
7797 
7798  // TODO: There could be another tracklet-to-track link with the same weight
7799  // as the matched one that hypothetically - in contrast to the
7800  // matched link - originated from the target. This case is
7801  // not covered here (cf. the filling of the "SelRefTrackShare"
7802  // efficiency histograms above).
7803  if (0 == std::strcmp("target", cMaterialName)
7805  <= tAccTrackPointMatch->GetNofLinks()) {
7807  > tTrackletAccTrackMatch->GetTrueOverAllHitsRatio()) {
7809 
7810  if (tAccTrack->GetMass()) {
7811  fhAccRefTrackAcceptancePurity->Fill(kFALSE,
7812  tAccTrack->GetRapidity(),
7813  tAccTrack->GetPt()
7814  / tAccTrack->GetMass());
7815  }
7816  } else {
7818 
7819  if (tAccTrack->GetMass()) {
7820  fhAccRefTrackAcceptancePurity->Fill(kTRUE,
7821  tAccTrack->GetRapidity(),
7822  tAccTrack->GetPt()
7823  / tAccTrack->GetMass());
7824  }
7825  }
7826 
7827  // Another tracklet has been matched to the MC track the current
7828  // tracklet has been matched to as well.
7829  if (kFALSE
7830  == (tMatchedAccTracks.emplace(1.,
7831  tLink.GetIndex(),
7832  tLink.GetEntry(),
7833  tLink.GetFile()))
7834  .second) {
7836  } else {
7838  }
7839  } else {
7841  > tTrackletAccTrackMatch->GetTrueOverAllHitsRatio()) {
7843  } else {
7845  }
7846 
7847  // Another tracklet has been matched to the MC track the current
7848  // tracklet has been matched to as well.
7849  if (kFALSE
7850  == (tMatchedAccTracks.emplace(1.,
7851  tLink.GetIndex(),
7852  tLink.GetEntry(),
7853  tLink.GetFile()))
7854  .second) {
7856  } else {
7858  }
7859  }
7860  }
7861  }
7862  }
7863 
7864 
7865  for (auto const& CounterModuleNode : fCounterModuleNodes) {
7866  auto const& CounterID = CounterModuleNode.first;
7867  Int_t iModuleType = std::get<0>(CounterID);
7868  // Int_t iModuleIndex = std::get<1>(CounterID); (VF) not used
7869  Int_t iCounterIndex = std::get<2>(CounterID);
7870  Int_t iNCounterCells =
7871  fDigiBdfPar->GetNbChan(iModuleType, iCounterIndex);
7872 
7873  fhCounterAccTrackMul.at(CounterID)->Fill(CounterNAccTracks[CounterID]);
7874  fhCounterAccRefTrackMul.at(CounterID)->Fill(
7875  CounterNAccRefTracks[CounterID]);
7876  fhCounterAccRndmTrackMul.at(CounterID)->Fill(
7877  CounterNAccRndmTracks[CounterID]);
7878  fhCounterAccDomTrackMul.at(CounterID)->Fill(
7879  CounterNAccDomTracks[CounterID]);
7880 
7881  if (fTofTrackColl) {
7882  fhCounterRecRefTrackEfficiencyPassed.at(CounterID)->Fill(
7883  CounterNAccRefTracks[CounterID], CounterNRecRefTracks[CounterID]);
7884  fhCounterRecRefTrackEfficiencyTotal.at(CounterID)->Fill(
7885  CounterNAccRefTracks[CounterID], CounterNAccRefTracks[CounterID]);
7886  fhCounterRecRefTrackPurityPassed.at(CounterID)->Fill(
7887  CounterNAccRefTracks[CounterID], CounterNPureRefTracks[CounterID]);
7888  }
7889 
7890  Int_t iCounterHitMul(0);
7891  Int_t iCounterRefTrackMul(0);
7892 
7893  for (Int_t iCell = 0; iCell < iNCounterCells; iCell++) {
7894  fhCounterRefTrackMulCell.at(CounterID)->Fill(
7895  iCell, CounterNCellAccRefTracks[CounterID][iCell]);
7896  iCounterRefTrackMul += CounterNCellAccRefTracks[CounterID][iCell];
7897  iCounterHitMul += CounterNCellHits[CounterID][iCell];
7898  }
7899 
7900  fhCounterRefTrackMulHitMul.at(CounterID)->Fill(iCounterRefTrackMul,
7901  iCounterHitMul);
7902  }
7903  }
7904  }
7905 
7906 
7907  for (auto const& CounterModuleNode : fCounterModuleNodes) {
7908  auto const& CounterID = CounterModuleNode.first;
7909  Int_t iModuleType = std::get<0>(CounterID);
7910  // Int_t iModuleIndex = std::get<1>(CounterID); (VF) not used
7911  Int_t iCounterIndex = std::get<2>(CounterID);
7912  Int_t iNCounterCells = fDigiBdfPar->GetNbChan(iModuleType, iCounterIndex);
7913 
7914  for (Int_t iCell = 0; iCell < iNCounterCells; iCell++) {
7915  fhCounterHitMulCell.at(CounterID)->Fill(
7916  iCell, CounterNCellHits[CounterID][iCell]);
7917  }
7918  }
7919 
7920  return kTRUE;
7921 } //FillHistos end
7922 // ------------------------------------------------------------------
7923 
7925 
7926  LOG(info) << "Write ./tofAnaTestBeam.hst.root, mode = " << fiCorMode;
7927 
7928  // Write histogramms to the file
7929  TDirectory* oldir = gDirectory;
7930  TFile* fHist = new TFile(fCalOutFileName, "RECREATE");
7931  fHist->cd();
7932 
7933  switch (fiCorMode) {
7934  case 0:
7935  case 1: {
7936  TProfile* htmp = fhDTD4DT04D4best->ProfileX();
7937  TH1D* htmp1D = htmp->ProjectionX();
7938 
7939  // htmp1D->Draw();
7940 
7941  if (fhDTD4DT04D4Off != NULL) {
7942  // fhDTD4DT04D4Off->Draw("same");
7943  // fhDTD4DT04D4Off->Write();
7944  //LOG(info)<<"Update hDTD4DT04D4best";
7945  Double_t nx = htmp1D->GetNbinsX();
7946  for (Int_t ix = 1; ix <= nx; ix++) {
7947  Double_t dVal =
7948  htmp1D->GetBinContent(ix) + fhDTD4DT04D4Off->GetBinContent(ix);
7949  // Double_t dVal=fhDTD4DT04D4Off->GetBinContent(ix);
7950  LOG(debug2) << "Update hDTD4DT04D4best " << ix << ": "
7951  << htmp1D->GetBinContent(ix) << " + "
7952  << fhDTD4DT04D4Off->GetBinContent(ix) << " -> " << dVal;
7953  htmp1D->SetBinContent(ix, dVal);
7954  }
7955  } else {
7956  LOG(WARNING) << "Histo fhDTD4DT04D4Off not found ";
7957  }
7958  // fhDTD4DT04D4best->Write();
7959  htmp1D->Write();
7960  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
7961  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
7962  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
7963  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
7964  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
7965  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
7966  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
7967  } break;
7968  case 2: {
7969  TProfile* htmpx = fhDTX4D4best->ProfileX();
7970  TH1D* htmpx1D = htmpx->ProjectionX();
7971  if (fhDTX4D4Off != NULL) {
7972  Double_t nx = htmpx1D->GetNbinsX();
7973  for (Int_t ix = 1; ix <= nx; ix++) {
7974  Double_t dVal =
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);
7980  }
7981  } else {
7982  LOG(WARNING) << "Histo fhDTX4D4Off not found ";
7983  }
7984  htmpx1D->Write();
7985  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
7986  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
7987  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
7988  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
7989  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
7990  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
7991  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
7992  } break;
7993 
7994  case 3: {
7995  TProfile* htmpx = fhDTY4D4best->ProfileX();
7996  TH1D* htmpx1D = htmpx->ProjectionX();
7997  if (fhDTY4D4Off != NULL) {
7998  Double_t nx = htmpx1D->GetNbinsX();
7999  for (Int_t ix = 1; ix <= nx; ix++) {
8000  Double_t dVal =
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);
8006  }
8007  } else {
8008  LOG(WARNING) << "Histo fhDTY4D4Off not found ";
8009  }
8010  htmpx1D->Write();
8011  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
8012  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
8013  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
8014  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
8015  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
8016  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
8017  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
8018  } break;
8019 
8020  case 4: {
8021  TProfile* htmpx = fhTexpDT04D4best->ProfileX();
8022  TH1D* htmpx1D = htmpx->ProjectionX();
8023  if (fhDTTexpD4Off != NULL) {
8024  Double_t nx = htmpx1D->GetNbinsX();
8025  for (Int_t ix = 1; ix <= nx; ix++) {
8026  Double_t dVal =
8027  htmpx1D->GetBinContent(ix) + fhDTTexpD4Off->GetBinContent(ix);
8028  LOG(debug1) << "Update hDTTexpD4best " << ix << ": "
8029  << htmpx1D->GetBinContent(ix) << " + "
8030  << fhDTTexpD4Off->GetBinContent(ix) << " -> " << dVal;
8031  htmpx1D->SetBinContent(ix, dVal);
8032  }
8033  } else {
8034  LOG(WARNING) << "Histo fhDTTexpD4Off not found ";
8035  }
8036  htmpx1D->Write();
8037  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
8038  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
8039  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
8040  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
8041  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
8042  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
8043  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
8044  } break;
8045 
8046  case 5: {
8047  TProfile* htmpx = fhCluSize0DT04D4best->ProfileX();
8048  TH1D* htmpx1D = htmpx->ProjectionX();
8049  if (fhCluSize0DT04D4Off != NULL) {
8050  Double_t nx = htmpx1D->GetNbinsX();
8051  for (Int_t ix = 1; ix <= nx; ix++) {
8052  Double_t dVal =
8053  htmpx1D->GetBinContent(ix) + fhCluSize0DT04D4Off->GetBinContent(ix);
8054  LOG(debug1) << "Update hCluSize0DT04D4best " << ix << ": "
8055  << htmpx1D->GetBinContent(ix) << " + "
8056  << fhCluSize0DT04D4Off->GetBinContent(ix) << " -> "
8057  << dVal;
8058  htmpx1D->SetBinContent(ix, dVal);
8059  }
8060  } else {
8061  LOG(WARNING) << "Histo fhCluSize0DT04D4Off not found ";
8062  }
8063  htmpx1D->Write();
8064  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
8065  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
8066  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
8067  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
8068  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
8069  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
8070  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
8071  } break;
8072 
8073  case 6: {
8074  TProfile* htmpx = fhCluSize4DT04D4best->ProfileX();
8075  TH1D* htmpx1D = htmpx->ProjectionX();
8076  if (fhCluSize4DT04D4Off != NULL) {
8077  Double_t nx = htmpx1D->GetNbinsX();
8078  for (Int_t ix = 1; ix <= nx; ix++) {
8079  Double_t dVal =
8080  htmpx1D->GetBinContent(ix) + fhCluSize4DT04D4Off->GetBinContent(ix);
8081  LOG(debug1) << "Update hCluSize4DT04D4best " << ix << ": "
8082  << htmpx1D->GetBinContent(ix) << " + "
8083  << fhCluSize4DT04D4Off->GetBinContent(ix) << " -> "
8084  << dVal;
8085  htmpx1D->SetBinContent(ix, dVal);
8086  }
8087  } else {
8088  LOG(WARNING) << "Histo fhCluSize4DT04D4Off not found ";
8089  }
8090  htmpx1D->Write();
8091  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
8092  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
8093  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
8094  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
8095  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
8096  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
8097  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
8098  } break;
8099 
8100  case 7: {
8101  TProfile* htmpx = fhTot0DT04D4best->ProfileX();
8102  TH1D* htmpx1D = htmpx->ProjectionX();
8103  if (fhTot0DT04D4Off != NULL) {
8104  Double_t nx = htmpx1D->GetNbinsX();
8105  for (Int_t ix = 1; ix <= nx; ix++) {
8106  Double_t dVal =
8107  htmpx1D->GetBinContent(ix) + fhTot0DT04D4Off->GetBinContent(ix);
8108  LOG(debug1) << "Update hTot0DT04D4best " << ix << ": "
8109  << htmpx1D->GetBinContent(ix) << " + "
8110  << fhTot0DT04D4Off->GetBinContent(ix) << " -> " << dVal;
8111  htmpx1D->SetBinContent(ix, dVal);
8112  }
8113  } else {
8114  LOG(WARNING) << "Histo fhTot0DT04D4Off not found ";
8115  }
8116  htmpx1D->Write();
8117  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
8118  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
8119  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
8120  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
8121  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
8122  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
8123  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
8124  } break;
8125 
8126  case 8: {
8127  TProfile* htmpx = fhTot4DT04D4best->ProfileX();
8128  TH1D* htmpx1D = htmpx->ProjectionX();
8129  if (fhTot4DT04D4Off != NULL) {
8130  Double_t nx = htmpx1D->GetNbinsX();
8131  for (Int_t ix = 1; ix <= nx; ix++) {
8132  Double_t dVal =
8133  htmpx1D->GetBinContent(ix) + fhTot4DT04D4Off->GetBinContent(ix);
8134  LOG(debug1) << "Update hTot4DT04D4best " << ix << ": "
8135  << htmpx1D->GetBinContent(ix) << " + "
8136  << fhTot4DT04D4Off->GetBinContent(ix) << " -> " << dVal;
8137  htmpx1D->SetBinContent(ix, dVal);
8138  }
8139  } else {
8140  LOG(WARNING) << "Histo fhTot4DT04D4Off not found ";
8141  }
8142  htmpx1D->Write();
8143  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
8144  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
8145  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
8146  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
8147  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
8148  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
8149  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
8150  } break;
8151 
8152  case 9: {
8153  for (Int_t iSelType = 0; iSelType < 3; iSelType++) {
8154  TH1D* hResidualT =
8155  fhSelTypeNNResidualT->ProjectionY("_py", iSelType + 1, iSelType + 1);
8156  TH1D* hResidualX =
8157  fhSelTypeNNResidualX->ProjectionY("_py", iSelType + 1, iSelType + 1);
8158  TH1D* hResidualY =
8159  fhSelTypeNNResidualY->ProjectionY("_py", iSelType + 1, iSelType + 1);
8160 
8161  if (hResidualT->GetEntries() > 100.) {
8162  Double_t dRMS = TMath::Abs(hResidualT->GetRMS());
8163  /*
8164  TFitResultPtr tFitResult = hResidualT->Fit("gaus", "QS");
8165  dRMS = tFitResult->Parameter(2);
8166 */
8167  fhSelTypeNNResidualT_Width->SetBinContent(iSelType + 1, dRMS);
8168  }
8169 
8170  if (hResidualX->GetEntries() > 100.) {
8171  Double_t dRMS = TMath::Abs(hResidualX->GetRMS());
8172  /*
8173  TFitResultPtr tFitResult = hResidualX->Fit("gaus", "QS");
8174  dRMS = tFitResult->Parameter(2);
8175 */
8176  fhSelTypeNNResidualX_Width->SetBinContent(iSelType + 1, dRMS);
8177  }
8178 
8179  if (hResidualY->GetEntries() > 100.) {
8180  Double_t dRMS = TMath::Abs(hResidualY->GetRMS());
8181  /*
8182  TFitResultPtr tFitResult = hResidualY->Fit("gaus", "QS");
8183  dRMS = tFitResult->Parameter(2);
8184 */
8185  fhSelTypeNNResidualY_Width->SetBinContent(iSelType + 1, dRMS);
8186  }
8187  }
8188 
8189 
8190  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
8191  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
8192  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
8193  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
8194  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
8195  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
8196  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
8197  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
8198  } break;
8199 
8200  case 10: {
8201  if (fhDXSel24->GetEntries() > 100.) {
8202  Double_t dRMS = TMath::Abs(fhDXSel24->GetRMS());
8203 
8204  fhSelHitTupleResidualXYT_Width->SetBinContent(1, dRMS);
8205  }
8206 
8207  if (fhDYSel24->GetEntries() > 100.) {
8208  Double_t dRMS = TMath::Abs(fhDYSel24->GetRMS());
8209 
8210  fhSelHitTupleResidualXYT_Width->SetBinContent(2, dRMS);
8211  }
8212 
8213  if (fhDTSel24->GetEntries() > 100.) {
8214  Double_t dRMS = TMath::Abs(fhDTSel24->GetRMS());
8215 
8216  fhSelHitTupleResidualXYT_Width->SetBinContent(3, dRMS);
8217  }
8218 
8219 
8220  if (fhDTD4DT04D4Off != NULL) fhDTD4DT04D4Off->Write();
8221  if (fhDTX4D4Off != NULL) fhDTX4D4Off->Write();
8222  if (fhDTY4D4Off != NULL) fhDTY4D4Off->Write();
8223  if (fhDTTexpD4Off != NULL) fhDTTexpD4Off->Write();
8224  if (fhCluSize0DT04D4Off != NULL) fhCluSize0DT04D4Off->Write();
8225  if (fhCluSize4DT04D4Off != NULL) fhCluSize4DT04D4Off->Write();
8226  if (fhTot0DT04D4Off != NULL) fhTot0DT04D4Off->Write();
8227  if (fhTot4DT04D4Off != NULL) fhTot4DT04D4Off->Write();
8228  } break;
8229 
8230  default:;
8231  }
8232 
8233  fhDistDT04D4best->Write();
8234 
8235  if (fhSelHitTupleResidualXYT_Width != NULL)
8240 
8241  // fHist->Write();
8242  if (0) {
8243  fhXX2->Write();
8244  fhYY2->Write();
8245  for (Int_t iDet = 0; iDet < 2; iDet++) {
8246  fhXX02[iDet]->Write();
8247  fhYY02[iDet]->Write();
8248  }
8249  fhXX04->Write();
8250  fhYY04->Write();
8251  fhXY04->Write();
8252  fhYX04->Write();
8253  }
8254  gDirectory->cd(oldir->GetPath());
8255 
8256  fHist->Close();
8257 
8258  return kTRUE;
8259 }
8260 
8262  // Test class performance
8263 
8264  // Mapping
8265 
8266  return kTRUE;
8267 }
8268 
8269 
8270 Double_t CbmTofAnaTestbeam::GetSigT(Int_t iSelType) {
8271  return (Double_t) fhSelTypeNNResidualT_Width->GetBinContent(iSelType + 1);
8272 }
8273 
8274 
8275 Double_t CbmTofAnaTestbeam::GetSigX(Int_t iSelType) {
8276  return (Double_t) fhSelTypeNNResidualX_Width->GetBinContent(iSelType + 1);
8277 }
8278 
8279 
8280 Double_t CbmTofAnaTestbeam::GetSigY(Int_t iSelType) {
8281  return (Double_t) fhSelTypeNNResidualY_Width->GetBinContent(iSelType + 1);
8282 }
8283 
8284 
8286  return (Double_t) fhSelHitTupleResidualXYT_Width->GetBinContent(1);
8287 }
8288 
8289 
8291  return (Double_t) fhSelHitTupleResidualXYT_Width->GetBinContent(2);
8292 }
8293 
8294 
8296  return (Double_t) fhSelHitTupleResidualXYT_Width->GetBinContent(3);
8297 }
8298 
8299 
8301  Bool_t bFoundTofNode(kFALSE);
8302  TGeoNode* tTofNode(NULL);
8303 
8304  fCurrentNodePath = "/" + (TString) gGeoManager->GetTopNode()->GetName();
8305 
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;
8314  fCurrentNodePath += "/" + (TString) tDaughterNode->GetName();
8315  break;
8316  }
8317  }
8318 
8319  if (!bFoundTofNode) {
8320  LOG(error) << "Could not retrieve 'tof' node from TGeoManager.";
8321  return kFALSE;
8322  }
8323 
8324  ExpandNode(tTofNode);
8325 
8326  return kTRUE;
8327 }
8328 
8329 
8330 void CbmTofAnaTestbeam::ExpandNode(TGeoNode* tMotherNode) {
8331  TObjArray* tDaughterNodes = tMotherNode->GetNodes();
8332 
8333  for (Int_t iNode = 0; iNode < tDaughterNodes->GetEntriesFast(); iNode++) {
8334  TGeoNode* tDaughterNode =
8335  dynamic_cast<TGeoNode*>(tDaughterNodes->At(iNode));
8336  fCurrentNodePath += "/" + (TString) tDaughterNode->GetName();
8337 
8338  // Extract the current module type and module index from the module node
8339  if (TString(tDaughterNode->GetName()).Contains("module")) {
8340  fiCurrentModuleType = -1;
8341  fiCurrentModuleIndex = -1;
8342  fiCurrentCounterIndex = -1;
8343 
8344  boost::regex rgx(".*_(\\d+)_.*");
8345  boost::cmatch match;
8346  if (boost::regex_search(tDaughterNode->GetName(), match, rgx)) {
8347  fiCurrentModuleType = boost::lexical_cast<Int_t>(match[1]);
8348  }
8349 
8350  fiCurrentModuleIndex = tDaughterNode->GetNumber();
8351 
8353  }
8354  // Extract the current counter index from the counter node
8355  else if (TString(tDaughterNode->GetName()).Contains("counter")) {
8356  fiCurrentCounterIndex = tDaughterNode->GetNumber();
8357 
8358  fCounterModuleNodes[std::make_tuple(
8360  new TGeoPhysicalNode(fCurrentModuleNodePath.Data());
8361  }
8362 
8363  // Expand nodes recursively
8364  if (0 < tDaughterNode->GetNdaughters()) { ExpandNode(tDaughterNode); }
8365 
8366  // Remove a node's name from the current node path upon completing a recursion step
8367  fCurrentNodePath.ReplaceAll("/" + (TString) tDaughterNode->GetName(), "");
8368  }
8369 }
8370 
8371 
8372 void GetPdgName(Int_t iPdgCode, const char*& cPdgName) {
8373  auto itPdg = giPdgMap.find(iPdgCode);
8374  if (itPdg != giPdgMap.end()) {
8375  cPdgName = itPdg->second;
8376  } else {
8377  cPdgName = "XXX";
8378  LOG(error) << "unknown PDG code: " << iPdgCode;
8379  }
8380 }
8381 
8382 void GetMaterialName(const char* cMaterial, const char*& cMaterialName) {
8383  auto itMaterial = gcMaterialMap.find(cMaterial);
8384  if (itMaterial != gcMaterialMap.end()) {
8385  cMaterialName = itMaterial->second;
8386  } else {
8387  cMaterialName = "XXX";
8388  LOG(error) << "unknown material: " << cMaterial;
8389  }
8390 }
8391 
8392 void GetProcessName(const char* cProcess, const char*& cProcessName) {
8393  auto itProcess = gcProcessMap.find(cProcess);
8394  if (itProcess != gcProcessMap.end()) {
8395  cProcessName = itProcess->second;
8396  } else {
8397  cProcessName = "XXX";
8398  LOG(error) << "unknown process: " << cProcess;
8399  }
8400 }
8401 
8402 
CbmTofDigiBdfPar.h
CbmTofAnaTestbeam::fhXX02
TH2 * fhXX02[2]
Definition: CbmTofAnaTestbeam.h:513
CbmTofAnaTestbeam::fhDTMul4D4best
TH2 * fhDTMul4D4best
Definition: CbmTofAnaTestbeam.h:440
CbmTofAnaTestbeam::fhChiDT04D4sbest
TH2 * fhChiDT04D4sbest
Definition: CbmTofAnaTestbeam.h:470
CbmTofAnaTestbeam::fhCluSizeSigT0D4best
TH2 * fhCluSizeSigT0D4best
Definition: CbmTofAnaTestbeam.h:432
CbmTofAnaTestbeam::fiCurrentModuleIndex
Int_t fiCurrentModuleIndex
Definition: CbmTofAnaTestbeam.h:813
CbmTofCell::GetZ
Double_t GetZ() const
Definition: CbmTofCell.h:38
CbmTofAnaTestbeam::fhTIR_all
TH1 * fhTIR_all
Definition: CbmTofAnaTestbeam.h:361
CbmTofAnaTestbeam::fhSelRefTrackProcSpec
TH2 * fhSelRefTrackProcSpec
Definition: CbmTofAnaTestbeam.h:582
fdSpillDuration
const Double_t fdSpillDuration
Definition: CbmTofEventClusterizer.cxx:77
CbmTofAnaTestbeam::fhAccTrackMul
TH1 * fhAccTrackMul
Definition: CbmTofAnaTestbeam.h:560
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
gcMaterialMap
std::map< const char *, const char *, cmp_str > gcMaterialMap
Definition: CbmTofAnaTestbeam.cxx:142
CbmTofTrackletTools
contains fits and resolution functions
Definition: CbmTofTrackletTools.h:21
CbmTofAnaTestbeam::fhDTLH_sel1
TH1 * fhDTLH_sel1
Definition: CbmTofAnaTestbeam.h:369
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmTofAnaTestbeam::fhDutDTLH_CluSize
TH2 * fhDutDTLH_CluSize
Definition: CbmTofAnaTestbeam.h:546
CbmTofAnaTestbeam::fhDXX4D4sbest
TH2 * fhDXX4D4sbest
Definition: CbmTofAnaTestbeam.h:478
CbmMCDataManager::GetObject
CbmMCDataObject * GetObject(const char *name)
Definition: CbmMCDataManager.cxx:137
CbmTofAnaTestbeam::fhDutResT_Hit_MC
TH2 * fhDutResT_Hit_MC
Definition: CbmTofAnaTestbeam.h:615
CbmTofAnaTestbeam::fMCEventList
CbmMCEventList * fMCEventList
Definition: CbmTofAnaTestbeam.h:799
CbmTofAnaTestbeam::fhResY04HitMC
TH2 * fhResY04HitMC
Definition: CbmTofAnaTestbeam.h:590
CbmTofAnaTestbeam::GetSigY
Double_t GetSigY(Int_t iSelType)
Definition: CbmTofAnaTestbeam.cxx:8280
CbmTofAnaTestbeam::fhCluSize0DT04D4sbest
TH2 * fhCluSize0DT04D4sbest
Definition: CbmTofAnaTestbeam.h:466
TTrbHeader::TriggerFired
Bool_t TriggerFired(Int_t iTrg)
Definition: TTrbHeader.cxx:47
CbmMCTrack::GetMass
Double_t GetMass() const
Mass of the associated particle.
Definition: CbmMCTrack.cxx:114
CbmMCEventList::GetFileIdByIndex
Int_t GetFileIdByIndex(UInt_t index)
File number by index @value File number for event at given index in list.
Definition: CbmMCEventList.cxx:106
CbmTofAnaTestbeam::fhRecRndmTrackEfficiency
TEfficiency * fhRecRndmTrackEfficiency
Definition: CbmTofAnaTestbeam.h:650
CbmMatch
Definition: CbmMatch.h:22
CbmTofAnaTestbeam::fhXYSel2D4best
TH2 * fhXYSel2D4best
Definition: CbmTofAnaTestbeam.h:503
CbmMCTrack::GetStartX
Double_t GetStartX() const
Definition: CbmMCTrack.h:75
CbmTofAnaTestbeam::fiDut
Int_t fiDut
Definition: CbmTofAnaTestbeam.h:763
CbmTofFindTracks::GetMinNofHits
Int_t GetMinNofHits() const
Definition: CbmTofFindTracks.h:107
CbmTofAnaTestbeam::fMCEventHeader
CbmMCDataObject * fMCEventHeader
Definition: CbmTofAnaTestbeam.h:798
CbmTofAnaTestbeam::fhDXDY04D4sbest
TH2 * fhDXDY04D4sbest
Definition: CbmTofAnaTestbeam.h:461
CbmMCDataManager.h
CbmEvent::GetIndex
UInt_t GetIndex(ECbmDataType type, UInt_t iData)
Definition: CbmEvent.cxx:24
CbmTofCell::GetSizex
Double_t GetSizex() const
Definition: CbmTofCell.h:40
CbmTofAnaTestbeam::fhXY0D4best
TH2 * fhXY0D4best
Definition: CbmTofAnaTestbeam.h:499
CbmTofAnaTestbeam::fhRecRndmTrackGhostShare
TEfficiency * fhRecRndmTrackGhostShare
Definition: CbmTofAnaTestbeam.h:653
CbmVertex.h
CbmTofAnaTestbeam::fhCluSize4DT04D4Off
TH1 * fhCluSize4DT04D4Off
Definition: CbmTofAnaTestbeam.h:721
CbmTofAnaTestbeam::fhDT04DX4_1
TH2 * fhDT04DX4_1
Definition: CbmTofAnaTestbeam.h:520
CbmTofAnaTestbeam::fhNTracksPerSelSel2Hit
TH1 * fhNTracksPerSelSel2Hit
Definition: CbmTofAnaTestbeam.h:598
CbmTofAnaTestbeam::fdDCh4Sel
Double_t fdDCh4Sel
Definition: CbmTofAnaTestbeam.h:736
CbmTofAnaTestbeam::fhTIS_sel
TH1 * fhTIS_sel
Definition: CbmTofAnaTestbeam.h:358
CbmTofAnaTestbeam::fhDXDT04
TH2 * fhDXDT04
Definition: CbmTofAnaTestbeam.h:391
DTDMAX
const Double_t DTDMAX
Definition: CbmTofAnaTestbeam.cxx:76
CbmTofAnaTestbeam::fhCounterHitMulCell
std::map< std::tuple< Int_t, Int_t, Int_t >, TH2 * > fhCounterHitMulCell
Definition: CbmTofAnaTestbeam.h:676
CbmTofAnaTestbeam::fhXY0D4sel
TH2 * fhXY0D4sel
Definition: CbmTofAnaTestbeam.h:504
CbmTofAnaTestbeam::fhDutTIS_Found
TH2 * fhDutTIS_Found
Definition: CbmTofAnaTestbeam.h:540
CbmTofAnaTestbeam::fhTexpDT04D4best
TH2 * fhTexpDT04D4best
Definition: CbmTofAnaTestbeam.h:427
CbmTofAnaTestbeam::fhSelTrklFitRedChiSq
TH1 * fhSelTrklFitRedChiSq
Definition: CbmTofAnaTestbeam.h:678
CbmTofAnaTestbeam::fhDXDY04D4best
TH2 * fhDXDY04D4best
Definition: CbmTofAnaTestbeam.h:423
CbmTofAnaTestbeam::fhGoodSelTypeNNAllChiSq
TH2 * fhGoodSelTypeNNAllChiSq
Definition: CbmTofAnaTestbeam.h:696
CbmTofAnaTestbeam::fhVelD4best
TH1 * fhVelD4best
Definition: CbmTofAnaTestbeam.h:411
CbmTofTestBeamClusterizer.h
CbmTofAnaTestbeam::fdSpillBreak
Double_t fdSpillBreak
Definition: CbmTofAnaTestbeam.h:730
CbmTofAnaTestbeam::fhVelD4sbest
TH1 * fhVelD4sbest
Definition: CbmTofAnaTestbeam.h:457
CbmTofAnaTestbeam::fhCounterAccRndmTrackMul
std::map< std::tuple< Int_t, Int_t, Int_t >, TH1 * > fhCounterAccRndmTrackMul
Definition: CbmTofAnaTestbeam.h:663
CbmTofAnaTestbeam::fhDYDT04D4best
TH2 * fhDYDT04D4best
Definition: CbmTofAnaTestbeam.h:425
CbmTofAnaTestbeam::fhDigiMul0D4best
TH2 * fhDigiMul0D4best
Definition: CbmTofAnaTestbeam.h:412
CbmTofAnaTestbeam::fhDomTracksProcMat
std::map< std::tuple< Int_t, Int_t, Int_t >, TH2 * > fhDomTracksProcMat
Definition: CbmTofAnaTestbeam.h:657
CbmTofAnaTestbeam::fhDXDY04best
TH2 * fhDXDY04best
Definition: CbmTofAnaTestbeam.h:399
CbmTofAnaTestbeam::fhXY04
TH2 * fhXY04
Definition: CbmTofAnaTestbeam.h:378
CbmTofAnaTestbeam::fiMrpcRefAddr
Int_t fiMrpcRefAddr
Definition: CbmTofAnaTestbeam.h:759
CbmTofAnaTestbeam::fiDutSm
Int_t fiDutSm
Definition: CbmTofAnaTestbeam.h:764
CbmTrackMatchNew::GetTrueOverAllHitsRatio
Double_t GetTrueOverAllHitsRatio() const
Definition: CbmTrackMatchNew.h:35
TTrbHeader::GetTriggerType
UInt_t GetTriggerType() const
Definition: TTrbHeader.h:31
CbmTofGeoHandler::GetCounter
Int_t GetCounter(Int_t uniqueId)
Definition: CbmTofGeoHandler.cxx:469
CbmTofAnaTestbeam::~CbmTofAnaTestbeam
virtual ~CbmTofAnaTestbeam()
Definition: CbmTofAnaTestbeam.cxx:647
CbmTofAnaTestbeam::fDigiBdfPar
CbmTofDigiBdfPar * fDigiBdfPar
Definition: CbmTofAnaTestbeam.h:329
CbmTofAnaTestbeam::fhDTY4D4Off
TH1 * fhDTY4D4Off
Definition: CbmTofAnaTestbeam.h:718
CbmTofAddress::GetSmType
static Int_t GetSmType(UInt_t address)
Definition: CbmTofAddress.h:82
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmTofAnaTestbeam::fhAccRefTrackResTy
TH2 * fhAccRefTrackResTy
Definition: CbmTofAnaTestbeam.h:644
CbmMatch::GetLink
const CbmLink & GetLink(Int_t i) const
Definition: CbmMatch.h:35
CbmTofAnaTestbeam::fhAccRndmTrackPointMul
TH1 * fhAccRndmTrackPointMul
Definition: CbmTofAnaTestbeam.h:565
CbmTofAnaTestbeam::fhTIR_sel2
TH1 * fhTIR_sel2
Definition: CbmTofAnaTestbeam.h:364
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
CbmTofTracklet::GetTdif
virtual Double_t GetTdif(Int_t iSmType, CbmTofHit *pHit)
Definition: CbmTofTracklet.cxx:412
CbmTofAnaTestbeam::fhSelMatchPurity
TEfficiency * fhSelMatchPurity
Definition: CbmTofAnaTestbeam.h:584
CbmTofAnaTestbeam::fdChS2Sel
Double_t fdChS2Sel
Definition: CbmTofAnaTestbeam.h:739
CbmTofAnaTestbeam::fhCluSizeTrel4D4best
TH2 * fhCluSizeTrel4D4best
Definition: CbmTofAnaTestbeam.h:422
CbmTofAnaTestbeam::fhCluMul04D4best
TH2 * fhCluMul04D4best
Definition: CbmTofAnaTestbeam.h:415
CbmStsAddress::GetAddress
Int_t GetAddress(UInt_t unit=0, UInt_t ladder=0, UInt_t halfladder=0, UInt_t module=0, UInt_t sensor=0, UInt_t side=0, UInt_t version=kCurrentVersion)
Construct address.
Definition: CbmStsAddress.cxx:90
CbmTofAnaTestbeam::fbUseSigCalib
Bool_t fbUseSigCalib
Definition: CbmTofAnaTestbeam.h:823
CbmTofAnaTestbeam::fhDutDTLH_Mul
TH2 * fhDutDTLH_Mul
Definition: CbmTofAnaTestbeam.h:548
CbmTofAnaTestbeam::fbMonteCarloComparison
Bool_t fbMonteCarloComparison
Definition: CbmTofAnaTestbeam.h:795
CbmTofAnaTestbeam::fhCluSizeTrel0D4best
TH2 * fhCluSizeTrel0D4best
Definition: CbmTofAnaTestbeam.h:421
CbmTofTracklet::GetNofHits
Int_t GetNofHits() const
Definition: CbmTofTracklet.h:48
CbmTofAnaTestbeam::fhDXX0D4sbest
TH2 * fhDXX0D4sbest
Definition: CbmTofAnaTestbeam.h:485
CbmTofAnaTestbeam::fhDXX4D4best
TH2 * fhDXX4D4best
Definition: CbmTofAnaTestbeam.h:443
CbmTofFindTracks::GetVertexT
Double_t GetVertexT() const
Definition: CbmTofFindTracks.h:170
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmTofAnaTestbeam::fhDT04DY0_1
TH2 * fhDT04DY0_1
Definition: CbmTofAnaTestbeam.h:519
CbmTofAnaTestbeam::fCalParFileName
TString fCalParFileName
Definition: CbmTofAnaTestbeam.h:713
CbmTofAnaTestbeam::fhDutResT_Hit_Trk
TH2 * fhDutResT_Hit_Trk
Definition: CbmTofAnaTestbeam.h:613
CbmTofAnaTestbeam::fhDutChi_Found
TH1 * fhDutChi_Found
Definition: CbmTofAnaTestbeam.h:531
CbmTofAnaTestbeam::fhDomTracksProcSpec
std::map< std::tuple< Int_t, Int_t, Int_t >, TH2 * > fhDomTracksProcSpec
Definition: CbmTofAnaTestbeam.h:656
CbmTofAnaTestbeam::fhSelHitTupleDutHitMatchAccMul
TH1 * fhSelHitTupleDutHitMatchAccMul
Definition: CbmTofAnaTestbeam.h:683
CbmTofDigiBdfPar::GetNbChan
Int_t GetNbChan(Int_t iSmType, Int_t iRpc) const
Definition: CbmTofDigiBdfPar.cxx:570
CbmTofAnaTestbeam::fhNTracksPerSelMRefHit
TH1 * fhNTracksPerSelMRefHit
Definition: CbmTofAnaTestbeam.h:597
CbmTofDigiPar::GetNrOfModules
Int_t GetNrOfModules()
Definition: CbmTofDigiPar.h:44
CbmTofAnaTestbeam::fhDTSel24
TH1 * fhDTSel24
Definition: CbmTofAnaTestbeam.h:389
CbmDigiManager::Init
InitStatus Init()
Initialisation.
Definition: CbmDigiManager.cxx:71
CbmTofAnaTestbeam::fhDYX0D4best
TH2 * fhDYX0D4best
Definition: CbmTofAnaTestbeam.h:452
CbmTofAnaTestbeam::fhSelTrklDutHitMatchAccNNMul
TH1 * fhSelTrklDutHitMatchAccNNMul
Definition: CbmTofAnaTestbeam.h:680
CbmTofAnaTestbeam::fiNAccRefTracks
Int_t fiNAccRefTracks
Definition: CbmTofAnaTestbeam.h:818
CbmTofAnaTestbeam::fiBeamRefSmId
Int_t fiBeamRefSmId
Definition: CbmTofAnaTestbeam.h:777
CbmTofAnaTestbeam::fhCluSize4DT04D4sbest
TH2 * fhCluSize4DT04D4sbest
Definition: CbmTofAnaTestbeam.h:467
giPdgMap
std::map< Int_t, const char * > giPdgMap
Definition: CbmTofAnaTestbeam.cxx:100
CbmTofAnaTestbeam::fdDTMean
Double_t fdDTMean
Definition: CbmTofAnaTestbeam.h:346
CbmTofAnaTestbeam::fhEtaPhi
TH2 * fhEtaPhi
Definition: CbmTofAnaTestbeam.h:517
CbmTofAnaTestbeam::fdPosY4SelOff
Double_t fdPosY4SelOff
Definition: CbmTofAnaTestbeam.h:738
CbmTofAnaTestbeam::GetSHTSigT
Double_t GetSHTSigT()
Definition: CbmTofAnaTestbeam.cxx:8295
CbmTofTracklet::RemoveTofHitIndex
void RemoveTofHitIndex(Int_t, Int_t iDet, CbmTofHit *, Double_t)
Definition: CbmTofTracklet.h:205
CbmTofAnaTestbeam::fhYY02
TH2 * fhYY02[2]
Definition: CbmTofAnaTestbeam.h:514
CbmTofAnaTestbeam::FindModuleNodes
Bool_t FindModuleNodes()
Definition: CbmTofAnaTestbeam.cxx:8300
CbmTofAnaTestbeam::ExpandNode
void ExpandNode(TGeoNode *tMotherNode)
Definition: CbmTofAnaTestbeam.cxx:8330
CbmTofTracklet::GetTofHitIndex
Int_t GetTofHitIndex(Int_t ind) const
Definition: CbmTofTracklet.h:71
CbmTofAnaTestbeam::fhCounterRefTrackMulHitMul
std::map< std::tuple< Int_t, Int_t, Int_t >, TH2 * > fhCounterRefTrackMulHitMul
Definition: CbmTofAnaTestbeam.h:673
CbmTofTracklet
Provides information on attaching a TofHit to a TofTrack.
Definition: CbmTofTracklet.h:25
CbmTofAnaTestbeam::fhTriggerType
TH1 * fhTriggerType
Definition: CbmTofAnaTestbeam.h:354
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
CbmTofAnaTestbeam::fhDutXYDX
TH3 * fhDutXYDX
Definition: CbmTofAnaTestbeam.h:554
CbmTofAnaTestbeam::fhSelTrklEfficiencyTIS
TEfficiency * fhSelTrklEfficiencyTIS
Definition: CbmTofAnaTestbeam.h:618
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTofAnaTestbeam::fhXYPos
std::vector< TH2 * > fhXYPos
Definition: CbmTofAnaTestbeam.h:516
CbmTofAnaTestbeam::fdDYMean
Double_t fdDYMean
Definition: CbmTofAnaTestbeam.h:345
CbmTofAnaTestbeam::fhDutDTLH_DDH_Found
TH2 * fhDutDTLH_DDH_Found
Definition: CbmTofAnaTestbeam.h:551
CbmTofAnaTestbeam::fhSelMCTrackDutCluSizeTIS
TH2 * fhSelMCTrackDutCluSizeTIS
Definition: CbmTofAnaTestbeam.h:631
CbmTofAnaTestbeam::fiMrpcRefSm
Int_t fiMrpcRefSm
Definition: CbmTofAnaTestbeam.h:767
CbmTofAnaTestbeam::fiCurrentModuleType
Int_t fiCurrentModuleType
Definition: CbmTofAnaTestbeam.h:812
CbmTofAnaTestbeam::fhDTLH_all
TH1 * fhDTLH_all
Definition: CbmTofAnaTestbeam.h:367
CbmTofAnaTestbeam::fhX0DT04D4sbest
TH2 * fhX0DT04D4sbest
Definition: CbmTofAnaTestbeam.h:473
CbmMCDataManager::InitBranch
CbmMCDataArray * InitBranch(const char *name)
Definition: CbmMCDataManager.cxx:106
CbmTofAnaTestbeam::fhDTD4DT04D4best
TH2 * fhDTD4DT04D4best
Definition: CbmTofAnaTestbeam.h:436
CbmTofTracklet::HitIndexOfAddr
virtual Int_t HitIndexOfAddr(Int_t iAddr)
Definition: CbmTofTracklet.cxx:479
CbmTofAnaTestbeam::fhSelTypeNNChiSq
TH2 * fhSelTypeNNChiSq
Definition: CbmTofAnaTestbeam.h:685
CbmTofAnaTestbeam::fhDYDT04best
TH2 * fhDYDT04best
Definition: CbmTofAnaTestbeam.h:401
CbmTofAnaTestbeam::fhRecRndmTrackCloneShare
TEfficiency * fhRecRndmTrackCloneShare
Definition: CbmTofAnaTestbeam.h:654
CbmTofAddress::GetRpcId
static Int_t GetRpcId(UInt_t address)
Definition: CbmTofAddress.h:89
ECbmDataType::kTofDigi
@ kTofDigi
CbmTofAnaTestbeam::fhDutPullXB
TH1 * fhDutPullXB
Definition: CbmTofAnaTestbeam.h:525
CbmTofAnaTestbeam::fhNTracksPerSel2Hit
TH1 * fhNTracksPerSel2Hit
Definition: CbmTofAnaTestbeam.h:595
CbmMCDataArray.h
CbmTofAnaTestbeam::fhDXDT04D4best
TH2 * fhDXDT04D4best
Definition: CbmTofAnaTestbeam.h:424
CbmTofTrackFinderNN.h
gcProcessMap
std::map< const char *, const char *, cmp_str > gcProcessMap
Definition: CbmTofAnaTestbeam.cxx:152
GetProcessName
void GetProcessName(const char *cProcess, const char *&cProcessName)
Definition: CbmTofAnaTestbeam.cxx:8392
CbmTofAnaTestbeam::fhCluMulTrel0D4best
TH2 * fhCluMulTrel0D4best
Definition: CbmTofAnaTestbeam.h:419
CbmTofAnaTestbeam::fdDTWidth
Double_t fdDTWidth
Definition: CbmTofAnaTestbeam.h:349
CbmTofTracklet::GetTrackTy
Double_t GetTrackTy() const
Definition: CbmTofTracklet.h:108
CbmTofAnaTestbeam::fhDTLH_sel2
TH1 * fhDTLH_sel2
Definition: CbmTofAnaTestbeam.h:370
CbmTofAnaTestbeam::fdMul0Max
Double_t fdMul0Max
Definition: CbmTofAnaTestbeam.h:733
CbmTofAnaTestbeam::GetSHTSigY
Double_t GetSHTSigY()
Definition: CbmTofAnaTestbeam.cxx:8290
CbmTofAnaTestbeam::SetParContainers
virtual void SetParContainers()
Inherited from FairTask.
Definition: CbmTofAnaTestbeam.cxx:696
CbmTofAnaTestbeam::fCurrentNodePath
TString fCurrentNodePath
Definition: CbmTofAnaTestbeam.h:810
CbmTofAnaTestbeam::fhDutDTLH_Found
TH1 * fhDutDTLH_Found
Definition: CbmTofAnaTestbeam.h:536
CbmTofAnaTestbeam::fhDTD4DT04D4Off
TH1 * fhDTD4DT04D4Off
Definition: CbmTofAnaTestbeam.h:716
iNspills
Int_t iNspills
Definition: CbmTofAnaTestbeam.cxx:84
CbmTofAnaTestbeam::fSIGLIM
Double_t fSIGLIM
Definition: CbmTofAnaTestbeam.h:784
CbmTofAnaTestbeam::fhDT04DT4_2
TH2 * fhDT04DT4_2
Definition: CbmTofAnaTestbeam.h:522
CbmTofAnaTestbeam::fhCluMul04D4sbest
TH2 * fhCluMul04D4sbest
Definition: CbmTofAnaTestbeam.h:460
CbmTofDigiBdfPar::GetSigVel
Double_t GetSigVel(Int_t iSmType, Int_t iSm, Int_t iRpc) const
Definition: CbmTofDigiBdfPar.cxx:546
ECbmDataType::kTofHit
@ kTofHit
CbmMCEventList::GetEventTimeByIndex
Double_t GetEventTimeByIndex(UInt_t index)
Event time by index @value Event time for event at given index in list.
Definition: CbmMCEventList.cxx:96
CbmTofDigiBdfPar::GetDetInd
Int_t GetDetInd(Int_t iAddr)
Definition: CbmTofDigiBdfPar.cxx:878
CbmMCTrack::GetPx
Double_t GetPx() const
Definition: CbmMCTrack.h:72
CbmTofAnaTestbeam::fhDutXYDT
TH3 * fhDutXYDT
Definition: CbmTofAnaTestbeam.h:556
CbmTofAnaTestbeam::fhYY04D4best
TH2 * fhYY04D4best
Definition: CbmTofAnaTestbeam.h:502
CbmTofAnaTestbeam::fhDTX0D4sbest
TH2 * fhDTX0D4sbest
Definition: CbmTofAnaTestbeam.h:483
CbmTofAnaTestbeam::fhSelMCTrackMatchPurity
TEfficiency * fhSelMCTrackMatchPurity
Definition: CbmTofAnaTestbeam.h:575
CbmTofAnaTestbeam::fhDXY0D4best
TH2 * fhDXY0D4best
Definition: CbmTofAnaTestbeam.h:451
CbmTofAnaTestbeam::fSIGY
Double_t fSIGY
Definition: CbmTofAnaTestbeam.h:787
CbmTofAnaTestbeam::fhChi04D4best
TH1 * fhChi04D4best
Definition: CbmTofAnaTestbeam.h:409
CbmTofAnaTestbeam::fhDT04DX4_2
TH2 * fhDT04DX4_2
Definition: CbmTofAnaTestbeam.h:522
CbmTofAnaTestbeam::fTofHitsColl
TClonesArray * fTofHitsColl
Definition: CbmTofAnaTestbeam.h:332
CbmMCTrack::GetPy
Double_t GetPy() const
Definition: CbmMCTrack.h:73
NStations
const int NStations
Definition: L1AlgoPulls.h:9
CbmTofAnaTestbeam::fhSelTypeAccNNChiSq
TH2 * fhSelTypeAccNNChiSq
Definition: CbmTofAnaTestbeam.h:690
CbmTofAnaTestbeam::fhY0DT04D4best
TH2 * fhY0DT04D4best
Definition: CbmTofAnaTestbeam.h:438
CbmTofAnaTestbeam::fhCluMulTSig4D4best
TH2 * fhCluMulTSig4D4best
Definition: CbmTofAnaTestbeam.h:418
CbmTofAnaTestbeam::fhGoodSelTypeNNPureChiSq
TH2 * fhGoodSelTypeNNPureChiSq
Definition: CbmTofAnaTestbeam.h:695
CbmTofAnaTestbeam::fdPosY4Sel
Double_t fdPosY4Sel
Definition: CbmTofAnaTestbeam.h:737
CbmTofAnaTestbeam::fhSelRefTrackShare
TEfficiency * fhSelRefTrackShare
Definition: CbmTofAnaTestbeam.h:581
CbmTofAnaTestbeam::fhNTracksPerMRefHit
TH1 * fhNTracksPerMRefHit
Definition: CbmTofAnaTestbeam.h:594
CbmTofAnaTestbeam::fhDutChi_Missed
TH1 * fhDutChi_Missed
Definition: CbmTofAnaTestbeam.h:532
CbmTofDigi.h
CbmTofAnaTestbeam::fhAccRefTrackAcceptanceEfficiency
TEfficiency * fhAccRefTrackAcceptanceEfficiency
Definition: CbmTofAnaTestbeam.h:568
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmTofAnaTestbeam::fhDutResY_Hit_MC
TH2 * fhDutResY_Hit_MC
Definition: CbmTofAnaTestbeam.h:612
CbmTofAnaTestbeam::fhSelEfficiency
TEfficiency * fhSelEfficiency
Definition: CbmTofAnaTestbeam.h:579
CbmTofAnaTestbeam::fiBeamRefSmType
Int_t fiBeamRefSmType
Definition: CbmTofAnaTestbeam.h:776
fhLHTime
static std::vector< TH2D * > fhLHTime
Definition: CbmTofAnaTestbeam.cxx:90
CbmTofAnaTestbeam
Definition: CbmTofAnaTestbeam.h:44
CbmTofDigiPar.h
CbmTrackMatchNew::SetNofTrueHits
void SetNofTrueHits(Int_t nofTrueHits)
Definition: CbmTrackMatchNew.h:45
CbmTofAnaTestbeam::fhDutTIS_Missed
TH2 * fhDutTIS_Missed
Definition: CbmTofAnaTestbeam.h:541
CbmTofAnaTestbeam::fbTracksInInputFile
Bool_t fbTracksInInputFile
Definition: CbmTofAnaTestbeam.h:797
CbmMatch.h
CbmTofAnaTestbeam::fhBRefMul
TH1 * fhBRefMul
Definition: CbmTofAnaTestbeam.h:510
CbmTofTestBeamClusterizer::fdMemoryTime
Double_t fdMemoryTime
Definition: CbmTofTestBeamClusterizer.h:420
GetMaterialName
void GetMaterialName(const char *cMaterial, const char *&cMaterialName)
Definition: CbmTofAnaTestbeam.cxx:8382
CbmTofAnaTestbeam::fhChi04
TH1 * fhChi04
Definition: CbmTofAnaTestbeam.h:385
CbmTofAnaTestbeam::fiDutRpc
Int_t fiDutRpc
Definition: CbmTofAnaTestbeam.h:765
CbmTofAnaTestbeam::fhSelTypeNNResidualX
TH2 * fhSelTypeNNResidualX
Definition: CbmTofAnaTestbeam.h:687
CbmTofAnaTestbeam::fhXY4D4sel
TH2 * fhXY4D4sel
Definition: CbmTofAnaTestbeam.h:505
CbmTofAnaTestbeam::fhRecRefTrackEfficiency
TEfficiency * fhRecRefTrackEfficiency
Definition: CbmTofAnaTestbeam.h:649
CbmTofHit::ToString
virtual std::string ToString() const
Inherited from CbmBaseHit.
Definition: CbmTofHit.cxx:71
CbmTofAnaTestbeam::fhSelTypeAccNNResidualT
TH2 * fhSelTypeAccNNResidualT
Definition: CbmTofAnaTestbeam.h:691
CbmTofAnaTestbeam::fhDTMul0D4sbest
TH2 * fhDTMul0D4sbest
Definition: CbmTofAnaTestbeam.h:482
CbmTofAnaTestbeam::fdDutY
Double_t fdDutY
Definition: CbmTofAnaTestbeam.h:754
CbmTofAddress::GetSmId
static Int_t GetSmId(UInt_t address)
Definition: CbmTofAddress.h:75
StartSpillTime
static Double_t StartSpillTime
Definition: CbmTofAnaTestbeam.cxx:82
CbmTofDigiPar::GetCell
CbmTofCell * GetCell(Int_t i)
Definition: CbmTofDigiPar.h:48
CbmDigiManager::IsPresent
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
Definition: CbmDigiManager.cxx:112
CbmTofAnaTestbeam::fhDTY4D4best
TH2 * fhDTY4D4best
Definition: CbmTofAnaTestbeam.h:442
CbmTofTracklet::GetTrackTx
Double_t GetTrackTx() const
Definition: CbmTofTracklet.h:105
CbmTofAnaTestbeam::fiMrpcSel2Addr
Int_t fiMrpcSel2Addr
Definition: CbmTofAnaTestbeam.h:760
CbmHit::GetTimeError
Double_t GetTimeError() const
Definition: CbmHit.h:76
CbmTofAnaTestbeam::WriteHistos
Bool_t WriteHistos()
Definition: CbmTofAnaTestbeam.cxx:7924
CbmTofGeoHandler::GetSModule
Int_t GetSModule(Int_t uniqueId)
Definition: CbmTofGeoHandler.cxx:464
CbmTofAnaTestbeam::fhCluSize0DT04D4Off
TH1 * fhCluSize0DT04D4Off
Definition: CbmTofAnaTestbeam.h:720
CbmTofAnaTestbeam::Init
virtual InitStatus Init()
Definition: CbmTofAnaTestbeam.cxx:653
CbmTofAnaTestbeam::fTofHitPointMatches
TClonesArray * fTofHitPointMatches
Definition: CbmTofAnaTestbeam.h:804
CbmTofAnaTestbeam::fhAccRefTrackResTx
TH2 * fhAccRefTrackResTx
Definition: CbmTofAnaTestbeam.h:643
CbmTofAnaTestbeam::fhDutDTLH_Missed
TH1 * fhDutDTLH_Missed
Definition: CbmTofAnaTestbeam.h:537
CbmTofAnaTestbeam::fhNMatchD4sel
TH1 * fhNMatchD4sel
Definition: CbmTofAnaTestbeam.h:408
CbmTofAnaTestbeam::fhChiSel24
TH1 * fhChiSel24
Definition: CbmTofAnaTestbeam.h:386
CbmTofTracklet.h
CbmTofAnaTestbeam::fhCounterRecRefTrackPurityPassed
std::map< std::tuple< Int_t, Int_t, Int_t >, TH1 * > fhCounterRecRefTrackPurityPassed
Definition: CbmTofAnaTestbeam.h:671
CbmTofAnaTestbeam::fhDYX0D4sbest
TH2 * fhDYX0D4sbest
Definition: CbmTofAnaTestbeam.h:487
CbmTofAnaTestbeam::fGeoHandler
CbmTofGeoHandler * fGeoHandler
Definition: CbmTofAnaTestbeam.h:308
CbmDigiManager::Instance
static CbmDigiManager * Instance()
Static instance.
Definition: CbmDigiManager.h:93
CbmTofAnaTestbeam::fTofDigisCollIn
TClonesArray * fTofDigisCollIn
Definition: CbmTofAnaTestbeam.h:337
CbmTofAnaTestbeam::fhTofD4sel
TH1 * fhTofD4sel
Definition: CbmTofAnaTestbeam.h:509
CbmTofAnaTestbeam::fEvents
Int_t fEvents
Definition: CbmTofAnaTestbeam.h:305
CbmTofAnaTestbeam::fMCTracks
CbmMCDataArray * fMCTracks
Definition: CbmTofAnaTestbeam.h:803
CbmTofGeoHandler.h
CbmTofAnaTestbeam::fhTIR_sel1
TH1 * fhTIR_sel1
Definition: CbmTofAnaTestbeam.h:363
CbmTofAnaTestbeam::fAccTracks
TClonesArray * fAccTracks
Definition: CbmTofAnaTestbeam.h:800
CbmTofAnaTestbeam::fEnableMatchPosScaling
Bool_t fEnableMatchPosScaling
Definition: CbmTofAnaTestbeam.h:789
CbmTofAnaTestbeam::fTrbHeader
TTrbHeader * fTrbHeader
Definition: CbmTofAnaTestbeam.h:342
CbmTofAnaTestbeam::CreateHistos
Bool_t CreateHistos()
Definition: CbmTofAnaTestbeam.cxx:1449
CbmTofTracklet::GetMatChi2
virtual Double_t GetMatChi2(Int_t iSm)
Definition: CbmTofTracklet.cxx:116
CbmTofAnaTestbeam::fhTT04
TH2 * fhTT04
Definition: CbmTofAnaTestbeam.h:380
CbmTofAnaTestbeam::ExecEvent
virtual void ExecEvent(Option_t *option)
Definition: CbmTofAnaTestbeam.cxx:838
CbmTofFindTracks::Instance
static CbmTofFindTracks * Instance()
Definition: CbmTofFindTracks.h:65
CbmTofAnaTestbeam::fhDutResX_Hit_Trk
TH2 * fhDutResX_Hit_Trk
Definition: CbmTofAnaTestbeam.h:607
CbmTofDetectorId_v14a.h
CbmTofAnaTestbeam::fhRecRefTrackGhostShare
TEfficiency * fhRecRefTrackGhostShare
Definition: CbmTofAnaTestbeam.h:651
CbmMCTrack::GetStartZ
Double_t GetStartZ() const
Definition: CbmMCTrack.h:77
CbmTofAnaTestbeam::fhPVResYRef
TH2 * fhPVResYRef
Definition: CbmTofAnaTestbeam.h:638
CbmTofAnaTestbeam::fhTIS_Nhit
TH2 * fhTIS_Nhit
Definition: CbmTofAnaTestbeam.h:365
ECbmDataType::kTofTrack
@ kTofTrack
CbmEvent.h
CbmTofTracklet::GetR0
Double_t GetR0()
Definition: CbmTofTracklet.cxx:149
CbmTofAnaTestbeam::fhDXDT04D4sbest
TH2 * fhDXDT04D4sbest
Definition: CbmTofAnaTestbeam.h:462
CbmTofAnaTestbeam::fhDigiMul4best
TH1 * fhDigiMul4best
Definition: CbmTofAnaTestbeam.h:398
CbmTofAnaTestbeam::fTofAccTrackPointMatches
TClonesArray * fTofAccTrackPointMatches
Definition: CbmTofAnaTestbeam.h:808
CbmTofAnaTestbeam::fdGhostTrackHitQuota
Double_t fdGhostTrackHitQuota
Definition: CbmTofAnaTestbeam.h:819
CbmMCEventList::GetNofEvents
std::size_t GetNofEvents() const
Number of events in the list @value Number of events.
Definition: CbmMCEventList.h:90
CbmTofAnaTestbeam::fhCluSize04D4best
TH2 * fhCluSize04D4best
Definition: CbmTofAnaTestbeam.h:414
CbmTofAnaTestbeam::fTofHitAccTrackMatches
TClonesArray * fTofHitAccTrackMatches
Definition: CbmTofAnaTestbeam.h:805
CbmTofAnaTestbeam::fhDutResX_Hit_MC
TH2 * fhDutResX_Hit_MC
Definition: CbmTofAnaTestbeam.h:609
CbmTofAnaTestbeam::fhTIR_sel
TH1 * fhTIR_sel
Definition: CbmTofAnaTestbeam.h:362
CbmTofAnaTestbeam::fhDT04DY4_1
TH2 * fhDT04DY4_1
Definition: CbmTofAnaTestbeam.h:520
CbmTofAnaTestbeam::fDigiPar
CbmTofDigiPar * fDigiPar
Definition: CbmTofAnaTestbeam.h:328
CbmTofAnaTestbeam::fhDT04DY4_2
TH2 * fhDT04DY4_2
Definition: CbmTofAnaTestbeam.h:522
CbmTofAnaTestbeam::fdDutX
Double_t fdDutX
Definition: CbmTofAnaTestbeam.h:752
CbmTofAnaTestbeam::fSIGX
Double_t fSIGX
Definition: CbmTofAnaTestbeam.h:786
CbmTofAnaTestbeam::fdMulDMax
Double_t fdMulDMax
Definition: CbmTofAnaTestbeam.h:728
StartAnalysisTime
static Double_t StartAnalysisTime
Definition: CbmTofAnaTestbeam.cxx:80
CbmTofAnaTestbeam::fhResX04ExpMC
TH2 * fhResX04ExpMC
Definition: CbmTofAnaTestbeam.h:586
CbmTofAnaTestbeam::fhDutPullY
TH1 * fhDutPullY
Definition: CbmTofAnaTestbeam.h:526
CbmTofAnaTestbeam::fhY0DT04best
TH2 * fhY0DT04best
Definition: CbmTofAnaTestbeam.h:406
fDetIdMap
static std::map< UInt_t, UInt_t > fDetIdMap
Definition: CbmTofAnaTestbeam.cxx:92
iNSel
const Int_t iNSel
Definition: CbmTofClusterizersDef.h:67
CbmTofAnaTestbeam::fhAccRefTrackAcceptancePurity
TEfficiency * fhAccRefTrackAcceptancePurity
Definition: CbmTofAnaTestbeam.h:569
TTrbHeader::GetTriggerPattern
UInt_t GetTriggerPattern() const
Definition: TTrbHeader.h:30
CbmTofAnaTestbeam::fdDChS2Sel
Double_t fdDChS2Sel
Definition: CbmTofAnaTestbeam.h:740
CbmTofAnaTestbeam::fiDutAddr
Int_t fiDutAddr
Definition: CbmTofAnaTestbeam.h:758
CbmTofAnaTestbeam::fhDistDT04D4best
TH2 * fhDistDT04D4best
Definition: CbmTofAnaTestbeam.h:426
CbmTofAnaTestbeam::fhPVResXAll
TH2 * fhPVResXAll
Definition: CbmTofAnaTestbeam.h:634
CbmTofAnaTestbeam::fhDXY4D4sbest
TH2 * fhDXY4D4sbest
Definition: CbmTofAnaTestbeam.h:479
CbmTofAnaTestbeam::fhDXSel24
TH1 * fhDXSel24
Definition: CbmTofAnaTestbeam.h:387
CbmTofAnaTestbeam::fhResX04HitExp
TH2 * fhResX04HitExp
Definition: CbmTofAnaTestbeam.h:585
CbmTofAnaTestbeam::fdSel2TOff
Double_t fdSel2TOff
Definition: CbmTofAnaTestbeam.h:743
CbmTofAnaTestbeam::fhTISDT04D4best
TH2 * fhTISDT04D4best
Definition: CbmTofAnaTestbeam.h:439
CbmTofAnaTestbeam::fEventsColl
TClonesArray * fEventsColl
Definition: CbmTofAnaTestbeam.h:336
CbmTofGeoHandler
Definition: CbmTofGeoHandler.h:30
CbmMCDataObject.h
CbmTofAnaTestbeam::fhCounterAccTrackMul
std::map< std::tuple< Int_t, Int_t, Int_t >, TH1 * > fhCounterAccTrackMul
Definition: CbmTofAnaTestbeam.h:661
CbmTofTracklet::ContainsAddr
virtual Bool_t ContainsAddr(Int_t iAddr)
Definition: CbmTofTracklet.cxx:466
CbmDigiManager::Get
const Digi * Get(Int_t index) const
Get a digi object.
Definition: CbmDigiManager.h:52
CbmTofAnaTestbeam::fhDutPullT
TH1 * fhDutPullT
Definition: CbmTofAnaTestbeam.h:529
CbmTofAnaTestbeam::fhDutResT_Trk_MC
TH2 * fhDutResT_Trk_MC
Definition: CbmTofAnaTestbeam.h:614
CbmTofAnaTestbeam::fhResT04ExpMC
TH2 * fhResT04ExpMC
Definition: CbmTofAnaTestbeam.h:592
CbmTofTracklet::SetTime
void SetTime(Double_t val)
Definition: CbmTofTracklet.h:240
CbmTofCell::GetX
Double_t GetX() const
Definition: CbmTofCell.h:36
CbmTofAnaTestbeam::fhTIS_sel2
TH1 * fhTIS_sel2
Definition: CbmTofAnaTestbeam.h:360
CbmTofDetectorId_v12b.h
CbmTofAnaTestbeam::fdDTDia
Double_t fdDTDia
Definition: CbmTofAnaTestbeam.h:731
CbmTofAnaTestbeam::fbDelayMCPoints
Bool_t fbDelayMCPoints
Definition: CbmTofAnaTestbeam.h:820
CbmTofAnaTestbeam::fdCh4Sel
Double_t fdCh4Sel
Definition: CbmTofAnaTestbeam.h:735
CbmTofDigi::GetChannel
Double_t GetChannel() const
Channel .
Definition: CbmTofDigi.h:136
CbmMCDataArray::Get
TObject * Get(const CbmLink *lnk)
Definition: CbmMCDataArray.h:47
CbmTofAnaTestbeam::InitParameters
Bool_t InitParameters()
Initialize other parameters not included in parameter classes.
Definition: CbmTofAnaTestbeam.cxx:1193
GetPdgName
void GetPdgName(Int_t iPdgCode, const char *&cPdgName)
Definition: CbmTofAnaTestbeam.cxx:8372
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmTofCell
Definition: CbmTofCell.h:8
CbmTofAnaTestbeam::fhSelTypeNNResidualT_Width
TH1 * fhSelTypeNNResidualT_Width
Definition: CbmTofAnaTestbeam.h:724
cmp_str
Definition: CbmTofAnaTestbeam.cxx:94
CbmTofAnaTestbeam::fhRndmTracksProcSpec
std::map< std::tuple< Int_t, Int_t, Int_t >, TH2 * > fhRndmTracksProcSpec
Definition: CbmTofAnaTestbeam.h:658
CbmTofAnaTestbeam::LoadGeometry
Bool_t LoadGeometry()
Definition: CbmTofAnaTestbeam.cxx:708
CbmTofAnaTestbeam::fCurrentModuleNodePath
TString fCurrentModuleNodePath
Definition: CbmTofAnaTestbeam.h:811
CbmTofAnaTestbeam::fhSelTrklMatchEfficiency
TEfficiency * fhSelTrklMatchEfficiency
Definition: CbmTofAnaTestbeam.h:605
CbmTofAddress::GetChannelId
static Int_t GetChannelId(UInt_t address)
Definition: CbmTofAddress.h:96
CbmTofAnaTestbeam::fhDutTIR_Missed
TH2 * fhDutTIR_Missed
Definition: CbmTofAnaTestbeam.h:543
CbmTofAnaTestbeam::fhAccRefTrackResV
TH2 * fhAccRefTrackResV
Definition: CbmTofAnaTestbeam.h:645
CbmTofFindTracks::GetTOff
Double_t GetTOff(Int_t iAddr)
Definition: CbmTofFindTracks.cxx:2383
CbmTofAnaTestbeam::fhDT2
TH1 * fhDT2
Definition: CbmTofAnaTestbeam.h:372
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
CbmTrackMatchNew.h
CbmMCEventList::GetEventTime
Double_t GetEventTime(UInt_t event, UInt_t file)
Event start time.
Definition: CbmMCEventList.cxx:86
k14a
@ k14a
Definition: CbmTofGeoHandler.h:17
CbmTofAnaTestbeam::fhResY04HitExp
TH2 * fhResY04HitExp
Definition: CbmTofAnaTestbeam.h:588
CbmTofAnaTestbeam::fhSelMCTrackDutHitMatchNNMul
TH1 * fhSelMCTrackDutHitMatchNNMul
Definition: CbmTofAnaTestbeam.h:576
CbmMatch::AddLink
void AddLink(const CbmLink &newLink)
Definition: CbmMatch.cxx:42
CbmTofAnaTestbeam::fhSelTypeNNResidualY
TH2 * fhSelTypeNNResidualY
Definition: CbmTofAnaTestbeam.h:688
CbmTofAnaTestbeam::fiCorMode
Int_t fiCorMode
Definition: CbmTofAnaTestbeam.h:757
CbmTofAnaTestbeam::GetSHTSigX
Double_t GetSHTSigX()
Definition: CbmTofAnaTestbeam.cxx:8285
CbmTofAnaTestbeam::fdHitDistMin
Double_t fdHitDistMin
Definition: CbmTofAnaTestbeam.h:745
CbmTofAnaTestbeam::fhAccTrackPointMul
TH1 * fhAccTrackPointMul
Definition: CbmTofAnaTestbeam.h:563
CbmTofAnaTestbeam::fhDYDT04
TH2 * fhDYDT04
Definition: CbmTofAnaTestbeam.h:392
CbmTofAnaTestbeam::fhPVResXRef
TH2 * fhPVResXRef
Definition: CbmTofAnaTestbeam.h:637
CbmTofTracklet::GetTt
Double_t GetTt() const
Definition: CbmTofTracklet.h:54
CbmTofAnaTestbeam::fhSelMCTrackEfficiency
TEfficiency * fhSelMCTrackEfficiency
Definition: CbmTofAnaTestbeam.h:573
CbmTofAnaTestbeam::fhDutDTLH_DD_Found
TH2 * fhDutDTLH_DD_Found
Definition: CbmTofAnaTestbeam.h:552
CbmTofAnaTestbeam::fTofDigiMatchColl
TClonesArray * fTofDigiMatchColl
Definition: CbmTofAnaTestbeam.h:333
dDTD4Min
Double_t dDTD4Min
Definition: CbmTofAnaTestbeam.cxx:79
CbmTofAddress.h
CbmTofAnaTestbeam::fhSelHitTupleMatchEfficiencyTIS
TEfficiency * fhSelHitTupleMatchEfficiencyTIS
Definition: CbmTofAnaTestbeam.h:621
CbmTrackMatchNew::SetNofWrongHits
void SetNofWrongHits(Int_t nofWrongHits)
Definition: CbmTrackMatchNew.h:46
CbmTofAnaTestbeam::fiCurrentCounterIndex
Int_t fiCurrentCounterIndex
Definition: CbmTofAnaTestbeam.h:814
CbmTofAnaTestbeam::fhDTMul0D4best
TH2 * fhDTMul0D4best
Definition: CbmTofAnaTestbeam.h:447
CbmTofAnaTestbeam::fbBestSelTrackletOnly
Bool_t fbBestSelTrackletOnly
Definition: CbmTofAnaTestbeam.h:822
CbmTofAnaTestbeam::fhSelHitTupleDutCluSizeTIS
TH2 * fhSelHitTupleDutCluSizeTIS
Definition: CbmTofAnaTestbeam.h:629
CbmTofAnaTestbeam::fhDTD4
TH1 * fhDTD4
Definition: CbmTofAnaTestbeam.h:511
CbmTofAnaTestbeam::fhXX2
TH2 * fhXX2
Definition: CbmTofAnaTestbeam.h:373
CbmTofHit::GetR
Double_t GetR() const
Definition: core/data/tof/CbmTofHit.h:94
CbmTofGeoHandler::Init
Int_t Init(Bool_t isSimulation=kFALSE)
Definition: CbmTofGeoHandler.cxx:39
CbmTofAnaTestbeam::fhRefDXDYDT
TH3 * fhRefDXDYDT
Definition: CbmTofAnaTestbeam.h:383
CbmTofAnaTestbeam::GetSigT
Double_t GetSigT(Int_t iSelType)
Definition: CbmTofAnaTestbeam.cxx:8270
CbmTofAnaTestbeam::fChannelInfo
CbmTofCell * fChannelInfo
Definition: CbmTofAnaTestbeam.h:310
CbmDigiManager
CbmDigiManager.
Definition: CbmDigiManager.h:37
CbmMCTrack::GetGeantProcessId
UInt_t GetGeantProcessId() const
Definition: CbmMCTrack.h:69
CbmTofAnaTestbeam::fhDutDTLH_DD_Missed
TH2 * fhDutDTLH_DD_Missed
Definition: CbmTofAnaTestbeam.h:553
CbmTofDigiBdfPar
Parameters class for the CBM ToF digitizer using beam data distributions.
Definition: CbmTofDigiBdfPar.h:30
CbmMCEventList
Container class for MC events with number, file and start time.
Definition: CbmMCEventList.h:38
CbmTofAnaTestbeam::fhStrMul04D4best
TH2 * fhStrMul04D4best
Definition: CbmTofAnaTestbeam.h:416
CbmTofAnaTestbeam::fhDutDTLH_Tot
TH2 * fhDutDTLH_Tot
Definition: CbmTofAnaTestbeam.h:547
CbmTofAnaTestbeam::fhDYY4D4sbest
TH2 * fhDYY4D4sbest
Definition: CbmTofAnaTestbeam.h:481
CbmTofAnaTestbeam::fhDXY4D4best
TH2 * fhDXY4D4best
Definition: CbmTofAnaTestbeam.h:444
CbmTofAnaTestbeam::fdMCSIGY
Double_t fdMCSIGY
Definition: CbmTofAnaTestbeam.h:829
CbmTofAnaTestbeam::fhChiDT04D4best
TH2 * fhChiDT04D4best
Definition: CbmTofAnaTestbeam.h:434
CbmTofAnaTestbeam::fhTot4DT04D4sbest
TH2 * fhTot4DT04D4sbest
Definition: CbmTofAnaTestbeam.h:469
CbmTofAnaTestbeam::fdSpillDuration
Double_t fdSpillDuration
Definition: CbmTofAnaTestbeam.h:729
CbmTofAnaTestbeam::fdMCSIGT
Double_t fdMCSIGT
Definition: CbmTofAnaTestbeam.h:827
dTLEvt
static Double_t dTLEvt
Definition: CbmTofAnaTestbeam.cxx:81
CbmTofAnaTestbeam::fhSelMCTrackMatchEfficiencyTIS
TEfficiency * fhSelMCTrackMatchEfficiencyTIS
Definition: CbmTofAnaTestbeam.h:623
CbmTofAnaTestbeam::fdDutDY
Double_t fdDutDY
Definition: CbmTofAnaTestbeam.h:755
CbmTofAnaTestbeam::fhDTLH_sel
TH1 * fhDTLH_sel
Definition: CbmTofAnaTestbeam.h:368
ClassImp
ClassImp(CbmTofAnaTestbeam)
CbmTofAnaTestbeam::fhDTY4D4sbest
TH2 * fhDTY4D4sbest
Definition: CbmTofAnaTestbeam.h:477
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmTofAnaTestbeam::fhPVResYAll
TH2 * fhPVResYAll
Definition: CbmTofAnaTestbeam.h:635
CbmTofAnaTestbeam::fhDT04DY0_2
TH2 * fhDT04DY0_2
Definition: CbmTofAnaTestbeam.h:521
CbmTofAnaTestbeam::fTofDigiMatchCollIn
TClonesArray * fTofDigiMatchCollIn
Definition: CbmTofAnaTestbeam.h:339
CbmTofTrackFinderNN::Line3Dfit
static void Line3Dfit(CbmTofTracklet *pTrk)
Definition: CbmTofTrackFinderNN.cxx:1189
CbmTofCell.h
CbmTofAnaTestbeam::fChannelInfoRef
CbmTofCell * fChannelInfoRef
Definition: CbmTofAnaTestbeam.h:311
CbmTofTestBeamClusterizer::fvLastHits
std::vector< std::vector< std::vector< std::vector< std::list< CbmTofHit * > > > > > fvLastHits
Definition: CbmTofTestBeamClusterizer.h:367
CbmTofTrackletTools::FitTt
Double_t FitTt(CbmTofTracklet *pTrk, Int_t iDetId)
Definition: CbmTofTrackletTools.cxx:65
CbmTofAnaTestbeam::fStop
TTimeStamp fStop
Definition: CbmTofAnaTestbeam.h:711
CbmTofAnaTestbeam::fhResT04HitExp
TH2 * fhResT04HitExp
Definition: CbmTofAnaTestbeam.h:591
CbmTofAnaTestbeam::fhAccRefTrackPointMul
TH1 * fhAccRefTrackPointMul
Definition: CbmTofAnaTestbeam.h:564
CbmTofAnaTestbeam::fhCounterRecRefTrackEfficiencyPassed
std::map< std::tuple< Int_t, Int_t, Int_t >, TH1 * > fhCounterRecRefTrackEfficiencyPassed
Definition: CbmTofAnaTestbeam.h:667
CbmTofAnaTestbeam::fhSelMatchEfficiency
TEfficiency * fhSelMatchEfficiency
Definition: CbmTofAnaTestbeam.h:583
CbmTofAnaTestbeam::fiMrpcRefRpc
Int_t fiMrpcRefRpc
Definition: CbmTofAnaTestbeam.h:768
CbmTofAnaTestbeam::fhCluSizeSigT4D4best
TH2 * fhCluSizeSigT4D4best
Definition: CbmTofAnaTestbeam.h:433
CbmTofAnaTestbeam::fhNTracksPerDutHit
TH1 * fhNTracksPerDutHit
Definition: CbmTofAnaTestbeam.h:596
CbmTofAnaTestbeam::fStart
TTimeStamp fStart
Definition: CbmTofAnaTestbeam.h:710
CbmTofAnaTestbeam::fdTShift
Double_t fdTShift
Definition: CbmTofAnaTestbeam.h:748
CbmTofAnaTestbeam::fhSelMCTrackDutHitMatchAccNNMul
TH1 * fhSelMCTrackDutHitMatchAccNNMul
Definition: CbmTofAnaTestbeam.h:577
CbmTofTracklet::AddTofHitIndex
void AddTofHitIndex(Int_t tofHitIndex, Int_t iDet, CbmTofHit *pHit)
Definition: CbmTofTracklet.h:167
CbmTofAnaTestbeam::fhAccRefTrackShare
TEfficiency * fhAccRefTrackShare
Definition: CbmTofAnaTestbeam.h:648
fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmTofAnaTestbeam.cxx:88
CbmTofAnaTestbeam::fhDXDY04
TH2 * fhDXDY04
Definition: CbmTofAnaTestbeam.h:390
CbmTofAnaTestbeam::fhCluMulTSig0D4best
TH2 * fhCluMulTSig0D4best
Definition: CbmTofAnaTestbeam.h:417
fTofHitsColl
TClonesArray * fTofHitsColl
Definition: CbmHadronAnalysis.cxx:52
TTrbHeader::GetTimeInSpill
Double_t GetTimeInSpill() const
Definition: TTrbHeader.h:32
CbmTofFindTracks::GetVertexX
Double_t GetVertexX() const
Definition: CbmTofFindTracks.h:171
CbmTofAnaTestbeam::fhNMatch04
TH1 * fhNMatch04
Definition: CbmTofAnaTestbeam.h:375
CbmTofDigi
Data class for expanded digital TOF information.
Definition: CbmTofDigi.h:38
CbmTofAnaTestbeam::fhDXY0D4sbest
TH2 * fhDXY0D4sbest
Definition: CbmTofAnaTestbeam.h:486
CbmMCTrack::GetPt
Double_t GetPt() const
Definition: CbmMCTrack.h:99
CbmTofAnaTestbeam::fhDutPullTB
TH1 * fhDutPullTB
Definition: CbmTofAnaTestbeam.h:530
CbmTofFindTracks::InspectEvent
Bool_t InspectEvent() const
Definition: CbmTofFindTracks.h:132
fvLHit
static std::vector< std::vector< CbmTofHit * > > fvLHit
Definition: CbmTofAnaTestbeam.cxx:91
CbmTofAnaTestbeam::fhDutXY_Missed
TH2 * fhDutXY_Missed
Definition: CbmTofAnaTestbeam.h:535
CbmTofCell::GetSizey
Double_t GetSizey() const
Definition: CbmTofCell.h:41
CbmTofAnaTestbeam::fhDutTIR_Found
TH2 * fhDutTIR_Found
Definition: CbmTofAnaTestbeam.h:542
CbmTofAnaTestbeam::fiMrpcSel2
Int_t fiMrpcSel2
Definition: CbmTofAnaTestbeam.h:769
fdSpillBreak
const Double_t fdSpillBreak
Definition: CbmTofEventClusterizer.cxx:78
CbmTofAnaTestbeam::fhTriggerPattern
TH1 * fhTriggerPattern
Definition: CbmTofAnaTestbeam.h:353
CbmTofAnaTestbeam::fdDutDX
Double_t fdDutDX
Definition: CbmTofAnaTestbeam.h:753
CbmMCDataManager
Task class creating and managing CbmMCDataArray objects.
Definition: CbmMCDataManager.h:27
CbmTofAnaTestbeam::fhDutMul_Found
TH1 * fhDutMul_Found
Definition: CbmTofAnaTestbeam.h:538
CbmTofAnaTestbeam::fhSelHitTupleResidualXYT_Width
TH1 * fhSelHitTupleResidualXYT_Width
Definition: CbmTofAnaTestbeam.h:727
CbmEvent::GetNofData
Int_t GetNofData() const
Definition: CbmEvent.h:90
CbmTofAnaTestbeam::fdTOffD4
Double_t fdTOffD4
Definition: CbmTofAnaTestbeam.h:747
CbmTofAnaTestbeam::fhSelTrklPurity
TEfficiency * fhSelTrklPurity
Definition: CbmTofAnaTestbeam.h:602
CbmTofTracklet::UpdateT0
Double_t UpdateT0()
Definition: CbmTofTracklet.cxx:186
CbmTofAnaTestbeam::fhDutResY_Hit_Trk
TH2 * fhDutResY_Hit_Trk
Definition: CbmTofAnaTestbeam.h:610
CbmTofAnaTestbeam::fhAccPrimTrackMul
TH1 * fhAccPrimTrackMul
Definition: CbmTofAnaTestbeam.h:562
CbmTofFindTracks::fMapRpcIdParInd
std::map< Int_t, Int_t > fMapRpcIdParInd
Definition: CbmTofFindTracks.h:200
CbmTofTracklet::GetTime
Double_t GetTime() const
Definition: CbmTofTracklet.h:112
CbmTofAnaTestbeam::fhX0DT04D4best
TH2 * fhX0DT04D4best
Definition: CbmTofAnaTestbeam.h:437
CbmTofAnaTestbeam::fhDXX0D4best
TH2 * fhDXX0D4best
Definition: CbmTofAnaTestbeam.h:450
CbmTofAnaTestbeam::fhDutDTLH_Missed_TIS
TH2 * fhDutDTLH_Missed_TIS
Definition: CbmTofAnaTestbeam.h:550
CbmTofAnaTestbeam::fhDTY0D4sbest
TH2 * fhDTY0D4sbest
Definition: CbmTofAnaTestbeam.h:484
CbmTofAnaTestbeam::fhTimeInSpill
TH1 * fhTimeInSpill
Definition: CbmTofAnaTestbeam.h:355
CbmTofAnaTestbeam::fhSelTrklRefTrackProcSpec
TH2 * fhSelTrklRefTrackProcSpec
Definition: CbmTofAnaTestbeam.h:604
CbmMCEventList.h
CbmMCTrack::GetRapidity
Double_t GetRapidity() const
Definition: CbmMCTrack.cxx:177
CbmTofAnaTestbeam::fhSelTrklMatchPurity
TEfficiency * fhSelTrklMatchPurity
Definition: CbmTofAnaTestbeam.h:606
CbmTofAnaTestbeam::fhAccRefTrackResY
TH2 * fhAccRefTrackResY
Definition: CbmTofAnaTestbeam.h:642
CbmTofAnaTestbeam::fhYX04
TH2 * fhYX04
Definition: CbmTofAnaTestbeam.h:379
CbmTofAnaTestbeam::fhDTMul4D4sbest
TH2 * fhDTMul4D4sbest
Definition: CbmTofAnaTestbeam.h:475
CbmTofAnaTestbeam::fhCounterAccRefTrackMul
std::map< std::tuple< Int_t, Int_t, Int_t >, TH1 * > fhCounterAccRefTrackMul
Definition: CbmTofAnaTestbeam.h:662
CbmTofAnaTestbeam::fhXY4D4best
TH2 * fhXY4D4best
Definition: CbmTofAnaTestbeam.h:500
CbmTofAnaTestbeam::fhDigiMul4D4sbest
TH1 * fhDigiMul4D4sbest
Definition: CbmTofAnaTestbeam.h:459
CbmTofAnaTestbeam::fdDTD4MAX
Double_t fdDTD4MAX
Definition: CbmTofAnaTestbeam.h:732
CbmMCTrack::GetStartY
Double_t GetStartY() const
Definition: CbmMCTrack.h:76
CbmTofAnaTestbeam::fhDutChi_Match
TH1 * fhDutChi_Match
Definition: CbmTofAnaTestbeam.h:533
CbmTofAnaTestbeam::fhDT04DT0_1
TH2 * fhDT04DT0_1
Definition: CbmTofAnaTestbeam.h:519
fdMemoryTime
static Double_t fdMemoryTime
Definition: CbmTofAnaTestbeam.cxx:86
CbmTofAnaTestbeam::fdMul4Max
Double_t fdMul4Max
Definition: CbmTofAnaTestbeam.h:734
CbmTofTracklet::HitPointerOfAddr
virtual CbmTofHit * HitPointerOfAddr(Int_t iAddr)
Definition: CbmTofTracklet.cxx:486
CbmTofAnaTestbeam::fTofHitsCollIn
TClonesArray * fTofHitsCollIn
Definition: CbmTofAnaTestbeam.h:338
CbmTofAnaTestbeam::fhDYY4D4best
TH2 * fhDYY4D4best
Definition: CbmTofAnaTestbeam.h:446
CbmTofAnaTestbeam::fTofTrackCollIn
TClonesArray * fTofTrackCollIn
Definition: CbmTofAnaTestbeam.h:340
CbmTofAnaTestbeam::fhChiDT04best
TH2 * fhChiDT04best
Definition: CbmTofAnaTestbeam.h:402
CbmTofAnaTestbeam::fhTrklNofHitsRateInSpill
TH2 * fhTrklNofHitsRateInSpill
Definition: CbmTofAnaTestbeam.h:704
CbmTofAnaTestbeam::fhDTX0D4best
TH2 * fhDTX0D4best
Definition: CbmTofAnaTestbeam.h:448
CbmTofAnaTestbeam::fhTot0DT04D4best
TH2 * fhTot0DT04D4best
Definition: CbmTofAnaTestbeam.h:430
CbmMCTrack.h
CbmTofTracklet::GetFitX
Double_t GetFitX(Double_t Z)
Definition: CbmTofTracklet.cxx:516
CbmTofAnaTestbeam::fhNMergedMCEvents
TH1 * fhNMergedMCEvents
Definition: CbmTofAnaTestbeam.h:559
CbmTofAnaTestbeam::fhDTTexpD4Off
TH1 * fhDTTexpD4Off
Definition: CbmTofAnaTestbeam.h:719
CbmTofAnaTestbeam::fSIGT
Double_t fSIGT
Definition: CbmTofAnaTestbeam.h:785
TTrbHeader.h
CbmMCEventList::GetEventIdByIndex
Int_t GetEventIdByIndex(UInt_t index)
Event number by index @value Event number for event at given index in list.
Definition: CbmMCEventList.cxx:77
CbmTofAnaTestbeam::fhAccRefTrackMulCentrality
TH2 * fhAccRefTrackMulCentrality
Definition: CbmTofAnaTestbeam.h:570
CbmTofAnaTestbeam::fhSelMCTrackEfficiencyTIS
TEfficiency * fhSelMCTrackEfficiencyTIS
Definition: CbmTofAnaTestbeam.h:619
CbmTofAnaTestbeam::fhSelMCTrackMatchEfficiency
TEfficiency * fhSelMCTrackMatchEfficiency
Definition: CbmTofAnaTestbeam.h:574
CbmDigiManager.h
CbmTofAnaTestbeam::fTrackletTools
CbmTofTrackletTools * fTrackletTools
Definition: CbmTofAnaTestbeam.h:793
CbmTofAnaTestbeam::fhDT04DT4_1
TH2 * fhDT04DT4_1
Definition: CbmTofAnaTestbeam.h:520
CbmTofAnaTestbeam::fhCluSize0DT04D4best
TH2 * fhCluSize0DT04D4best
Definition: CbmTofAnaTestbeam.h:428
CbmTofAnaTestbeam::fCalOutFileName
TString fCalOutFileName
Definition: CbmTofAnaTestbeam.h:714
CbmTofAnaTestbeam::fhCounterRecRefTrackEfficiencyTotal
std::map< std::tuple< Int_t, Int_t, Int_t >, TH1 * > fhCounterRecRefTrackEfficiencyTotal
Definition: CbmTofAnaTestbeam.h:669
CbmTofAnaTestbeam::fhCounterRefTrackMulCell
std::map< std::tuple< Int_t, Int_t, Int_t >, TH2 * > fhCounterRefTrackMulCell
Definition: CbmTofAnaTestbeam.h:675
CbmTofAnaTestbeam::fhDT04DT0_2
TH2 * fhDT04DT0_2
Definition: CbmTofAnaTestbeam.h:521
CbmTofAnaTestbeam::fhPVResTAll
TH2 * fhPVResTAll
Definition: CbmTofAnaTestbeam.h:633
CbmTofAnaTestbeam::fhDutPullZ
TH1 * fhDutPullZ
Definition: CbmTofAnaTestbeam.h:528
CbmTofAnaTestbeam::fCalParFile
TFile * fCalParFile
Definition: CbmTofAnaTestbeam.h:715
CbmTofDigiBdfPar::GetNbDet
Int_t GetNbDet() const
Definition: CbmTofDigiBdfPar.cxx:876
CbmTofAnaTestbeam::fTofPointsTB
TClonesArray * fTofPointsTB
Definition: CbmTofAnaTestbeam.h:801
CbmTofAnaTestbeam::fhYY04
TH2 * fhYY04
Definition: CbmTofAnaTestbeam.h:377
CbmTofAnaTestbeam::fhSelMCTrackResidualTTIS
TH2 * fhSelMCTrackResidualTTIS
Definition: CbmTofAnaTestbeam.h:627
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmTofAnaTestbeam::fChannelInfoDut
CbmTofCell * fChannelInfoDut
Definition: CbmTofAnaTestbeam.h:312
CbmTofFindTracks::GetVertexY
Double_t GetVertexY() const
Definition: CbmTofFindTracks.h:172
CbmTofAnaTestbeam::fTofTrackletAccTrackMatches
TClonesArray * fTofTrackletAccTrackMatches
Definition: CbmTofAnaTestbeam.h:806
CbmTofAnaTestbeam::fhDutPullYB
TH1 * fhDutPullYB
Definition: CbmTofAnaTestbeam.h:527
CbmTofAnaTestbeam::fiDutNch
Int_t fiDutNch
Definition: CbmTofAnaTestbeam.h:779
CbmTofAnaTestbeam::Finish
virtual void Finish()
Definition: CbmTofAnaTestbeam.cxx:861
CbmTofAnaTestbeam::fhDutXYDY
TH3 * fhDutXYDY
Definition: CbmTofAnaTestbeam.h:555
CbmTofDigiPar
Definition: CbmTofDigiPar.h:18
CbmTofPoint.h
CbmTofAnaTestbeam::fhSelTypeNNResidualX_Width
TH1 * fhSelTypeNNResidualX_Width
Definition: CbmTofAnaTestbeam.h:725
CbmTofAnaTestbeam::fhRndmTracksProcMat
std::map< std::tuple< Int_t, Int_t, Int_t >, TH2 * > fhRndmTracksProcMat
Definition: CbmTofAnaTestbeam.h:659
CbmTofTracklet::GetFitY
Double_t GetFitY(Double_t Z)
Definition: CbmTofTracklet.cxx:520
CbmTofFindTracks::GetNStationsFired
Int_t GetNStationsFired()
Definition: CbmTofFindTracks.cxx:2409
CbmTofTrackletTools.h
CbmTofAnaTestbeam::fhSelTypeAccNNResidualX
TH2 * fhSelTypeAccNNResidualX
Definition: CbmTofAnaTestbeam.h:692
CbmTofAnaTestbeam::fhAccRefTrackResX
TH2 * fhAccRefTrackResX
Definition: CbmTofAnaTestbeam.h:641
CbmTofAnaTestbeam::fhDYDT04D4sbest
TH2 * fhDYDT04D4sbest
Definition: CbmTofAnaTestbeam.h:463
CbmTofAnaTestbeam::fhChi04best
TH1 * fhChi04best
Definition: CbmTofAnaTestbeam.h:396
CbmTofTracklet::GetChiSq
Double_t GetChiSq() const
Definition: CbmTofTracklet.h:127
CbmTofGeoHandler::GetSMType
Int_t GetSMType(Int_t uniqueId)
Definition: CbmTofGeoHandler.cxx:459
CbmTofAnaTestbeam::fhXYSel2D4sel
TH2 * fhXYSel2D4sel
Definition: CbmTofAnaTestbeam.h:506
CbmTofAnaTestbeam::fhAccRefTrackMul
TH1 * fhAccRefTrackMul
Definition: CbmTofAnaTestbeam.h:561
CbmTofDigiPar::GetCellId
Int_t GetCellId(Int_t i)
Definition: CbmTofDigiPar.h:45
CbmTofAnaTestbeam::fhSelTypeNNResidualT
TH2 * fhSelTypeNNResidualT
Definition: CbmTofAnaTestbeam.h:686
CbmTofAnaTestbeam::fhDutResX_Trk_MC
TH2 * fhDutResX_Trk_MC
Definition: CbmTofAnaTestbeam.h:608
CbmTofAnaTestbeam::fhAccRefTrackResN
TH2 * fhAccRefTrackResN
Definition: CbmTofAnaTestbeam.h:646
fEventsColl
TClonesArray * fEventsColl
Definition: CbmHadronAnalysis.cxx:50
CbmTofAnaTestbeam::FillHistos
Bool_t FillHistos()
Definition: CbmTofAnaTestbeam.cxx:4123
CbmTofTracklet::GetXdif
virtual Double_t GetXdif(Int_t iSmType, CbmTofHit *pHit)
Definition: CbmTofTracklet.cxx:327
CbmTofAnaTestbeam::fhRecRefTrackCloneShare
TEfficiency * fhRecRefTrackCloneShare
Definition: CbmTofAnaTestbeam.h:652
CbmTofAnaTestbeam::fhY0DT04D4sbest
TH2 * fhY0DT04D4sbest
Definition: CbmTofAnaTestbeam.h:474
CbmTofAnaTestbeam::fiMrpcRef
Int_t fiMrpcRef
Definition: CbmTofAnaTestbeam.h:766
CbmTofAnaTestbeam::fhSelHitTupleDutHitMatchMul
TH1 * fhSelHitTupleDutHitMatchMul
Definition: CbmTofAnaTestbeam.h:682
CbmTofAnaTestbeam::fhDT04DX0_2
TH2 * fhDT04DX0_2
Definition: CbmTofAnaTestbeam.h:521
CbmEvent
Class characterising one event by a collection of links (indices) to data objects,...
Definition: CbmEvent.h:30
CbmTofAnaTestbeam::fhXX04D4best
TH2 * fhXX04D4best
Definition: CbmTofAnaTestbeam.h:501
CbmTofAnaTestbeam::fhTot4DT04D4best
TH2 * fhTot4DT04D4best
Definition: CbmTofAnaTestbeam.h:431
CbmTofAnaTestbeam::fhDT04DX0_1
TH2 * fhDT04DX0_1
Definition: CbmTofAnaTestbeam.h:519
CbmTofAnaTestbeam::fhDXDT04best
TH2 * fhDXDT04best
Definition: CbmTofAnaTestbeam.h:400
CbmTofAnaTestbeam::LoadCalParameter
Bool_t LoadCalParameter()
Load the geometry: for now just resizing the Digis temporary vectors.
Definition: CbmTofAnaTestbeam.cxx:1256
CbmTofAnaTestbeam::fiReqTrg
Int_t fiReqTrg
Definition: CbmTofAnaTestbeam.h:780
CbmTofAnaTestbeam::fhSelPurity
TEfficiency * fhSelPurity
Definition: CbmTofAnaTestbeam.h:580
CbmTofAnaTestbeam::fhDTLH_DStrip
TH2 * fhDTLH_DStrip
Definition: CbmTofAnaTestbeam.h:371
CbmTofAnaTestbeam::GetSigX
Double_t GetSigX(Int_t iSelType)
Definition: CbmTofAnaTestbeam.cxx:8275
CbmTofAnaTestbeam::fiMrpcSel3Addr
Int_t fiMrpcSel3Addr
Definition: CbmTofAnaTestbeam.h:761
CbmTofAnaTestbeam::fdHitDistAv
Double_t fdHitDistAv
Definition: CbmTofAnaTestbeam.h:746
CbmTofAnaTestbeam::fhDYX4D4best
TH2 * fhDYX4D4best
Definition: CbmTofAnaTestbeam.h:445
cmp_str::operator()
bool operator()(char const *a, char const *b) const
Definition: CbmTofAnaTestbeam.cxx:95
CbmTofAnaTestbeam::fhSelHitTupleResidualTTIS
TH2 * fhSelHitTupleResidualTTIS
Definition: CbmTofAnaTestbeam.h:625
CbmTofAnaTestbeam::fdPosYS2SelOff
Double_t fdPosYS2SelOff
Definition: CbmTofAnaTestbeam.h:742
CbmTofAnaTestbeam::fiBeamRefAddr
Int_t fiBeamRefAddr
Definition: CbmTofAnaTestbeam.h:762
CbmTofAnaTestbeam::fbAttachDutHitToTracklet
Bool_t fbAttachDutHitToTracklet
Definition: CbmTofAnaTestbeam.h:821
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmTofAnaTestbeam::fhCounterAccDomTrackMul
std::map< std::tuple< Int_t, Int_t, Int_t >, TH1 * > fhCounterAccDomTrackMul
Definition: CbmTofAnaTestbeam.h:664
CbmTofAnaTestbeam::fClusterizer
CbmTofTestBeamClusterizer * fClusterizer
Definition: CbmTofAnaTestbeam.h:792
CbmTofAnaTestbeam::fR0LimFit
Double_t fR0LimFit
Definition: CbmTofAnaTestbeam.h:783
CbmTofPoint
Geometric intersection of a MC track with a TOFb detector.
Definition: CbmTofPoint.h:40
CbmTofAnaTestbeam::RegisterInputs
Bool_t RegisterInputs()
Definition: CbmTofAnaTestbeam.cxx:945
CbmTofAnaTestbeam::fdDXMean
Double_t fdDXMean
Definition: CbmTofAnaTestbeam.h:344
dTDia
Double_t dTDia
Definition: CbmTofAnaTestbeam.cxx:78
CbmTofAnaTestbeam::fhTot0DT04D4sbest
TH2 * fhTot0DT04D4sbest
Definition: CbmTofAnaTestbeam.h:468
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmTofAnaTestbeam::fhTIS_all
TH1 * fhTIS_all
Definition: CbmTofAnaTestbeam.h:357
CbmTofAnaTestbeam::fdMCSIGLIM
Double_t fdMCSIGLIM
Definition: CbmTofAnaTestbeam.h:826
CbmTofAnaTestbeam::fhResY04ExpMC
TH2 * fhResY04ExpMC
Definition: CbmTofAnaTestbeam.h:589
CbmTofAnaTestbeam::fhResT04HitMC
TH2 * fhResT04HitMC
Definition: CbmTofAnaTestbeam.h:593
CbmTofAnaTestbeam::fCounterModuleNodes
std::map< std::tuple< Int_t, Int_t, Int_t >, TGeoPhysicalNode * > fCounterModuleNodes
Definition: CbmTofAnaTestbeam.h:816
CbmTofCell::GetY
Double_t GetY() const
Definition: CbmTofCell.h:37
CbmTofAnaTestbeam::fhDutVel_Found
TH1 * fhDutVel_Found
Definition: CbmTofAnaTestbeam.h:544
CbmTofAnaTestbeam::fTofTrackColl
TClonesArray * fTofTrackColl
Definition: CbmTofAnaTestbeam.h:334
CbmTofDigi::GetTot
Double_t GetTot() const
Alias for GetCharge.
Definition: CbmTofDigi.h:120
CbmTofAddress::GetUniqueAddress
static UInt_t GetUniqueAddress(UInt_t Sm, UInt_t Rpc, UInt_t Channel, UInt_t Side=0, UInt_t SmType=0)
Definition: CbmTofAddress.h:124
CbmTofAnaTestbeam::fhDTX4D4Off
TH1 * fhDTX4D4Off
Definition: CbmTofAnaTestbeam.h:717
CbmTofAnaTestbeam::fhSelTrklEfficiency
TEfficiency * fhSelTrklEfficiency
Definition: CbmTofAnaTestbeam.h:601
CbmTofAnaTestbeam::fhTot0DT04D4Off
TH1 * fhTot0DT04D4Off
Definition: CbmTofAnaTestbeam.h:722
CbmTofAnaTestbeam::fhDutVel_Missed
TH1 * fhDutVel_Missed
Definition: CbmTofAnaTestbeam.h:545
CbmTofAnaTestbeam::fhXX04
TH2 * fhXX04
Definition: CbmTofAnaTestbeam.h:376
CbmTofAnaTestbeam::fhSelTrklDutCluSizeTIS
TH2 * fhSelTrklDutCluSizeTIS
Definition: CbmTofAnaTestbeam.h:630
CbmTofAnaTestbeam::fiMinMCRefTrackPoints
Int_t fiMinMCRefTrackPoints
Definition: CbmTofAnaTestbeam.h:831
CbmTofAnaTestbeam::fhTrklDetHitRateInSpill
TH2 * fhTrklDetHitRateInSpill
Definition: CbmTofAnaTestbeam.h:705
CbmTofAnaTestbeam::fhSelTrklResidualTTIS
TH2 * fhSelTrklResidualTTIS
Definition: CbmTofAnaTestbeam.h:626
CbmMCDataObject::Get
TObject * Get(const CbmLink *lnk)
Definition: CbmMCDataObject.h:46
CbmTofAnaTestbeam::fhNTracksPerSelDutHit
TH1 * fhNTracksPerSelDutHit
Definition: CbmTofAnaTestbeam.h:599
CbmTofAnaTestbeam::fbPointsInInputFile
Bool_t fbPointsInInputFile
Definition: CbmTofAnaTestbeam.h:796
CbmTofAnaTestbeam::Exec
virtual void Exec(Option_t *option)
Definition: CbmTofAnaTestbeam.cxx:769
CbmTofAnaTestbeam::fTofPoints
CbmMCDataArray * fTofPoints
Definition: CbmTofAnaTestbeam.h:802
CbmTofAnaTestbeam::fhCluSize4DT04D4best
TH2 * fhCluSize4DT04D4best
Definition: CbmTofAnaTestbeam.h:429
CbmMCTrack::GetEnergy
Double_t GetEnergy() const
Definition: CbmMCTrack.h:165
ECbmDataType::kTofCalDigi
@ kTofCalDigi
CbmTofAnaTestbeam::fhDigiMul4D4best
TH2 * fhDigiMul4D4best
Definition: CbmTofAnaTestbeam.h:413
CbmTofAnaTestbeam::fdChi2Lim
Double_t fdChi2Lim
Definition: CbmTofAnaTestbeam.h:749
CbmTofAnaTestbeam::fhRate_all
TH1 * fhRate_all
Definition: CbmTofAnaTestbeam.h:356
CbmTofAnaTestbeam::fhPVResTRef
TH2 * fhPVResTRef
Definition: CbmTofAnaTestbeam.h:636
CbmTofAnaTestbeam::fhCounterRefTrackLocalXY
std::map< std::tuple< Int_t, Int_t, Int_t >, TH2 * > fhCounterRefTrackLocalXY
Definition: CbmTofAnaTestbeam.h:674
CbmTofFindTracks::PrintMapRpcIdParInd
void PrintMapRpcIdParInd()
Definition: CbmTofFindTracks.cxx:2485
CbmTofAnaTestbeam::fhDigiMul0D4sbest
TH1 * fhDigiMul0D4sbest
Definition: CbmTofAnaTestbeam.h:458
CbmTofAnaTestbeam::fhAccRefTracksProcSpec
TH2 * fhAccRefTracksProcSpec
Definition: CbmTofAnaTestbeam.h:571
TTrbHeader
Definition: TTrbHeader.h:10
CbmTofAnaTestbeam::fhSelTrklDutHitMatchNNMul
TH1 * fhSelTrklDutHitMatchNNMul
Definition: CbmTofAnaTestbeam.h:679
CbmTofAnaTestbeam::fhDutDXDYDT
TH3 * fhDutDXDYDT
Definition: CbmTofAnaTestbeam.h:382
CbmTofAnaTestbeam::fdChi2Lim2
Double_t fdChi2Lim2
Definition: CbmTofAnaTestbeam.h:750
CbmTofAnaTestbeam::fhTrklDetHitRate
TH2 * fhTrklDetHitRate
Definition: CbmTofAnaTestbeam.h:703
CbmTofAnaTestbeam::fhDYY0D4best
TH2 * fhDYY0D4best
Definition: CbmTofAnaTestbeam.h:453
CbmTofAnaTestbeam::fhCluMulTrel4D4best
TH2 * fhCluMulTrel4D4best
Definition: CbmTofAnaTestbeam.h:420
CbmTofFindTracks::GetNStations
Int_t GetNStations() const
Definition: CbmTofFindTracks.h:108
CbmTofAnaTestbeam::fhDutResY_Trk_MC
TH2 * fhDutResY_Trk_MC
Definition: CbmTofAnaTestbeam.h:611
CbmTofAnaTestbeam::fhSelTypeAccNNResidualY
TH2 * fhSelTypeAccNNResidualY
Definition: CbmTofAnaTestbeam.h:693
CbmTofAnaTestbeam::fhDutMul_Missed
TH1 * fhDutMul_Missed
Definition: CbmTofAnaTestbeam.h:539
CbmTofAnaTestbeam::fTofAccTrackTrackletMatches
TClonesArray * fTofAccTrackTrackletMatches
Definition: CbmTofAnaTestbeam.h:807
CbmTofAnaTestbeam::fhSelTypeNNResidualY_Width
TH1 * fhSelTypeNNResidualY_Width
Definition: CbmTofAnaTestbeam.h:726
CbmTofAnaTestbeam::fdPosYS2Sel
Double_t fdPosYS2Sel
Definition: CbmTofAnaTestbeam.h:741
CbmTofAnaTestbeam::fhDistDT04D4sbest
TH2 * fhDistDT04D4sbest
Definition: CbmTofAnaTestbeam.h:464
CbmTofAnaTestbeam::fhDutPullX
TH1 * fhDutPullX
Definition: CbmTofAnaTestbeam.h:524
CbmTofAnaTestbeam::fhSelTrklRefTrackShare
TEfficiency * fhSelTrklRefTrackShare
Definition: CbmTofAnaTestbeam.h:603
CbmTofAnaTestbeam::fdDYWidth
Double_t fdDYWidth
Definition: CbmTofAnaTestbeam.h:348
CbmTofAnaTestbeam::fhSelTrklMatchEfficiencyTIS
TEfficiency * fhSelTrklMatchEfficiencyTIS
Definition: CbmTofAnaTestbeam.h:622
CbmTofAnaTestbeam::fhTexpDT04D4sbest
TH2 * fhTexpDT04D4sbest
Definition: CbmTofAnaTestbeam.h:465
CbmTofAnaTestbeam::fhDutXY_Found
TH2 * fhDutXY_Found
Definition: CbmTofAnaTestbeam.h:534
CbmTofAnaTestbeam::fhDYX4D4sbest
TH2 * fhDYX4D4sbest
Definition: CbmTofAnaTestbeam.h:480
CbmTofAnaTestbeam::fhDTD4DT04D4sbest
TH2 * fhDTD4DT04D4sbest
Definition: CbmTofAnaTestbeam.h:472
CbmTofAnaTestbeam::fhTot4DT04D4Off
TH1 * fhTot4DT04D4Off
Definition: CbmTofAnaTestbeam.h:723
CbmTofAnaTestbeam::fhAccRefTrackResT
TH2 * fhAccRefTrackResT
Definition: CbmTofAnaTestbeam.h:640
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
CbmTofTracklet::GetFitT
Double_t GetFitT(Double_t R)
Definition: CbmTofTracklet.cxx:524
CbmTofAnaTestbeam::fhX0DT04best
TH2 * fhX0DT04best
Definition: CbmTofAnaTestbeam.h:405
CbmTofTracklet::GetYdif
virtual Double_t GetYdif(Int_t iSmType, CbmTofHit *pHit)
Definition: CbmTofTracklet.cxx:370
CbmTofTracklet::GetTofHitPointer
CbmTofHit * GetTofHitPointer(Int_t ind)
Definition: CbmTofTracklet.h:72
CbmTofAnaTestbeam::fhTIS_Ntrk
TH2 * fhTIS_Ntrk
Definition: CbmTofAnaTestbeam.h:366
CbmTofAnaTestbeam::fhNMatch04sel
TH1 * fhNMatch04sel
Definition: CbmTofAnaTestbeam.h:395
CbmTofAnaTestbeam::DeleteHistos
Bool_t DeleteHistos()
Definition: CbmTofAnaTestbeam.cxx:8261
CbmTofAnaTestbeam::fhDTY0D4best
TH2 * fhDTY0D4best
Definition: CbmTofAnaTestbeam.h:449
CbmTofAnaTestbeam::fhDTX4D4best
TH2 * fhDTX4D4best
Definition: CbmTofAnaTestbeam.h:441
CbmTofAnaTestbeam::fFindTracks
CbmTofFindTracks * fFindTracks
Definition: CbmTofAnaTestbeam.h:791
CbmTofAnaTestbeam::fChannelInfoSel2
CbmTofCell * fChannelInfoSel2
Definition: CbmTofAnaTestbeam.h:313
CbmTofAnaTestbeam::fhDTD4sel
TH1 * fhDTD4sel
Definition: CbmTofAnaTestbeam.h:508
CbmTofAnaTestbeam::fTofDigisColl
TClonesArray * fTofDigisColl
Definition: CbmTofAnaTestbeam.h:331
CbmTofAnaTestbeam::fhTIS_sel1
TH1 * fhTIS_sel1
Definition: CbmTofAnaTestbeam.h:359
CbmTofAnaTestbeam::fhSelHitTupleEfficiencyTIS
TEfficiency * fhSelHitTupleEfficiencyTIS
Definition: CbmTofAnaTestbeam.h:617
CbmTofAnaTestbeam::fhYY2
TH2 * fhYY2
Definition: CbmTofAnaTestbeam.h:374
CbmTofAnaTestbeam::fhDigiMul0best
TH1 * fhDigiMul0best
Definition: CbmTofAnaTestbeam.h:397
CbmMCTrack::GetPz
Double_t GetPz() const
Definition: CbmMCTrack.h:74
CbmTofAnaTestbeam::CbmTofAnaTestbeam
CbmTofAnaTestbeam()
Definition: CbmTofAnaTestbeam.cxx:174
CbmTofAnaTestbeam::fhAccRefTrackAcceptance
TH2 * fhAccRefTrackAcceptance
Definition: CbmTofAnaTestbeam.h:567
CbmTofAnaTestbeam::fdDXWidth
Double_t fdDXWidth
Definition: CbmTofAnaTestbeam.h:347
CbmTofAnaTestbeam::fhTrklNofHitsRate
TH2 * fhTrklNofHitsRate
Definition: CbmTofAnaTestbeam.h:702
CbmTofAnaTestbeam::fhDutDTLH_TIS
TH2 * fhDutDTLH_TIS
Definition: CbmTofAnaTestbeam.h:549
CbmTofAnaTestbeam::fhDYY0D4sbest
TH2 * fhDYY0D4sbest
Definition: CbmTofAnaTestbeam.h:488
CbmTofAnaTestbeam::fhDTX4D4sbest
TH2 * fhDTX4D4sbest
Definition: CbmTofAnaTestbeam.h:476
CbmTofAnaTestbeam::fhDYSel24
TH1 * fhDYSel24
Definition: CbmTofAnaTestbeam.h:388
CbmTofAnaTestbeam::fhResX04HitMC
TH2 * fhResX04HitMC
Definition: CbmTofAnaTestbeam.h:587
CbmTofAnaTestbeam::fdMCSIGX
Double_t fdMCSIGX
Definition: CbmTofAnaTestbeam.h:828
CbmTofAnaTestbeam::fhTofD4best
TH1 * fhTofD4best
Definition: CbmTofAnaTestbeam.h:410
CbmTofAnaTestbeam::fhTofD4sbest
TH1 * fhTofD4sbest
Definition: CbmTofAnaTestbeam.h:456
CbmTofFindTracks::GetStationOfAddr
Int_t GetStationOfAddr(Int_t iAddr)
Definition: CbmTofFindTracks.cxx:2358
CbmTofTestBeamClusterizer::Instance
static CbmTofTestBeamClusterizer * Instance()
Definition: CbmTofTestBeamClusterizer.h:54
CbmTofAnaTestbeam::fhTofSel24
TH1 * fhTofSel24
Definition: CbmTofAnaTestbeam.h:393
DetMask
const Int_t DetMask
Definition: CbmTofAnaTestbeam.cxx:75
CbmTofAnaTestbeam.h
CbmMCTrack::GetStartT
Double_t GetStartT() const
Definition: CbmMCTrack.h:78
CbmTofAnaTestbeam::fhChi04D4sbest
TH1 * fhChi04D4sbest
Definition: CbmTofAnaTestbeam.h:455