CbmRoot
Loading...
Searching...
No Matches
CbmTofHitFinderQa.cxx
Go to the documentation of this file.
1/* Copyright (C) 2015-2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
10#include "CbmTofHitFinderQa.h"
11
12// TOF Classes and includes
13#include "CbmTofAddress.h" // in cbmdata/tof
14#include "CbmTofCell.h" // in tof/TofData
15#include "CbmTofDetectorId_v12b.h" // in cbmdata/tof
16#include "CbmTofDetectorId_v14a.h" // in cbmdata/tof
17#include "CbmTofDigi.h" // in cbmdata/tof
18#include "CbmTofDigiBdfPar.h" // in tof/TofParam
19#include "CbmTofDigiPar.h" // in tof/TofParam
20#include "CbmTofGeoHandler.h" // in tof/TofTools
21#include "CbmTofHit.h" // in cbmdata/tof
22#include "CbmTofPoint.h" // in cbmdata/tof
23
24// CBMroot classes and includes
25#include "CbmMCTrack.h"
26#include "CbmMatch.h"
27
28// FAIR classes and includes
29#include "FairMCEventHeader.h"
30#include "FairRootManager.h"
31#include "FairRunAna.h"
32#include "FairRuntimeDb.h"
33#include <Logger.h>
34
35// ROOT Classes and includes
36#include "TClonesArray.h"
37#include "TFile.h"
38#include "TH1.h"
39#include "TH2.h"
40#include "TH3.h"
41#include "TMath.h"
42#include "TProfile2D.h"
43#include "TROOT.h"
44#include "TRandom.h"
45#include "TString.h"
46
47#include "Riostream.h"
48
49using std::cout;
50using std::endl;
51
52//___________________________________________________________________
53// Constants definitions: Particles list
54const Int_t kiNbPart = 13;
55const TString ksPartTag[kiNbPart] = {"others", "ep", "em", "pip", "pim", "kp", "km", "p", "pbar", "d", "t", "he", "a"};
56const Int_t kiPartPdgCode[kiNbPart] = {0, 11, -11, 211, -211, 321, -321,
57 2212, -2212, 1000010020, 1000010030, 1000020030, 1000020040};
58const TString ksPartName[kiNbPart] = {"any other part.", "e+", "e-", "#pi+", "#pi-", "k+", "k-", "p",
59 "anti-p", "d", "t", "he", "#alpha"};
60const Int_t kiMinNbStsPntAcc = 3; // Number of STS Pnt for Trk to be reconstructable
61//___________________________________________________________________
62
63
64//___________________________________________________________________
65//
66// CbmTofHitFinderQa
67//
68// Task for QA of TOF event based hit finders and digitizers
69//
70// ------------------------------------------------------------------
72 : FairTask("TofHitFinderQa")
73 , fEvents(0)
74 , fGeoHandler(new CbmTofGeoHandler())
75 , fTofId(NULL)
76 , fChannelInfo(NULL)
77 , iNbSmTot(0)
78 , fvTypeSmOffs()
79 , iNbRpcTot(0)
80 , fvSmRpcOffs()
81 , fiNbChTot(0)
82 , fvRpcChOffs()
83 , fDigiPar(NULL)
84 , fDigiBdfPar(NULL)
85 , fMCEventHeader(NULL)
86 , fTofPointsColl(NULL)
87 , fMcTracksColl(NULL)
88 , fTofDigisColl(NULL)
89 , fTofDigiMatchPointsColl(NULL)
90 , fTofHitsColl(NULL)
91 , fTofDigiMatchColl(NULL)
92 , fTofHitMatchColl(NULL)
93 , fbHitProducerSource(kFALSE)
94 , fRealTofPointsColl(NULL)
95 , fRealTofMatchColl(NULL)
96 , fbRealPointAvail(kFALSE)
97 , fbNormHistGenMode(kFALSE)
98 , fsHistoInNormCartFilename("")
99 , fsHistoInNormAngFilename("")
100 , fsHistoInNormSphFilename("")
101 , fsHistoOutFilename("./tofQa.hst.root")
102 , fdWallPosZ(1000)
103 , fuNbEventsForHitsNbPlots(30000)
104 , fhNbHitsPerEvent(NULL)
105 , fhNbHitsSingPntPerEvent(NULL)
106 , fhNbHitsMultPntPerEvent(NULL)
107 , fhNbHitsSingTrkPerEvent(NULL)
108 , fhNbHitsMultTrkPerEvent(NULL)
109 , fhNbDigisInHit(NULL)
110 , fhNbDigisInHitMapXY(NULL)
111 , fvhTrackAllStartZCent()
112 , // Beam pipe check
113 fvhTrackSecStartZCent()
114 , // Beam pipe check
115 fvhTrackAllStartXZCent()
116 , // Beam pipe check
117 fvhTrackAllStartXZ()
118 , // Beam pipe check
119 fvhTrackAllStartYZ()
120 , // Beam pipe check
121 fvhTofPntAllAngCent()
122 , // Beam pipe check
123 fhTrackMapXY(NULL)
124 , // Only when creating normalization histos
125 fhTrackMapXZ(NULL)
126 , // Only when creating normalization histos
127 fhTrackMapYZ(NULL)
128 , // Only when creating normalization histos
129 fhTrackMapAng(NULL)
130 , // Only when creating normalization histos
131 fhTrackMapSph(NULL)
132 , // Only when creating normalization histos
133 fhPointMapXY(NULL)
134 , fhPointMapXZ(NULL)
135 , fhPointMapYZ(NULL)
136 , fhPointMapAng(NULL)
137 , fhPointMapSph(NULL)
138 , fhRealPointMapXY(NULL)
139 , fhRealPointMapXZ(NULL)
140 , fhRealPointMapYZ(NULL)
141 , fhRealPointMapAng(NULL)
142 , fhRealPointMapSph(NULL)
143 , fhDigiMapXY(NULL)
144 , fhDigiMapXZ(NULL)
145 , fhDigiMapYZ(NULL)
146 , fhDigiMapAng(NULL)
147 , fhDigiMapSph(NULL)
148 , fhHitMapXY(NULL)
149 , fhHitMapXZ(NULL)
150 , fhHitMapYZ(NULL)
151 , fhHitMapAng(NULL)
152 , fhHitMapSph(NULL)
153 , fhLeftRightDigiMatch(NULL)
154 , fhNbPointsInHit(NULL)
155 , fhNbTracksInHit(NULL)
156 , fhHitMapSingPntXY(NULL)
157 , fhHitMapSingPntXZ(NULL)
158 , fhHitMapSingPntYZ(NULL)
159 , fhHitMapSingPntAng(NULL)
160 , fhHitMapSingPntSph(NULL)
161 , fhHitMapMultPntXY(NULL)
162 , fhHitMapMultPntXZ(NULL)
163 , fhHitMapMultPntYZ(NULL)
164 , fhHitMapMultPntAng(NULL)
165 , fhHitMapMultPntSph(NULL)
166 , fhHitMapSingTrkXY(NULL)
167 , fhHitMapSingTrkXZ(NULL)
168 , fhHitMapSingTrkYZ(NULL)
169 , fhHitMapSingTrkAng(NULL)
170 , fhHitMapSingTrkSph(NULL)
171 , fhHitMapMultTrkXY(NULL)
172 , fhHitMapMultTrkXZ(NULL)
173 , fhHitMapMultTrkYZ(NULL)
174 , fhHitMapMultTrkAng(NULL)
175 , fhHitMapMultTrkSph(NULL)
176 , fhSinglePointHitDeltaX(NULL)
177 , fhSinglePointHitDeltaY(NULL)
178 , fhSinglePointHitDeltaZ(NULL)
179 , fhSinglePointHitDeltaR(NULL)
180 , fhSinglePointHitDeltaT(NULL)
181 , fhSinglePointHitPullX(NULL)
182 , fhSinglePointHitPullY(NULL)
183 , fhSinglePointHitPullZ(NULL)
184 , fhSinglePointHitPullR(NULL)
185 , fhSinglePointHitPullT(NULL)
186 , fhCltSzSinglePointHitPullX(NULL)
187 , fhCltSzSinglePointHitPullY(NULL)
188 , fhCltSzSinglePointHitPullZ(NULL)
189 , fhCltSzSinglePointHitPullR(NULL)
190 , fhCltSzSinglePointHitPullT(NULL)
191 , fhMultiPntHitClosestDeltaX(NULL)
192 , fhMultiPntHitClosestDeltaY(NULL)
193 , fhMultiPntHitClosestDeltaZ(NULL)
194 , fhMultiPntHitClosestDeltaR(NULL)
195 , fhMultiPntHitClosestDeltaT(NULL)
196 , fhMultiPntHitClosestPullX(NULL)
197 , fhMultiPntHitClosestPullY(NULL)
198 , fhMultiPntHitClosestPullZ(NULL)
199 , fhMultiPntHitClosestPullR(NULL)
200 , fhMultiPntHitClosestPullT(NULL)
201 , fhMultiPntHitFurthestDeltaX(NULL)
202 , fhMultiPntHitFurthestDeltaY(NULL)
203 , fhMultiPntHitFurthestDeltaZ(NULL)
204 , fhMultiPntHitFurthestDeltaR(NULL)
205 , fhMultiPntHitFurthestDeltaT(NULL)
206 , fhMultiPntHitFurthestPullX(NULL)
207 , fhMultiPntHitFurthestPullY(NULL)
208 , fhMultiPntHitFurthestPullZ(NULL)
209 , fhMultiPntHitFurthestPullR(NULL)
210 , fhMultiPntHitFurthestPullT(NULL)
211 , fhMultiPntHitMeanDeltaX(NULL)
212 , fhMultiPntHitMeanDeltaY(NULL)
213 , fhMultiPntHitMeanDeltaZ(NULL)
214 , fhMultiPntHitMeanDeltaR(NULL)
215 , fhMultiPntHitMeanDeltaT(NULL)
216 , fhMultiPntHitMeanPullX(NULL)
217 , fhMultiPntHitMeanPullY(NULL)
218 , fhMultiPntHitMeanPullZ(NULL)
219 , fhMultiPntHitMeanPullR(NULL)
220 , fhMultiPntHitMeanPullT(NULL)
221 , fhMultiPntHitBestDeltaX(NULL)
222 , fhMultiPntHitBestDeltaY(NULL)
223 , fhMultiPntHitBestDeltaZ(NULL)
224 , fhMultiPntHitBestDeltaR(NULL)
225 , fhMultiPntHitBestDeltaT(NULL)
226 , fhMultiPntHitBestPullX(NULL)
227 , fhMultiPntHitBestPullY(NULL)
228 , fhMultiPntHitBestPullZ(NULL)
229 , fhMultiPntHitBestPullR(NULL)
230 , fhMultiPntHitBestPullT(NULL)
231 , fhSingleTrackHitDeltaX(NULL)
232 , fhSingleTrackHitDeltaY(NULL)
233 , fhSingleTrackHitDeltaZ(NULL)
234 , fhSingleTrackHitDeltaR(NULL)
235 , fhSingleTrackHitDeltaT(NULL)
236 , fhSingleTrackHitPullX(NULL)
237 , fhSingleTrackHitPullY(NULL)
238 , fhSingleTrackHitPullZ(NULL)
239 , fhSingleTrackHitPullR(NULL)
240 , fhSingleTrackHitPullT(NULL)
241 , fhSingTrkMultiPntHitDeltaX(NULL)
242 , fhSingTrkMultiPntHitDeltaY(NULL)
243 , fhSingTrkMultiPntHitDeltaZ(NULL)
244 , fhSingTrkMultiPntHitDeltaR(NULL)
245 , fhSingTrkMultiPntHitDeltaT(NULL)
246 , fhSingTrkMultiPntHitPullX(NULL)
247 , fhSingTrkMultiPntHitPullY(NULL)
248 , fhSingTrkMultiPntHitPullZ(NULL)
249 , fhSingTrkMultiPntHitPullR(NULL)
250 , fhSingTrkMultiPntHitPullT(NULL)
251 , fhMultiTrkHitClosestDeltaX(NULL)
252 , fhMultiTrkHitClosestDeltaY(NULL)
253 , fhMultiTrkHitClosestDeltaZ(NULL)
254 , fhMultiTrkHitClosestDeltaR(NULL)
255 , fhMultiTrkHitClosestDeltaT(NULL)
256 , fhMultiTrkHitClosestPullX(NULL)
257 , fhMultiTrkHitClosestPullY(NULL)
258 , fhMultiTrkHitClosestPullZ(NULL)
259 , fhMultiTrkHitClosestPullR(NULL)
260 , fhMultiTrkHitClosestPullT(NULL)
261 , fhMultiTrkHitFurthestDeltaX(NULL)
262 , fhMultiTrkHitFurthestDeltaY(NULL)
263 , fhMultiTrkHitFurthestDeltaZ(NULL)
264 , fhMultiTrkHitFurthestDeltaR(NULL)
265 , fhMultiTrkHitFurthestDeltaT(NULL)
266 , fhMultiTrkHitFurthestPullX(NULL)
267 , fhMultiTrkHitFurthestPullY(NULL)
268 , fhMultiTrkHitFurthestPullZ(NULL)
269 , fhMultiTrkHitFurthestPullR(NULL)
270 , fhMultiTrkHitFurthestPullT(NULL)
271 , fhMultiTrkHitMeanDeltaX(NULL)
272 , fhMultiTrkHitMeanDeltaY(NULL)
273 , fhMultiTrkHitMeanDeltaZ(NULL)
274 , fhMultiTrkHitMeanDeltaR(NULL)
275 , fhMultiTrkHitMeanDeltaT(NULL)
276 , fhMultiTrkHitMeanPullX(NULL)
277 , fhMultiTrkHitMeanPullY(NULL)
278 , fhMultiTrkHitMeanPullZ(NULL)
279 , fhMultiTrkHitMeanPullR(NULL)
280 , fhMultiTrkHitMeanPullT(NULL)
281 , fhMultiTrkHitBestDeltaX(NULL)
282 , fhMultiTrkHitBestDeltaY(NULL)
283 , fhMultiTrkHitBestDeltaZ(NULL)
284 , fhMultiTrkHitBestDeltaR(NULL)
285 , fhMultiTrkHitBestDeltaT(NULL)
286 , fhMultiTrkHitBestPullX(NULL)
287 , fhMultiTrkHitBestPullY(NULL)
288 , fhMultiTrkHitBestPullZ(NULL)
289 , fhMultiTrkHitBestPullR(NULL)
290 , fhMultiTrkHitBestPullT(NULL)
291 , fvhPtmRapGenTrk()
292 , fvhPtmRapStsPnt()
293 , fvhPtmRapTofPnt()
294 , fvhPtmRapTofHit()
295 , fvhPtmRapTofHitSinglePnt()
296 , fvhPtmRapTofHitSingleTrk()
297 , fvhPtmRapSecGenTrk()
298 , fvhPtmRapSecStsPnt()
299 , fvhPtmRapSecTofPnt()
300 , fvhPtmRapSecTofHit()
301 , fvhPtmRapSecTofHitSinglePnt()
302 , fvhPtmRapSecTofHitSingleTrk()
303 , fvhPlabGenTrk()
304 , fvhPlabStsPnt()
305 , fvhPlabTofPnt()
306 , fvhPlabTofHit()
307 , fvhPlabTofHitSinglePnt()
308 , fvhPlabTofHitSingleTrk()
309 , fvhPlabSecGenTrk()
310 , fvhPlabSecStsPnt()
311 , fvhPlabSecTofPnt()
312 , fvhPlabSecTofHit()
313 , fvhPlabSecTofHitSinglePnt()
314 , fvhPlabSecTofHitSingleTrk()
315 , fvhPtmRapGenTrkTofPnt()
316 , fvhPtmRapGenTrkTofHit()
317 , fvhPlabGenTrkTofPnt()
318 , fvhPlabGenTrkTofHit()
319 , fvhPlabStsTrkTofPnt()
320 , fvhPlabStsTrkTofHit()
321 , fvhPtmRapSecGenTrkTofPnt()
322 , fvhPtmRapSecGenTrkTofHit()
323 , fvhPlabSecGenTrkTofPnt()
324 , fvhPlabSecGenTrkTofHit()
325 , fvhPlabSecStsTrkTofPnt()
326 , fvhPlabSecStsTrkTofHit()
327 , fvulIdxTracksWithPnt()
328 , fvulIdxTracksWithHit()
329 , fhIntegratedHitPntEff(NULL)
330 , fvulIdxPrimTracksWithPnt()
331 , fvulIdxPrimTracksWithHit()
332 , fhIntegratedHitPntEffPrim(NULL)
333 , fvulIdxSecTracksWithPnt()
334 , fvulIdxSecTracksWithHit()
335 , fhIntegratedHitPntEffSec(NULL)
336 , fvulIdxHiddenTracksWithHit()
337 , fhIntegratedHiddenHitPntLoss(NULL)
338 , fvulIdxHiddenPrimTracksWithHit()
339 , fhIntegratedHiddenHitPntLossPrim(NULL)
340 , fvulIdxHiddenSecTracksWithHit()
341 , fhIntegratedHiddenHitPntLossSec(NULL)
342 , fvulIdxTracksWithPntGaps()
343 , fvulIdxTracksWithHitGaps()
344 , fhIntegratedHitPntEffGaps(NULL)
345 , fvulIdxPrimTracksWithPntGaps()
346 , fvulIdxPrimTracksWithHitGaps()
347 , fhIntegratedHitPntEffPrimGaps(NULL)
348 , fvulIdxSecTracksWithPntGaps()
349 , fvulIdxSecTracksWithHitGaps()
350 , fhIntegratedHitPntEffSecGaps(NULL)
351 , fhMcTrkStartPrimSingTrk(NULL)
352 , fhMcTrkStartSecSingTrk(NULL)
353 , fhMcTrkStartPrimMultiTrk(NULL)
354 , fhMcTrkStartSecMultiTrk(NULL)
355 , fhPointMatchWeight(NULL)
356{
357 cout << "CbmTofHitFinderQa: Task started " << endl;
358}
359// ------------------------------------------------------------------
360
361// ------------------------------------------------------------------
362CbmTofHitFinderQa::CbmTofHitFinderQa(const char* name, Int_t verbose)
363 : FairTask(name, verbose)
364 , fEvents(0)
365 , fGeoHandler(new CbmTofGeoHandler())
366 , fTofId(NULL)
367 , fChannelInfo(NULL)
368 , iNbSmTot(0)
369 , fvTypeSmOffs()
370 , iNbRpcTot(0)
371 , fvSmRpcOffs()
372 , fiNbChTot(0)
373 , fvRpcChOffs()
374 , fDigiPar(NULL)
375 , fDigiBdfPar(NULL)
376 , fMCEventHeader(NULL)
377 , fTofPointsColl(NULL)
378 , fMcTracksColl(NULL)
379 , fTofDigisColl(NULL)
380 , fTofDigiMatchPointsColl(NULL)
381 , fTofHitsColl(NULL)
382 , fTofDigiMatchColl(NULL)
383 , fTofHitMatchColl(NULL)
384 , fbHitProducerSource(kFALSE)
385 , fRealTofPointsColl(NULL)
386 , fRealTofMatchColl(NULL)
387 , fbRealPointAvail(kFALSE)
388 , fbNormHistGenMode(kFALSE)
389 , fsHistoInNormCartFilename("")
390 , fsHistoInNormAngFilename("")
391 , fsHistoInNormSphFilename("")
392 , fsHistoOutFilename("./tofQa.hst.root")
393 , fdWallPosZ(1000)
394 , fuNbEventsForHitsNbPlots(30000)
395 , fhNbHitsPerEvent(NULL)
396 , fhNbHitsSingPntPerEvent(NULL)
397 , fhNbHitsMultPntPerEvent(NULL)
398 , fhNbHitsSingTrkPerEvent(NULL)
399 , fhNbHitsMultTrkPerEvent(NULL)
400 , fhNbDigisInHit(NULL)
401 , fhNbDigisInHitMapXY(NULL)
402 , fvhTrackAllStartZCent()
403 , // Beam pipe check
404 fvhTrackSecStartZCent()
405 , // Beam pipe check
406 fvhTrackAllStartXZCent()
407 , // Beam pipe check
408 fvhTrackAllStartXZ()
409 , // Beam pipe check
410 fvhTrackAllStartYZ()
411 , // Beam pipe check
412 fvhTofPntAllAngCent()
413 , // Beam pipe check
414 fhTrackMapXY(NULL)
415 , // Only when creating normalization histos
416 fhTrackMapXZ(NULL)
417 , // Only when creating normalization histos
418 fhTrackMapYZ(NULL)
419 , // Only when creating normalization histos
420 fhTrackMapAng(NULL)
421 , // Only when creating normalization histos
422 fhTrackMapSph(NULL)
423 , // Only when creating normalization histos
424 fhPointMapXY(NULL)
425 , fhPointMapXZ(NULL)
426 , fhPointMapYZ(NULL)
427 , fhPointMapAng(NULL)
428 , fhPointMapSph(NULL)
429 , fhRealPointMapXY(NULL)
430 , fhRealPointMapXZ(NULL)
431 , fhRealPointMapYZ(NULL)
432 , fhRealPointMapAng(NULL)
433 , fhRealPointMapSph(NULL)
434 , fhDigiMapXY(NULL)
435 , fhDigiMapXZ(NULL)
436 , fhDigiMapYZ(NULL)
437 , fhDigiMapAng(NULL)
438 , fhDigiMapSph(NULL)
439 , fhHitMapXY(NULL)
440 , fhHitMapXZ(NULL)
441 , fhHitMapYZ(NULL)
442 , fhHitMapAng(NULL)
443 , fhHitMapSph(NULL)
444 , fhLeftRightDigiMatch(NULL)
445 , fhNbPointsInHit(NULL)
446 , fhNbTracksInHit(NULL)
447 , fhHitMapSingPntXY(NULL)
448 , fhHitMapSingPntXZ(NULL)
449 , fhHitMapSingPntYZ(NULL)
450 , fhHitMapSingPntAng(NULL)
451 , fhHitMapSingPntSph(NULL)
452 , fhHitMapMultPntXY(NULL)
453 , fhHitMapMultPntXZ(NULL)
454 , fhHitMapMultPntYZ(NULL)
455 , fhHitMapMultPntAng(NULL)
456 , fhHitMapMultPntSph(NULL)
457 , fhHitMapSingTrkXY(NULL)
458 , fhHitMapSingTrkXZ(NULL)
459 , fhHitMapSingTrkYZ(NULL)
460 , fhHitMapSingTrkAng(NULL)
461 , fhHitMapSingTrkSph(NULL)
462 , fhHitMapMultTrkXY(NULL)
463 , fhHitMapMultTrkXZ(NULL)
464 , fhHitMapMultTrkYZ(NULL)
465 , fhHitMapMultTrkAng(NULL)
466 , fhHitMapMultTrkSph(NULL)
467 , fhSinglePointHitDeltaX(NULL)
468 , fhSinglePointHitDeltaY(NULL)
469 , fhSinglePointHitDeltaZ(NULL)
470 , fhSinglePointHitDeltaR(NULL)
471 , fhSinglePointHitDeltaT(NULL)
472 , fhSinglePointHitPullX(NULL)
473 , fhSinglePointHitPullY(NULL)
474 , fhSinglePointHitPullZ(NULL)
475 , fhSinglePointHitPullR(NULL)
476 , fhSinglePointHitPullT(NULL)
477 , fhCltSzSinglePointHitPullX(NULL)
478 , fhCltSzSinglePointHitPullY(NULL)
479 , fhCltSzSinglePointHitPullZ(NULL)
480 , fhCltSzSinglePointHitPullR(NULL)
481 , fhCltSzSinglePointHitPullT(NULL)
482 , fhMultiPntHitClosestDeltaX(NULL)
483 , fhMultiPntHitClosestDeltaY(NULL)
484 , fhMultiPntHitClosestDeltaZ(NULL)
485 , fhMultiPntHitClosestDeltaR(NULL)
486 , fhMultiPntHitClosestDeltaT(NULL)
487 , fhMultiPntHitClosestPullX(NULL)
488 , fhMultiPntHitClosestPullY(NULL)
489 , fhMultiPntHitClosestPullZ(NULL)
490 , fhMultiPntHitClosestPullR(NULL)
491 , fhMultiPntHitClosestPullT(NULL)
492 , fhMultiPntHitFurthestDeltaX(NULL)
493 , fhMultiPntHitFurthestDeltaY(NULL)
494 , fhMultiPntHitFurthestDeltaZ(NULL)
495 , fhMultiPntHitFurthestDeltaR(NULL)
496 , fhMultiPntHitFurthestDeltaT(NULL)
497 , fhMultiPntHitFurthestPullX(NULL)
498 , fhMultiPntHitFurthestPullY(NULL)
499 , fhMultiPntHitFurthestPullZ(NULL)
500 , fhMultiPntHitFurthestPullR(NULL)
501 , fhMultiPntHitFurthestPullT(NULL)
502 , fhMultiPntHitMeanDeltaX(NULL)
503 , fhMultiPntHitMeanDeltaY(NULL)
504 , fhMultiPntHitMeanDeltaZ(NULL)
505 , fhMultiPntHitMeanDeltaR(NULL)
506 , fhMultiPntHitMeanDeltaT(NULL)
507 , fhMultiPntHitMeanPullX(NULL)
508 , fhMultiPntHitMeanPullY(NULL)
509 , fhMultiPntHitMeanPullZ(NULL)
510 , fhMultiPntHitMeanPullR(NULL)
511 , fhMultiPntHitMeanPullT(NULL)
512 , fhMultiPntHitBestDeltaX(NULL)
513 , fhMultiPntHitBestDeltaY(NULL)
514 , fhMultiPntHitBestDeltaZ(NULL)
515 , fhMultiPntHitBestDeltaR(NULL)
516 , fhMultiPntHitBestDeltaT(NULL)
517 , fhMultiPntHitBestPullX(NULL)
518 , fhMultiPntHitBestPullY(NULL)
519 , fhMultiPntHitBestPullZ(NULL)
520 , fhMultiPntHitBestPullR(NULL)
521 , fhMultiPntHitBestPullT(NULL)
522 , fhSingleTrackHitDeltaX(NULL)
523 , fhSingleTrackHitDeltaY(NULL)
524 , fhSingleTrackHitDeltaZ(NULL)
525 , fhSingleTrackHitDeltaR(NULL)
526 , fhSingleTrackHitDeltaT(NULL)
527 , fhSingleTrackHitPullX(NULL)
528 , fhSingleTrackHitPullY(NULL)
529 , fhSingleTrackHitPullZ(NULL)
530 , fhSingleTrackHitPullR(NULL)
531 , fhSingleTrackHitPullT(NULL)
532 , fhSingTrkMultiPntHitDeltaX(NULL)
533 , fhSingTrkMultiPntHitDeltaY(NULL)
534 , fhSingTrkMultiPntHitDeltaZ(NULL)
535 , fhSingTrkMultiPntHitDeltaR(NULL)
536 , fhSingTrkMultiPntHitDeltaT(NULL)
537 , fhSingTrkMultiPntHitPullX(NULL)
538 , fhSingTrkMultiPntHitPullY(NULL)
539 , fhSingTrkMultiPntHitPullZ(NULL)
540 , fhSingTrkMultiPntHitPullR(NULL)
541 , fhSingTrkMultiPntHitPullT(NULL)
542 , fhMultiTrkHitClosestDeltaX(NULL)
543 , fhMultiTrkHitClosestDeltaY(NULL)
544 , fhMultiTrkHitClosestDeltaZ(NULL)
545 , fhMultiTrkHitClosestDeltaR(NULL)
546 , fhMultiTrkHitClosestDeltaT(NULL)
547 , fhMultiTrkHitClosestPullX(NULL)
548 , fhMultiTrkHitClosestPullY(NULL)
549 , fhMultiTrkHitClosestPullZ(NULL)
550 , fhMultiTrkHitClosestPullR(NULL)
551 , fhMultiTrkHitClosestPullT(NULL)
552 , fhMultiTrkHitFurthestDeltaX(NULL)
553 , fhMultiTrkHitFurthestDeltaY(NULL)
554 , fhMultiTrkHitFurthestDeltaZ(NULL)
555 , fhMultiTrkHitFurthestDeltaR(NULL)
556 , fhMultiTrkHitFurthestDeltaT(NULL)
557 , fhMultiTrkHitFurthestPullX(NULL)
558 , fhMultiTrkHitFurthestPullY(NULL)
559 , fhMultiTrkHitFurthestPullZ(NULL)
560 , fhMultiTrkHitFurthestPullR(NULL)
561 , fhMultiTrkHitFurthestPullT(NULL)
562 , fhMultiTrkHitMeanDeltaX(NULL)
563 , fhMultiTrkHitMeanDeltaY(NULL)
564 , fhMultiTrkHitMeanDeltaZ(NULL)
565 , fhMultiTrkHitMeanDeltaR(NULL)
566 , fhMultiTrkHitMeanDeltaT(NULL)
567 , fhMultiTrkHitMeanPullX(NULL)
568 , fhMultiTrkHitMeanPullY(NULL)
569 , fhMultiTrkHitMeanPullZ(NULL)
570 , fhMultiTrkHitMeanPullR(NULL)
571 , fhMultiTrkHitMeanPullT(NULL)
572 , fhMultiTrkHitBestDeltaX(NULL)
573 , fhMultiTrkHitBestDeltaY(NULL)
574 , fhMultiTrkHitBestDeltaZ(NULL)
575 , fhMultiTrkHitBestDeltaR(NULL)
576 , fhMultiTrkHitBestDeltaT(NULL)
577 , fhMultiTrkHitBestPullX(NULL)
578 , fhMultiTrkHitBestPullY(NULL)
579 , fhMultiTrkHitBestPullZ(NULL)
580 , fhMultiTrkHitBestPullR(NULL)
581 , fhMultiTrkHitBestPullT(NULL)
582 , fvhPtmRapGenTrk()
583 , fvhPtmRapStsPnt()
584 , fvhPtmRapTofPnt()
585 , fvhPtmRapTofHit()
586 , fvhPtmRapTofHitSinglePnt()
587 , fvhPtmRapTofHitSingleTrk()
588 , fvhPtmRapSecGenTrk()
589 , fvhPtmRapSecStsPnt()
590 , fvhPtmRapSecTofPnt()
591 , fvhPtmRapSecTofHit()
592 , fvhPtmRapSecTofHitSinglePnt()
593 , fvhPtmRapSecTofHitSingleTrk()
594 , fvhPlabGenTrk()
595 , fvhPlabStsPnt()
596 , fvhPlabTofPnt()
597 , fvhPlabTofHit()
598 , fvhPlabTofHitSinglePnt()
599 , fvhPlabTofHitSingleTrk()
600 , fvhPlabSecGenTrk()
601 , fvhPlabSecStsPnt()
602 , fvhPlabSecTofPnt()
603 , fvhPlabSecTofHit()
604 , fvhPlabSecTofHitSinglePnt()
605 , fvhPlabSecTofHitSingleTrk()
606 , fvhPtmRapGenTrkTofPnt()
607 , fvhPtmRapGenTrkTofHit()
608 , fvhPlabGenTrkTofPnt()
609 , fvhPlabGenTrkTofHit()
610 , fvhPlabStsTrkTofPnt()
611 , fvhPlabStsTrkTofHit()
612 , fvhPtmRapSecGenTrkTofPnt()
613 , fvhPtmRapSecGenTrkTofHit()
614 , fvhPlabSecGenTrkTofPnt()
615 , fvhPlabSecGenTrkTofHit()
616 , fvhPlabSecStsTrkTofPnt()
617 , fvhPlabSecStsTrkTofHit()
618 , fvulIdxTracksWithPnt()
619 , fvulIdxTracksWithHit()
620 , fhIntegratedHitPntEff(NULL)
621 , fvulIdxPrimTracksWithPnt()
622 , fvulIdxPrimTracksWithHit()
623 , fhIntegratedHitPntEffPrim(NULL)
624 , fvulIdxSecTracksWithPnt()
625 , fvulIdxSecTracksWithHit()
626 , fhIntegratedHitPntEffSec(NULL)
627 , fvulIdxHiddenTracksWithHit()
628 , fhIntegratedHiddenHitPntLoss(NULL)
629 , fvulIdxHiddenPrimTracksWithHit()
630 , fhIntegratedHiddenHitPntLossPrim(NULL)
631 , fvulIdxHiddenSecTracksWithHit()
632 , fhIntegratedHiddenHitPntLossSec(NULL)
633 , fvulIdxTracksWithPntGaps()
634 , fvulIdxTracksWithHitGaps()
635 , fhIntegratedHitPntEffGaps(NULL)
636 , fvulIdxPrimTracksWithPntGaps()
637 , fvulIdxPrimTracksWithHitGaps()
638 , fhIntegratedHitPntEffPrimGaps(NULL)
639 , fvulIdxSecTracksWithPntGaps()
640 , fvulIdxSecTracksWithHitGaps()
641 , fhIntegratedHitPntEffSecGaps(NULL)
642 , fhMcTrkStartPrimSingTrk(NULL)
643 , fhMcTrkStartSecSingTrk(NULL)
644 , fhMcTrkStartPrimMultiTrk(NULL)
645 , fhMcTrkStartSecMultiTrk(NULL)
646 , fhPointMatchWeight(NULL)
647{
648}
649// ------------------------------------------------------------------
650
651// ------------------------------------------------------------------
653{
654 // Destructor
655}
656// ------------------------------------------------------------------
657/************************************************************************************/
658// FairTasks inherited functions
660{
661 if (kFALSE == RegisterInputs()) return kFATAL;
662
663 // Initialize the TOF GeoHandler
664 Bool_t isSimulation = kFALSE;
665 Int_t iGeoVersion = fGeoHandler->Init(isSimulation);
666 LOG(info) << "CbmTofHitFinderQa::Init with GeoVersion " << iGeoVersion;
667
668 if (k12b > iGeoVersion) {
669 LOG(error) << "CbmTofHitFinderQa::Init => Only compatible with geometries "
670 "after v12b !!!";
671 return kFATAL;
672 } // if( k12b > iGeoVersion )
673
674 if (NULL != fTofId) LOG(info) << "CbmTofHitFinderQa::Init with GeoVersion " << fGeoHandler->GetGeoVersion();
675 else {
676 switch (iGeoVersion) {
677 case k12b: fTofId = new CbmTofDetectorId_v12b(); break;
678 case k14a: fTofId = new CbmTofDetectorId_v14a(); break;
679 default: LOG(error) << "CbmTofHitFinderQa::Init => Invalid geometry!!!" << iGeoVersion; return kFATAL;
680 } // switch(iGeoVersion)
681 } // else of if(NULL != fTofId)
682
683 if (kFALSE == LoadGeometry()) return kFATAL;
684
685 if (kFALSE == CreateHistos()) return kFATAL;
686
687 return kSUCCESS;
688}
689
691{
692 LOG(info) << " CbmTofHitFinderQa => Get the digi parameters for tof";
693
694 // Get Base Container
695 FairRunAna* ana = FairRunAna::Instance();
696 FairRuntimeDb* rtdb = ana->GetRuntimeDb();
697
698 fDigiPar = (CbmTofDigiPar*) (rtdb->getContainer("CbmTofDigiPar"));
699
700 fDigiBdfPar = (CbmTofDigiBdfPar*) (rtdb->getContainer("CbmTofDigiBdfPar"));
701}
702
703void CbmTofHitFinderQa::Exec(Option_t* /*option*/)
704{
705 // Task execution
706
707 LOG(debug) << " CbmTofHitFinderQa => New event";
708
709 FillHistos();
710
711 if (0 == (fEvents % 100) && 0 < fEvents) {
712 cout << "-I- CbmTofHitFinderQa::Exec : "
713 << "event " << fEvents << " processed." << endl;
714 }
715 fEvents += 1;
716}
717
719{
720 // Normalisations
721 cout << "CbmTofHitFinderQa::Finish up with " << fEvents << " analyzed events " << endl;
722
723 if (kFALSE == fbNormHistGenMode) NormalizeMapHistos();
724 else
726
727 WriteHistos();
728 // Prevent them from being sucked in by the CbmHadronAnalysis WriteHistograms method
729 DeleteHistos();
730}
731
732/************************************************************************************/
733// Functions common for all clusters approximations
735{
736 FairRootManager* fManager = FairRootManager::Instance();
737
738 fMCEventHeader = (FairMCEventHeader*) fManager->GetObject("MCEventHeader.");
739 if (NULL == fMCEventHeader) {
740 LOG(error) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
741 "MCEventHeader object!!!";
742 return kFALSE;
743 }
744
745 fTofPointsColl = (TClonesArray*) fManager->GetObject("TofPoint");
746 if (NULL == fTofPointsColl) {
747 LOG(error) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
748 "TofPoint TClonesArray!!!";
749 return kFALSE;
750 } // if( NULL == fTofPointsColl)
751
752 fMcTracksColl = (TClonesArray*) fManager->GetObject("MCTrack");
753 if (NULL == fMcTracksColl) {
754 LOG(error) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
755 "MCTrack TClonesArray!!!";
756 return kFALSE;
757 } // if( NULL == fMcTracksColl)
758
759 fTofDigisColl = (TClonesArray*) fManager->GetObject("TofDigi");
760 if (NULL == fTofDigisColl) {
761 LOG(warning) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
762 "TofDigi TClonesArray!!!";
763 LOG(warning) << " => Assuming that the "
764 "CbmTofHitProducerNew is used!!!";
765 // return kFALSE;
766 } // if( NULL == fTofDigisColl)
767 fTofDigiMatchPointsColl = (TClonesArray*) fManager->GetObject("TofDigiMatchPoints");
768 if (NULL == fTofDigiMatchPointsColl) {
769 LOG(warning) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
770 "TofDigiMatchPoints TClonesArray!!!";
771 LOG(warning) << " => Assuming that the "
772 "CbmTofHitProducerNew is used!!!";
773 // return kFALSE;
774 } // if( NULL == fTofDigiMatchPointsColl)
775
776 fTofHitsColl = (TClonesArray*) fManager->GetObject("TofHit");
777 if (NULL == fTofHitsColl) {
778 LOG(error) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
779 "TofHit TClonesArray!!!";
780 return kFALSE;
781 } // if( NULL == fTofHitsColl)
782 fTofDigiMatchColl = (TClonesArray*) fManager->GetObject("TofDigiMatch");
783 if (NULL == fTofDigiMatchColl) {
784 LOG(warning) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
785 "TofDigiMatch TClonesArray!!!";
786 LOG(warning) << " => Assuming that the "
787 "CbmTofHitProducerNew is used!!!";
788 // return kFALSE;
789 } // if( NULL == fTofDigiMatchColl)
790
791 fTofHitMatchColl = (TClonesArray*) fManager->GetObject("TofHitMatch");
792 if (NULL == fTofHitMatchColl) {
793 LOG(error) << "CbmTofHitFinderQa::RegisterInputs => Could not get the "
794 "TofHitMatch TClonesArray!!!";
795 return kFALSE;
796 } // if( NULL == fTofDigiMatchPointsColl)
797
798 if (NULL == fTofDigisColl && NULL == fTofDigiMatchPointsColl && NULL == fTofDigiMatchColl)
799 fbHitProducerSource = kTRUE;
800
801 if ((kFALSE == fbHitProducerSource)
802 && (NULL == fTofDigisColl || NULL == fTofDigiMatchPointsColl || NULL == fTofDigiMatchColl)) {
803 LOG(error) << "CbmTofHitFinderQa::RegisterInputs => fTofDigisColl or "
804 "fTofDigiMatchPointsColl or fTofDigiMatchColl present while "
805 "the other is missing";
806 LOG(error) << " => Cannot be the result "
807 "of CbmTofHitProducerNew use!!!";
808 return kFALSE;
809 } // if only one of fTofDigisColl and fTofDigiMatchColl is missing
810
811 fRealTofPointsColl = (TClonesArray*) fManager->GetObject("RealisticTofPoint");
812 fRealTofMatchColl = (TClonesArray*) fManager->GetObject("TofRealPntMatch");
813 if (NULL != fRealTofPointsColl && NULL != fRealTofMatchColl) {
814 fbRealPointAvail = kTRUE;
815 LOG(info) << "CbmTofHitFinderQa::RegisterInputs => Both fRealTofPointsColl & "
816 "fRealTofMatchColl there, realistic mean TOF MC point used for QA";
817 } // if( NULL != fRealTofPointsColl && NULL != fRealTofMatchColl )
818
819 return kTRUE;
820}
821/************************************************************************************/
823{
824 /*
825 Type 0: 5 RPC/SM, 24 SM, 32 ch/RPC => 3840 ch , 120 RPC ,
826 Type 1: 5 RPC/SM, 142 SM, 32 ch/RPC => 22720 ch => 26560 , 710 RPC => 830 , => 166
827 Type 3: 3 RPC/SM, 50 SM, 56 ch/RPC => 8400 ch => 34960 , 150 RPC => 980 , => 216
828 Type 4: 5 RPC/SM, 8 SM, 96 ch/RPC => 3840 ch => 38800 , 40 RPC => 1020 , => 224
829 Type 5: 5 RPC/SM, 8 SM, 96 ch/RPC => 3840 ch => 42640 , 40 RPC => 1060 , => 232
830 Type 6: 2 RPC/SM, 10 SM, 96 ch/RPC => 1920 ch => 44560 , 20 RPC => 1080 , => 242
831 */
832
833 // Count the total number of channels and
834 // generate an array with the global channel index of the first channe in each RPC
835 Int_t iNbSmTypes = fDigiBdfPar->GetNbSmTypes();
836 fvTypeSmOffs.resize(iNbSmTypes);
837 fvSmRpcOffs.resize(iNbSmTypes);
838 fvRpcChOffs.resize(iNbSmTypes);
839 iNbSmTot = 0;
840 iNbRpcTot = 0;
841 fiNbChTot = 0;
842 for (Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++) {
843 Int_t iNbSm = fDigiBdfPar->GetNbSm(iSmType);
844 Int_t iNbRpc = fDigiBdfPar->GetNbRpc(iSmType);
845
846 fvTypeSmOffs[iSmType] = iNbSmTot;
847 iNbSmTot += iNbSm;
848
849 fvSmRpcOffs[iSmType].resize(iNbSm);
850 fvRpcChOffs[iSmType].resize(iNbSm);
851
852 for (Int_t iSm = 0; iSm < iNbSm; iSm++) {
853 fvSmRpcOffs[iSmType][iSm] = iNbRpcTot;
854 iNbRpcTot += iNbRpc;
855
856 fvRpcChOffs[iSmType][iSm].resize(iNbRpc);
857 for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++) {
858 fvRpcChOffs[iSmType][iSm][iRpc] = fiNbChTot;
859 fiNbChTot += fDigiBdfPar->GetNbChan(iSmType, iRpc);
860 } // for( Int_t iRpc = 0; iRpc < iNbRpc; iRpc++ )
861 } // for( Int_t iSm = 0; iSm < iNbSm; iSm++ )
862 } // for( Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++ )
863
864 return kTRUE;
865}
866/************************************************************************************/
867// ------------------------------------------------------------------
868Bool_t CbmTofHitFinderQa::SetWallPosZ(Double_t dWallPosCm)
869{
870 fdWallPosZ = dWallPosCm;
871 LOG(info) << "CbmTofHitFinderQa::SetWallPosZ => Change histograms center on "
872 "Z axis to "
873 << dWallPosCm << " cm";
874 return kTRUE;
875}
877{
878 // Create histogramms
879
880 TDirectory* oldir = gDirectory; // <= To prevent histos from being sucked in by the param file of the TRootManager!
881 gROOT->cd(); // <= To prevent histos from being sucked in by the param file of the TRootManager !
882 /*
883 Double_t ymin=-1.;
884 Double_t ymax=4.;
885 Double_t ptmmax=2.5;
886 Int_t ptm_nbx=30;
887 Int_t ptm_nby=30;
888
889 Double_t v1_nbx=20.;
890 Double_t v1_nby=20.;
891 Double_t yvmax=1.3;
892*/
893 // xy - hit densities and rates
894 Int_t nbinx = 1500;
895 Int_t nbiny = 1000;
896 Int_t nbinz = 1500;
897 Double_t xrange = 750.;
898 Double_t yrange = 500.;
899 Double_t zmin = fdWallPosZ - 50.;
900 Double_t zmax = fdWallPosZ + 150.;
901
902 // angular densities for overlap check
903 Int_t iNbBinThetaX = 1200;
904 Double_t dThetaXMin = -60.0;
905 Double_t dThetaXMax = 60.0;
906 Int_t iNbBinThetaY = 900;
907 Double_t dThetaYMin = -45.0;
908 Double_t dThetaYMax = 45.0;
909
910 Int_t iNbBinTheta = 180;
911 Double_t dThetaMin = 0;
912 Double_t dThetaMax = TMath::Pi() * 90 / 180;
913 Int_t iNbBinPhi = 180;
914 Double_t dPhiMin = -TMath::Pi();
915 Double_t dPhiMax = TMath::Pi();
916
917 // Range hit deviation from MC
918 Int_t iNbBinsDeltaPos = 600;
919 Double_t dDeltaPosRange = 30; // cm
920 Int_t iNbBinsDeltaTime = 1000;
921 Double_t dDeltaTimeRange = 1000; // ps
922 Int_t iNbBinsMulti = 18;
923 Double_t iMinMulti = 2 - 0.5;
924 Double_t iMaxMulti = 19 + 0.5;
925 // Range pulls from MC
926 Int_t iNbBinsPullPos = 500;
927 Double_t dPullPosRange = 5;
928
929 // Range Mapping
930 Int_t iNbBinsStartZ = 1250;
931 Double_t dMinStartZ = -50.0;
932 Double_t dMaxStartZ = 1200.0;
933 Int_t iNbBinsStartXY = 1200;
934 Double_t dMinStartXY = -600.0;
935 Double_t dMaxStartXY = 600.0;
936 Int_t iNbBinsCentr = 16;
937 Double_t dNbMinCentr = 0.0;
938 Double_t dNbMaxCentr = 16.0;
939
940 // Nb Hits per event for first N events
941 fhNbHitsPerEvent = new TH1I("TofTests_NbHitsPerEvent", "Number of Hits per event; EventsIdx []; # [Hits]",
944 new TH1I("TofTests_NbHitsSingPntPerEvent", "Number of Single Point Hits per event; EventsIdx []; # [Hits]",
947 new TH1I("TofTests_NbHitsMultPntPerEvent", "Number of Multi Point Hits per event; EventsIdx []; # [Hits]",
950 new TH1I("TofTests_NbHitsSingTrkPerEvent", "Number of Single Track Hits per event; EventsIdx []; # [Hits]",
953 new TH1I("TofTests_NbHitsMultTrkPerEvent", "Number of Multi Track Hits per event; EventsIdx []; # [Hits]",
955 // Nb different TOF digis in Hit
956 fhNbDigisInHit = new TH1I("TofTests_NbDigisInHit", "Number of Digis per Hit; # [Digis]", 100, -0.5, 100 - 0.5);
958 new TProfile2D("TofTests_NbDigisInHitMapXY", "Number of Digis per Hit vs Position; X[cm]; Y[cm]; Mean [Digis/Hit]",
959 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
960
961 // Mapping
962 // Dependence of Track origin on centrality
969 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
970 // Track origin for tracks reaching TOF
971 fvhTrackAllStartZCent[iPartIdx] =
972 new TH2D(Form("TofTests_TrackAllStartZCent_%s", ksPartTag[iPartIdx].Data()),
973 Form("Centrality vs Start Z distribution for MC tracks w/ TOF Pnt, %s, "
974 "all tracks; Start Z [cm]; B [fm]; # []",
975 ksPartName[iPartIdx].Data()),
976 iNbBinsStartZ, dMinStartZ, dMaxStartZ, iNbBinsCentr, dNbMinCentr, dNbMaxCentr);
977 fvhTrackSecStartZCent[iPartIdx] =
978 new TH2D(Form("TofTests_TrackSecStartZCent_%s", ksPartTag[iPartIdx].Data()),
979 Form("Centrality vs Start Z distribution for MC tracks w/ TOF Pnt, %s, "
980 "secondary tracks; Start Z [cm]; B [fm]; # []",
981 ksPartName[iPartIdx].Data()),
982 iNbBinsStartZ, dMinStartZ, dMaxStartZ, iNbBinsCentr, dNbMinCentr, dNbMaxCentr);
983 if (2 == iPartIdx) // 3D plot only for e-
984 fvhTrackAllStartXZCent[iPartIdx] =
985 new TH3D(Form("TofTests_TrackAllStartXZCent_%s", ksPartTag[iPartIdx].Data()),
986 Form("Centrality vs Start Z distribution for MC tracks w/ TOF Pnt, %s, "
987 "all tracks; Start X [cm]; Start Z [cm]; B [fm];",
988 ksPartName[iPartIdx].Data()),
989 iNbBinsStartXY / 2, dMinStartXY, dMaxStartXY, iNbBinsStartZ / 2, dMinStartZ, dMaxStartZ, iNbBinsCentr,
990 dNbMinCentr, dNbMaxCentr);
991 fvhTrackAllStartXZ[iPartIdx] =
992 new TH2D(Form("TofTests_TrackAllStartXZ_%s", ksPartTag[iPartIdx].Data()),
993 Form("Start X vs Z distribution for MC tracks w/ TOF Pnt, %s, "
994 "all tracks; Start Z [cm]; Start X [cm]; # []",
995 ksPartName[iPartIdx].Data()),
996 iNbBinsStartZ / 2, dMinStartZ, dMaxStartZ, iNbBinsStartXY, dMinStartXY, dMaxStartXY);
997 fvhTrackAllStartYZ[iPartIdx] =
998 new TH2D(Form("TofTests_TrackAllStartYZ_%s", ksPartTag[iPartIdx].Data()),
999 Form("Start Y vs Z distribution for MC tracks w/ TOF Pnt, %s, "
1000 "all tracks; Start Z [cm]; Start Y [cm]; # []",
1001 ksPartName[iPartIdx].Data()),
1002 iNbBinsStartZ / 2, dMinStartZ, dMaxStartZ, iNbBinsStartXY, dMinStartXY, dMaxStartXY);
1003 fvhTofPntAllAngCent[iPartIdx] = new TH3D(Form("TofTests_TofPntAllAngCent_%s", ksPartTag[iPartIdx].Data()),
1004 Form("Centrality vs Angular position of TOF Pnt, %s, all "
1005 "tracks; #theta_{x}[Deg.]; #theta_{y}[Deg.]; B [fm];",
1006 ksPartName[iPartIdx].Data()),
1007 iNbBinThetaX / 2, dThetaXMin, dThetaXMax, iNbBinThetaY / 2, dThetaYMin,
1008 dThetaYMax, iNbBinsCentr, dNbMinCentr, dNbMaxCentr);
1009 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
1010 // tracks: Only when creating normalization histos
1011 if (kTRUE == fbNormHistGenMode) {
1012 fhTrackMapXY = new TH2D("TofTests_TracksMapXY",
1013 "Position of the MC Tracks assuming along Z axis; "
1014 "X[cm]; Y[cm]; # [Tracks]",
1015 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
1016 fhTrackMapXZ = new TH2D("TofTests_TracksMapXZ",
1017 "Position of the MC Tracks assuming along Z axis; "
1018 "X[cm]; Z[cm]; # [Tracks]",
1019 nbinx, -xrange, xrange, nbinz, zmin, zmax);
1020 fhTrackMapYZ = new TH2D("TofTests_TracksMapYZ",
1021 "Position of the MC Tracks assuming along Z axis; "
1022 "Y[cm]; Z[cm]; # [Tracks]",
1023 nbiny, -yrange, yrange, nbinz, zmin, zmax);
1024 fhTrackMapAng = new TH2D("TofTests_TracksMapAng",
1025 "Position of the MC Tracks assuming from origin; "
1026 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Tracks]",
1027 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1028 fhTrackMapSph = new TH2D("TofTests_TracksMapSph",
1029 "Position of the MC Tracks assuming from origin; "
1030 "#theta[rad.]; #phi[rad.]; # [Tracks]",
1031 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1032 } // if( kTRUE == fbNormHistGenMode )
1033 // points
1034 fhPointMapXY = new TH2D("TofTests_PointsMapXY", "Position of the Tof Points; X[cm]; Y[cm]; # [Points]", nbinx,
1035 -xrange, xrange, nbiny, -yrange, yrange);
1036 fhPointMapXZ = new TH2D("TofTests_PointsMapXZ", "Position of the Tof Points; X[cm]; Z[cm]; # [Points]", nbinx,
1037 -xrange, xrange, nbinz, zmin, zmax);
1038 fhPointMapYZ = new TH2D("TofTests_PointsMapYZ", "Position of the Tof Points; Y[cm]; Z[cm]; # [Points]", nbiny,
1039 -yrange, yrange, nbinz, zmin, zmax);
1040 fhPointMapAng = new TH2D("TofTests_PointsMapAng",
1041 "Position of the Tof Points; #theta_{x}[Deg.]; "
1042 "#theta_{y}[Deg.]; # [Points]",
1043 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1044 fhPointMapSph = new TH2D("TofTests_PointsMapSph", "Position of the Tof Points; #theta[rad.]; #phi[rad.]; # [Points]",
1045 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1046 // real (mean over all gaps) points
1048 new TH2D("TofTests_RealPointsMapXY", "Position of the Tof Points (mean o/ gaps); X[cm]; Y[cm]; # [Points]", nbinx,
1049 -xrange, xrange, nbiny, -yrange, yrange);
1051 new TH2D("TofTests_RealPointsMapXZ", "Position of the Tof Points (mean o/ gaps); X[cm]; Z[cm]; # [Points]", nbinx,
1052 -xrange, xrange, nbinz, zmin, zmax);
1054 new TH2D("TofTests_RealPointsMapYZ", "Position of the Tof Points (mean o/ gaps); Y[cm]; Z[cm]; # [Points]", nbiny,
1055 -yrange, yrange, nbinz, zmin, zmax);
1056 fhRealPointMapAng = new TH2D("TofTests_RealPointsMapAng",
1057 "Position of the Tof Points (mean o/ gaps); "
1058 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Points]",
1059 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1060 fhRealPointMapSph = new TH2D("TofTests_RealPointsMapSph",
1061 "Position of the Tof Points (mean o/ gaps); "
1062 "#theta[rad.]; #phi[rad.]; # [Points]",
1063 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1064 // Digis
1065 fhDigiMapXY = new TH2D("TofTests_DigisMapXY", "Position of the Tof Digis; X[cm]; Y[cm]; # [Digi]", nbinx, -xrange,
1066 xrange, nbiny, -yrange, yrange);
1067 fhDigiMapXZ = new TH2D("TofTests_DigisMapXZ", "Position of the Tof Digis; X[cm]; Z[cm]; # [Digi]", nbinx, -xrange,
1068 xrange, nbinz, zmin, zmax);
1069 fhDigiMapYZ = new TH2D("TofTests_DigisMapYZ", "Position of the Tof Digis; Y[cm]; Z[cm]; # [Digi]", nbiny, -yrange,
1070 yrange, nbinz, zmin, zmax);
1071 fhDigiMapAng =
1072 new TH2D("TofTests_DigisMapAng", "Position of the Tof Digis; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Digi]",
1073 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1074 fhDigiMapSph = new TH2D("TofTests_DigisMapSph", "Position of the Tof Digis; #theta[rad.]; #phi[rad.]; # [Points]",
1075 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1076
1077 // Hits
1078 fhHitMapXY = new TH2D("TofTests_HitsMapXY", "Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]", nbinx, -xrange,
1079 xrange, nbiny, -yrange, yrange);
1080 fhHitMapXZ = new TH2D("TofTests_HitsMapXZ", "Position of the Tof Hits; X[cm]; Z[cm]; # [Hits]", nbinx, -xrange,
1081 xrange, nbinz, zmin, zmax);
1082 fhHitMapYZ = new TH2D("TofTests_HitsMapYZ", "Position of the Tof Hits; Y[cm]; Z[cm]; # [Hits]", nbiny, -yrange,
1083 yrange, nbinz, zmin, zmax);
1084 fhHitMapAng =
1085 new TH2D("TofTests_HitsMapAng", "Position of the Tof Hits; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Hits]",
1086 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1087 fhHitMapSph = new TH2D("TofTests_HitsMapSph", "Position of the Tof Hits; #theta[rad.]; #phi[rad.]; # [Points]",
1088 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1089
1090 // L/R digis missmatch
1091 if (0 == fiNbChTot && kTRUE == fbHitProducerSource)
1092 fiNbChTot = 1; // Should only happen when the HitProducer is used, set to 1 to avoid histogram warning
1093
1094 fhLeftRightDigiMatch = new TH2D("TofTests_DigiMatchLR",
1095 "Matching between the left an right digi for "
1096 "strips added to hit; Global Strip Index []",
1097 fiNbChTot, 0, fiNbChTot, 3, -0.5, 2.5);
1098 fhLeftRightDigiMatch->GetYaxis()->SetBinLabel(1, "Same MC Point");
1099 fhLeftRightDigiMatch->GetYaxis()->SetBinLabel(2, "Same MC Track");
1100 fhLeftRightDigiMatch->GetYaxis()->SetBinLabel(3, "Diff MC Track");
1101
1102 // Nb different MC Points and Tracks in Hit
1104 new TH1D("TofTests_NbPointsInHit", "Number of different MC Points in Hit; # [MC Points]", 100, -0.5, 99.5);
1106 new TH1D("TofTests_NbTracksInHit", "Number of different MC Tracks in Hit; # [MC Tracks]", 100, -0.5, 99.5);
1107
1108 // Mapping of position for hits coming from a single MC Point
1110 new TH2D("TofTests_HitsMapSingPntXY", "Position of the Tof Hits from a single MC Point; X[cm]; Y[cm]; # [Hits]",
1111 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
1113 new TH2D("TofTests_HitsMapSingPntXZ", "Position of the Tof Hits from a single MC Point; X[cm]; Z[cm]; # [Hits]",
1114 nbinx, -xrange, xrange, nbinz, zmin, zmax);
1116 new TH2D("TofTests_HitsMapSingPntYZ", "Position of the Tof Hits from a single MC Point; Y[cm]; Z[cm]; # [Hits]",
1117 nbiny, -yrange, yrange, nbinz, zmin, zmax);
1118 fhHitMapSingPntAng = new TH2D("TofTests_HitsMapSingPntAng",
1119 "Position of the Tof Hits from a single MC Point; "
1120 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Hits]",
1121 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1122 fhHitMapSingPntSph = new TH2D("TofTests_HitsMapSingPntSph",
1123 "Position of the Tof Hits from a single MC "
1124 "Point; #theta[rad.]; #phi[rad.]; # [Points]",
1125 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1126 // Mapping of position for hits coming from multiple MC Points
1128 new TH2D("TofTests_HitsMapMultPntXY", "Position of the Tof Hits from multiple MC Points; X[cm]; Y[cm]; # [Hits]",
1129 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
1131 new TH2D("TofTests_HitsMapMultPntXZ", "Position of the Tof Hits from multiple MC Points; X[cm]; Z[cm]; # [Hits]",
1132 nbinx, -xrange, xrange, nbinz, zmin, zmax);
1134 new TH2D("TofTests_HitsMapMultPntYZ", "Position of the Tof Hits from multiple MC Points; Y[cm]; Z[cm]; # [Hits]",
1135 nbiny, -yrange, yrange, nbinz, zmin, zmax);
1136 fhHitMapMultPntAng = new TH2D("TofTests_HitsMapMultPntAng",
1137 "Position of the Tof Hits from multiple MC Points; "
1138 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Hits]",
1139 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1140 fhHitMapMultPntSph = new TH2D("TofTests_HitsMapMultPntSph",
1141 "Position of the Tof Hits from multiple MC "
1142 "Points; #theta[rad.]; #phi[rad.]; # [Points]",
1143 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1144 // Mapping of position for hits coming from a single MC Track
1146 new TH2D("TofTests_HitsMapSingTrkXY", "Position of the Tof Hits from a single MC Track; X[cm]; Y[cm]; # [Hits]",
1147 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
1149 new TH2D("TofTests_HitsMapSingTrkXZ", "Position of the Tof Hits from a single MC Track; X[cm]; Z[cm]; # [Hits]",
1150 nbinx, -xrange, xrange, nbinz, zmin, zmax);
1152 new TH2D("TofTests_HitsMapSingTrkYZ", "Position of the Tof Hits from a single MC Track; Y[cm]; Z[cm]; # [Hits]",
1153 nbiny, -yrange, yrange, nbinz, zmin, zmax);
1154 fhHitMapSingTrkAng = new TH2D("TofTests_HitsMapSingTrkAng",
1155 "Position of the Tof Hits from a single MC Track; "
1156 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Hits]",
1157 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1158 fhHitMapSingTrkSph = new TH2D("TofTests_HitsMapSingTrkSph",
1159 "Position of the Tof Hits from a single MC "
1160 "Track; #theta[rad.]; #phi[rad.]; # [Points]",
1161 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1162 // Mapping of position for hits coming from multiple MC Tracks
1164 new TH2D("TofTests_HitsMapMultTrkXY", "Position of the Tof Hits from multiple MC Tracks; X[cm]; Y[cm]; # [Hits]",
1165 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
1167 new TH2D("TofTests_HitsMapMultTrkXZ", "Position of the Tof Hits from multiple MC Tracks; X[cm]; Z[cm]; # [Hits]",
1168 nbinx, -xrange, xrange, nbinz, zmin, zmax);
1170 new TH2D("TofTests_HitsMapMultTrkYZ", "Position of the Tof Hits from multiple MC Tracks; Y[cm]; Z[cm]; # [Hits]",
1171 nbiny, -yrange, yrange, nbinz, zmin, zmax);
1172 fhHitMapMultTrkAng = new TH2D("TofTests_HitsMapMultTrkAng",
1173 "Position of the Tof Hits from multiple MC Tracks; "
1174 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Hits]",
1175 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
1176 fhHitMapMultTrkSph = new TH2D("TofTests_HitsMapMultTrkSph",
1177 "Position of the Tof Hits from multiple MC "
1178 "Tracks; #theta[rad.]; #phi[rad.]; # [Points]",
1179 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
1180
1181
1182 // Hit Quality for Hits coming from a single MC Point
1183 fhSinglePointHitDeltaX = new TH1D("TofTests_SinglePointHitDeltaX",
1184 "Quality of the Tof Hits position on X axis, for hit coming from "
1185 "a single MC Point; X(Hit) - X(Point) [cm]; # [Hits]",
1186 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1187 fhSinglePointHitDeltaY = new TH1D("TofTests_SinglePointHitDeltaY",
1188 "Quality of the Tof Hits position on Y axis, for hit coming from "
1189 "a single MC Point; Y(Hit) - Y(Point) [cm]; # [Hits]",
1190 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1191 fhSinglePointHitDeltaZ = new TH1D("TofTests_SinglePointHitDeltaZ",
1192 "Quality of the Tof Hits position on Z axis, for hit coming from "
1193 "a single MC Point; Z(Hit) - Z(Point) [cm]; # [Hits]",
1194 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1195 fhSinglePointHitDeltaR = new TH1D("TofTests_SinglePointHitDeltaR",
1196 "Quality of the Tof Hits position, for hit coming from a single "
1197 "MC Point; R(Hit -> Point) [cm]; # [Hits]",
1198 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1199 fhSinglePointHitDeltaT = new TH1D("TofTests_SinglePointHitDeltaT",
1200 "Quality of the Tof Hits Time, for hit coming from a single MC "
1201 "Point; T(hit) - T(Point) [ps]; # [Hits]",
1202 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange);
1203 fhSinglePointHitPullX = new TH1D("TofTests_SinglePointHitPullX",
1204 "Quality of the Tof Hits position error on X axis, for hit coming "
1205 "from a single MC Point; Pull X(Hit -> Point) []; # [Hits]",
1206 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1207 fhSinglePointHitPullY = new TH1D("TofTests_SinglePointHitPullY",
1208 "Quality of the Tof Hits position error on Y axis, for hit coming "
1209 "from a single MC Point; Pull Y(Hit -> Point) []; # [Hits]",
1210 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1211 fhSinglePointHitPullZ = new TH1D("TofTests_SinglePointHitPullZ",
1212 "Quality of the Tof Hits position error on Z axis, for hit coming "
1213 "from a single MC Point; Pull Z(Hit -> Point) []; # [Hits]",
1214 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1215 fhSinglePointHitPullR = new TH1D("TofTests_SinglePointHitPullR",
1216 "Quality of the Tof Hits position error, for hit coming from a "
1217 "single MC Point; Pull R(Hit -> Point) []; # [Hits]",
1218 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1219 fhSinglePointHitPullT = new TH1D("TofTests_SinglePointHitPullT",
1220 "Quality of the Tof Hits time error, for hit coming from a single "
1221 "MC Point; Pull T(Hit -> Point) []; # [Hits]",
1222 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1223 fhCltSzSinglePointHitPullX = new TH2D("TofTests_CltSzSinglePointHitPullX",
1224 "Quality of the Tof Hits position error on X axis, for hit coming "
1225 "from a single MC Point; Pull X(Hit -> Point) []; # [Hits]",
1226 iNbBinsPullPos, -dPullPosRange, dPullPosRange, 32, 1, 33);
1227 fhCltSzSinglePointHitPullY = new TH2D("TofTests_CltSzSinglePointHitPullY",
1228 "Quality of the Tof Hits position error on Y axis, for hit coming "
1229 "from a single MC Point; Pull Y(Hit -> Point) []; # [Hits]",
1230 iNbBinsPullPos, -dPullPosRange, dPullPosRange, 32, 1, 33);
1231 fhCltSzSinglePointHitPullZ = new TH2D("TofTests_CltSzSinglePointHitPullZ",
1232 "Quality of the Tof Hits position error on Z axis, for hit coming "
1233 "from a single MC Point; Pull Z(Hit -> Point) []; # [Hits]",
1234 iNbBinsPullPos, -dPullPosRange, dPullPosRange, 32, 1, 33);
1235 fhCltSzSinglePointHitPullR = new TH2D("TofTests_CltSzSinglePointHitPullR",
1236 "Quality of the Tof Hits position error, for hit coming from a "
1237 "single MC Point; Pull R(Hit -> Point) []; # [Hits]",
1238 iNbBinsPullPos, -dPullPosRange, dPullPosRange, 32, 1, 33);
1239 fhCltSzSinglePointHitPullT = new TH2D("TofTests_CltSzSinglePointHitPullT",
1240 "Quality of the Tof Hits time error, for hit coming from a single "
1241 "MC Point; Pull T(Hit -> Point) []; # [Hits]",
1242 iNbBinsPullPos, -dPullPosRange, dPullPosRange, 32, 1, 33);
1243
1244 // Hit Quality for Hits coming from a multiple MC Points
1245 // To Point closest to Hit
1247 new TH2D("TofTests_MultiPntHitClosestDeltaX",
1248 "Quality of the Tof Hits position on X axis relative to closest "
1249 "Point, for hit coming from multiple MC Point; X(Hit) - X(Point) "
1250 "[cm]; # [Hits]; Multi [Pnt]",
1251 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1253 new TH2D("TofTests_MultiPntHitClosestDeltaY",
1254 "Quality of the Tof Hits position on Y axis relative to closest "
1255 "Point, for hit coming from multiple MC Point; Y(Hit) - Y(Point) "
1256 "[cm]; # [Hits]; Multi [Pnt]",
1257 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1259 new TH2D("TofTests_MultiPntHitClosestDeltaZ",
1260 "Quality of the Tof Hits position on Z axis relative to closest "
1261 "Point, for hit coming from multiple MC Point; Z(Hit) - Z(Point) "
1262 "[cm]; # [Hits]; Multi [Pnt]",
1263 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1265 new TH2D("TofTests_MultiPntHitClosestDeltaR",
1266 "Quality of the Tof Hits position relative to closest Point, for "
1267 "hit coming from multiple MC Point; R(Hit -> Point) [cm]; # "
1268 "[Hits]; Multi [Pnt]",
1269 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1271 new TH2D("TofTests_MultiPntHitClosestDeltaT",
1272 "Quality of the Tof Hits Time relative to closest Point, for hit coming "
1273 "from multiple MC Point; T(hit) - T(Point) [ps]; # [Hits]; Multi [Pnt]",
1274 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1276 new TH2D("TofTests_MultiPntHitClosestPullX",
1277 "Quality of the Tof Hits position error on X axis relative to "
1278 "closest Point, for hit coming from multiple MC Point; Pull X(Hit "
1279 "-> Point) []; # [Hits]; Multi [Pnt]",
1280 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1282 new TH2D("TofTests_MultiPntHitClosestPullY",
1283 "Quality of the Tof Hits position error on Y axis relative to "
1284 "closest Point, for hit coming from multiple MC Point; Pull Y(Hit "
1285 "-> Point) []; # [Hits]; Multi [Pnt]",
1286 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1288 new TH2D("TofTests_MultiPntHitClosestPullZ",
1289 "Quality of the Tof Hits position error on Z axis relative to "
1290 "closest Point, for hit coming from multiple MC Point; Pull Z(Hit "
1291 "-> Point) []; # [Hits]; Multi [Pnt]",
1292 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1294 new TH2D("TofTests_MultiPntHitClosestPullR",
1295 "Quality of the Tof Hits position error relative to closest "
1296 "Point, for hit coming from multiple MC Point; Pull R(Hit -> "
1297 "Point) []; # [Hits]; Multi [Pnt]",
1298 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1300 new TH2D("TofTests_MultiPntHitClosestPullT",
1301 "Quality of the Tof Hits time error relative to closest Point, "
1302 "for hit coming from multiple MC Point; Pull T(Hit -> Point) []; "
1303 "# [Hits]; Multi [Pnt]",
1304 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1305 // To Point furthest from Hit
1307 new TH2D("TofTests_MultiPntHitFurthestDeltaX",
1308 "Quality of the Tof Hits position on X axis relative to furthest "
1309 "Point, for hit coming from multiple MC Point; X(Hit) - X(Point) "
1310 "[cm]; # [Hits]; Multi [Pnt]",
1311 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1313 new TH2D("TofTests_MultiPntHitFurthestDeltaY",
1314 "Quality of the Tof Hits position on Y axis relative to furthest "
1315 "Point, for hit coming from multiple MC Point; Y(Hit) - Y(Point) "
1316 "[cm]; # [Hits]; Multi [Pnt]",
1317 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1319 new TH2D("TofTests_MultiPntHitFurthestDeltaZ",
1320 "Quality of the Tof Hits position on Z axis relative to furthest "
1321 "Point, for hit coming from multiple MC Point; Z(Hit) - Z(Point) "
1322 "[cm]; # [Hits]; Multi [Pnt]",
1323 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1325 new TH2D("TofTests_MultiPntHitFurthestDeltaR",
1326 "Quality of the Tof Hits position relative to furthest Point, for "
1327 "hit coming from multiple MC Point; R(Hit -> Point) [cm]; # "
1328 "[Hits]; Multi [Pnt]",
1329 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1331 new TH2D("TofTests_MultiPntHitFurthestDeltaT",
1332 "Quality of the Tof Hits Time relative to furthest Point, for hit coming "
1333 "from multiple MC Point; T(hit) - T(Point) [ps]; # [Hits]; Multi [Pnt]",
1334 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1336 new TH2D("TofTests_MultiPntHitFurthestPullX",
1337 "Quality of the Tof Hits position error on X axis relative to "
1338 "furthest Point, for hit coming from multiple MC Point; Pull "
1339 "X(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1340 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1342 new TH2D("TofTests_MultiPntHitFurthestPullY",
1343 "Quality of the Tof Hits position error on Y axis relative to "
1344 "furthest Point, for hit coming from multiple MC Point; Pull "
1345 "Y(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1346 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1348 new TH2D("TofTests_MultiPntHitFurthestPullZ",
1349 "Quality of the Tof Hits position error on Z axis relative to "
1350 "furthest Point, for hit coming from multiple MC Point; Pull "
1351 "Z(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1352 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1354 new TH2D("TofTests_MultiPntHitFurthestPullR",
1355 "Quality of the Tof Hits position error relative to furthest "
1356 "Point, for hit coming from multiple MC Point; Pull R(Hit -> "
1357 "Point) []; # [Hits]; Multi [Pnt]",
1358 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1360 new TH2D("TofTests_MultiPntHitFurthestPullT",
1361 "Quality of the Tof Hits time error relative to furthest Point, "
1362 "for hit coming from multiple MC Point; Pull T(Hit -> Point) []; "
1363 "# [Hits]; Multi [Pnt]",
1364 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1365 // To mean Point position
1367 new TH2D("TofTests_MultiPntHitMeanDeltaX",
1368 "Quality of the Tof Hits position on X axis relative to mean "
1369 "Point position, for hit coming from multiple MC Point; X(Hit) - "
1370 "X(Point) [cm]; # [Hits]; Multi [Pnt]",
1371 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1373 new TH2D("TofTests_MultiPntHitMeanDeltaY",
1374 "Quality of the Tof Hits position on Y axis relative to mean "
1375 "Point position, for hit coming from multiple MC Point; Y(Hit) - "
1376 "Y(Point) [cm]; # [Hits]; Multi [Pnt]",
1377 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1379 new TH2D("TofTests_MultiPntHitMeanDeltaZ",
1380 "Quality of the Tof Hits position on Z axis relative to mean "
1381 "Point position, for hit coming from multiple MC Point; Z(Hit) - "
1382 "Z(Point) [cm]; # [Hits]; Multi [Pnt]",
1383 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1385 new TH2D("TofTests_MultiPntHitMeanDeltaR",
1386 "Quality of the Tof Hits position relative to mean Point "
1387 "position, for hit coming from multiple MC Point; R(Hit -> Point) "
1388 "[cm]; # [Hits]; Multi [Pnt]",
1389 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1391 new TH2D("TofTests_MultiPntHitMeanDeltaT",
1392 "Quality of the Tof Hits Time relative to mean Point time, for hit coming "
1393 "from multiple MC Point; T(hit) - T(Point) [ps]; # [Hits]; Multi [Pnt]",
1394 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1395 fhMultiPntHitMeanPullX = new TH2D("TofTests_MultiPntHitMeanPullX",
1396 "Quality of the Tof Hits position error on X axis relative to "
1397 "mean Point position, for hit coming from multiple MC Point; Pull "
1398 "X(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1399 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1400 fhMultiPntHitMeanPullY = new TH2D("TofTests_MultiPntHitMeanPullY",
1401 "Quality of the Tof Hits position error on Y axis relative to "
1402 "mean Point position, for hit coming from multiple MC Point; Pull "
1403 "Y(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1404 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1405 fhMultiPntHitMeanPullZ = new TH2D("TofTests_MultiPntHitMeanPullZ",
1406 "Quality of the Tof Hits position error on Z axis relative to "
1407 "mean Point position, for hit coming from multiple MC Point; Pull "
1408 "Z(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1409 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1410 fhMultiPntHitMeanPullR = new TH2D("TofTests_MultiPntHitMeanPullR",
1411 "Quality of the Tof Hits position error relative to mean Point "
1412 "position, for hit coming from multiple MC Point; Pull R(Hit -> "
1413 "Point) []; # [Hits]; Multi [Pnt]",
1414 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1415 fhMultiPntHitMeanPullT = new TH2D("TofTests_MultiPntHitMeanPullT",
1416 "Quality of the Tof Hits time error relative to mean Point time, "
1417 "for hit coming from multiple MC Point; Pull T(Hit -> Point) []; "
1418 "# [Hits]; Multi [Pnt]",
1419 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1420 // To best Point (highest TOT contribution
1422 new TH2D("TofTests_MultiPntHitBestDeltaX",
1423 "Quality of the Tof Hits position on X axis relative to best "
1424 "Point position, for hit coming from multiple MC Point; X(Hit) - "
1425 "X(Point) [cm]; # [Hits]; Multi [Pnt]",
1426 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1428 new TH2D("TofTests_MultiPntHitBestDeltaY",
1429 "Quality of the Tof Hits position on Y axis relative to best "
1430 "Point position, for hit coming from multiple MC Point; Y(Hit) - "
1431 "Y(Point) [cm]; # [Hits]; Multi [Pnt]",
1432 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1434 new TH2D("TofTests_MultiPntHitBestDeltaZ",
1435 "Quality of the Tof Hits position on Z axis relative to best "
1436 "Point position, for hit coming from multiple MC Point; Z(Hit) - "
1437 "Z(Point) [cm]; # [Hits]; Multi [Pnt]",
1438 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1440 new TH2D("TofTests_MultiPntHitBestDeltaR",
1441 "Quality of the Tof Hits position relative to best Point "
1442 "position, for hit coming from multiple MC Point; R(Hit -> Point) "
1443 "[cm]; # [Hits]; Multi [Pnt]",
1444 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1446 new TH2D("TofTests_MultiPntHitBestDeltaT",
1447 "Quality of the Tof Hits Time relative to best Point time, for hit coming "
1448 "from multiple MC Point; T(hit) - T(Point) [ps]; # [Hits]; Multi [Pnt]",
1449 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1450 fhMultiPntHitBestPullX = new TH2D("TofTests_MultiPntHitBestPullX",
1451 "Quality of the Tof Hits position error on X axis relative to "
1452 "best Point position, for hit coming from multiple MC Point; Pull "
1453 "X(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1454 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1455 fhMultiPntHitBestPullY = new TH2D("TofTests_MultiPntHitBestPullY",
1456 "Quality of the Tof Hits position error on Y axis relative to "
1457 "best Point position, for hit coming from multiple MC Point; Pull "
1458 "Y(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1459 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1460 fhMultiPntHitBestPullZ = new TH2D("TofTests_MultiPntHitBestPullZ",
1461 "Quality of the Tof Hits position error on Z axis relative to "
1462 "best Point position, for hit coming from multiple MC Point; Pull "
1463 "Z(Hit -> Point) []; # [Hits]; Multi [Pnt]",
1464 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1465 fhMultiPntHitBestPullR = new TH2D("TofTests_MultiPntHitBestPullR",
1466 "Quality of the Tof Hits position error relative to best Point "
1467 "position, for hit coming from multiple MC Point; Pull R(Hit -> "
1468 "Point) []; # [Hits]; Multi [Pnt]",
1469 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1470 fhMultiPntHitBestPullT = new TH2D("TofTests_MultiPntHitBestPullT",
1471 "Quality of the Tof Hits time error relative to best Point time, "
1472 "for hit coming from multiple MC Point; Pull T(Hit -> Point) []; "
1473 "# [Hits]; Multi [Pnt]",
1474 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1475
1476 // Hit Quality for Hits coming from a single MC Track
1477 fhSingleTrackHitDeltaX = new TH1D("TofTests_SingleTrackHitDeltaX",
1478 "Quality of the Tof Hits position on X axis, for hit coming from "
1479 "a single MC Track; X(Hit) - X(Track) [cm]; # [Hits]",
1480 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1481 fhSingleTrackHitDeltaY = new TH1D("TofTests_SingleTrackHitDeltaY",
1482 "Quality of the Tof Hits position on Y axis, for hit coming from "
1483 "a single MC Track; Y(Hit) - X(Track) [cm]; # [Hits]",
1484 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1485 fhSingleTrackHitDeltaZ = new TH1D("TofTests_SingleTrackHitDeltaZ",
1486 "Quality of the Tof Hits position on Z axis, for hit coming from "
1487 "a single MC Track; Z(Hit) - X(Track) [cm]; # [Hits]",
1488 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1489 fhSingleTrackHitDeltaR = new TH1D("TofTests_SingleTrackHitDeltaR",
1490 "Quality of the Tof Hits position, for hit coming from a single "
1491 "MC Track; R(Hit -> Track) [cm]; # [Hits]",
1492 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1493 fhSingleTrackHitDeltaT = new TH1D("TofTests_SingleTrackHitDeltaT",
1494 "Quality of the Tof Hits Time, for hit coming from a single MC "
1495 "Track; T(hit) - T(Track) [ps]; # [Hits]",
1496 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange);
1497 fhSingleTrackHitPullX = new TH1D("TofTests_SingleTrackHitPullX",
1498 "Quality of the Tof Hits position error on X axis, for hit coming "
1499 "from a single MC Track; Pull X(Hit -> Track) []; # [Hits]",
1500 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1501 fhSingleTrackHitPullY = new TH1D("TofTests_SingleTrackHitPullY",
1502 "Quality of the Tof Hits position error on Y axis, for hit coming "
1503 "from a single MC Track; Y(Hit) - X(Track) []; # [Hits]",
1504 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1505 fhSingleTrackHitPullZ = new TH1D("TofTests_SingleTrackHitPullZ",
1506 "Quality of the Tof Hits position error on Z axis, for hit coming "
1507 "from a single MC Track; Z(Hit) - X(Track) []; # [Hits]",
1508 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1509 fhSingleTrackHitPullR = new TH1D("TofTests_SingleTrackHitPullR",
1510 "Quality of the Tof Hits position error, for hit coming from a "
1511 "single MC Track; Pull R(Hit -> Track) []; # [Hits]",
1512 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1513 fhSingleTrackHitPullT = new TH1D("TofTests_SingleTrackHitPullT",
1514 "Quality of the Tof Hits time error, for hit coming from a single "
1515 "MC Track; Pull T(Hit -> Track) []; # [Hits]",
1516 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1517
1518 // Hit Quality for Hits coming from a single MC Track but multiple points
1519 fhSingTrkMultiPntHitDeltaX = new TH1D("TofTests_SingTrkMultiPntHitDeltaX",
1520 "Quality of the Tof Hits position on X axis, for hit coming from "
1521 "a single MC Track; X(Hit) - X(Track) [cm]; # [Hits]",
1522 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1523 fhSingTrkMultiPntHitDeltaY = new TH1D("TofTests_SingTrkMultiPntHitDeltaY",
1524 "Quality of the Tof Hits position on Y axis, for hit coming from "
1525 "a single MC Track; Y(Hit) - X(Track) [cm]; # [Hits]",
1526 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1527 fhSingTrkMultiPntHitDeltaZ = new TH1D("TofTests_SingTrkMultiPntHitDeltaZ",
1528 "Quality of the Tof Hits position on Z axis, for hit coming from "
1529 "a single MC Track; Z(Hit) - X(Track) [cm]; # [Hits]",
1530 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1531 fhSingTrkMultiPntHitDeltaR = new TH1D("TofTests_SingTrkMultiPntHitDeltaR",
1532 "Quality of the Tof Hits position, for hit coming from a single "
1533 "MC Track; R(Hit -> Track) [cm]; # [Hits]",
1534 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange);
1535 fhSingTrkMultiPntHitDeltaT = new TH1D("TofTests_SingTrkMultiPntHitDeltaT",
1536 "Quality of the Tof Hits Time, for hit coming from a single MC "
1537 "Track; T(hit) - T(Track) [ps]; # [Hits]",
1538 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange);
1539 fhSingTrkMultiPntHitPullX = new TH1D("TofTests_SingTrkMultiPntHitPullX",
1540 "Quality of the Tof Hits position error on X axis, for hit coming "
1541 "from a single MC Track; Pull X(Hit -> Track) []; # [Hits]",
1542 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1543 fhSingTrkMultiPntHitPullY = new TH1D("TofTests_SingTrkMultiPntHitPullY",
1544 "Quality of the Tof Hits position error on Y axis, for hit coming "
1545 "from a single MC Track; Y(Hit) - X(Track) []; # [Hits]",
1546 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1547 fhSingTrkMultiPntHitPullZ = new TH1D("TofTests_SingTrkMultiPntHitPullZ",
1548 "Quality of the Tof Hits position error on Z axis, for hit coming "
1549 "from a single MC Track; Z(Hit) - X(Track) []; # [Hits]",
1550 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1551 fhSingTrkMultiPntHitPullR = new TH1D("TofTests_SingTrkMultiPntHitPullR",
1552 "Quality of the Tof Hits position error, for hit coming from a "
1553 "single MC Track; Pull R(Hit -> Track) []; # [Hits]",
1554 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1555 fhSingTrkMultiPntHitPullT = new TH1D("TofTests_SingTrkMultiPntHitPullT",
1556 "Quality of the Tof Hits time error, for hit coming from a single "
1557 "MC Track; Pull T(Hit -> Track) []; # [Hits]",
1558 iNbBinsPullPos, -dPullPosRange, dPullPosRange);
1559
1560 // Hit Quality for Hits coming from a multiple MC Tracks
1561 // To Point closest to Hit
1563 new TH2D("TofTests_MultiTrkHitClosestDeltaX",
1564 "Quality of the Tof Hits position on X axis relative to closest "
1565 "Track, for hit coming from multiple MC Track; X(Hit) - X(Track) "
1566 "[cm]; # [Hits]; Multi [Trk]",
1567 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1569 new TH2D("TofTests_MultiTrkHitClosestDeltaY",
1570 "Quality of the Tof Hits position on Y axis relative to closest "
1571 "Track, for hit coming from multiple MC Track; Y(Hit) - Y(Track) "
1572 "[cm]; # [Hits]; Multi [Trk]",
1573 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1575 new TH2D("TofTests_MultiTrkHitClosestDeltaZ",
1576 "Quality of the Tof Hits position on Z axis relative to closest "
1577 "Track, for hit coming from multiple MC Track; Z(Hit) - Z(Track) "
1578 "[cm]; # [Hits]; Multi [Trk]",
1579 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1581 new TH2D("TofTests_MultiTrkHitClosestDeltaR",
1582 "Quality of the Tof Hits position relative to closest Track, for "
1583 "hit coming from multiple MC Track; R(Hit -> Track) [cm]; # "
1584 "[Hits]; Multi [Trk]",
1585 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1587 new TH2D("TofTests_MultiTrkHitClosestDeltaT",
1588 "Quality of the Tof Hits Time relative to closest Track, for hit coming "
1589 "from multiple MC Track; T(hit) - T(Track) [ps]; # [Hits]; Multi [Trk]",
1590 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1592 new TH2D("TofTests_MultiTrkHitClosestPullX",
1593 "Quality of the Tof Hits position error on X axis relative to "
1594 "closest Track, for hit coming from multiple MC Track; Pull X(Hit "
1595 "-> Track) []; # [Hits]; Multi [Trk]",
1596 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1598 new TH2D("TofTests_MultiTrkHitClosestPullY",
1599 "Quality of the Tof Hits position error on Y axis relative to "
1600 "closest Track, for hit coming from multiple MC Track; Pull Y(Hit "
1601 "-> Track) []; # [Hits]; Multi [Trk]",
1602 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1604 new TH2D("TofTests_MultiTrkHitClosestPullZ",
1605 "Quality of the Tof Hits position error on Z axis relative to "
1606 "closest Track, for hit coming from multiple MC Track; Pull Z(Hit "
1607 "-> Track) []; # [Hits]; Multi [Trk]",
1608 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1610 new TH2D("TofTests_MultiTrkHitClosestPullR",
1611 "Quality of the Tof Hits position error relative to closest "
1612 "Track, for hit coming from multiple MC Track; Pull R(Hit -> "
1613 "Track) []; # [Hits]; Multi [Trk]",
1614 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1616 new TH2D("TofTests_MultiTrkHitClosestPullT",
1617 "Quality of the Tof Hits time error relative to closest Track, "
1618 "for hit coming from multiple MC Track; Pull T(Hit -> Track) []; "
1619 "# [Hits]; Multi [Trk]",
1620 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1621 // To Track furthest from Hit
1623 new TH2D("TofTests_MultiTrkHitFurthestDeltaX",
1624 "Quality of the Tof Hits position on X axis relative to furthest "
1625 "Track, for hit coming from multiple MC Track; X(Hit) - X(Track) "
1626 "[cm]; # [Hits]; Multi [Trk]",
1627 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1629 new TH2D("TofTests_MultiTrkHitFurthestDeltaY",
1630 "Quality of the Tof Hits position on Y axis relative to furthest "
1631 "Track, for hit coming from multiple MC Track; Y(Hit) - Y(Track) "
1632 "[cm]; # [Hits]; Multi [Trk]",
1633 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1635 new TH2D("TofTests_MultiTrkHitFurthestDeltaZ",
1636 "Quality of the Tof Hits position on Z axis relative to furthest "
1637 "Track, for hit coming from multiple MC Track; Z(Hit) - Z(Track) "
1638 "[cm]; # [Hits]; Multi [Trk]",
1639 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1641 new TH2D("TofTests_MultiTrkHitFurthestDeltaR",
1642 "Quality of the Tof Hits position relative to furthest Track, for "
1643 "hit coming from multiple MC Track; R(Hit -> Track) [cm]; # "
1644 "[Hits]; Multi [Trk]",
1645 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1647 new TH2D("TofTests_MultiTrkHitFurthestDeltaT",
1648 "Quality of the Tof Hits Time relative to furthest Track, for hit coming "
1649 "from multiple MC Track; T(hit) - T(Track) [ps]; # [Hits]; Multi [Trk]",
1650 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1652 new TH2D("TofTests_MultiTrkHitFurthestPullX",
1653 "Quality of the Tof Hits position error on X axis relative to "
1654 "furthest Track, for hit coming from multiple MC Track; Pull "
1655 "X(Hit -> Track) []; # [Hits]; Multi [Trk]",
1656 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1658 new TH2D("TofTests_MultiTrkHitFurthestPullY",
1659 "Quality of the Tof Hits position error on Y axis relative to "
1660 "furthest Track, for hit coming from multiple MC Track; Pull "
1661 "Y(Hit -> Track) []; # [Hits]; Multi [Trk]",
1662 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1664 new TH2D("TofTests_MultiTrkHitFurthestPullZ",
1665 "Quality of the Tof Hits position error on Z axis relative to "
1666 "furthest Track, for hit coming from multiple MC Track; Pull "
1667 "Z(Hit -> Track) []; # [Hits]; Multi [Trk]",
1668 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1670 new TH2D("TofTests_MultiTrkHitFurthestPullR",
1671 "Quality of the Tof Hits position error relative to furthest "
1672 "Track, for hit coming from multiple MC Track; Pull R(Hit -> "
1673 "Track) []; # [Hits]; Multi [Trk]",
1674 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1676 new TH2D("TofTests_MultiTrkHitFurthestPullT",
1677 "Quality of the Tof Hits time error relative to furthest Track, "
1678 "for hit coming from multiple MC Track; Pull T(Hit -> Track) []; "
1679 "# [Hits]; Multi [Trk]",
1680 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1681 // To mean Track position
1683 new TH2D("TofTests_MultiTrkHitMeanDeltaX",
1684 "Quality of the Tof Hits position on X axis relative to mean "
1685 "Track position, for hit coming from multiple MC Track; X(Hit) - "
1686 "X(Track) [cm]; # [Hits]; Multi [Trk]",
1687 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1689 new TH2D("TofTests_MultiTrkHitMeanDeltaY",
1690 "Quality of the Tof Hits position on Y axis relative to mean "
1691 "Track position, for hit coming from multiple MC Track; Y(Hit) - "
1692 "Y(Track) [cm]; # [Hits]; Multi [Trk]",
1693 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1695 new TH2D("TofTests_MultiTrkHitMeanDeltaZ",
1696 "Quality of the Tof Hits position on Z axis relative to mean "
1697 "Track position, for hit coming from multiple MC Track; Z(Hit) - "
1698 "Z(Track) [cm]; # [Hits]; Multi [Trk]",
1699 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1701 new TH2D("TofTests_MultiTrkHitMeanDeltaR",
1702 "Quality of the Tof Hits position relative to mean Track "
1703 "position, for hit coming from multiple MC Track; R(Hit -> Track) "
1704 "[cm]; # [Hits]; Multi [Trk]",
1705 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1707 new TH2D("TofTests_MultiTrkHitMeanDeltaT",
1708 "Quality of the Tof Hits Time relative to mean Track time, for hit coming "
1709 "from multiple MC Track; T(hit) - T(Track) [ps]; # [Hits]; Multi [Trk]",
1710 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1711 fhMultiTrkHitMeanPullX = new TH2D("TofTests_MultiTrkHitMeanPullX",
1712 "Quality of the Tof Hits position error on X axis relative to "
1713 "mean Track position, for hit coming from multiple MC Track; Pull "
1714 "X(Hit -> Track) []; # [Hits]; Multi [Trk]",
1715 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1716 fhMultiTrkHitMeanPullY = new TH2D("TofTests_MultiTrkHitMeanPullY",
1717 "Quality of the Tof Hits position error on Y axis relative to "
1718 "mean Track position, for hit coming from multiple MC Track; Pull "
1719 "Y(Hit -> Track) []; # [Hits]; Multi [Trk]",
1720 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1721 fhMultiTrkHitMeanPullZ = new TH2D("TofTests_MultiTrkHitMeanPullZ",
1722 "Quality of the Tof Hits position error on Z axis relative to "
1723 "mean Track position, for hit coming from multiple MC Track; Pull "
1724 "Z(Hit -> Track) []; # [Hits]; Multi [Trk]",
1725 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1726 fhMultiTrkHitMeanPullR = new TH2D("TofTests_MultiTrkHitMeanPullR",
1727 "Quality of the Tof Hits position error relative to mean Track "
1728 "position, for hit coming from multiple MC Track; Pull R(Hit -> "
1729 "Track) []; # [Hits]; Multi [Trk]",
1730 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1731 fhMultiTrkHitMeanPullT = new TH2D("TofTests_MultiTrkHitMeanPullT",
1732 "Quality of the Tof Hits time error relative to mean Track "
1733 "position, for hit coming from multiple MC Track; Pull T(Hit -> "
1734 "Track) []; # [Hits]; Multi [Trk]",
1735 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1736 // To best Track (Highest TOT contribution)
1738 new TH2D("TofTests_MultiTrkHitBestDeltaX",
1739 "Quality of the Tof Hits position on X axis relative to best "
1740 "Track position, for hit coming from multiple MC Track; X(Hit) - "
1741 "X(Track) [cm]; # [Hits]; Multi [Trk]",
1742 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1744 new TH2D("TofTests_MultiTrkHitBestDeltaY",
1745 "Quality of the Tof Hits position on Y axis relative to best "
1746 "Track position, for hit coming from multiple MC Track; Y(Hit) - "
1747 "Y(Track) [cm]; # [Hits]; Multi [Trk]",
1748 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1750 new TH2D("TofTests_MultiTrkHitBestDeltaZ",
1751 "Quality of the Tof Hits position on Z axis relative to best "
1752 "Track position, for hit coming from multiple MC Track; Z(Hit) - "
1753 "Z(Track) [cm]; # [Hits]; Multi [Trk]",
1754 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1756 new TH2D("TofTests_MultiTrkHitBestDeltaR",
1757 "Quality of the Tof Hits position relative to best Track "
1758 "position, for hit coming from multiple MC Track; R(Hit -> Track) "
1759 "[cm]; # [Hits]; Multi [Trk]",
1760 iNbBinsDeltaPos, -dDeltaPosRange, dDeltaPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1762 new TH2D("TofTests_MultiTrkHitBestDeltaT",
1763 "Quality of the Tof Hits Time relative to best Track time, for hit coming "
1764 "from multiple MC Track; T(hit) - T(Track) [ps]; # [Hits]; Multi [Trk]",
1765 iNbBinsDeltaTime, -dDeltaTimeRange, dDeltaTimeRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1766 fhMultiTrkHitBestPullX = new TH2D("TofTests_MultiTrkHitBestPullX",
1767 "Quality of the Tof Hits position error on X axis relative to "
1768 "best Track position, for hit coming from multiple MC Track; Pull "
1769 "X(Hit -> Track) []; # [Hits]; Multi [Trk]",
1770 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1771 fhMultiTrkHitBestPullY = new TH2D("TofTests_MultiTrkHitBestPullY",
1772 "Quality of the Tof Hits position error on Y axis relative to "
1773 "best Track position, for hit coming from multiple MC Track; Pull "
1774 "Y(Hit -> Track) []; # [Hits]; Multi [Trk]",
1775 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1776 fhMultiTrkHitBestPullZ = new TH2D("TofTests_MultiTrkHitBestPullZ",
1777 "Quality of the Tof Hits position error on Z axis relative to "
1778 "best Track position, for hit coming from multiple MC Track; Pull "
1779 "Z(Hit -> Track) []; # [Hits]; Multi [Trk]",
1780 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1781 fhMultiTrkHitBestPullR = new TH2D("TofTests_MultiTrkHitBestPullR",
1782 "Quality of the Tof Hits position error relative to best Track "
1783 "position, for hit coming from multiple MC Track; Pull R(Hit -> "
1784 "Track) []; # [Hits]; Multi [Trk]",
1785 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1786 fhMultiTrkHitBestPullT = new TH2D("TofTests_MultiTrkHitBestPullT",
1787 "Quality of the Tof Hits time error relative to best Track "
1788 "position, for hit coming from multiple MC Track; Pull T(Hit -> "
1789 "Track) []; # [Hits]; Multi [Trk]",
1790 iNbBinsPullPos, -dPullPosRange, dPullPosRange, iNbBinsMulti, iMinMulti, iMaxMulti);
1791
1792 // Physics coord mapping, 1 per particle type
1793 // Phase space
1794 Int_t iNbBinsY = 30;
1795 Double_t dMinY = -1.;
1796 Double_t dMaxY = 4.;
1797 Int_t iNbBNinsPtm = 30;
1798 Double_t dMinPtm = 0.0;
1799 Double_t dMaxPtm = 2.5;
1800 fvhPtmRapGenTrk.resize(kiNbPart);
1801 fvhPtmRapStsPnt.resize(kiNbPart);
1802 fvhPtmRapTofPnt.resize(kiNbPart);
1803 fvhPtmRapTofHit.resize(kiNbPart);
1812 // PLab
1813 Int_t iNbBinsPlab = 100;
1814 Double_t dMinPlab = 0.0;
1815 Double_t dMaxPlab = 10.0;
1816 fvhPlabGenTrk.resize(kiNbPart);
1817 fvhPlabStsPnt.resize(kiNbPart);
1818 fvhPlabTofPnt.resize(kiNbPart);
1819 fvhPlabTofHit.resize(kiNbPart);
1822 fvhPlabSecGenTrk.resize(kiNbPart);
1823 fvhPlabSecStsPnt.resize(kiNbPart);
1824 fvhPlabSecTofPnt.resize(kiNbPart);
1825 fvhPlabSecTofHit.resize(kiNbPart);
1828 // MC Tracks losses
1841 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
1842 // Phase space
1843 fvhPtmRapGenTrk[iPartIdx] = new TH2D(Form("TofTests_PtmRapGenTrk_%s", ksPartTag[iPartIdx].Data()),
1844 Form("P_{t}/M vs y distribution for MC tracks, %s, primary "
1845 "tracks; y; P_{t}/M; # []",
1846 ksPartName[iPartIdx].Data()),
1847 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1848 fvhPtmRapStsPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapStsPnt_%s", ksPartTag[iPartIdx].Data()),
1849 Form("P_{t}/M vs y distribution from MC Track with STS points, "
1850 "%s, primary tracks; y; P_{t}/M; # []",
1851 ksPartName[iPartIdx].Data()),
1852 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1853 fvhPtmRapTofPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapTofPnt_%s", ksPartTag[iPartIdx].Data()),
1854 Form("P_{t}/M vs y distribution from MC Track for TOF points, "
1855 "%s, primary tracks; y; P_{t}/M; # []",
1856 ksPartName[iPartIdx].Data()),
1857 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1858 fvhPtmRapTofHit[iPartIdx] = new TH2D(Form("TofTests_PtmRapTofHit_%s", ksPartTag[iPartIdx].Data()),
1859 Form("P_{t}/M vs y distribution from MC Track for TOF Hits, %s, "
1860 "primary tracks; y; P_{t}/M; # []",
1861 ksPartName[iPartIdx].Data()),
1862 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1863 fvhPtmRapTofHitSinglePnt[iPartIdx] =
1864 new TH2D(Form("TofTests_PtmRapTofHitSinglePnt_%s", ksPartTag[iPartIdx].Data()),
1865 Form("P_{t}/M vs y distribution from MC Track for TOF Hits from a single "
1866 "TOF Point, %s, primary tracks; y; P_{t}/M; # []",
1867 ksPartName[iPartIdx].Data()),
1868 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1869 fvhPtmRapTofHitSingleTrk[iPartIdx] =
1870 new TH2D(Form("TofTests_PtmRapTofHitSingleTrk_%s", ksPartTag[iPartIdx].Data()),
1871 Form("P_{t}/M vs y distribution from MC Track for TOF Hits from a single "
1872 "MC track, %s, primary tracks; y; P_{t}/M; # []",
1873 ksPartName[iPartIdx].Data()),
1874 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1875 // PLab
1876 fvhPlabGenTrk[iPartIdx] = new TH1D(Form("TofTests_PlabGenTrk_%s", ksPartTag[iPartIdx].Data()),
1877 Form("P_{lab} distribution for MC tracks, %s, primary tracks; "
1878 "P_{lab} [GeV/c]; # []",
1879 ksPartName[iPartIdx].Data()),
1880 iNbBinsPlab, dMinPlab, dMaxPlab);
1881 fvhPlabStsPnt[iPartIdx] = new TH1D(Form("TofTests_PlabStsPnt_%s", ksPartTag[iPartIdx].Data()),
1882 Form("P_{lab} distribution from MC Track with STS points, %s, "
1883 "primary tracks; P_{lab} [GeV/c]; # []",
1884 ksPartName[iPartIdx].Data()),
1885 iNbBinsPlab, dMinPlab, dMaxPlab);
1886 fvhPlabTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabTofPnt_%s", ksPartTag[iPartIdx].Data()),
1887 Form("P_{lab} distribution from MC Track for TOF points, %s, "
1888 "primary tracks; P_{lab} [GeV/c]; # []",
1889 ksPartName[iPartIdx].Data()),
1890 iNbBinsPlab, dMinPlab, dMaxPlab);
1891 fvhPlabTofHit[iPartIdx] = new TH1D(Form("TofTests_PlabTofHit_%s", ksPartTag[iPartIdx].Data()),
1892 Form("P_{lab} distribution from MC Track for TOF Hits, %s, "
1893 "primary tracks; P_{lab} [GeV/c]; # []",
1894 ksPartName[iPartIdx].Data()),
1895 iNbBinsPlab, dMinPlab, dMaxPlab);
1896 fvhPlabTofHitSinglePnt[iPartIdx] =
1897 new TH1D(Form("TofTests_PlabTofHitSinglePnt_%s", ksPartTag[iPartIdx].Data()),
1898 Form("P_{lab} distribution from MC Track for TOF Hits from a single TOF "
1899 "Point, %s, primary tracks; P_{lab} [GeV/c]; # []",
1900 ksPartName[iPartIdx].Data()),
1901 iNbBinsPlab, dMinPlab, dMaxPlab);
1902 fvhPlabTofHitSingleTrk[iPartIdx] = new TH1D(Form("TofTests_PlabTofHitSingleTrk_%s", ksPartTag[iPartIdx].Data()),
1903 Form("P_{lab} distribution from MC Track for TOF Hits from a single MC "
1904 "tracks, %s, primary tracks; P_{lab} [GeV/c]; # []",
1905 ksPartName[iPartIdx].Data()),
1906 iNbBinsPlab, dMinPlab, dMaxPlab);
1907
1908
1909 // MC Tracks losses
1910 fvhPtmRapGenTrkTofPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapGenTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
1911 Form("P_{t}/M vs y distribution for MC tracks with TOF Point(s), %s, "
1912 "primary tracks; y; P_{t}/M; # []",
1913 ksPartName[iPartIdx].Data()),
1914 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1915 fvhPtmRapGenTrkTofHit[iPartIdx] = new TH2D(Form("TofTests_PtmRapGenTrkTofHit_%s", ksPartTag[iPartIdx].Data()),
1916 Form("P_{t}/M vs y distribution for MC tracks with TOF Hit(s), %s, "
1917 "primary tracks; y; P_{t}/M; # []",
1918 ksPartName[iPartIdx].Data()),
1919 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1920
1921 fvhPlabGenTrkTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabGenTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
1922 Form("P_{lab} distribution for MC tracks with TOF Point(s), %s, "
1923 "primary tracks; P_{lab} [GeV/c]; # []",
1924 ksPartName[iPartIdx].Data()),
1925 iNbBinsPlab, dMinPlab, dMaxPlab);
1926 fvhPlabGenTrkTofHit[iPartIdx] = new TH1D(Form("TofTests_PlabGenTrkTofHit_%s", ksPartTag[iPartIdx].Data()),
1927 Form("P_{lab} distribution from MC Track with TOF Hit(s), %s, "
1928 "primary tracks; P_{lab} [GeV/c]; # []",
1929 ksPartName[iPartIdx].Data()),
1930 iNbBinsPlab, dMinPlab, dMaxPlab);
1931 fvhPlabStsTrkTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabStsTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
1932 Form("P_{lab} distribution for MC tracks with STS and TOF "
1933 "Point(s), %s, primary tracks; P_{lab} [GeV/c]; # []",
1934 ksPartName[iPartIdx].Data()),
1935 iNbBinsPlab, dMinPlab, dMaxPlab);
1936 fvhPlabStsTrkTofHit[iPartIdx] = new TH1D(Form("TofTests_PlabStsTrkTofHit_%s", ksPartTag[iPartIdx].Data()),
1937 Form("P_{lab} distribution from MC Track with STS points and "
1938 "TOF Hit(s), %s, primary tracks; P_{lab} [GeV/c]; # []",
1939 ksPartName[iPartIdx].Data()),
1940 iNbBinsPlab, dMinPlab, dMaxPlab);
1941
1942 // Secondary tracks
1943 // Phase space
1944 fvhPtmRapSecGenTrk[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecGenTrk_%s", ksPartTag[iPartIdx].Data()),
1945 Form("P_{t}/M vs y distribution for MC tracks, %s, secondary "
1946 "tracks; y; P_{t}/M; # []",
1947 ksPartName[iPartIdx].Data()),
1948 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1949 fvhPtmRapSecStsPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecStsPnt_%s", ksPartTag[iPartIdx].Data()),
1950 Form("P_{t}/M vs y distribution from MC Track with STS points, "
1951 "%s, secondary tracks; y; P_{t}/M; # []",
1952 ksPartName[iPartIdx].Data()),
1953 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1954 fvhPtmRapSecTofPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecTofPnt_%s", ksPartTag[iPartIdx].Data()),
1955 Form("P_{t}/M vs y distribution from MC Track for TOF points, "
1956 "%s, secondary tracks; y; P_{t}/M; # []",
1957 ksPartName[iPartIdx].Data()),
1958 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1959 fvhPtmRapSecTofHit[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecTofHit_%s", ksPartTag[iPartIdx].Data()),
1960 Form("P_{t}/M vs y distribution from MC Track for TOF Hits, %s, "
1961 "secondary tracks; y; P_{t}/M; # []",
1962 ksPartName[iPartIdx].Data()),
1963 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1964 fvhPtmRapSecTofHitSinglePnt[iPartIdx] =
1965 new TH2D(Form("TofTests_PtmRapSecTofHitSinglePnt_%s", ksPartTag[iPartIdx].Data()),
1966 Form("P_{t}/M vs y distribution from MC Track for TOF Hits from a single "
1967 "TOF Point, %s, secondary tracks; y; P_{t}/M; # []",
1968 ksPartName[iPartIdx].Data()),
1969 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1970 fvhPtmRapSecTofHitSingleTrk[iPartIdx] =
1971 new TH2D(Form("TofTests_PtmRapSecTofHitSingleTrk_%s", ksPartTag[iPartIdx].Data()),
1972 Form("P_{t}/M vs y distribution from MC Track for TOF Hits from a single "
1973 "MC track, %s, secondary tracks; y; P_{t}/M; # []",
1974 ksPartName[iPartIdx].Data()),
1975 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
1976 // PLab
1977 fvhPlabSecGenTrk[iPartIdx] = new TH1D(Form("TofTests_PlabSecGenTrk_%s", ksPartTag[iPartIdx].Data()),
1978 Form("P_{lab} distribution for MC tracks, %s, secondary tracks; "
1979 "P_{lab} [GeV/c]; # []",
1980 ksPartName[iPartIdx].Data()),
1981 iNbBinsPlab, dMinPlab, dMaxPlab);
1982 fvhPlabSecStsPnt[iPartIdx] = new TH1D(Form("TofTests_PlabSecStsPnt_%s", ksPartTag[iPartIdx].Data()),
1983 Form("P_{lab} distribution from MC Track with STS points, %s, "
1984 "secondary tracks; P_{lab} [GeV/c]; # []",
1985 ksPartName[iPartIdx].Data()),
1986 iNbBinsPlab, dMinPlab, dMaxPlab);
1987 fvhPlabSecTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabSecTofPnt_%s", ksPartTag[iPartIdx].Data()),
1988 Form("P_{lab} distribution from MC Track for TOF points, %s, "
1989 "secondary tracks; P_{lab} [GeV/c]; # []",
1990 ksPartName[iPartIdx].Data()),
1991 iNbBinsPlab, dMinPlab, dMaxPlab);
1992 fvhPlabSecTofHit[iPartIdx] = new TH1D(Form("TofTests_PlabSecTofHit_%s", ksPartTag[iPartIdx].Data()),
1993 Form("P_{lab} distribution from MC Track for TOF Hits, %s, "
1994 "secondary tracks; P_{lab} [GeV/c]; # []",
1995 ksPartName[iPartIdx].Data()),
1996 iNbBinsPlab, dMinPlab, dMaxPlab);
1997 fvhPlabSecTofHitSinglePnt[iPartIdx] =
1998 new TH1D(Form("TofTests_PlabSecTofHitSinglePnt_%s", ksPartTag[iPartIdx].Data()),
1999 Form("P_{lab} distribution from MC Track for TOF Hits from a single TOF "
2000 "Point, %s, secondary tracks; P_{lab} [GeV/c]; # []",
2001 ksPartName[iPartIdx].Data()),
2002 iNbBinsPlab, dMinPlab, dMaxPlab);
2003 fvhPlabSecTofHitSingleTrk[iPartIdx] =
2004 new TH1D(Form("TofTests_PlabSecTofHitSingleTrk_%s", ksPartTag[iPartIdx].Data()),
2005 Form("P_{lab} distribution from MC Track for TOF Hits from a single MC "
2006 "tracks, %s, secondary tracks; P_{lab} [GeV/c]; # []",
2007 ksPartName[iPartIdx].Data()),
2008 iNbBinsPlab, dMinPlab, dMaxPlab);
2009
2010
2011 // MC Tracks losses
2012 fvhPtmRapSecGenTrkTofPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecGenTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
2013 Form("P_{t}/M vs y distribution for MC tracks with TOF Point(s), %s, "
2014 "secondary tracks; y; P_{t}/M; # []",
2015 ksPartName[iPartIdx].Data()),
2016 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
2017 fvhPtmRapSecGenTrkTofHit[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecGenTrkTofHit_%s", ksPartTag[iPartIdx].Data()),
2018 Form("P_{t}/M vs y distribution for MC tracks with TOF Hit(s), %s, "
2019 "secondary tracks; y; P_{t}/M; # []",
2020 ksPartName[iPartIdx].Data()),
2021 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
2022
2023 fvhPlabSecGenTrkTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabSecGenTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
2024 Form("P_{lab} distribution for MC tracks with TOF Point(s), %s, "
2025 "secondary tracks; P_{lab} [GeV/c]; # []",
2026 ksPartName[iPartIdx].Data()),
2027 iNbBinsPlab, dMinPlab, dMaxPlab);
2028 fvhPlabSecGenTrkTofHit[iPartIdx] =
2029 new TH1D(Form("TofTests_PlabSecGenTrkTofHit_%s", ksPartTag[iPartIdx].Data()),
2030 Form("P_{lab} distribution from MC Track with TOF Hit(s), %s, secondary "
2031 "tracks; P_{lab} [GeV/c]; # []",
2032 ksPartName[iPartIdx].Data()),
2033 iNbBinsPlab, dMinPlab, dMaxPlab);
2034
2035 fvhPlabSecStsTrkTofPnt[iPartIdx] =
2036 new TH1D(Form("TofTests_PlabSecStsTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
2037 Form("P_{lab} distribution for MC tracks with STS and TOF Point(s), %s, "
2038 "secondary tracks; P_{lab} [GeV/c]; # []",
2039 ksPartName[iPartIdx].Data()),
2040 iNbBinsPlab, dMinPlab, dMaxPlab);
2041 fvhPlabSecStsTrkTofHit[iPartIdx] =
2042 new TH1D(Form("TofTests_PlabSecStsTrkTofHit_%s", ksPartTag[iPartIdx].Data()),
2043 Form("P_{lab} distribution from MC Track with STS points and TOF Hit(s), "
2044 "%s, secondary tracks; P_{lab} [GeV/c]; # []",
2045 ksPartName[iPartIdx].Data()),
2046 iNbBinsPlab, dMinPlab, dMaxPlab);
2047 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
2048
2049 // Integrated TofHit Efficiency
2050 fhIntegratedHitPntEff = new TH1D("TofTests_IntegratedHitPntEff",
2051 "Efficiency of TOF hit generation, all tracks; Eff = Nb_{Trk w/ "
2052 "Hit}/Nb_{Trk w/ Pnt} [\%]; # [Events]",
2053 202, -0.5, 100.5);
2054 fhIntegratedHitPntEffPrim = new TH1D("TofTests_IntegratedHitPntEffPrim",
2055 "Efficiency of TOF hit generation, primary tracks; Eff = Nb_{Trk "
2056 "w/ Hit}/Nb_{Trk w/ Pnt} [\%]; # [Events]",
2057 202, -0.5, 100.5);
2058 fhIntegratedHitPntEffSec = new TH1D("TofTests_IntegratedHitPntEffSec",
2059 "Efficiency of TOF hit generation, secondary tracks; Eff = "
2060 "Nb_{Trk w/ Hit}/Nb_{Trk w/ Pnt} [\%]; # [Events]",
2061 202, -0.5, 100.5);
2062
2063
2064 // Integrated TofHit Efficiency: Tracks firing channel but not going to Digi/Hit
2065 fhIntegratedHiddenHitPntLoss = new TH1D("TofTests_IntegratedHiddenHitPntLoss",
2066 "Losses of TOF hit generation due to multiplicity, all tracks; "
2067 "Loss = Nb_{Trk w/ Hidden Hit}/Nb_{Trk w/ Pnt} [\%]; # [Events]",
2068 202, -0.5, 100.5);
2069 fhIntegratedHiddenHitPntLossPrim = new TH1D("TofTests_IntegratedHiddenHitPntLossPrim",
2070 "Efficiency of TOF hit generation due to multiplicity, primary tracks; "
2071 "Loss = Nb_{Trk w/ Hidden Hit}/Nb_{Trk w/ Pnt} [\%]; # [Events]",
2072 202, -0.5, 100.5);
2073 fhIntegratedHiddenHitPntLossSec = new TH1D("TofTests_IntegratedHiddenHitPntLossSec",
2074 "Efficiency of TOF hit generation due to multiplicity, secondary tracks; "
2075 "Loss = Nb_{Trk w/ Hidden Hit}/Nb_{Trk w/ Pnt} [\%]; # [Events]",
2076 202, -0.5, 100.5);
2077
2078 // Efficiency dependence on nb crossed gaps
2085 fhIntegratedHitPntEffGaps = new TH2D("TofTests_IntegratedHitPntEffGaps",
2086 "Efficiency of TOF hit generation VS gaps crossed, all tracks; Eff = "
2087 "Nb_{Trk w/ Hit}/Nb_{Trk w/ Pnt} [\%]; Nb TofPoint (gaps) []; # [Events]",
2088 202, -0.5, 100.5, fuMaxCrossedGaps, 0.5, fuMaxCrossedGaps + 0.5);
2089 fhIntegratedHitPntEffPrimGaps = new TH2D("TofTests_IntegratedHitPntEffPrimGaps",
2090 "Efficiency of TOF hit generation VS gaps crossed, primary tracks; Eff = "
2091 "Nb_{Trk w/ Hit}/Nb_{Trk w/ Pnt} [\%]; Nb TofPoint (gaps) []; # [Events]",
2092 202, -0.5, 100.5, fuMaxCrossedGaps, 0.5, fuMaxCrossedGaps + 0.5);
2093 fhIntegratedHitPntEffSecGaps = new TH2D("TofTests_IntegratedHitPntEffSecGaps",
2094 "Efficiency of TOF hit generation VS gaps crossed, secondary tracks; Eff = "
2095 "Nb_{Trk w/ Hit}/Nb_{Trk w/ Pnt} [\%]; Nb TofPoint (gaps) []; # [Events]",
2096 202, -0.5, 100.5, fuMaxCrossedGaps, 0.5, fuMaxCrossedGaps + 0.5);
2097
2098 Float_t fMaxCbmLen = 1500;
2099 fhMcTrkStartPrimSingTrk = new TH2D("TofTests_McTrkStartPrimSingTrk",
2100 "Origin in Z of the MC primary tracks in hits with a single "
2101 "track; MC trk Start Z [cm]; ; # [Events]",
2102 fMaxCbmLen + 1, -1, fMaxCbmLen, kiNbPart, -0.5, kiNbPart - 0.5);
2103 fhMcTrkStartSecSingTrk = new TH2D("TofTests_McTrkStartSecSingTrk",
2104 "Origin in Z of the MC secondary tracks in hits with a single "
2105 "track; MC trk Start Z [cm]; ; # [Events]",
2106 fMaxCbmLen + 1, -1, fMaxCbmLen, kiNbPart, -0.5, kiNbPart - 0.5);
2107 fhMcTrkStartPrimMultiTrk = new TH2D("TofTests_McTrkStartPrimMultiTrk",
2108 "Origin in Z of the MC primary tracks in hits with multiple "
2109 "tracks; MC trk Start Z [cm]; ; # [Events]",
2110 fMaxCbmLen + 1, -1, fMaxCbmLen, kiNbPart, -0.5, kiNbPart - 0.5);
2111 fhMcTrkStartSecMultiTrk = new TH2D("TofTests_McTrkStartSecMultiTrk",
2112 "Origin in Z of the MC secondary tracks in hits with multiple "
2113 "tracks; MC trk Start Z [cm]; ; # [Events]",
2114 fMaxCbmLen + 1, -1, fMaxCbmLen, kiNbPart, -0.5, kiNbPart - 0.5);
2115 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
2116 fhMcTrkStartPrimSingTrk->GetYaxis()->SetBinLabel(1 + iPartIdx, ksPartTag[iPartIdx]);
2117 fhMcTrkStartSecSingTrk->GetYaxis()->SetBinLabel(1 + iPartIdx, ksPartTag[iPartIdx]);
2118 fhMcTrkStartPrimMultiTrk->GetYaxis()->SetBinLabel(1 + iPartIdx, ksPartTag[iPartIdx]);
2119 fhMcTrkStartSecMultiTrk->GetYaxis()->SetBinLabel(1 + iPartIdx, ksPartTag[iPartIdx]);
2120 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
2121
2123 new TH1I("TofTests_PointMatchWeight", "Weigth of TofPoints contributing to Hits; w [Prop. or ps]; #", 1000, -0.05,
2124 100 - 0.05);
2125
2126 gDirectory->cd(oldir->GetPath()); // <= To prevent histos from being sucked in by the param file of the TRootManager!
2127
2128 return kTRUE;
2129}
2130
2131// ------------------------------------------------------------------
2133{
2134 // Declare variables outside the loop
2135 CbmMCTrack* pMcTrk;
2136 CbmTofPoint* pTofPoint;
2137 CbmMatch* pMatchDigiPnt;
2138 CbmMatch* pMatchDigiPntB;
2139 CbmTofHit* pTofHit;
2140 CbmMatch* pMatchHitDigi;
2141 CbmMatch* pMatchHitPnt;
2142
2143 Int_t iNbTracks, iNbTofPts, iNbTofRealPts, iNbTofDigisMatch, iNbTofHits, iNbTofHitsMatch;
2144 Int_t iNbTofDigis = 0;
2145
2146 iNbTracks = fMcTracksColl->GetEntriesFast();
2147 iNbTofPts = fTofPointsColl->GetEntriesFast();
2148 if (kTRUE == fbRealPointAvail) iNbTofRealPts = fRealTofPointsColl->GetEntriesFast();
2149 else
2150 iNbTofRealPts = 0;
2151 iNbTofHits = fTofHitsColl->GetEntriesFast();
2152 if (kFALSE == fbHitProducerSource) {
2153 iNbTofDigis = fTofDigisColl->GetEntriesFast();
2154 iNbTofDigisMatch = fTofDigiMatchPointsColl->GetEntriesFast();
2155 iNbTofHitsMatch = fTofDigiMatchColl->GetEntriesFast();
2156 if (iNbTofDigis != iNbTofDigisMatch)
2157 LOG(fatal) << "CbmTofHitFinderQa::FillHistos => Nb entries in TofDigiMatchPoints "
2158 "TClonesArray doe not match nb entries in TofDigi!!!";
2159 if (iNbTofHits != iNbTofHitsMatch)
2160 LOG(fatal) << "CbmTofHitFinderQa::FillHistos => Nb entries in TofDigiMatch "
2161 "TClonesArray doe not match nb entries in TofHit!!! "
2162 << iNbTofHits << " VS " << iNbTofHitsMatch << " (Prev step: " << iNbTofDigis << " VS "
2163 << iNbTofDigisMatch << " )";
2164 } // if( kFALSE == fbHitProducerSource )
2165
2166 fvulIdxTracksWithPnt.clear();
2167 fvulIdxTracksWithHit.clear();
2175 for (UInt_t uNbGaps = 0; uNbGaps < fuMaxCrossedGaps; uNbGaps++) {
2176 fvulIdxTracksWithPntGaps[uNbGaps].clear();
2177 fvulIdxTracksWithHitGaps[uNbGaps].clear();
2178 fvulIdxPrimTracksWithPntGaps[uNbGaps].clear();
2179 fvulIdxPrimTracksWithHitGaps[uNbGaps].clear();
2180 fvulIdxSecTracksWithPntGaps[uNbGaps].clear();
2181 fvulIdxSecTracksWithHitGaps[uNbGaps].clear();
2182 } // for( UInt_t uNbGaps = 0; uNbGaps < fuMaxCrossedGaps; uNbGaps++)
2183
2184 // Tracks Info
2185 Int_t iNbTofTracks = 0;
2186 Int_t iNbTofTracksPrim = 0;
2187 std::vector<Bool_t> vbTrackHasHit(iNbTracks, kFALSE);
2188 // Are MC tracks reconstructable in STS?
2189 // std::vector< Bool_t > vbTrackStsRecOk( iNbTracks kFALSE);
2190 for (Int_t iTrkInd = 0; iTrkInd < iNbTracks; iTrkInd++) {
2191 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(iTrkInd);
2192
2193 // Is track reconstructable in STS
2194 /*
2195 UInt_t uNbStsPnts = pMcTrk->GetNPoints(ECbmModuleId::kSts);
2196
2197 // True criterium is whether enough STS stations are crossed
2198 // but if already less STS points, can escape looping
2199 if( kiMinNbStsPntAcc <= uNbStsPnts )
2200 {
2201 std::vector< UInt_t > vStsStationsId();
2202 for( UInt_t uStsPntIdx = 0; uStsPntIdx < uNbStsPnts; uStsPntIdx++)
2203 {
2204 UInt_t uStation = CbmStsAddress::GetElementId(
2205 (dynamic_cast<CbmStsPoint*>fStsPointsColl->At( uStsPntIdx ))->GetDetectorID(), 1);
2206 if( kiMinNbStsPntAcc <= vStsStationsId.size() )
2207 {
2208 vbTrackStsRecOk[iTrkInd] = kTRUE;
2209 break;
2210 }
2211 } // for( UInt_t uStsPntIdx = 0; uStsPntIdx < uNbStsPnts; uStsPntIdx++)
2212 } // if( kiMinNbStsPntAcc <= pMcTrk->GetNPoints(ECbmModuleId::kSts) )
2213 */
2214
2215 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) {
2216 iNbTofTracks++;
2217 // Keep track of MC tracks with at least one TOF Point
2218 fvulIdxTracksWithPnt.push_back(iTrkInd);
2219
2220 UInt_t uNbTofPnt = pMcTrk->GetNPoints(ECbmModuleId::kTof) - 1;
2221 if (uNbTofPnt < fuMaxCrossedGaps) fvulIdxTracksWithPntGaps[uNbTofPnt].push_back(iTrkInd);
2222
2223 if (-1 == pMcTrk->GetMotherId()) {
2224 iNbTofTracksPrim++;
2225 fvulIdxPrimTracksWithPnt.push_back(iTrkInd);
2226 if (uNbTofPnt < fuMaxCrossedGaps) fvulIdxPrimTracksWithPntGaps[uNbTofPnt].push_back(iTrkInd);
2227 } // if( -1 == pMcTrk->GetMotherId() )
2228 else {
2229 fvulIdxSecTracksWithPnt.push_back(iTrkInd);
2230
2231 if (uNbTofPnt < fuMaxCrossedGaps) fvulIdxSecTracksWithPntGaps[uNbTofPnt].push_back(iTrkInd);
2232 } // else of if( -1 == pMcTrk->GetMotherId() )
2233 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kTof) )
2234
2235 // tracks mapping: Only when creating normalization histos
2236 // Assume only TOF in setup, no field (only straight tracks)
2237 // and all tracks reach TOF (protons)
2238 if (kTRUE == fbNormHistGenMode) {
2239 // XYZ mapping: assume tracks along Z axis
2240 if (pMcTrk->GetPz() == pMcTrk->GetP()) {
2241 fhTrackMapXY->Fill(pMcTrk->GetStartX(), pMcTrk->GetStartY());
2242 // fhTrackMapXZ->Fill( pMcTrk->GetStartX(), fdWallPosZ ); // Not sure how to get Z here
2243 // fhTrackMapYZ->Fill( pMcTrk->GetStartY(), fdWallPosZ ); // Not sure how to get Z here
2244 } // if( pMcTrk->GetPz() == pMcTrk->GetP() )
2245
2246 // Angular mapping: assume tracks all coming from origin and not necess. along Z axis
2247 if (0 != pMcTrk->GetPz() && ((0 != pMcTrk->GetPx()) || (0 != pMcTrk->GetPy())))
2248 fhTrackMapAng->Fill(TMath::ATan2(pMcTrk->GetPx(), pMcTrk->GetPz()) * 180.0 / TMath::Pi(),
2249 TMath::ATan2(pMcTrk->GetPy(), pMcTrk->GetPz()) * 180.0 / TMath::Pi());
2250
2251 // Spherical mapping: assume tracks all coming from origin and not necess. along Z axis
2252 if (0 != pMcTrk->GetPz() && 0 != pMcTrk->GetPx())
2253 fhTrackMapSph->Fill(TMath::ATan2(pMcTrk->GetPt(), pMcTrk->GetPz()),
2254 TMath::ATan2(pMcTrk->GetPy(), pMcTrk->GetPx()));
2255 } // if( kTRUE == fbNormHistGenMode )
2256
2257 // Physics coord mapping, 1 per particle type
2258 Int_t iPdgCode = pMcTrk->GetPdgCode();
2259 Int_t iPartIdx = -1;
2260 for (Int_t iPart = 0; iPart < kiNbPart; iPart++)
2261 if (kiPartPdgCode[iPart] == iPdgCode) {
2262 iPartIdx = iPart;
2263 break;
2264 } // if( kiPartPdgCode[iPart] == iPdgCode )
2265 if (-1 == iPartIdx) iPartIdx = 0;
2266
2267 // Dependence of Track origin on centrality or position
2268 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) {
2269 fvhTrackAllStartZCent[iPartIdx]->Fill(pMcTrk->GetStartZ(), fMCEventHeader->GetB());
2270 if (2 == iPartIdx) // 3D plot only for e-
2271 fvhTrackAllStartXZCent[iPartIdx]->Fill(pMcTrk->GetStartX(), pMcTrk->GetStartZ(), fMCEventHeader->GetB());
2272 fvhTrackAllStartXZ[iPartIdx]->Fill(pMcTrk->GetStartZ(), pMcTrk->GetStartX());
2273 fvhTrackAllStartYZ[iPartIdx]->Fill(pMcTrk->GetStartZ(), pMcTrk->GetStartY());
2274 }
2275
2276 if (-1 == pMcTrk->GetMotherId()) {
2277 // primary track
2278 // Phase space
2279 fvhPtmRapGenTrk[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
2280 // PLab
2281 fvhPlabGenTrk[iPartIdx]->Fill(pMcTrk->GetP());
2282 // Do the same for tracks within STS acceptance
2284 fvhPtmRapStsPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
2285 fvhPlabStsPnt[iPartIdx]->Fill(pMcTrk->GetP());
2286 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kSts) )
2287 // Do the same for tracks within STS acceptance
2288 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) {
2289 fvhPtmRapGenTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
2290 fvhPlabGenTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
2291
2293 fvhPlabStsTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
2294 } // if( 0 < pMcTrk->GetNPoints(kTof) )
2295 } // if( -1 == pMcTrk->GetMotherId() )
2296 else {
2297 // secondary track
2298 // Dependence of Track origin on centrality
2299 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof))
2300 fvhTrackSecStartZCent[iPartIdx]->Fill(pMcTrk->GetStartZ(), fMCEventHeader->GetB());
2301
2302 // Phase space
2303 fvhPtmRapSecGenTrk[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
2304 // PLab
2305 fvhPlabSecGenTrk[iPartIdx]->Fill(pMcTrk->GetP());
2306 // Do the same for tracks within STS acceptance
2308 fvhPtmRapSecStsPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
2309 fvhPlabSecStsPnt[iPartIdx]->Fill(pMcTrk->GetP());
2310 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kSts) )
2311 // Do the same for tracks within STS acceptance
2312 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) {
2313 fvhPtmRapSecGenTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
2314 fvhPlabSecGenTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
2315
2317 fvhPlabSecStsTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
2318 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kTof) )
2319 } // else of if( -1 == pMcTrk->GetMotherId() )
2320 } // for(Int_t iTrkInd = 0; iTrkInd < nMcTracks; iTrkInd++)
2321
2322 // Loop over Points and map them?
2323 for (Int_t iPntInd = 0; iPntInd < iNbTofPts; iPntInd++) {
2324 // Get a pointer to the TOF point
2325 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iPntInd);
2326 // Get a pointer to the corresponding MC Track
2327 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(pTofPoint->GetTrackID());
2328
2329 // Obtain position
2330 TVector3 vPntPos;
2331 pTofPoint->Position(vPntPos);
2332
2333 Double_t dX = vPntPos.X();
2334 Double_t dY = vPntPos.Y();
2335 Double_t dZ = vPntPos.Z();
2336
2337 // tracks mapping: Only when creating normalization histos
2338 // Assume only TOF in setup, no field (only straight tracks)
2339 // and all tracks reach TOF (protons)
2340 if (kTRUE == fbNormHistGenMode) {
2341 // XYZ mapping: assume tracks along Z axis
2342 if (pMcTrk->GetPz() == pMcTrk->GetP() && pMcTrk->GetStartX() == dX && pMcTrk->GetStartY() == dY) {
2343 fhTrackMapXZ->Fill(dX, dZ); // only way to get Z here?
2344 fhTrackMapYZ->Fill(dY, dZ); // only way to get Z here?
2345 } // if( pMcTrk->GetPz() == pMcTrk->GetP() )
2346 } // if( kTRUE == fbNormHistGenMode )
2347
2348 fhPointMapXY->Fill(dX, dY);
2349 fhPointMapXZ->Fill(dX, dZ);
2350 fhPointMapYZ->Fill(dY, dZ);
2351
2352 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
2353 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
2354 fhPointMapAng->Fill(dThetaX, dThetaY);
2355
2356 Double_t dTheta = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ); // *180.0/TMath::Pi();
2357 Double_t dPhi = TMath::ATan2(dY, dX); // *180.0/TMath::Pi();
2358 fhPointMapSph->Fill(dTheta, dPhi);
2359
2360 // Physics coord mapping, 1 per particle type
2361 Int_t iPdgCode = pMcTrk->GetPdgCode();
2362 Int_t iPartIdx = -1;
2363 for (Int_t iPart = 0; iPart < kiNbPart; iPart++)
2364 if (kiPartPdgCode[iPart] == iPdgCode) {
2365 iPartIdx = iPart;
2366 break;
2367 } // if( kiPartPdgCode[iPart] == iPdgCode )
2368 if (-1 == iPartIdx) iPartIdx = 0;
2369
2370 // Beam pipe check
2371 fvhTofPntAllAngCent[iPartIdx]->Fill(dThetaX, dThetaY, fMCEventHeader->GetB());
2372
2373 if (-1 == pMcTrk->GetMotherId()) {
2374 // primary track
2375 // Phase space
2376 fvhPtmRapTofPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
2377 // PLab
2378 fvhPlabTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
2379 } // if( -1 == pMcTrk->GetMotherId() )
2380 else {
2381 // secondary track
2382 // Phase space
2383 fvhPtmRapSecTofPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
2384 // PLab
2385 fvhPlabSecTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
2386 } // else of if( -1 == pMcTrk->GetMotherId() )
2387 } // for (Int_t iPntInd = 0; iPntInd < nTofPoint; iPntInd++ )
2388
2389 // Loop over Real Points and map them, only in case of protons
2390 if (kTRUE == fbRealPointAvail)
2391 for (Int_t iPntInd = 0; iPntInd < iNbTofRealPts; iPntInd++) {
2392 // Get a pointer to the TOF point
2393 pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(iPntInd);
2394 // Get a pointer to the corresponding MC Track
2395 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(pTofPoint->GetTrackID());
2396
2397 // Physics coord mapping, 1 per particle type
2398 // Int_t iPdgCode = pMcTrk->GetPdgCode();
2399 // if( 2212 == iPdgCode ) // Protons cut, comment to get all
2400 {
2401 // Obtain position
2402 TVector3 vPntPos;
2403 pTofPoint->Position(vPntPos);
2404
2405 Double_t dX = vPntPos.X();
2406 Double_t dY = vPntPos.Y();
2407 Double_t dZ = vPntPos.Z();
2408
2409 fhRealPointMapXY->Fill(dX, dY);
2410 fhRealPointMapXZ->Fill(dX, dZ);
2411 fhRealPointMapYZ->Fill(dY, dZ);
2412
2413 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
2414 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
2415 fhRealPointMapAng->Fill(dThetaX, dThetaY);
2416
2417 Double_t dTheta = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY),
2418 dZ); // *180.0/TMath::Pi();
2419 Double_t dPhi = TMath::ATan2(dY, dX); // *180.0/TMath::Pi();
2420 fhRealPointMapSph->Fill(dTheta, dPhi);
2421 } // if( 2212 == iPdgCode )
2422 } // for (Int_t iPntInd = 0; iPntInd < iNbTofRealPts; iPntInd++ )
2423
2424 // Loop over Digis and map them?
2425 if (kFALSE == fbHitProducerSource) {
2426 if (kTRUE == fDigiBdfPar->UseExpandedDigi()) {
2427 CbmTofDigi* pTofDigi;
2428 for (Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++) {
2429 pTofDigi = (CbmTofDigi*) fTofDigisColl->At(iDigInd);
2430
2431 Int_t iSmType = pTofDigi->GetType();
2432 Int_t iSm = pTofDigi->GetSm();
2433 Int_t iRpc = pTofDigi->GetRpc();
2434 Int_t iCh = pTofDigi->GetChannel();
2435 // First Get X/Y position info
2436 if (fGeoHandler->GetGeoVersion() < k14a) iCh = iCh + 1; //FIXME: Due to change in tofGeoHandler
2437 CbmTofDetectorInfo xDetInfo(ECbmModuleId::kTof, iSmType, iSm, iRpc, 0, iCh);
2438 Int_t iChId = fTofId->SetDetectorInfo(xDetInfo);
2439 fChannelInfo = fDigiPar->GetCell(iChId);
2440
2441 Double_t dX = fChannelInfo->GetX();
2442 Double_t dY = fChannelInfo->GetY();
2443 Double_t dZ = fChannelInfo->GetZ();
2444
2445 fhDigiMapXY->Fill(dX, dY);
2446 fhDigiMapXZ->Fill(dX, dZ);
2447 fhDigiMapYZ->Fill(dY, dZ);
2448
2449 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
2450 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
2451 fhDigiMapAng->Fill(dThetaX, dThetaY);
2452
2453 Double_t dTheta = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY),
2454 dZ); // *180.0/TMath::Pi();
2455 Double_t dPhi = TMath::ATan2(dY, dX); // *180.0/TMath::Pi();
2456 fhDigiMapSph->Fill(dTheta, dPhi);
2457 } // for( Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++ )
2458 } // if( kTRUE == fDigiBdfPar->UseExpandedDigi() )
2459 } // if( kFALSE == fbHitProducerSource )
2460
2461 // Loop Over Hits
2462 Int_t iNbTofHitsSingPnt = 0;
2463 Int_t iNbTofHitsMultPnt = 0;
2464 Int_t iNbTofHitsSingTrk = 0;
2465 Int_t iNbTofHitsMultTrk = 0;
2466 for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
2467 std::vector<Int_t> vTofPointsId;
2468 std::vector<Int_t> vTofTracksId;
2469 std::vector<Double_t> vTofTracksWeight;
2470 std::vector<Int_t> vTofTracksFirstPntId;
2471 Double_t dPntMeanPosX = 0;
2472 Double_t dPntMeanPosY = 0;
2473 Double_t dPntMeanPosZ = 0;
2474 Double_t dPntMeanTime = 0;
2475 Double_t dTrkMeanPosX = 0;
2476 Double_t dTrkMeanPosY = 0;
2477 Double_t dTrkMeanPosZ = 0;
2478 Double_t dTrkMeanTime = 0;
2479 Int_t iClosestPntIdx = -1;
2480 Double_t dClosestPntDr = 1e18;
2481 Int_t iFurthestPntIdx = -1;
2482 Double_t dFurthestPntDr = -1;
2483 Int_t iClosestTrkIdx = -1;
2484 Double_t dClosestTrkDr = 1e18;
2485 Int_t iFurthestTrkIdx = -1;
2486 Double_t dFurthestTrkDr = -1;
2487
2488 pTofHit = (CbmTofHit*) fTofHitsColl->At(iHitInd);
2489 pMatchHitPnt = (CbmMatch*) fTofHitMatchColl->At(iHitInd);
2490 Int_t iNbPntHit = pMatchHitPnt->GetNofLinks();
2491
2492 Double_t dX = pTofHit->GetX();
2493 Double_t dY = pTofHit->GetY();
2494 Double_t dZ = pTofHit->GetZ();
2495 Double_t dErrX = pTofHit->GetDx();
2496 Double_t dErrY = pTofHit->GetDy();
2497 Double_t dErrZ = pTofHit->GetDz();
2498 Double_t dErrT = pTofHit->GetTimeError() * 1000.0;
2499 // Double_t dErrR = TMath::Sqrt( dErrX*dErrX + dErrY*dErrY + dErrZ*dErrZ );
2500 Double_t dErrR = TMath::Sqrt(dErrX * dErrX + dErrY * dErrY);
2501
2502 Int_t iClusterSize = pTofHit->GetClusterSize();
2503 /*
2504 LOG(info) << "Hit errors = X "
2505 << dErrX << " Y " << dErrY << " Z " << dErrZ
2506 << " T " << dErrT
2507 << " R " << dErrR
2508 ;
2509*/
2510 fhHitMapXY->Fill(dX, dY);
2511 fhHitMapXZ->Fill(dX, dZ);
2512 fhHitMapYZ->Fill(dY, dZ);
2513
2514 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
2515 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
2516 fhHitMapAng->Fill(dThetaX, dThetaY);
2517
2518 Double_t dTheta = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ); // *180.0/TMath::Pi();
2519 Double_t dPhi = TMath::ATan2(dY, dX); // *180.0/TMath::Pi();
2520 fhHitMapSph->Fill(dTheta, dPhi);
2521
2522 if (kFALSE == fbNormHistGenMode) {
2523 // Tests using the Digis as data
2524 if (kFALSE == fbHitProducerSource) {
2525 pMatchHitDigi = (CbmMatch*) fTofDigiMatchColl->At(iHitInd);
2526 Int_t iNbDigisHit = pMatchHitDigi->GetNofLinks();
2527 if (0 != iNbDigisHit % 2)
2528 LOG(fatal) << "CbmTofHitFinderQa::FillHistos => Nb of digis matching Hit #" << iHitInd << " in event #"
2529 << fEvents
2530 << " is not a multiple of 2 => should not happen as both ends of "
2531 "strp required!!!";
2532
2533 // Nb different TOF digis in Hit
2534 fhNbDigisInHit->Fill(iNbDigisHit);
2535 fhNbDigisInHitMapXY->Fill(dX, dY, iNbDigisHit);
2536
2537 // Loop over Digis inside Hit
2538 if (kTRUE == fDigiBdfPar->UseExpandedDigi()) {
2539 CbmTofDigi* pTofDigi;
2540 for (Int_t iDigi = 0; iDigi < iNbDigisHit; iDigi++) {
2541 CbmLink lDigi = pMatchHitDigi->GetLink(iDigi);
2542 Int_t iDigiIdx = lDigi.GetIndex();
2543
2544 if (iNbTofDigis <= iDigiIdx) {
2545 LOG(error) << "CbmTofHitFinderQa::FillHistos => Digi index from Hit #" << iHitInd << " in event #"
2546 << fEvents << " is bigger than nb entries in Digis arrays => ignore it!!!";
2547 continue;
2548 } // if( iNbTofDigis <= iDigiIdx )
2549
2550 pTofDigi = (CbmTofDigi*) fTofDigisColl->At(iDigiIdx);
2551 pMatchDigiPnt = (CbmMatch*) fTofDigiMatchPointsColl->At(iDigiIdx);
2552
2553 CbmLink lPt = pMatchDigiPnt->GetMatchedLink();
2554 Int_t iPtIdx = lPt.GetIndex();
2555 Int_t iTrkId = ((CbmTofPoint*) fTofPointsColl->At(iPtIdx))->GetTrackID();
2556
2557 Int_t iSmType = pTofDigi->GetType();
2558 Int_t iSm = pTofDigi->GetSm();
2559 Int_t iRpc = pTofDigi->GetRpc();
2560 Int_t iCh = pTofDigi->GetChannel();
2561 Int_t iGlobalChan = iCh + fvRpcChOffs[iSmType][iSm][iRpc];
2562
2563 // Check Left-Right MC missmatch (digis match always stored by pairs)
2564 if (0 == iDigi % 2) {
2565 // Get Info about the other end of the strip
2566 pMatchDigiPntB = (CbmMatch*) fTofDigiMatchPointsColl->At(iDigiIdx + 1);
2567
2568 CbmLink lPtB = pMatchDigiPntB->GetMatchedLink();
2569 Int_t iPtIdxB = lPtB.GetIndex();
2570
2571 // Check Left-Right missmatch for MC Point
2572 if (iPtIdx != iPtIdxB) {
2573 // Check Left-Right missmatch for MC Track
2574 if (iTrkId != ((CbmTofPoint*) fTofPointsColl->At(iPtIdxB))->GetTrackID()) {
2575 fhLeftRightDigiMatch->Fill(iGlobalChan, 2);
2576 } // if( iTrkId != ((CbmTofPoint*) fTofPointsColl->At(iPtIdxB))->GetTrackID() )
2577 else
2578 fhLeftRightDigiMatch->Fill(iGlobalChan, 1);
2579 } // if( iPtIdx != iPtIdxB )
2580 else
2581 fhLeftRightDigiMatch->Fill(iGlobalChan, 0);
2582
2583 } // if( 0 == iDigi%2 )
2584 } // for( Int_t iDigiIdx = 0; iDigiIdx < iNbDigisHit; iDigiIdx++)
2585 } // if( kTRUE == fDigiBdfPar->UseExpandedDigi() )
2586 } // if( kFALSE == fbHitProducerSource )
2587
2588 // Tests independent of the Digis
2589 for (Int_t iPnt = 0; iPnt < iNbPntHit; iPnt++) {
2590 CbmLink lPnt = pMatchHitPnt->GetLink(iPnt);
2591 Int_t iPtIdx = lPnt.GetIndex();
2592
2593 if (iNbTofPts <= iPtIdx) {
2594 LOG(error) << "CbmTofHitFinderQa::FillHistos => Pnt index from Hit #" << iHitInd << " in event #" << fEvents
2595 << " is bigger than nb entries in TofPoints arrays => ignore it!!!";
2596 continue;
2597 } // if( iNbTofDigis <= iDigiIdx )
2598
2599 fhPointMatchWeight->Fill(lPnt.GetWeight());
2600
2601 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iPtIdx);
2602 if (kTRUE == fbRealPointAvail) {
2603 // Always only one mean MC Point Index per MC TofPoint
2604 // Weight always 1.0 so just read the index
2605 Int_t iRealPntIdx = (((CbmMatch*) fRealTofMatchColl->At(iPtIdx))->GetLink(0)).GetIndex();
2606 pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(iRealPntIdx);
2607 iPtIdx = iRealPntIdx;
2608 } // if( kTRUE == fbRealPointAvail )
2609
2610 Int_t iTrkId = pTofPoint->GetTrackID();
2611
2612 // MC Track losses
2613 if (kFALSE == vbTrackHasHit[iTrkId]) vbTrackHasHit[iTrkId] = kTRUE;
2614
2615 // Count Nb different MC Points in Hit
2616 Bool_t bPointFound = kFALSE;
2617 for (UInt_t uPrevPtIdx = 0; uPrevPtIdx < vTofPointsId.size(); uPrevPtIdx++)
2618 if (iPtIdx == vTofPointsId[uPrevPtIdx]) {
2619 bPointFound = kTRUE;
2620 break;
2621 } // if( iPtIdx == vTofPointsId[uPrevPtIdx] )
2622 if (kFALSE == bPointFound) {
2623 vTofPointsId.push_back(iPtIdx);
2624
2625 // Obtain Point position
2626 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iPtIdx);
2627 TVector3 vPntPos;
2628 pTofPoint->Position(vPntPos);
2629
2630 // Compute mean MC Points position (X, Y, Z, T)
2631 dPntMeanPosX += vPntPos.X();
2632 dPntMeanPosY += vPntPos.Y();
2633 dPntMeanPosZ += vPntPos.Z();
2634 dPntMeanTime += pTofPoint->GetTime();
2635
2636 // Check if closest MC Point to Hit position
2637 Double_t dPntDeltaR =
2638 TMath::Sqrt((dX - vPntPos.X()) * (dX - vPntPos.X()) + (dY - vPntPos.Y()) * (dY - vPntPos.Y()));
2639 // + (dZ - vPntPos.Z())*(dZ - vPntPos.Z()) );
2640 if (dPntDeltaR < dClosestPntDr) {
2641 iClosestPntIdx = iPtIdx;
2642 dClosestPntDr = dPntDeltaR;
2643 } // if( dPntDeltaR < dClosestPntDr )
2644 // Check if furthest MC Point to Hit position
2645 if (dFurthestPntDr < dPntDeltaR) {
2646 iFurthestPntIdx = iPtIdx;
2647 dFurthestPntDr = dPntDeltaR;
2648 } // if( dFurthestPntDr < dPntDeltaR )
2649 } // if( kFALSE == bPointFound )
2650
2651 // Count Nb different MC Tracks in Hit
2652 // Build a list of Track weigths
2653 Bool_t bTrackFound = kFALSE;
2654 for (UInt_t uPrevTrkIdx = 0; uPrevTrkIdx < vTofTracksId.size(); uPrevTrkIdx++)
2655 if (iTrkId == vTofTracksId[uPrevTrkIdx]) {
2656 bTrackFound = kTRUE;
2657 vTofTracksWeight[uPrevTrkIdx] += lPnt.GetWeight();
2658 break;
2659 } // if( iTrkId == vTofPointsId[uPrevTrkIdx] )
2660 if (kFALSE == bTrackFound) {
2661 vTofTracksId.push_back(iTrkId);
2662 vTofTracksWeight.push_back(lPnt.GetWeight());
2663 vTofTracksFirstPntId.push_back(iPtIdx);
2664
2665 // Obtain Point position (Consider 1st Pnt of each Trk is approximate coord)
2666 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iPtIdx);
2667 TVector3 vPntPos;
2668 pTofPoint->Position(vPntPos);
2669
2670 // Compute mean MC Tracks position (X, Y, Z, T)
2671 dTrkMeanPosX += vPntPos.X();
2672 dTrkMeanPosY += vPntPos.Y();
2673 dTrkMeanPosZ += vPntPos.Z();
2674 dTrkMeanTime += pTofPoint->GetTime();
2675
2676 // Check if closest MC track to Hit position
2677 Double_t dTrkDeltaR =
2678 TMath::Sqrt((dX - vPntPos.X()) * (dX - vPntPos.X()) + (dY - vPntPos.Y()) * (dY - vPntPos.Y()));
2679 // + (dZ - vPntPos.Z())*(dZ - vPntPos.Z()) );
2680 if (dTrkDeltaR < dClosestTrkDr) {
2681 iClosestTrkIdx = iPtIdx;
2682 dClosestTrkDr = dTrkDeltaR;
2683 } // if( dTrkDeltaR < dClosestTrkDr )
2684 // Check if furthest MC track to Hit position
2685 if (dFurthestTrkDr < dTrkDeltaR) {
2686 iFurthestTrkIdx = iPtIdx;
2687 dFurthestTrkDr = dTrkDeltaR;
2688 } // if( dFurthestTrkDr < dTrkDeltaR )
2689 } // if( kFALSE == bTrackFound )
2690 } // for( Int_t iPnt = 0; iPnt < iNbPntHit; iPnt++)
2691
2692 // Count Nb different MC Points in Hit
2693 UInt_t uNbPointsInHit = vTofPointsId.size();
2694 fhNbPointsInHit->Fill(uNbPointsInHit);
2695 // Count Nb different MC Tracks in Hit
2696 UInt_t uNbTracksInHit = vTofTracksId.size();
2697 fhNbTracksInHit->Fill(uNbTracksInHit);
2698
2699 // Keep track of MC tracks part of at least one TOF Hit
2700 UInt_t uHitTrk;
2701 for (UInt_t uTrkInHit = 0; uTrkInHit < vTofTracksId.size(); uTrkInHit++) {
2702 for (uHitTrk = 0; uHitTrk < fvulIdxTracksWithHit.size(); uHitTrk++)
2703 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxTracksWithHit[uHitTrk]) break;
2704 if (fvulIdxTracksWithHit.size() == uHitTrk) fvulIdxTracksWithHit.push_back(vTofTracksId[uTrkInHit]);
2705
2706 // Get a pointer to the corresponding MC Track
2707 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(vTofTracksId[uTrkInHit]);
2708
2709 if (-1 == pMcTrk->GetMotherId()) {
2710 for (uHitTrk = 0; uHitTrk < fvulIdxPrimTracksWithHit.size(); uHitTrk++)
2711 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxPrimTracksWithHit[uHitTrk]) break;
2712 if (fvulIdxPrimTracksWithHit.size() == uHitTrk) fvulIdxPrimTracksWithHit.push_back(vTofTracksId[uTrkInHit]);
2713 } // if( -1 == pMcTrk->GetMotherId() )
2714 else {
2715 for (uHitTrk = 0; uHitTrk < fvulIdxSecTracksWithHit.size(); uHitTrk++)
2716 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxSecTracksWithHit[uHitTrk]) break;
2717 if (fvulIdxSecTracksWithHit.size() == uHitTrk) fvulIdxSecTracksWithHit.push_back(vTofTracksId[uTrkInHit]);
2718 } // else of if( -1 == pMcTrk->GetMotherId() )
2719
2720 // Check as function of Nb gaps crossed
2721 UInt_t uNbTofPnt = pMcTrk->GetNPoints(ECbmModuleId::kTof) - 1;
2722 if (uNbTofPnt < fuMaxCrossedGaps) {
2723 for (uHitTrk = 0; uHitTrk < fvulIdxTracksWithHitGaps[uNbTofPnt].size(); uHitTrk++)
2724 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxTracksWithHitGaps[uNbTofPnt][uHitTrk]) break;
2725 if (fvulIdxTracksWithHitGaps[uNbTofPnt].size() == uHitTrk)
2726 fvulIdxTracksWithHitGaps[uNbTofPnt].push_back(vTofTracksId[uTrkInHit]);
2727
2728 if (-1 == pMcTrk->GetMotherId()) {
2729 for (uHitTrk = 0; uHitTrk < fvulIdxPrimTracksWithHitGaps[uNbTofPnt].size(); uHitTrk++)
2730 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxPrimTracksWithHitGaps[uNbTofPnt][uHitTrk])
2731 break;
2732 if (fvulIdxPrimTracksWithHitGaps[uNbTofPnt].size() == uHitTrk)
2733 fvulIdxPrimTracksWithHitGaps[uNbTofPnt].push_back(vTofTracksId[uTrkInHit]);
2734 } // if( -1 == pMcTrk->GetMotherId() )
2735 else {
2736 for (uHitTrk = 0; uHitTrk < fvulIdxSecTracksWithHitGaps[uNbTofPnt].size(); uHitTrk++)
2737 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxSecTracksWithHitGaps[uNbTofPnt][uHitTrk])
2738 break;
2739 if (fvulIdxSecTracksWithHitGaps[uNbTofPnt].size() == uHitTrk)
2740 fvulIdxSecTracksWithHitGaps[uNbTofPnt].push_back(vTofTracksId[uTrkInHit]);
2741 } // else of if( -1 == pMcTrk->GetMotherId() )
2742 } // if( static_cast<UInt_t>(pMcTrk->GetNPoints(ECbmModuleId::kTof)) < fuMaxCrossedGaps + 1 )
2743
2744 if (0 == vTofTracksWeight[uTrkInHit]) {
2745 // Tracks generating only signal hidden under signal from other tracks!
2746
2747 for (uHitTrk = 0; uHitTrk < fvulIdxHiddenTracksWithHit.size(); uHitTrk++)
2748 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxHiddenTracksWithHit[uHitTrk]) break;
2749 if (fvulIdxHiddenTracksWithHit.size() == uHitTrk)
2750 fvulIdxHiddenTracksWithHit.push_back(vTofTracksId[uTrkInHit]);
2751
2752 // Get a pointer to the corresponding MC Track
2753 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(vTofTracksId[uTrkInHit]);
2754
2755 if (-1 == pMcTrk->GetMotherId()) {
2756 for (uHitTrk = 0; uHitTrk < fvulIdxHiddenPrimTracksWithHit.size(); uHitTrk++)
2757 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxHiddenPrimTracksWithHit[uHitTrk]) break;
2758 if (fvulIdxHiddenPrimTracksWithHit.size() == uHitTrk)
2759 fvulIdxHiddenPrimTracksWithHit.push_back(vTofTracksId[uTrkInHit]);
2760 } // if( -1 == pMcTrk->GetMotherId() )
2761 else {
2762 for (uHitTrk = 0; uHitTrk < fvulIdxHiddenSecTracksWithHit.size(); uHitTrk++)
2763 if (static_cast<ULong64_t>(vTofTracksId[uTrkInHit]) == fvulIdxHiddenSecTracksWithHit[uHitTrk]) break;
2764 if (fvulIdxHiddenSecTracksWithHit.size() == uHitTrk)
2765 fvulIdxHiddenSecTracksWithHit.push_back(vTofTracksId[uTrkInHit]);
2766 } // else of if( -1 == pMcTrk->GetMotherId() )
2767 } // if( 0 == vTofTracksWeight[uTrkInHit] )
2768 } // for( UInt_t uTrkInHit = 0; uTrkInHit < vTofTracksId.size(); uTrkInHit ++)
2769
2770 // Check Hit Quality for Hits coming from a single MC Point
2771 if (1 == uNbPointsInHit) {
2772 iNbTofHitsSingPnt++;
2773
2774 fhHitMapSingPntXY->Fill(dX, dY);
2775 fhHitMapSingPntXZ->Fill(dX, dZ);
2776 fhHitMapSingPntYZ->Fill(dY, dZ);
2777 fhHitMapSingPntAng->Fill(dThetaX, dThetaY);
2778 fhHitMapSingPntSph->Fill(dTheta, dPhi);
2779
2780 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At(vTofPointsId[0]);
2781 if (kTRUE == fbRealPointAvail) pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(vTofPointsId[0]);
2782 else
2783 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(vTofPointsId[0]);
2784
2785 // Obtain Point position
2786 TVector3 vPntPos;
2787 pTofPoint->Position(vPntPos);
2788
2789 Double_t dDeltaX = dX - vPntPos.X();
2790 Double_t dDeltaY = dY - vPntPos.Y();
2791 Double_t dDeltaZ = dZ - vPntPos.Z();
2792 Double_t dDeltaR = TMath::Sqrt(dDeltaX * dDeltaX + dDeltaY * dDeltaY);
2793 Double_t dDeltaT = 1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime());
2794
2795 fhSinglePointHitDeltaX->Fill(dDeltaX);
2796 fhSinglePointHitDeltaY->Fill(dDeltaY);
2797 fhSinglePointHitDeltaZ->Fill(dDeltaZ);
2798 fhSinglePointHitDeltaR->Fill(dDeltaR);
2799 fhSinglePointHitDeltaT->Fill(dDeltaT);
2800 fhSinglePointHitPullX->Fill(dDeltaX / dErrX);
2801 fhSinglePointHitPullY->Fill(dDeltaY / dErrY);
2802 fhSinglePointHitPullZ->Fill(dDeltaZ / dErrZ); // Offset(s) bec. hit assigned to middle of det.
2803 fhSinglePointHitPullR->Fill(dDeltaR / dErrR);
2804 fhSinglePointHitPullT->Fill(dDeltaT / dErrT);
2805
2806 fhCltSzSinglePointHitPullX->Fill(dDeltaX / dErrX, iClusterSize);
2807 fhCltSzSinglePointHitPullY->Fill(dDeltaY / dErrY, iClusterSize);
2808 fhCltSzSinglePointHitPullZ->Fill(dDeltaZ / dErrZ,
2809 iClusterSize); // Offset(s) bec. hit assigned to middle of det.
2810 fhCltSzSinglePointHitPullR->Fill(dDeltaR / dErrR, iClusterSize);
2811 fhCltSzSinglePointHitPullT->Fill(dDeltaT / dErrT, iClusterSize);
2812 } // if( 1 == vTofPointsId.size() )
2813 // For Hits with multiple MC Points
2814 else {
2815 iNbTofHitsMultPnt++;
2816
2817 fhHitMapMultPntXY->Fill(dX, dY);
2818 fhHitMapMultPntXZ->Fill(dX, dZ);
2819 fhHitMapMultPntYZ->Fill(dY, dZ);
2820 fhHitMapMultPntAng->Fill(dThetaX, dThetaY);
2821 fhHitMapMultPntSph->Fill(dTheta, dPhi);
2822
2823 // Check Hit Quality relative to mean of all MC Points
2824 dPntMeanPosX /= vTofPointsId.size();
2825 dPntMeanPosY /= vTofPointsId.size();
2826 dPntMeanPosZ /= vTofPointsId.size();
2827 dPntMeanTime /= vTofPointsId.size();
2828
2829 Double_t dDeltaMeanX = dX - dPntMeanPosX;
2830 Double_t dDeltaMeanY = dY - dPntMeanPosY;
2831 Double_t dDeltaMeanZ = dZ - dPntMeanPosZ;
2832 Double_t dDeltaMeanR = TMath::Sqrt(dDeltaMeanX * dDeltaMeanX + dDeltaMeanY * dDeltaMeanY);
2833 Double_t dDeltaMeanT = 1000.0 * (pTofHit->GetTime() - dPntMeanTime);
2834
2835 fhMultiPntHitMeanDeltaX->Fill(dDeltaMeanX, uNbPointsInHit);
2836 fhMultiPntHitMeanDeltaY->Fill(dDeltaMeanY, uNbPointsInHit);
2837 fhMultiPntHitMeanDeltaZ->Fill(dDeltaMeanZ, uNbPointsInHit);
2838 fhMultiPntHitMeanDeltaR->Fill(dDeltaMeanR, uNbPointsInHit);
2839 fhMultiPntHitMeanDeltaT->Fill(dDeltaMeanT, uNbPointsInHit);
2840 fhMultiPntHitMeanPullX->Fill(dDeltaMeanX / dErrX, uNbPointsInHit);
2841 fhMultiPntHitMeanPullY->Fill(dDeltaMeanY / dErrY, uNbPointsInHit);
2842 fhMultiPntHitMeanPullZ->Fill(dDeltaMeanZ / dErrZ,
2843 uNbPointsInHit); // Offset(s) bec. hit assigned to middle of det.
2844 fhMultiPntHitMeanPullR->Fill(dDeltaMeanR / dErrR, uNbPointsInHit);
2845 fhMultiPntHitMeanPullT->Fill(dDeltaMeanT / dErrT, uNbPointsInHit);
2846
2847 // Check Hit Quality relative to closest MC Point
2848 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iClosestPntIdx);
2849 if (kTRUE == fbRealPointAvail) pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(iClosestPntIdx);
2850 else
2851 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iClosestPntIdx);
2852
2853 // Obtain Point position
2854 TVector3 vPntPosClo;
2855 pTofPoint->Position(vPntPosClo);
2856
2857 Double_t dDeltaCloX = dX - vPntPosClo.X();
2858 Double_t dDeltaCloY = dY - vPntPosClo.Y();
2859 Double_t dDeltaCloZ = dZ - vPntPosClo.Z();
2860 Double_t dDeltaCloR = TMath::Sqrt(dDeltaCloX * dDeltaCloX + dDeltaCloY * dDeltaCloY);
2861 Double_t dDeltaCloT = 1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime());
2862
2863 fhMultiPntHitClosestDeltaX->Fill(dDeltaCloX, uNbPointsInHit);
2864 fhMultiPntHitClosestDeltaY->Fill(dDeltaCloY, uNbPointsInHit);
2865 fhMultiPntHitClosestDeltaZ->Fill(dDeltaCloZ, uNbPointsInHit);
2866 fhMultiPntHitClosestDeltaR->Fill(dDeltaCloR, uNbPointsInHit);
2867 fhMultiPntHitClosestDeltaT->Fill(dDeltaCloT, uNbPointsInHit);
2868 fhMultiPntHitClosestPullX->Fill(dDeltaCloX / dErrX, uNbPointsInHit);
2869 fhMultiPntHitClosestPullY->Fill(dDeltaCloY / dErrY, uNbPointsInHit);
2870 fhMultiPntHitClosestPullZ->Fill(dDeltaCloZ / dErrZ,
2871 uNbPointsInHit); // Offset(s) bec. hit assigned to middle of det.
2872 fhMultiPntHitClosestPullR->Fill(dDeltaCloR / dErrR, uNbPointsInHit);
2873 fhMultiPntHitClosestPullT->Fill(dDeltaCloT / dErrT, uNbPointsInHit);
2874
2875 // Check Hit Quality relative to furthest MC Point
2876 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iFurthestPntIdx);
2877 if (kTRUE == fbRealPointAvail) pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(iFurthestPntIdx);
2878 else
2879 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iFurthestPntIdx);
2880
2881 // Obtain Point position
2882 TVector3 vPntPosFar;
2883 pTofPoint->Position(vPntPosFar);
2884
2885 Double_t dDeltaFarX = dX - vPntPosFar.X();
2886 Double_t dDeltaFarY = dY - vPntPosFar.Y();
2887 Double_t dDeltaFarZ = dZ - vPntPosFar.Z();
2888 Double_t dDeltaFarR = TMath::Sqrt(dDeltaFarX * dDeltaFarX + dDeltaFarY * dDeltaFarY);
2889 Double_t dDeltaFarT = 1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime());
2890
2891 fhMultiPntHitFurthestDeltaX->Fill(dDeltaFarX, uNbPointsInHit);
2892 fhMultiPntHitFurthestDeltaY->Fill(dDeltaFarY, uNbPointsInHit);
2893 fhMultiPntHitFurthestDeltaZ->Fill(dDeltaFarZ, uNbPointsInHit);
2894 fhMultiPntHitFurthestDeltaR->Fill(dDeltaFarR, uNbPointsInHit);
2895 fhMultiPntHitFurthestDeltaT->Fill(dDeltaFarT, uNbPointsInHit);
2896 fhMultiPntHitFurthestPullX->Fill(dDeltaFarX / dErrX, uNbPointsInHit);
2897 fhMultiPntHitFurthestPullY->Fill(dDeltaFarY / dErrY, uNbPointsInHit);
2898 fhMultiPntHitFurthestPullZ->Fill(dDeltaFarZ / dErrZ,
2899 uNbPointsInHit); // Offset(s) bec. hit assigned to middle of det.
2900 fhMultiPntHitFurthestPullR->Fill(dDeltaFarR / dErrR, uNbPointsInHit);
2901 fhMultiPntHitFurthestPullT->Fill(dDeltaFarT / dErrT, uNbPointsInHit);
2902
2903 // Check Quality to best Point match (highest sum of TOT)
2904 // Do not fill it in Hit producer case as both strip ends receive a same weigth of 1/2
2905 if (kFALSE == fbHitProducerSource) {
2906 CbmLink lPnt = pMatchHitPnt->GetMatchedLink();
2907 Int_t iPtIdx = lPnt.GetIndex();
2908 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iPtIdx);
2909 if (kTRUE == fbRealPointAvail) {
2910 // Always only one mean MC Point Index per MC TofPoint
2911 // Weight always 1.0 so just read the index
2912 Int_t iRealPntIdx = (((CbmMatch*) fRealTofMatchColl->At(iPtIdx))->GetLink(0)).GetIndex();
2913 pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(iRealPntIdx);
2914 iPtIdx = iRealPntIdx;
2915 } // if( kTRUE == fbRealPointAvail )
2916
2917 // Obtain Point position
2918 TVector3 vPntPosBest;
2919 pTofPoint->Position(vPntPosBest);
2920
2921 Double_t dDeltaBestX = dX - vPntPosBest.X();
2922 Double_t dDeltaBestY = dY - vPntPosBest.Y();
2923 Double_t dDeltaBestZ = dZ - vPntPosBest.Z();
2924 Double_t dDeltaBestR = TMath::Sqrt(dDeltaBestX * dDeltaBestX + dDeltaBestY * dDeltaBestY);
2925 Double_t dDeltaBestT = 1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime());
2926
2927 fhMultiPntHitBestDeltaX->Fill(dDeltaBestX, uNbPointsInHit);
2928 fhMultiPntHitBestDeltaY->Fill(dDeltaBestY, uNbPointsInHit);
2929 fhMultiPntHitBestDeltaZ->Fill(dDeltaBestZ, uNbPointsInHit);
2930 fhMultiPntHitBestDeltaR->Fill(dDeltaBestR, uNbPointsInHit);
2931 fhMultiPntHitBestDeltaT->Fill(dDeltaBestT, uNbPointsInHit);
2932 fhMultiPntHitBestPullX->Fill(dDeltaBestX / dErrX, uNbPointsInHit);
2933 fhMultiPntHitBestPullY->Fill(dDeltaBestY / dErrY, uNbPointsInHit);
2934 fhMultiPntHitBestPullZ->Fill(dDeltaBestZ / dErrZ,
2935 uNbPointsInHit); // Offset(s) bec. hit assigned to middle of det.
2936 fhMultiPntHitBestPullR->Fill(dDeltaBestR / dErrR, uNbPointsInHit);
2937 fhMultiPntHitBestPullT->Fill(dDeltaBestT / dErrT, uNbPointsInHit);
2938 } // if( kFALSE == fbHitProducerSource )
2939 } // else of if( 1 == vTofPointsId.size() )
2940
2941 // Check Hit Quality for Hits coming from a single MC Track
2942 if (1 == uNbTracksInHit) {
2943 iNbTofHitsSingTrk++;
2944
2945 fhHitMapSingTrkXY->Fill(dX, dY);
2946 fhHitMapSingTrkXZ->Fill(dX, dZ);
2947 fhHitMapSingTrkYZ->Fill(dY, dZ);
2948 fhHitMapSingTrkAng->Fill(dThetaX, dThetaY);
2949 fhHitMapSingTrkSph->Fill(dTheta, dPhi);
2950
2951 // => If all points come from the same track, any of them should give
2952 // the approximate position and time of the track at the detector level
2953 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At(vTofPointsId[0]);
2954 if (kTRUE == fbRealPointAvail) pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(vTofPointsId[0]);
2955 else
2956 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(vTofPointsId[0]);
2957
2958 // Obtain Point position
2959 TVector3 vPntPos;
2960 pTofPoint->Position(vPntPos);
2961
2962 Double_t dDeltaX = dX - vPntPos.X();
2963 Double_t dDeltaY = dY - vPntPos.Y();
2964 Double_t dDeltaZ = dZ - vPntPos.Z();
2965 Double_t dDeltaR = TMath::Sqrt(dDeltaX * dDeltaX + dDeltaY * dDeltaY);
2966 Double_t dDeltaT = 1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime());
2967
2968 fhSingleTrackHitDeltaX->Fill(dDeltaX);
2969 fhSingleTrackHitDeltaY->Fill(dDeltaY);
2970 fhSingleTrackHitDeltaZ->Fill(dDeltaZ);
2971 fhSingleTrackHitDeltaR->Fill(dDeltaR);
2972 fhSingleTrackHitDeltaT->Fill(dDeltaT);
2973 fhSingleTrackHitPullX->Fill(dDeltaX / dErrX);
2974 fhSingleTrackHitPullY->Fill(dDeltaY / dErrY);
2975 fhSingleTrackHitPullZ->Fill(dDeltaZ / dErrZ); // Offset(s) bec. hit assigned to middle of det.
2976 fhSingleTrackHitPullR->Fill(dDeltaR / dErrR);
2977 fhSingleTrackHitPullT->Fill(dDeltaT / dErrT);
2978
2979 if (1 < uNbPointsInHit) {
2980 fhSingTrkMultiPntHitDeltaX->Fill(dDeltaX);
2981 fhSingTrkMultiPntHitDeltaY->Fill(dDeltaY);
2982 fhSingTrkMultiPntHitDeltaZ->Fill(dDeltaZ);
2983 fhSingTrkMultiPntHitDeltaR->Fill(dDeltaR);
2984 fhSingTrkMultiPntHitDeltaT->Fill(1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime()));
2985 fhSingTrkMultiPntHitPullX->Fill(dDeltaX / dErrX);
2986 fhSingTrkMultiPntHitPullY->Fill(dDeltaY / dErrY);
2987 fhSingTrkMultiPntHitPullZ->Fill(dDeltaZ / dErrZ); // Offset(s) bec. hit assigned to middle of det.
2988 fhSingTrkMultiPntHitPullR->Fill(dDeltaR / dErrR);
2989 fhSingTrkMultiPntHitPullT->Fill(dDeltaT / dErrT);
2990 } // if( 1 < uNbPointsInHit )
2991
2992 // Get the MC track and fill its length up to the TOF point in the proper histo
2993 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(pTofPoint->GetTrackID());
2994
2995 Int_t iPdgCode = pMcTrk->GetPdgCode();
2996 Int_t iPartIdx = -1;
2997 for (Int_t iPart = 0; iPart < kiNbPart; iPart++)
2998 if (kiPartPdgCode[iPart] == iPdgCode) {
2999 iPartIdx = iPart;
3000 break;
3001 } // if( kiPartPdgCode[iPart] == iPdgCode )
3002 if (-1 == iPartIdx) iPartIdx = 0;
3003 if (-1 == pMcTrk->GetMotherId()) fhMcTrkStartPrimSingTrk->Fill(pMcTrk->GetStartZ(), iPartIdx);
3004 else
3005 fhMcTrkStartSecSingTrk->Fill(pMcTrk->GetStartZ(), iPartIdx);
3006 } // if( 1 == vTofTracksId.size() )
3007 // For Hits with multiple MC Tracks
3008 else {
3009 iNbTofHitsMultTrk++;
3010
3011 fhHitMapMultTrkXY->Fill(dX, dY);
3012 fhHitMapMultTrkXZ->Fill(dX, dZ);
3013 fhHitMapMultTrkYZ->Fill(dY, dZ);
3014 fhHitMapMultTrkAng->Fill(dThetaX, dThetaY);
3015 fhHitMapMultTrkSph->Fill(dTheta, dPhi);
3016
3017 // Check Hit Quality relative to mean of all MC Tracks
3018 dTrkMeanPosX /= vTofTracksId.size();
3019 dTrkMeanPosY /= vTofTracksId.size();
3020 dTrkMeanPosZ /= vTofTracksId.size();
3021 dTrkMeanTime /= vTofTracksId.size();
3022
3023 Double_t dDeltaMeanX = dX - dTrkMeanPosX;
3024 Double_t dDeltaMeanY = dY - dTrkMeanPosY;
3025 Double_t dDeltaMeanZ = dZ - dTrkMeanPosZ;
3026 Double_t dDeltaMeanR = TMath::Sqrt(dDeltaMeanX * dDeltaMeanX + dDeltaMeanY * dDeltaMeanY);
3027 Double_t dDeltaMeanT = 1000.0 * (pTofHit->GetTime() - dTrkMeanTime);
3028
3029 fhMultiTrkHitMeanDeltaX->Fill(dDeltaMeanX, uNbTracksInHit);
3030 fhMultiTrkHitMeanDeltaY->Fill(dDeltaMeanY, uNbTracksInHit);
3031 fhMultiTrkHitMeanDeltaZ->Fill(dDeltaMeanZ, uNbTracksInHit);
3032 fhMultiTrkHitMeanDeltaR->Fill(dDeltaMeanR, uNbTracksInHit);
3033 fhMultiTrkHitMeanDeltaT->Fill(dDeltaMeanT, uNbTracksInHit);
3034 fhMultiTrkHitMeanPullX->Fill(dDeltaMeanX / dErrX, uNbTracksInHit);
3035 fhMultiTrkHitMeanPullY->Fill(dDeltaMeanY / dErrY, uNbTracksInHit);
3036 fhMultiTrkHitMeanPullZ->Fill(dDeltaMeanZ / dErrZ,
3037 uNbTracksInHit); // Offset(s) bec. hit assigned to middle of det.
3038 fhMultiTrkHitMeanPullR->Fill(dDeltaMeanR / dErrR, uNbTracksInHit);
3039 fhMultiTrkHitMeanPullT->Fill(dDeltaMeanT / dErrT, uNbTracksInHit);
3040
3041 // Check Hit Quality relative to closest MC Tracks
3042 // Obtain Point position (Consider 1st Pnt of each Trk is approximate coord)
3043 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iClosestTrkIdx);
3044 if (kTRUE == fbRealPointAvail) pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(iClosestTrkIdx);
3045 else
3046 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iClosestTrkIdx);
3047
3048 TVector3 vPntPosClo;
3049 pTofPoint->Position(vPntPosClo);
3050
3051 Double_t dDeltaCloX = dX - vPntPosClo.X();
3052 Double_t dDeltaCloY = dY - vPntPosClo.Y();
3053 Double_t dDeltaCloZ = dZ - vPntPosClo.Z();
3054 Double_t dDeltaCloR = TMath::Sqrt(dDeltaCloX * dDeltaCloX + dDeltaCloY * dDeltaCloY);
3055 Double_t dDeltaCloT = 1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime());
3056
3057 fhMultiTrkHitClosestDeltaX->Fill(dDeltaCloX, uNbTracksInHit);
3058 fhMultiTrkHitClosestDeltaY->Fill(dDeltaCloY, uNbTracksInHit);
3059 fhMultiTrkHitClosestDeltaZ->Fill(dDeltaCloZ, uNbTracksInHit);
3060 fhMultiTrkHitClosestDeltaR->Fill(dDeltaCloR, uNbTracksInHit);
3061 fhMultiTrkHitClosestDeltaT->Fill(dDeltaCloT, uNbTracksInHit);
3062 fhMultiTrkHitClosestPullX->Fill(dDeltaCloX / dErrX, uNbTracksInHit);
3063 fhMultiTrkHitClosestPullY->Fill(dDeltaCloY / dErrY, uNbTracksInHit);
3064 fhMultiTrkHitClosestPullZ->Fill(dDeltaCloZ / dErrZ,
3065 uNbTracksInHit); // Offset(s) bec. hit assigned to middle of det.
3066 fhMultiTrkHitClosestPullR->Fill(dDeltaCloR / dErrR, uNbTracksInHit);
3067 fhMultiTrkHitClosestPullT->Fill(dDeltaCloT / dErrT, uNbTracksInHit);
3068
3069 // Check Hit Quality relative to furthest MC Tracks
3070 // Obtain Point position (Consider 1st Pnt of each Trk is approximate coord)
3071 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iFurthestTrkIdx);
3072 if (kTRUE == fbRealPointAvail) pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(iFurthestTrkIdx);
3073 else
3074 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iFurthestTrkIdx);
3075
3076 TVector3 vPntPosFar;
3077 pTofPoint->Position(vPntPosFar);
3078
3079 Double_t dDeltaFarX = dX - vPntPosFar.X();
3080 Double_t dDeltaFarY = dY - vPntPosFar.Y();
3081 Double_t dDeltaFarZ = dZ - vPntPosFar.Z();
3082 Double_t dDeltaFarR = TMath::Sqrt(dDeltaFarX * dDeltaFarX + dDeltaFarY * dDeltaFarY);
3083 Double_t dDeltaFarT = 1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime());
3084
3085 fhMultiTrkHitFurthestDeltaX->Fill(dDeltaFarX, uNbTracksInHit);
3086 fhMultiTrkHitFurthestDeltaY->Fill(dDeltaFarY, uNbTracksInHit);
3087 fhMultiTrkHitFurthestDeltaZ->Fill(dDeltaFarZ, uNbTracksInHit);
3088 fhMultiTrkHitFurthestDeltaR->Fill(dDeltaFarR, uNbTracksInHit);
3089 fhMultiTrkHitFurthestDeltaT->Fill(dDeltaFarT, uNbTracksInHit);
3090 fhMultiTrkHitFurthestPullX->Fill(dDeltaFarX / dErrX, uNbTracksInHit);
3091 fhMultiTrkHitFurthestPullY->Fill(dDeltaFarY / dErrY, uNbTracksInHit);
3092 fhMultiTrkHitFurthestPullZ->Fill(dDeltaFarZ / dErrZ,
3093 uNbTracksInHit); // Offset(s) bec. hit assigned to middle of det.
3094 fhMultiTrkHitFurthestPullR->Fill(dDeltaFarR / dErrR, uNbTracksInHit);
3095 fhMultiTrkHitFurthestPullT->Fill(dDeltaFarT / dErrT, uNbTracksInHit);
3096
3097 // Check Quality to best Track match (highest sum of TOT)
3098 // Do not fill it in Hit producer case as both strip ends receive a same weigth of 1/2
3099 if (kFALSE == fbHitProducerSource) {
3100 // Loop on tracks to find the one with the highest weight
3101 UInt_t uBestTrackIdx = 0;
3102 Double_t dBestTrackWeight = -1.0;
3103 for (UInt_t uTrkIdx = 0; uTrkIdx < vTofTracksId.size(); uTrkIdx++)
3104 if (dBestTrackWeight < vTofTracksWeight[uTrkIdx]) {
3105 uBestTrackIdx = uTrkIdx;
3106 dBestTrackWeight = vTofTracksWeight[uTrkIdx];
3107 } // if( dBestTrackWeight < vTofTracksWeight[uTrkIdx] )
3108
3109 // Obtain Point position (Consider 1st Pnt of each Trk is approximate coord)
3110 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At( vTofTracksFirstPntId[uBestTrackIdx] );
3111 if (kTRUE == fbRealPointAvail)
3112 pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(vTofTracksFirstPntId[uBestTrackIdx]);
3113 else
3114 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(vTofTracksFirstPntId[uBestTrackIdx]);
3115
3116 TVector3 vPntPosBest;
3117 pTofPoint->Position(vPntPosBest);
3118
3119 Double_t dDeltaBestX = dX - vPntPosBest.X();
3120 Double_t dDeltaBestY = dY - vPntPosBest.Y();
3121 Double_t dDeltaBestZ = dZ - vPntPosBest.Z();
3122 Double_t dDeltaBestR = TMath::Sqrt(dDeltaBestX * dDeltaBestX + dDeltaBestY * dDeltaBestY);
3123 Double_t dDeltaBestT = 1000.0 * (pTofHit->GetTime() - pTofPoint->GetTime());
3124
3125 fhMultiTrkHitBestDeltaX->Fill(dDeltaBestX, uNbTracksInHit);
3126 fhMultiTrkHitBestDeltaY->Fill(dDeltaBestY, uNbTracksInHit);
3127 fhMultiTrkHitBestDeltaZ->Fill(dDeltaBestZ, uNbTracksInHit);
3128 fhMultiTrkHitBestDeltaR->Fill(dDeltaBestR, uNbTracksInHit);
3129 fhMultiTrkHitBestDeltaT->Fill(dDeltaBestT, uNbTracksInHit);
3130 fhMultiTrkHitBestPullX->Fill(dDeltaBestX / dErrX, uNbTracksInHit);
3131 fhMultiTrkHitBestPullY->Fill(dDeltaBestY / dErrY, uNbTracksInHit);
3132 fhMultiTrkHitBestPullZ->Fill(dDeltaBestZ / dErrZ,
3133 uNbTracksInHit); // Offset(s) bec. hit assigned to middle of det.
3134 fhMultiTrkHitBestPullR->Fill(dDeltaBestR / dErrR, uNbTracksInHit);
3135 fhMultiTrkHitBestPullT->Fill(dDeltaBestT / dErrT, uNbTracksInHit);
3136 } // if( kFALSE == fbHitProducerSource )
3137
3138 // Get each MC track and fill its length up to the 1at TOF point in the proper histo
3139 for (UInt_t uTrkIdx = 0; uTrkIdx < vTofTracksId.size(); uTrkIdx++) {
3140 // pTofPoint = (CbmTofPoint*) fTofPointsColl->At( vTofTracksFirstPntId[uTrkIdx] );
3141 if (kTRUE == fbRealPointAvail)
3142 pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(vTofTracksFirstPntId[uTrkIdx]);
3143 else
3144 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(vTofTracksFirstPntId[uTrkIdx]);
3145
3146 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(pTofPoint->GetTrackID());
3147
3148 Int_t iPdgCode = pMcTrk->GetPdgCode();
3149 Int_t iPartIdx = -1;
3150 for (Int_t iPart = 0; iPart < kiNbPart; iPart++)
3151 if (kiPartPdgCode[iPart] == iPdgCode) {
3152 iPartIdx = iPart;
3153 break;
3154 } // if( kiPartPdgCode[iPart] == iPdgCode )
3155 if (-1 == iPartIdx) iPartIdx = 0;
3156 if (-1 == pMcTrk->GetMotherId()) fhMcTrkStartPrimMultiTrk->Fill(pMcTrk->GetStartZ(), iPartIdx);
3157 else
3158 fhMcTrkStartSecMultiTrk->Fill(pMcTrk->GetStartZ(), iPartIdx);
3159 } // for( UInt_t uTrkIdx = 0; uTrkIdx < vTofTracksId.size(); uTrkIdx++)
3160 } // else of if( 1 == vTofTracksId.size() )
3161
3162 // Physics coord mapping, 1 per particle type
3163 /*
3164 // Do as in CbmHadronAna: Take the MC Point of the first Digi matched with the hit
3165 pMatchHitDigi = (CbmMatch*) fTofDigiMatchColl->At( iHitInd );
3166 // Get index of first digi
3167 CbmLink lDigi = pMatchHitDigi->GetLink(0);
3168 Int_t iDigiIdx = lDigi.GetIndex();
3169 if( iNbTofDigis <= iDigiIdx )
3170 {
3171 LOG(error)<<"CbmTofHitFinderQa::FillHistos => Digi index from Hit #"
3172 <<iHitInd<<" in event #"<<fEvents
3173 <<" is bigger than nb entries in Digis arrays => ignore it!!!";
3174 continue;
3175 } // if( iNbTofDigis <= iDigiIdx )
3176 // Get pointer on match of first digi
3177 pMatchDigiPnt = (CbmMatch*) fTofDigiMatchPointsColl->At( iDigiIdx );
3178 // Get index of tof point corresponding to the first digi
3179 CbmLink lPt = pMatchDigiPnt->GetMatchedLink();
3180*/
3181 // Get point with the best match (highest weight), in HitProd this returns the left Pnt
3182 CbmLink lPt = pMatchHitPnt->GetMatchedLink();
3183 Int_t iPtIdx = lPt.GetIndex();
3184 // Get index of corresponding MC track
3185 Int_t iTrkId = ((CbmTofPoint*) fTofPointsColl->At(iPtIdx))->GetTrackID();
3186 if (kTRUE == fbRealPointAvail) {
3187 // Always only one mean MC Point Index per MC TofPoint
3188 // Weight always 1.0 so just read the index
3189 Int_t iRealPntIdx = (((CbmMatch*) fRealTofMatchColl->At(iPtIdx))->GetLink(0)).GetIndex();
3190 iTrkId = ((CbmTofPoint*) fRealTofPointsColl->At(iRealPntIdx))->GetTrackID();
3191 iPtIdx = iRealPntIdx;
3192 } // if( kTRUE == fbRealPointAvail )
3193
3194 // Get a pointer to the corresponding MC Track
3195 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(iTrkId);
3196
3197 Int_t iPdgCode = pMcTrk->GetPdgCode();
3198 Int_t iPartIdx = -1;
3199 for (Int_t iPart = 0; iPart < kiNbPart; iPart++)
3200 if (kiPartPdgCode[iPart] == iPdgCode) {
3201 iPartIdx = iPart;
3202 break;
3203 } // if( kiPartPdgCode[iPart] == iPdgCode )
3204 if (-1 == iPartIdx) iPartIdx = 0;
3205 if (-1 == pMcTrk->GetMotherId()) {
3206 // primary track
3207 // Phase space
3208 fvhPtmRapTofHit[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
3209 // PLab
3210 fvhPlabTofHit[iPartIdx]->Fill(pMcTrk->GetP());
3211 if (1 == vTofPointsId.size()) {
3212 fvhPtmRapTofHitSinglePnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
3213 fvhPlabTofHitSinglePnt[iPartIdx]->Fill(pMcTrk->GetP());
3214 } // if( 1 == vTofPointsId.size() )
3215 if (1 == vTofTracksId.size()) {
3216 fvhPtmRapTofHitSingleTrk[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
3217 fvhPlabTofHitSingleTrk[iPartIdx]->Fill(pMcTrk->GetP());
3218 } // if( 1 == vTofTracksId.size() )
3219 } // if( -1 == pMcTrk->GetMotherId() )
3220 else {
3221 // secondary track
3222 // Phase space
3223 fvhPtmRapSecTofHit[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
3224 // PLab
3225 fvhPlabSecTofHit[iPartIdx]->Fill(pMcTrk->GetP());
3226 if (1 == vTofPointsId.size()) {
3227 fvhPtmRapSecTofHitSinglePnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
3228 fvhPlabSecTofHitSinglePnt[iPartIdx]->Fill(pMcTrk->GetP());
3229 } // if( 1 == vTofPointsId.size() )
3230 if (1 == vTofTracksId.size()) {
3231 fvhPtmRapSecTofHitSingleTrk[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
3232 fvhPlabSecTofHitSingleTrk[iPartIdx]->Fill(pMcTrk->GetP());
3233 } // if( 1 == vTofTracksId.size() )
3234 } // else of if( -1 == pMcTrk->GetMotherId() )
3235 // clear storage of point and track IDs
3236 vTofPointsId.clear();
3237 vTofTracksId.clear();
3238 } // if( kFALSE == fbNormHistGenMode )
3239 } // for( Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++ )
3240
3241 // Nb Hits per event for first N events
3242 fhNbHitsPerEvent->Fill(fEvents, iNbTofHits);
3243 fhNbHitsSingPntPerEvent->Fill(fEvents, iNbTofHitsSingPnt);
3244 fhNbHitsMultPntPerEvent->Fill(fEvents, iNbTofHitsMultPnt);
3245 fhNbHitsSingTrkPerEvent->Fill(fEvents, iNbTofHitsSingTrk);
3246 fhNbHitsMultTrkPerEvent->Fill(fEvents, iNbTofHitsMultTrk);
3247
3248 // MC Tracks losses
3249 for (Int_t iTrkInd = 0; iTrkInd < iNbTracks; iTrkInd++) {
3250 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(iTrkInd);
3251
3252 if (kTRUE == vbTrackHasHit[iTrkInd]) {
3253 // Physics coord mapping, 1 per particle type
3254 Int_t iPdgCode = pMcTrk->GetPdgCode();
3255 Int_t iPartIdx = -1;
3256 for (Int_t iPart = 0; iPart < kiNbPart; iPart++)
3257 if (kiPartPdgCode[iPart] == iPdgCode) {
3258 iPartIdx = iPart;
3259 break;
3260 } // if( kiPartPdgCode[iPart] == iPdgCode )
3261 if (-1 == iPartIdx) iPartIdx = 0;
3262 if (-1 == pMcTrk->GetMotherId()) {
3263 // primary track
3264 fvhPtmRapGenTrkTofHit[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
3265 fvhPlabGenTrkTofHit[iPartIdx]->Fill(pMcTrk->GetP());
3266
3268 fvhPlabStsTrkTofHit[iPartIdx]->Fill(pMcTrk->GetP());
3269 } // if( -1 == pMcTrk->GetMotherId() )
3270 else {
3271 // secondary track
3272 fvhPtmRapSecGenTrkTofHit[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
3273 fvhPlabSecGenTrkTofHit[iPartIdx]->Fill(pMcTrk->GetP());
3274
3276 fvhPlabSecStsTrkTofHit[iPartIdx]->Fill(pMcTrk->GetP());
3277 } // else of if( -1 == pMcTrk->GetMotherId() )
3278 } // if( kTRUE == vbTrackHasHit[iTrkId] )
3279 } // for(Int_t iTrkInd = 0; iTrkInd < nMcTracks; iTrkInd++)
3280 vbTrackHasHit.clear();
3281
3282 // Integrated TofHit Efficiency
3283 if (0 < fvulIdxTracksWithPnt.size())
3284 fhIntegratedHitPntEff->Fill(100.0 * (static_cast<Double_t>(fvulIdxTracksWithHit.size()))
3285 / (static_cast<Double_t>(fvulIdxTracksWithPnt.size())));
3286 if (0 < fvulIdxPrimTracksWithPnt.size())
3287 fhIntegratedHitPntEffPrim->Fill(100.0 * (static_cast<Double_t>(fvulIdxPrimTracksWithHit.size()))
3288 / (static_cast<Double_t>(fvulIdxPrimTracksWithPnt.size())));
3289 if (0 < fvulIdxSecTracksWithPnt.size())
3290 fhIntegratedHitPntEffSec->Fill(100.0 * (static_cast<Double_t>(fvulIdxSecTracksWithHit.size()))
3291 / (static_cast<Double_t>(fvulIdxSecTracksWithPnt.size())));
3292
3293 // Integrated TofHit Efficiency: Tracks firing channel but not going to Digi/Hit
3294 if (0 < fvulIdxTracksWithPnt.size())
3295 fhIntegratedHiddenHitPntLoss->Fill(100.0 * (static_cast<Double_t>(fvulIdxHiddenTracksWithHit.size()))
3296 / (static_cast<Double_t>(fvulIdxTracksWithPnt.size())));
3297 if (0 < fvulIdxPrimTracksWithPnt.size())
3298 fhIntegratedHiddenHitPntLossPrim->Fill(100.0 * (static_cast<Double_t>(fvulIdxHiddenPrimTracksWithHit.size()))
3299 / (static_cast<Double_t>(fvulIdxPrimTracksWithPnt.size())));
3300 if (0 < fvulIdxSecTracksWithPnt.size())
3301 fhIntegratedHiddenHitPntLossSec->Fill(100.0 * (static_cast<Double_t>(fvulIdxHiddenSecTracksWithHit.size()))
3302 / (static_cast<Double_t>(fvulIdxSecTracksWithPnt.size())));
3303
3304 LOG(debug2) << "CbmTofHitFinderQa::FillHistos => nb prim trk w/ pnt: " << fvulIdxPrimTracksWithPnt.size()
3305 << " nb prim trk w/ hit: " << fvulIdxPrimTracksWithHit.size() << " ";
3306 // Efficiency dependence on nb crossed gaps
3307 TString sHead = "CbmTofHitFinderQa::FillHistos => N pnt: ";
3308 TString sPnt = "CbmTofHitFinderQa::FillHistos => nb prim trk w/ N pnt: ";
3309 TString sHit = "CbmTofHitFinderQa::FillHistos => nb prim trk w/ N pnt & hit: ";
3310 for (UInt_t uNbGaps = 0; uNbGaps < fuMaxCrossedGaps; uNbGaps++) {
3311 sHead += Form("%4u ", uNbGaps);
3312 sPnt += Form("%4lu ", fvulIdxPrimTracksWithPntGaps[uNbGaps].size());
3313 sHit += Form("%4lu ", fvulIdxPrimTracksWithHitGaps[uNbGaps].size());
3314
3315 if (0 < fvulIdxTracksWithPntGaps[uNbGaps].size())
3316 fhIntegratedHitPntEffGaps->Fill(100.0 * (static_cast<Double_t>(fvulIdxTracksWithHitGaps[uNbGaps].size()))
3317 / (static_cast<Double_t>(fvulIdxTracksWithPntGaps[uNbGaps].size())),
3318 uNbGaps + 1);
3319 if (0 < fvulIdxPrimTracksWithPntGaps[uNbGaps].size())
3320 fhIntegratedHitPntEffPrimGaps->Fill(100.0 * (static_cast<Double_t>(fvulIdxPrimTracksWithHitGaps[uNbGaps].size()))
3321 / (static_cast<Double_t>(fvulIdxPrimTracksWithPntGaps[uNbGaps].size())),
3322 uNbGaps + 1);
3323 if (0 < fvulIdxSecTracksWithPntGaps[uNbGaps].size())
3324 fhIntegratedHitPntEffSecGaps->Fill(100.0 * (static_cast<Double_t>(fvulIdxSecTracksWithHitGaps[uNbGaps].size()))
3325 / (static_cast<Double_t>(fvulIdxSecTracksWithPntGaps[uNbGaps].size())),
3326 uNbGaps + 1);
3327 } // for( UInt_t uNbGaps = 0; uNbGaps < fuMaxCrossedGaps; uNbGaps++)
3328 LOG(debug2) << sHead;
3329 LOG(debug2) << sPnt;
3330 LOG(debug2) << sHit;
3331
3332 return kTRUE;
3333}
3334// ------------------------------------------------------------------
3335
3337{
3338 fsHistoInNormCartFilename = sFilenameIn;
3339 return kTRUE;
3340}
3342{
3343 fsHistoInNormAngFilename = sFilenameIn;
3344 return kTRUE;
3345}
3347{
3348 fsHistoInNormSphFilename = sFilenameIn;
3349 return kTRUE;
3350}
3352{
3353 // TIP: Normalization files can (should?) be generated using the FairBoxGenerator
3354 // to get uniform distributions with the right density in the desired coords.
3355 // Normalization of Cartesian coordinates maps
3356 if ("" != fsHistoInNormCartFilename) {
3357 // Open file and set folders properly to avoid creating objects in uncontrolled places
3358
3360 TFile* oldFile = gFile;
3361 TDirectory* oldDir = gDirectory;
3362
3363 TFile* fHistNorm = new TFile(fsHistoInNormCartFilename, "READ");
3364 if (NULL == fHistNorm) {
3365 LOG(error) << "CbmTofHitFinderQa::NormalizeMapHistos => Could not open file"
3366 << " with Normalization histos of Cartesian coordinates maps with name " << fsHistoInNormCartFilename
3367 << " => Stopping normalization here!";
3368 return kFALSE;
3369 } // if( NULL == fHistNorm )
3370 gROOT->cd();
3371
3372 // Prepare pointers to access normalization histos
3373 TH2* fhPointMapNormXY = NULL;
3374 TH2* fhPointMapNormXZ = NULL;
3375 TH2* fhPointMapNormYZ = NULL;
3376 TH2* fhDigiMapNormXY = NULL;
3377 TH2* fhDigiMapNormXZ = NULL;
3378 TH2* fhDigiMapNormYZ = NULL;
3379 TH2* fhHitMapNormXY = NULL;
3380 TH2* fhHitMapNormXZ = NULL;
3381 TH2* fhHitMapNormYZ = NULL;
3382
3383 // Get pointers for norm histos from file if they exist
3384 fhPointMapNormXY = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_PointsMapXY"));
3385 fhPointMapNormXZ = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_PointsMapXZ"));
3386 fhPointMapNormYZ = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_PointsMapYZ"));
3387
3388 fhDigiMapNormXY = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_DigisMapXY"));
3389 fhDigiMapNormXZ = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_DigisMapXZ"));
3390 fhDigiMapNormYZ = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_DigisMapYZ"));
3391
3392 fhHitMapNormXY = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_HitsMapXY"));
3393 fhHitMapNormXZ = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_HitsMapXZ"));
3394 fhHitMapNormYZ = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_HitsMapYZ"));
3395 LOG(info) << "CbmTofHitFinderQa::NormalizeMapHistos => XY norm histos: " << fhPointMapNormXY << " "
3396 << fhDigiMapNormXY << " " << fhHitMapNormXY << " ";
3397 LOG(info) << "CbmTofHitFinderQa::NormalizeMapHistos => XZ norm histos: " << fhPointMapNormXZ << " "
3398 << fhDigiMapNormXZ << " " << fhHitMapNormXZ << " ";
3399 LOG(info) << "CbmTofHitFinderQa::NormalizeMapHistos => YZ norm histos: " << fhPointMapNormYZ << " "
3400 << fhDigiMapNormYZ << " " << fhHitMapNormYZ << " ";
3401
3402 // If norm histo found, normalize corresponding map
3403 if (NULL != fhPointMapNormXY) { fhPointMapXY->Divide(fhPointMapNormXY); } // if( NULL != fhPointMapNormXY )
3404 if (NULL != fhPointMapNormXZ) { fhPointMapXZ->Divide(fhPointMapNormXZ); } // if( NULL != fhPointMapNormXZ )
3405 if (NULL != fhPointMapNormYZ) { fhPointMapYZ->Divide(fhPointMapNormYZ); } // if( NULL != fhPointMapNormYZ )
3406 if (NULL != fhDigiMapNormXY) { fhDigiMapXY->Divide(fhDigiMapNormXY); } // if( NULL != fhDigiMapNormXY )
3407 if (NULL != fhDigiMapNormXZ) { fhDigiMapXZ->Divide(fhDigiMapNormXZ); } // if( NULL != fhDigiMapNormXZ )
3408 if (NULL != fhDigiMapNormYZ) { fhDigiMapYZ->Divide(fhDigiMapNormYZ); } // if( NULL != fhDigiMapNormYZ )
3409 if (NULL != fhHitMapNormXY) {
3410 fhHitMapXY->Divide(fhHitMapNormXY);
3411 fhHitMapSingPntXY->Divide(fhHitMapNormXY);
3412 fhHitMapMultPntXY->Divide(fhHitMapNormXY);
3413 fhHitMapSingTrkXY->Divide(fhHitMapNormXY);
3414 fhHitMapMultTrkXY->Divide(fhHitMapNormXY);
3415 } // if( NULL != fhHitMapNormXY )
3416 if (NULL != fhHitMapNormXZ) {
3417 fhHitMapXZ->Divide(fhHitMapNormXZ);
3418 fhHitMapSingPntXZ->Divide(fhHitMapNormXZ);
3419 fhHitMapMultPntXZ->Divide(fhHitMapNormXZ);
3420 fhHitMapSingTrkXZ->Divide(fhHitMapNormXZ);
3421 fhHitMapMultTrkXZ->Divide(fhHitMapNormXZ);
3422 } // if( NULL != fhHitMapNormXZ )
3423 if (NULL != fhHitMapNormYZ) {
3424 fhHitMapYZ->Divide(fhHitMapNormYZ);
3425 fhHitMapSingPntYZ->Divide(fhHitMapNormYZ);
3426 fhHitMapMultPntYZ->Divide(fhHitMapNormYZ);
3427 fhHitMapSingTrkYZ->Divide(fhHitMapNormYZ);
3428 fhHitMapMultTrkYZ->Divide(fhHitMapNormYZ);
3429 } // if( NULL != fhHitMapNormYZ )
3430
3432 gFile = oldFile;
3433 gDirectory = oldDir;
3434
3435 fHistNorm->Close();
3436 } // if( "" != fsHistoInNormCartFilename )
3437 else
3438 LOG(info) << "CbmTofHitFinderQa::NormalizeMapHistos => Name of input file for"
3439 << " Normalization of Cartesian coordinates maps not given"
3440 << " => no normalization for these maps!";
3441 // Normalization of Angular coordinates maps
3442 if ("" != fsHistoInNormAngFilename) {
3443 // Open file and set folders properly to avoid creating objects in uncontrolled places
3444
3446 TFile* oldFile = gFile;
3447 TDirectory* oldDir = gDirectory;
3448
3449 TFile* fHistNorm = new TFile(fsHistoInNormAngFilename, "READ");
3450 if (NULL == fHistNorm) {
3451 LOG(error) << "CbmTofHitFinderQa::NormalizeMapHistos => Could not open file"
3452 << " with Normalization histos of Angular coordinates maps with name " << fsHistoInNormAngFilename
3453 << " => Stopping normalization here!";
3454 return kFALSE;
3455 } // if( NULL == fHistNorm )
3456 gROOT->cd();
3457
3458 // Prepare pointers to access normalization histos
3459 TH2* fhPointMapNormAng = NULL;
3460 TH2* fhDigiMapNormAng = NULL;
3461 TH2* fhHitMapNormAng = NULL;
3462
3463 // Get pointers for norm histos from file if they exist
3464 fhPointMapNormAng = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_PointsMapAng"));
3465 fhDigiMapNormAng = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_DigisMapAng"));
3466 fhHitMapNormAng = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_HitsMapAng"));
3467 LOG(info) << "CbmTofHitFinderQa::NormalizeMapHistos => Angular norm histos: " << fhPointMapNormAng << " "
3468 << fhDigiMapNormAng << " " << fhHitMapNormAng << " ";
3469
3470 // If norm histo found, normalize corresponding map
3471 if (NULL != fhPointMapNormAng) fhPointMapAng->Divide(fhPointMapNormAng);
3472 if (NULL != fhDigiMapNormAng) fhDigiMapAng->Divide(fhDigiMapNormAng);
3473 if (NULL != fhHitMapNormAng) {
3474 fhHitMapAng->Divide(fhHitMapNormAng);
3475 fhHitMapSingPntAng->Divide(fhHitMapNormAng);
3476 fhHitMapMultPntAng->Divide(fhHitMapNormAng);
3477 fhHitMapSingTrkAng->Divide(fhHitMapNormAng);
3478 fhHitMapMultTrkAng->Divide(fhHitMapNormAng);
3479 }
3480
3482 gFile = oldFile;
3483 gDirectory = oldDir;
3484
3485 fHistNorm->Close();
3486 } // if( "" != fsHistoInNormAngFilename )
3487 else
3488 LOG(info) << "CbmTofHitFinderQa::NormalizeMapHistos => Name of input file for"
3489 << " Normalization of Angular coordinates maps not given"
3490 << " => no normalization for these maps!";
3491 // Normalization of Spherical coordinates maps
3492 if ("" != fsHistoInNormSphFilename) {
3493 // Open file and set folders properly to avoid creating objects in uncontrolled places
3494
3496 TFile* oldFile = gFile;
3497 TDirectory* oldDir = gDirectory;
3498
3499 TFile* fHistNorm = new TFile(fsHistoInNormSphFilename, "READ");
3500 if (NULL == fHistNorm) {
3501 LOG(error) << "CbmTofHitFinderQa::NormalizeMapHistos => Could not open file"
3502 << " with Normalization histos of Spherical coordinates maps with name " << fsHistoInNormSphFilename
3503 << " => Stopping normalization here!";
3504 return kFALSE;
3505 } // if( NULL == fHistNorm )
3506 gROOT->cd();
3507
3508 // Prepare pointers to access normalization histos
3509 TH2* fhPointMapNormSph = NULL;
3510 TH2* fhDigiMapNormSph = NULL;
3511 TH2* fhHitMapNormSph = NULL;
3512
3513 // Get pointers for norm histos from file if they exist
3514 fhPointMapNormSph = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_PointsMapSph"));
3515 fhDigiMapNormSph = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_DigisMapSph"));
3516 fhHitMapNormSph = static_cast<TH2*>(fHistNorm->FindObjectAny("TofTests_HitsMapSph"));
3517 LOG(info) << "CbmTofHitFinderQa::NormalizeMapHistos => Spherical norm histos: " << fhPointMapNormSph << " "
3518 << fhDigiMapNormSph << " " << fhHitMapNormSph << " ";
3519
3520 // If norm histo found, normalize corresponding map
3521 if (NULL != fhPointMapNormSph) fhPointMapSph->Divide(fhPointMapNormSph);
3522 if (NULL != fhDigiMapNormSph) fhDigiMapSph->Divide(fhDigiMapNormSph);
3523 if (NULL != fhHitMapNormSph) {
3524 fhHitMapSph->Divide(fhHitMapNormSph);
3525 fhHitMapSingPntSph->Divide(fhHitMapNormSph);
3526 fhHitMapMultPntSph->Divide(fhHitMapNormSph);
3527 fhHitMapSingTrkSph->Divide(fhHitMapNormSph);
3528 fhHitMapMultTrkSph->Divide(fhHitMapNormSph);
3529 }
3530
3532 gFile = oldFile;
3533 gDirectory = oldDir;
3534
3535 fHistNorm->Close();
3536 } // if( "" != fsHistoInNormSphFilename )
3537 else
3538 LOG(info) << "CbmTofHitFinderQa::NormalizeMapHistos => Name of input file for"
3539 << " Normalization of Spherical coordinates maps not given"
3540 << " => no normalization for these maps!";
3541 return kTRUE;
3542}
3544{
3545 if (0 < fhTrackMapXY->GetEntries()) {
3546 fhPointMapXY->Divide(fhTrackMapXY);
3547 fhDigiMapXY->Divide(fhTrackMapXY);
3548 fhHitMapXY->Divide(fhTrackMapXY);
3549 } // if( 0 < fhTrackMapXY->GetEntries())
3550 if (0 < fhTrackMapXZ->GetEntries()) {
3551 fhPointMapXZ->Divide(fhTrackMapXZ);
3552 fhDigiMapXZ->Divide(fhTrackMapXZ);
3553 fhHitMapXZ->Divide(fhTrackMapXZ);
3554 } // if( 0 < fhTrackMapXZ->GetEntries())
3555 if (0 < fhTrackMapYZ->GetEntries()) {
3556 fhPointMapYZ->Divide(fhTrackMapYZ);
3557 fhDigiMapYZ->Divide(fhTrackMapYZ);
3558 fhHitMapYZ->Divide(fhTrackMapYZ);
3559 } // if( 0 < fhTrackMapYZ->GetEntries())
3560 if (0 < fhTrackMapAng->GetEntries()) {
3562 fhDigiMapAng->Divide(fhTrackMapAng);
3563 fhHitMapAng->Divide(fhTrackMapAng);
3564 } // if( 0 < fhTrackMapAng->GetEntries())
3565 if (0 < fhTrackMapSph->GetEntries()) {
3567 fhDigiMapSph->Divide(fhTrackMapSph);
3568 fhHitMapSph->Divide(fhTrackMapSph);
3569 } // if( 0 < fhTrackMapSph->GetEntries())
3570
3571 return kTRUE;
3572}
3573// ------------------------------------------------------------------
3574
3575Bool_t CbmTofHitFinderQa::SetHistoFileName(TString sFilenameIn)
3576{
3577 fsHistoOutFilename = sFilenameIn;
3578 return kTRUE;
3579}
3581{
3582 // TODO: add sub-folders ?
3583
3585 TFile* oldFile = gFile;
3586 TDirectory* oldDir = gDirectory;
3587
3588 // Write histogramms to the file
3589 TFile* fHist = new TFile(fsHistoOutFilename, "RECREATE");
3590 fHist->cd();
3591
3592 // Nb Hits per event for first N events
3593 fhNbHitsPerEvent->Write();
3594 fhNbHitsSingPntPerEvent->Write();
3595 fhNbHitsMultPntPerEvent->Write();
3596 fhNbHitsSingTrkPerEvent->Write();
3597 fhNbHitsMultTrkPerEvent->Write();
3598 // Nb different TOF digis in Hit
3599 fhNbDigisInHit->Write();
3600 fhNbDigisInHitMapXY->Write();
3601
3602 // Mapping
3603 TDirectory* cdGeomMap = fHist->mkdir("GeomMap");
3604 cdGeomMap->cd(); // make the "GeomMap" directory the current directory
3605 if (kTRUE == fbNormHistGenMode) {
3606 fhTrackMapXY->Write();
3607 fhTrackMapXZ->Write();
3608 fhTrackMapYZ->Write();
3609 fhTrackMapAng->Write();
3610 fhTrackMapSph->Write();
3611 } // if( kTRUE == fbNormHistGenMode )
3612 fhPointMapXY->Write();
3613 fhPointMapXZ->Write();
3614 fhPointMapYZ->Write();
3615 fhPointMapAng->Write();
3616 fhPointMapSph->Write();
3617 fhRealPointMapXY->Write();
3618 fhRealPointMapXZ->Write();
3619 fhRealPointMapYZ->Write();
3620 fhRealPointMapAng->Write();
3621 fhRealPointMapSph->Write();
3622 fhDigiMapXY->Write();
3623 fhDigiMapXZ->Write();
3624 fhDigiMapYZ->Write();
3625 fhDigiMapAng->Write();
3626 fhDigiMapSph->Write();
3627 fhHitMapXY->Write();
3628 fhHitMapXZ->Write();
3629 fhHitMapYZ->Write();
3630 fhHitMapAng->Write();
3631 fhHitMapSph->Write();
3632
3633 if (kFALSE == fbNormHistGenMode) {
3634 fHist->cd(); // make the file root the current directory
3635 // L/R digis missmatch
3636 fhLeftRightDigiMatch->Write();
3637 // Nb different MC Points and Tracks in Hit
3638 fhNbPointsInHit->Write();
3639 fhNbTracksInHit->Write();
3640
3641 TDirectory* cdStartZ = fHist->mkdir("StartZ");
3642 cdStartZ->cd(); // make the "MixMap" directory the current directory
3643 // Dependence of Track origin on centrality
3644 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
3645 fvhTrackAllStartZCent[iPartIdx]->Write();
3646 fvhTrackSecStartZCent[iPartIdx]->Write();
3647 if (2 == iPartIdx) // 3D plot only for e-
3648 fvhTrackAllStartXZCent[iPartIdx]->Write();
3649 fvhTrackAllStartXZ[iPartIdx]->Write();
3650 fvhTrackAllStartYZ[iPartIdx]->Write();
3651 fvhTofPntAllAngCent[iPartIdx]->Write();
3652 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
3653
3654 TDirectory* cdMixMap = fHist->mkdir("MixMap");
3655 cdMixMap->cd(); // make the "MixMap" directory the current directory
3656 // Mapping of position for hits coming from a single MC Point
3657 fhHitMapSingPntXY->Write();
3658 fhHitMapSingPntXZ->Write();
3659 fhHitMapSingPntYZ->Write();
3660 fhHitMapSingPntAng->Write();
3661 fhHitMapSingPntSph->Write();
3662 // Mapping of position for hits coming from multiple MC Points
3663 fhHitMapMultPntXY->Write();
3664 fhHitMapMultPntXZ->Write();
3665 fhHitMapMultPntYZ->Write();
3666 fhHitMapMultPntAng->Write();
3667 fhHitMapMultPntSph->Write();
3668 // Mapping of position for hits coming from a single MC Track
3669 fhHitMapSingTrkXY->Write();
3670 fhHitMapSingTrkXZ->Write();
3671 fhHitMapSingTrkYZ->Write();
3672 fhHitMapSingTrkAng->Write();
3673 fhHitMapSingTrkSph->Write();
3674 // Mapping of position for hits coming from multiple MC Tracks
3675 fhHitMapMultTrkXY->Write();
3676 fhHitMapMultTrkXZ->Write();
3677 fhHitMapMultTrkYZ->Write();
3678 fhHitMapMultTrkAng->Write();
3679 fhHitMapMultTrkSph->Write();
3680
3681 TDirectory* cdHitQual = fHist->mkdir("HitQual");
3682 cdHitQual->cd(); // make the "HitQual" directory the current directory
3683 // Hit Quality for Hits coming from a single MC Point
3684 fhSinglePointHitDeltaX->Write();
3685 fhSinglePointHitDeltaY->Write();
3686 fhSinglePointHitDeltaZ->Write();
3687 fhSinglePointHitDeltaR->Write();
3688 fhSinglePointHitDeltaT->Write();
3689 fhSinglePointHitPullX->Write();
3690 fhSinglePointHitPullY->Write();
3691 fhSinglePointHitPullZ->Write();
3692 fhSinglePointHitPullR->Write();
3693 fhSinglePointHitPullT->Write();
3694
3700 // Hit Quality for Hits coming from a multiple MC Points
3701 // To Point closest to Hit
3712 // To Point furthest from Hit
3723 // To mean Point position
3724 fhMultiPntHitMeanDeltaX->Write();
3725 fhMultiPntHitMeanDeltaY->Write();
3726 fhMultiPntHitMeanDeltaZ->Write();
3727 fhMultiPntHitMeanDeltaR->Write();
3728 fhMultiPntHitMeanDeltaT->Write();
3729 fhMultiPntHitMeanPullX->Write();
3730 fhMultiPntHitMeanPullY->Write();
3731 fhMultiPntHitMeanPullZ->Write();
3732 fhMultiPntHitMeanPullR->Write();
3733 fhMultiPntHitMeanPullT->Write();
3734 // To best Point position
3735 fhMultiPntHitBestDeltaX->Write();
3736 fhMultiPntHitBestDeltaY->Write();
3737 fhMultiPntHitBestDeltaZ->Write();
3738 fhMultiPntHitBestDeltaR->Write();
3739 fhMultiPntHitBestDeltaT->Write();
3740 fhMultiPntHitBestPullX->Write();
3741 fhMultiPntHitBestPullY->Write();
3742 fhMultiPntHitBestPullZ->Write();
3743 fhMultiPntHitBestPullR->Write();
3744 fhMultiPntHitBestPullT->Write();
3745 // Hit Quality for Hits coming from a single MC Track
3746 fhSingleTrackHitDeltaX->Write();
3747 fhSingleTrackHitDeltaY->Write();
3748 fhSingleTrackHitDeltaZ->Write();
3749 fhSingleTrackHitDeltaR->Write();
3750 fhSingleTrackHitDeltaT->Write();
3751 fhSingleTrackHitPullX->Write();
3752 fhSingleTrackHitPullY->Write();
3753 fhSingleTrackHitPullZ->Write();
3754 fhSingleTrackHitPullR->Write();
3755 fhSingleTrackHitPullT->Write();
3756 // Hit Quality for Hits coming from a single MC Track but multiple points
3767 // Hit Quality for Hits coming from a multiple MC Points
3768 // To Track closest to Hit
3779 // To Track furthest from Hit
3790 // To mean Track position
3791 fhMultiTrkHitMeanDeltaX->Write();
3792 fhMultiTrkHitMeanDeltaY->Write();
3793 fhMultiTrkHitMeanDeltaZ->Write();
3794 fhMultiTrkHitMeanDeltaR->Write();
3795 fhMultiTrkHitMeanDeltaT->Write();
3796 fhMultiTrkHitMeanPullX->Write();
3797 fhMultiTrkHitMeanPullY->Write();
3798 fhMultiTrkHitMeanPullZ->Write();
3799 fhMultiTrkHitMeanPullR->Write();
3800 fhMultiTrkHitMeanPullT->Write();
3801 // To best Track position
3802 fhMultiTrkHitBestDeltaX->Write();
3803 fhMultiTrkHitBestDeltaY->Write();
3804 fhMultiTrkHitBestDeltaZ->Write();
3805 fhMultiTrkHitBestDeltaR->Write();
3806 fhMultiTrkHitBestDeltaT->Write();
3807 fhMultiTrkHitBestPullX->Write();
3808 fhMultiTrkHitBestPullY->Write();
3809 fhMultiTrkHitBestPullZ->Write();
3810 fhMultiTrkHitBestPullR->Write();
3811 fhMultiTrkHitBestPullT->Write();
3812
3813 TDirectory* cdPhysMap = fHist->mkdir("PhysMap");
3814 cdPhysMap->cd(); // make the "PhysMap" directory the current directory
3815 // Physics coord mapping, 1 per particle type
3816 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
3817 // Phase space
3818 fvhPtmRapGenTrk[iPartIdx]->Write();
3819 fvhPtmRapStsPnt[iPartIdx]->Write();
3820 fvhPtmRapTofPnt[iPartIdx]->Write();
3821 fvhPtmRapTofHit[iPartIdx]->Write();
3822 fvhPtmRapTofHitSinglePnt[iPartIdx]->Write();
3823 fvhPtmRapTofHitSingleTrk[iPartIdx]->Write();
3824 // PLab
3825 fvhPlabGenTrk[iPartIdx]->Write();
3826 fvhPlabStsPnt[iPartIdx]->Write();
3827 fvhPlabTofPnt[iPartIdx]->Write();
3828 fvhPlabTofHit[iPartIdx]->Write();
3829 fvhPlabTofHitSinglePnt[iPartIdx]->Write();
3830 fvhPlabTofHitSingleTrk[iPartIdx]->Write();
3831 // MC Tracks losses
3832 fvhPtmRapGenTrkTofPnt[iPartIdx]->Write();
3833 fvhPtmRapGenTrkTofHit[iPartIdx]->Write();
3834 fvhPlabGenTrkTofPnt[iPartIdx]->Write();
3835 fvhPlabGenTrkTofHit[iPartIdx]->Write();
3836 fvhPlabStsTrkTofPnt[iPartIdx]->Write();
3837 fvhPlabStsTrkTofHit[iPartIdx]->Write();
3838 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
3839
3840 TDirectory* cdPhysMapSec = fHist->mkdir("PhysMapSec");
3841 cdPhysMapSec->cd(); // make the "PhysMap" directory the current directory
3842 // Physics coord mapping, 1 per particle type
3843 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
3844 // Phase space
3845 fvhPtmRapSecGenTrk[iPartIdx]->Write();
3846 fvhPtmRapSecStsPnt[iPartIdx]->Write();
3847 fvhPtmRapSecTofPnt[iPartIdx]->Write();
3848 fvhPtmRapSecTofHit[iPartIdx]->Write();
3849 fvhPtmRapSecTofHitSinglePnt[iPartIdx]->Write();
3850 fvhPtmRapSecTofHitSingleTrk[iPartIdx]->Write();
3851 // PLab
3852 fvhPlabSecGenTrk[iPartIdx]->Write();
3853 fvhPlabSecStsPnt[iPartIdx]->Write();
3854 fvhPlabSecTofPnt[iPartIdx]->Write();
3855 fvhPlabSecTofHit[iPartIdx]->Write();
3856 fvhPlabSecTofHitSinglePnt[iPartIdx]->Write();
3857 fvhPlabSecTofHitSingleTrk[iPartIdx]->Write();
3858 // MC Tracks losses
3859 fvhPtmRapSecGenTrkTofPnt[iPartIdx]->Write();
3860 fvhPtmRapSecGenTrkTofHit[iPartIdx]->Write();
3861 fvhPlabSecGenTrkTofPnt[iPartIdx]->Write();
3862 fvhPlabSecGenTrkTofHit[iPartIdx]->Write();
3863 fvhPlabSecStsTrkTofPnt[iPartIdx]->Write();
3864 fvhPlabSecStsTrkTofHit[iPartIdx]->Write();
3865 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
3866
3867 fHist->cd();
3868 fhIntegratedHitPntEff->Write();
3870 fhIntegratedHitPntEffSec->Write();
3877
3878 fhMcTrkStartPrimSingTrk->Write();
3879 fhMcTrkStartSecSingTrk->Write();
3880 fhMcTrkStartPrimMultiTrk->Write();
3881 fhMcTrkStartSecMultiTrk->Write();
3882 } // if( kFALSE == fbNormHistGenMode )
3883
3884 fHist->cd(); // make the file root the current directory
3885 fhPointMatchWeight->Write();
3886
3888 gFile = oldFile;
3889 gDirectory = oldDir;
3890
3891 fHist->Close();
3892
3893 return kTRUE;
3894}
3896{
3897 // Nb Hits per event for first N events
3898 delete fhNbHitsPerEvent;
3903 // Nb different TOF digis in Hit
3904 delete fhNbDigisInHit;
3905 delete fhNbDigisInHitMapXY;
3906
3907 // Mapping
3908 // Physics coord mapping, 1 per particle type
3909 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
3910 delete fvhTrackAllStartZCent[iPartIdx];
3911 delete fvhTrackSecStartZCent[iPartIdx];
3912 if (2 == iPartIdx) // 3D plot only for e-
3913 delete fvhTrackAllStartXZCent[iPartIdx];
3914 delete fvhTrackAllStartXZ[iPartIdx];
3915 delete fvhTrackAllStartYZ[iPartIdx];
3916 delete fvhTofPntAllAngCent[iPartIdx];
3917 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
3918 fvhTrackAllStartZCent.clear();
3919 fvhTrackSecStartZCent.clear();
3920 fvhTrackAllStartXZCent.clear();
3921 fvhTrackAllStartXZ.clear();
3922 fvhTrackAllStartYZ.clear();
3923 fvhTofPntAllAngCent.clear();
3924 if (kTRUE == fbNormHistGenMode) {
3925 delete fhTrackMapXY;
3926 delete fhTrackMapXZ;
3927 delete fhTrackMapYZ;
3928 delete fhTrackMapAng;
3929 delete fhTrackMapSph;
3930 } // if( kTRUE == fbNormHistGenMode )
3931 delete fhPointMapXY;
3932 delete fhPointMapXZ;
3933 delete fhPointMapYZ;
3934 delete fhPointMapAng;
3935 delete fhPointMapSph;
3936 delete fhRealPointMapXY;
3937 delete fhRealPointMapXZ;
3938 delete fhRealPointMapYZ;
3939 delete fhRealPointMapAng;
3940 delete fhRealPointMapSph;
3941 delete fhDigiMapXY;
3942 delete fhDigiMapXZ;
3943 delete fhDigiMapYZ;
3944 delete fhDigiMapAng;
3945 delete fhDigiMapSph;
3946 delete fhHitMapXY;
3947 delete fhHitMapXZ;
3948 delete fhHitMapYZ;
3949 delete fhHitMapAng;
3950 delete fhHitMapSph;
3951 // L/R digis missmatch
3952 delete fhLeftRightDigiMatch;
3953 // Nb different MC Points and Tracks in Hit
3954 delete fhNbPointsInHit;
3955 delete fhNbTracksInHit;
3956 // Mapping of position for hits coming from a single MC Point
3957 delete fhHitMapSingPntXY;
3958 delete fhHitMapSingPntXZ;
3959 delete fhHitMapSingPntYZ;
3960 delete fhHitMapSingPntAng;
3961 delete fhHitMapSingPntSph;
3962 // Mapping of position for hits coming from multiple MC Points
3963 delete fhHitMapMultPntXY;
3964 delete fhHitMapMultPntXZ;
3965 delete fhHitMapMultPntYZ;
3966 delete fhHitMapMultPntAng;
3967 delete fhHitMapMultPntSph;
3968 // Mapping of position for hits coming from a single MC Track
3969 delete fhHitMapSingTrkXY;
3970 delete fhHitMapSingTrkXZ;
3971 delete fhHitMapSingTrkYZ;
3972 delete fhHitMapSingTrkAng;
3973 delete fhHitMapSingTrkSph;
3974 // Mapping of position for hits coming from multiple MC Tracks
3975 delete fhHitMapMultTrkXY;
3976 delete fhHitMapMultTrkXZ;
3977 delete fhHitMapMultTrkYZ;
3978 delete fhHitMapMultTrkAng;
3979 delete fhHitMapMultTrkSph;
3980 // Hit Quality for Hits coming from a single MC Point
3986 delete fhSinglePointHitPullX;
3987 delete fhSinglePointHitPullY;
3988 delete fhSinglePointHitPullZ;
3989 delete fhSinglePointHitPullR;
3990 delete fhSinglePointHitPullT;
3991
3997 // Hit Quality for Hits coming from a multiple MC Points
3998 // To Point closest to Hit
4009 // To Point furthest from Hit
4020 // To mean Point position
4031 // To best Point position
4042 // Hit Quality for Hits coming from a single MC Track
4048 delete fhSingleTrackHitPullX;
4049 delete fhSingleTrackHitPullY;
4050 delete fhSingleTrackHitPullZ;
4051 delete fhSingleTrackHitPullR;
4052 delete fhSingleTrackHitPullT;
4053 // Hit Quality for Hits coming from a single MC Track but multiple points
4064
4065 // Hit Quality for Hits coming from a multiple MC Points
4066 // To Track closest to Hit
4077 // To Track furthest from Hit
4088 // To mean Track position
4099 // To best Track position
4110
4111 // Physics coord mapping, 1 per particle type
4112 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
4113 // Phase space
4114 delete fvhPtmRapGenTrk[iPartIdx];
4115 delete fvhPtmRapStsPnt[iPartIdx];
4116 delete fvhPtmRapTofPnt[iPartIdx];
4117 delete fvhPtmRapTofHit[iPartIdx];
4118 delete fvhPtmRapTofHitSinglePnt[iPartIdx];
4119 delete fvhPtmRapTofHitSingleTrk[iPartIdx];
4120 // PLab
4121 delete fvhPlabGenTrk[iPartIdx];
4122 delete fvhPlabStsPnt[iPartIdx];
4123 delete fvhPlabTofPnt[iPartIdx];
4124 delete fvhPlabTofHit[iPartIdx];
4125 delete fvhPlabTofHitSinglePnt[iPartIdx];
4126 delete fvhPlabTofHitSingleTrk[iPartIdx];
4127 // MC Tracks losses
4128 delete fvhPtmRapGenTrkTofPnt[iPartIdx];
4129 delete fvhPtmRapGenTrkTofHit[iPartIdx];
4130 delete fvhPlabGenTrkTofPnt[iPartIdx];
4131 delete fvhPlabGenTrkTofHit[iPartIdx];
4132 delete fvhPlabStsTrkTofPnt[iPartIdx];
4133 delete fvhPlabStsTrkTofHit[iPartIdx];
4134
4135 // Secondary tracks
4136 // Phase space
4137 delete fvhPtmRapSecGenTrk[iPartIdx];
4138 delete fvhPtmRapSecStsPnt[iPartIdx];
4139 delete fvhPtmRapSecTofPnt[iPartIdx];
4140 delete fvhPtmRapSecTofHit[iPartIdx];
4141 delete fvhPtmRapSecTofHitSinglePnt[iPartIdx];
4142 delete fvhPtmRapSecTofHitSingleTrk[iPartIdx];
4143 // PLab
4144 delete fvhPlabSecGenTrk[iPartIdx];
4145 delete fvhPlabSecStsPnt[iPartIdx];
4146 delete fvhPlabSecTofPnt[iPartIdx];
4147 delete fvhPlabSecTofHit[iPartIdx];
4148 delete fvhPlabSecTofHitSinglePnt[iPartIdx];
4149 delete fvhPlabSecTofHitSingleTrk[iPartIdx];
4150 // MC Tracks losses
4151 delete fvhPtmRapSecGenTrkTofPnt[iPartIdx];
4152 delete fvhPtmRapSecGenTrkTofHit[iPartIdx];
4153 delete fvhPlabSecGenTrkTofPnt[iPartIdx];
4154 delete fvhPlabSecGenTrkTofHit[iPartIdx];
4155 delete fvhPlabSecStsTrkTofPnt[iPartIdx];
4156 delete fvhPlabSecStsTrkTofHit[iPartIdx];
4157 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
4158 // Phase space
4159 fvhPtmRapGenTrk.clear();
4160 fvhPtmRapStsPnt.clear();
4161 fvhPtmRapTofPnt.clear();
4162 fvhPtmRapTofHit.clear();
4165 // PLab
4166 fvhPlabGenTrk.clear();
4167 fvhPlabStsPnt.clear();
4168 fvhPlabTofPnt.clear();
4169 fvhPlabTofHit.clear();
4170 fvhPlabTofHitSinglePnt.clear();
4171 fvhPlabTofHitSingleTrk.clear();
4172 // MC Tracks losses
4173 fvhPtmRapGenTrkTofPnt.clear();
4174 fvhPtmRapGenTrkTofHit.clear();
4175 fvhPlabGenTrkTofPnt.clear();
4176 fvhPlabGenTrkTofHit.clear();
4177 fvhPlabStsTrkTofPnt.clear();
4178 fvhPlabStsTrkTofHit.clear();
4179
4180 // Secondary tracks
4181 // Phase space
4182 fvhPtmRapSecGenTrk.clear();
4183 fvhPtmRapSecStsPnt.clear();
4184 fvhPtmRapSecTofPnt.clear();
4185 fvhPtmRapSecTofHit.clear();
4188 // PLab
4189 fvhPlabSecGenTrk.clear();
4190 fvhPlabSecStsPnt.clear();
4191 fvhPlabSecTofPnt.clear();
4192 fvhPlabSecTofHit.clear();
4195 // MC Tracks losses
4198 fvhPlabSecGenTrkTofPnt.clear();
4199 fvhPlabSecGenTrkTofHit.clear();
4200 fvhPlabSecStsTrkTofPnt.clear();
4201 fvhPlabSecStsTrkTofHit.clear();
4202
4203 delete fhIntegratedHitPntEff;
4206
4210
4214
4219
4220 delete fhPointMatchWeight;
4221
4222 return kTRUE;
4223}
4224
4225
@ kTof
Time-of-flight Detector.
@ kSts
Silicon Tracking System.
static TFile * fHist
TClonesArray * fTofHitsColl
@ k12b
@ k14a
const TString ksPartTag[kiNbPart]
const TString ksPartName[kiNbPart]
const Int_t kiNbPart
const Int_t kiPartPdgCode[kiNbPart]
const Int_t kiMinNbStsPntAcc
ClassImp(CbmTofHitFinderQa)
const TString ksPartTag[kiNbPart]
const TString ksPartName[kiNbPart]
const Int_t kiNbPart
const Int_t kiPartPdgCode[kiNbPart]
const Int_t kiMinNbStsPntAcc
static constexpr size_t size()
Definition KfSimdPseudo.h:2
double GetTimeError() const
Definition CbmHit.h:77
double GetDz() const
Definition CbmHit.h:72
double GetTime() const
Definition CbmHit.h:76
double GetZ() const
Definition CbmHit.h:71
double GetPz() const
Definition CbmMCTrack.h:72
double GetPt() const
Definition CbmMCTrack.h:97
double GetP() const
Definition CbmMCTrack.h:98
double GetPx() const
Definition CbmMCTrack.h:70
double GetStartZ() const
Definition CbmMCTrack.h:75
int32_t GetMotherId() const
Definition CbmMCTrack.h:69
double GetMass() const
Mass of the associated particle.
double GetStartX() const
Definition CbmMCTrack.h:73
int32_t GetPdgCode() const
Definition CbmMCTrack.h:68
double GetStartY() const
Definition CbmMCTrack.h:74
double GetPy() const
Definition CbmMCTrack.h:71
double GetRapidity() const
int32_t GetNPoints(ECbmModuleId detId) const
const CbmLink & GetLink(int32_t i) const
Definition CbmMatch.h:39
int32_t GetNofLinks() const
Definition CbmMatch.h:42
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
double GetDy() const
Definition CbmPixelHit.h:76
double GetDx() const
Definition CbmPixelHit.h:75
double GetY() const
Definition CbmPixelHit.h:74
double GetX() const
Definition CbmPixelHit.h:73
Double_t GetY() const
Definition CbmTofCell.h:36
Double_t GetX() const
Definition CbmTofCell.h:35
Double_t GetZ() const
Definition CbmTofCell.h:37
virtual int32_t SetDetectorInfo(const CbmTofDetectorInfo detectorInfo)=0
Parameters class for the CBM ToF digitizer using beam data distributions.
Int_t GetNbSmTypes() const
Int_t GetNbSm(Int_t iSmType) const
Int_t GetNbChan(Int_t iSmType, Int_t iRpc) const
Int_t GetNbRpc(Int_t iSmType) const
Bool_t UseExpandedDigi() const
CbmTofCell * GetCell(Int_t i)
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47
double GetChannel() const
Channel .
Definition CbmTofDigi.h:156
double GetSm() const
Sm.
Definition CbmTofDigi.h:144
double GetType() const
Sm Type .
Definition CbmTofDigi.h:148
double GetRpc() const
Detector aka Module aka RPC .
Definition CbmTofDigi.h:152
Int_t Init(Bool_t isSimulation=kFALSE)
QA class for the TOF event based Hit finder tasks (clusterizers, ...)
std::vector< std::vector< ULong64_t > > fvulIdxSecTracksWithHitGaps
std::vector< std::vector< ULong64_t > > fvulIdxSecTracksWithPntGaps
std::vector< TH1 * > fvhPlabSecTofHitSinglePnt
std::vector< TH2 * > fvhPtmRapSecGenTrkTofPnt
std::vector< TH1 * > fvhPlabGenTrkTofHit
TClonesArray * fTofDigiMatchPointsColl
std::vector< TH2 * > fvhPtmRapSecGenTrkTofHit
Bool_t SetHistoFileNameSphCoordNorm(TString sFilenameIn)
std::vector< Int_t > fvTypeSmOffs
std::vector< TH2 * > fvhPtmRapTofHitSinglePnt
std::vector< TH2 * > fvhPtmRapSecStsPnt
std::vector< std::vector< ULong64_t > > fvulIdxPrimTracksWithHitGaps
std::vector< TH1 * > fvhPlabTofHit
std::vector< TH1 * > fvhPlabSecGenTrkTofHit
Bool_t SetHistoFileName(TString sFilenameIn)
virtual void SetParContainers()
Inherited from FairTask.
Bool_t SetWallPosZ(Double_t dWallPosCm=1000)
TClonesArray * fRealTofMatchColl
std::vector< TH1 * > fvhPlabStsTrkTofPnt
TProfile2D * fhNbDigisInHitMapXY
std::vector< TH1 * > fvhPlabGenTrk
std::vector< ULong64_t > fvulIdxHiddenTracksWithHit
std::vector< TH2 * > fvhPtmRapTofHitSingleTrk
CbmTofDetectorId * fTofId
FairMCEventHeader * fMCEventHeader
std::vector< TH1 * > fvhPlabStsPnt
TClonesArray * fRealTofPointsColl
CbmTofDigiBdfPar * fDigiBdfPar
std::vector< TH2 * > fvhPtmRapSecTofHit
std::vector< TH2 * > fvhPtmRapStsPnt
std::vector< ULong64_t > fvulIdxPrimTracksWithHit
std::vector< TH3 * > fvhTrackAllStartXZCent
std::vector< TH1 * > fvhPlabSecTofHitSingleTrk
std::vector< TH1 * > fvhPlabTofPnt
std::vector< TH1 * > fvhPlabStsTrkTofHit
std::vector< std::vector< std::vector< Int_t > > > fvRpcChOffs
std::vector< TH2 * > fvhTrackAllStartXZ
CbmTofCell * fChannelInfo
std::vector< TH1 * > fvhPlabSecStsTrkTofHit
TClonesArray * fMcTracksColl
std::vector< ULong64_t > fvulIdxTracksWithHit
std::vector< TH2 * > fvhPtmRapSecTofHitSinglePnt
CbmTofDigiPar * fDigiPar
std::vector< TH2 * > fvhPtmRapTofHit
std::vector< TH1 * > fvhPlabSecGenTrkTofPnt
std::vector< std::vector< Int_t > > fvSmRpcOffs
std::vector< std::vector< ULong64_t > > fvulIdxTracksWithPntGaps
std::vector< TH1 * > fvhPlabSecGenTrk
std::vector< TH2 * > fvhPtmRapGenTrk
CbmTofGeoHandler * fGeoHandler
std::vector< TH2 * > fvhTrackSecStartZCent
Bool_t SetHistoFileNameCartCoordNorm(TString sFilenameIn)
TClonesArray * fTofPointsColl
Bool_t LoadGeometry()
Load the geometry: for now just resizing the Digis temporary vectors.
std::vector< ULong64_t > fvulIdxSecTracksWithHit
std::vector< TH1 * > fvhPlabSecStsPnt
std::vector< TH2 * > fvhPtmRapSecTofHitSingleTrk
TClonesArray * fTofHitsColl
virtual InitStatus Init()
std::vector< TH3 * > fvhTofPntAllAngCent
std::vector< TH1 * > fvhPlabSecTofPnt
std::vector< TH2 * > fvhPtmRapGenTrkTofHit
TClonesArray * fTofDigiMatchColl
std::vector< TH1 * > fvhPlabTofHitSinglePnt
std::vector< TH1 * > fvhPlabSecTofHit
std::vector< TH2 * > fvhPtmRapSecGenTrk
TClonesArray * fTofDigisColl
std::vector< TH1 * > fvhPlabSecStsTrkTofPnt
std::vector< TH2 * > fvhPtmRapTofPnt
std::vector< TH1 * > fvhPlabTofHitSingleTrk
std::vector< TH2 * > fvhTrackAllStartZCent
std::vector< TH2 * > fvhPtmRapGenTrkTofPnt
std::vector< ULong64_t > fvulIdxTracksWithPnt
std::vector< std::vector< ULong64_t > > fvulIdxTracksWithHitGaps
virtual void Exec(Option_t *option)
std::vector< ULong64_t > fvulIdxPrimTracksWithPnt
std::vector< TH2 * > fvhPtmRapSecTofPnt
std::vector< std::vector< ULong64_t > > fvulIdxPrimTracksWithPntGaps
std::vector< TH2 * > fvhTrackAllStartYZ
std::vector< ULong64_t > fvulIdxHiddenPrimTracksWithHit
Bool_t SetHistoFileNameAngCoordNorm(TString sFilenameIn)
std::vector< ULong64_t > fvulIdxHiddenSecTracksWithHit
std::vector< TH1 * > fvhPlabGenTrkTofPnt
TClonesArray * fTofHitMatchColl
std::vector< ULong64_t > fvulIdxSecTracksWithPnt
int32_t GetClusterSize()
Definition CbmTofHit.h:98
Geometric intersection of a MC track with a TOFb detector.
Definition CbmTofPoint.h:44