CbmRoot
Loading...
Searching...
No Matches
CbmTofHitFinderQa.h
Go to the documentation of this file.
1/* Copyright (C) 2015-2018 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
15#ifndef _CBMTOFHITFINDERQA_H_
16#define _CBMTOFHITFINDERQA_H_
17
18#include "FairTask.h"
19
20class FairMCEventHeader;
22class CbmTofCell;
23// Geometry
26class CbmTofCell;
27
28class CbmTofDigiPar;
30
31class TClonesArray;
32class TH1;
33class TH2;
34class TH3;
35class TProfile2D;
36class TString;
37
38class CbmTofHitFinderQa : public FairTask {
39
40public:
42 CbmTofHitFinderQa(const char* name, Int_t verbose = 1);
43 virtual ~CbmTofHitFinderQa();
44
45 virtual InitStatus Init();
46 virtual void Exec(Option_t* option);
47 virtual void Finish();
48
52 virtual void SetParContainers();
53
54 Bool_t RegisterInputs();
55
56 Bool_t SetHistoFileNameCartCoordNorm(TString sFilenameIn);
57 Bool_t SetHistoFileNameAngCoordNorm(TString sFilenameIn);
58 Bool_t SetHistoFileNameSphCoordNorm(TString sFilenameIn);
59 Bool_t SetHistoFileName(TString sFilenameIn);
60
61 void SetNormHistGenerationMode(Bool_t bModeIn = kTRUE) { fbNormHistGenMode = bModeIn; }
62
63 Bool_t SetWallPosZ(Double_t dWallPosCm = 1000);
64
65 void SetNbEventsHitsNbPlots(UInt_t uNbEvents) { fuNbEventsForHitsNbPlots = uNbEvents; }
66
67private:
68 Bool_t CreateHistos();
69 Bool_t FillHistos();
70 Bool_t NormalizeMapHistos();
71 Bool_t NormalizeNormHistos();
72 Bool_t WriteHistos();
73 Bool_t DeleteHistos();
74
78 Bool_t LoadGeometry();
79
82
83 Int_t fEvents; // Number of processed events
84
85 // Geometry infos
89 Int_t iNbSmTot;
90 std::vector<Int_t> fvTypeSmOffs; // Offset in SM index for first SM of each SM type
91 Int_t iNbRpcTot;
92 std::vector<std::vector<Int_t>> fvSmRpcOffs; // Offset in RPC index for first RPC of each SM
93 Int_t fiNbChTot;
94 std::vector<std::vector<std::vector<Int_t>>> fvRpcChOffs; // Offset in channel index for first channel of each RPC
95
96 // Parameters
99
100 FairMCEventHeader* fMCEventHeader; // MC event header
101 // TClonesArray * fStsPointsColl; // STS MC points
102 TClonesArray* fTofPointsColl; // TOF MC points
103 TClonesArray* fMcTracksColl; // MC tracks
104 TClonesArray* fTofDigisColl; // TOF Digis
105 TClonesArray* fTofDigiMatchPointsColl; // Indices of MC original points for each digi (CbmMatch)
106 TClonesArray* fTofHitsColl; // TOF hits
107 TClonesArray* fTofDigiMatchColl; // Indices of TOF Digis for each hit (CbmMatch)
108 TClonesArray* fTofHitMatchColl; // // Indices of MC original points for each hit with TOT weight (CbmMatch)
110 TClonesArray* fRealTofPointsColl; // Realistics TOF MC points
111 TClonesArray* fRealTofMatchColl; // Index of Realistics TOF MC points for each MC Point (CbmMatch)
113
114 // Histograms
115 // Flag for Normalization histograms generation
117 // Input file names and path for Mapping Normalization histos
121 // Output file name and path
123 // Position of the TOF wall on Z axis for centering histos with Z
124 Double_t fdWallPosZ;
125 // Nb Hits per event for first N events
132 // Nb different TOF digis in Hit
135 // Geometric Mapping
136 std::vector<TH2*> fvhTrackAllStartZCent; // Dependence of Track origin on centrality, if TOF points
137 std::vector<TH2*> fvhTrackSecStartZCent; // Dependence of Track origin on centrality, if TOF points
138 std::vector<TH3*> fvhTrackAllStartXZCent; // Dependence of Track origin on centrality, if TOF points
139 std::vector<TH2*> fvhTrackAllStartXZ; // Track origin mapping, if TOF points
140 std::vector<TH2*> fvhTrackAllStartYZ; // Track origin mapping, if TOF points
141 std::vector<TH3*> fvhTofPntAllAngCent; // Dependence of Tof Point position (angular) on centrality
142 TH2* fhTrackMapXY; // Only when creating normalization histos
143 TH2* fhTrackMapXZ; // Only when creating normalization histos
144 TH2* fhTrackMapYZ; // Only when creating normalization histos
145 TH2* fhTrackMapAng; // Only when creating normalization histos
146 TH2* fhTrackMapSph; // Only when creating normalization histos
167 // L/R digis missmatch
169 // Nb different MC Points and Tracks in Hit
172 // Mapping of position for hits coming from a single MC Point
178 // Mapping of position for hits coming from multiple MC Points
184 // Mapping of position for hits coming from a single MC Track
190 // Mapping of position for hits coming from multiple MC Tracks
196 // Hit Quality for Hits coming from a single MC Point
207
213 // Hit Quality for Hits coming from multiple MC Points
214 // To Point closest to Hit
225 // To Point furthest from Hit
236 // To mean Point position
247 // To best Point position
258 // Hit Quality for Hits coming from a single MC Track
269 // Hit Quality for Hits coming from a single MC Track but multi Pnt
280 // Hit Quality for Hits coming from multiple MC Tracks
281 // To Track closest to Hit
292 // To Track furthest from Hit
303 // To mean Track position
314 // To best Track position
325
326 // Physics coord mapping, 1 per particle type
327 // Phase space
328 // Primary tracks
329 std::vector<TH2*> fvhPtmRapGenTrk;
330 std::vector<TH2*> fvhPtmRapStsPnt;
331 std::vector<TH2*> fvhPtmRapTofPnt;
332 std::vector<TH2*> fvhPtmRapTofHit;
333 std::vector<TH2*> fvhPtmRapTofHitSinglePnt;
334 std::vector<TH2*> fvhPtmRapTofHitSingleTrk;
335 // Secondary tracks
336 std::vector<TH2*> fvhPtmRapSecGenTrk;
337 std::vector<TH2*> fvhPtmRapSecStsPnt;
338 std::vector<TH2*> fvhPtmRapSecTofPnt;
339 std::vector<TH2*> fvhPtmRapSecTofHit;
342
343 // PLab
344 // Primary tracks
345 std::vector<TH1*> fvhPlabGenTrk;
346 std::vector<TH1*> fvhPlabStsPnt;
347 std::vector<TH1*> fvhPlabTofPnt;
348 std::vector<TH1*> fvhPlabTofHit;
349 std::vector<TH1*> fvhPlabTofHitSinglePnt;
350 std::vector<TH1*> fvhPlabTofHitSingleTrk;
351 // Secondary tracks
352 std::vector<TH1*> fvhPlabSecGenTrk;
353 std::vector<TH1*> fvhPlabSecStsPnt;
354 std::vector<TH1*> fvhPlabSecTofPnt;
355 std::vector<TH1*> fvhPlabSecTofHit;
356 std::vector<TH1*> fvhPlabSecTofHitSinglePnt;
357 std::vector<TH1*> fvhPlabSecTofHitSingleTrk;
358
359 // MC Tracks losses
360 // Primary tracks
361 std::vector<TH2*> fvhPtmRapGenTrkTofPnt;
362 std::vector<TH2*> fvhPtmRapGenTrkTofHit;
363 std::vector<TH1*> fvhPlabGenTrkTofPnt;
364 std::vector<TH1*> fvhPlabGenTrkTofHit;
365 std::vector<TH1*> fvhPlabStsTrkTofPnt;
366 std::vector<TH1*> fvhPlabStsTrkTofHit;
367 // Secondary tracks
368 std::vector<TH2*> fvhPtmRapSecGenTrkTofPnt;
369 std::vector<TH2*> fvhPtmRapSecGenTrkTofHit;
370 std::vector<TH1*> fvhPlabSecGenTrkTofPnt;
371 std::vector<TH1*> fvhPlabSecGenTrkTofHit;
372 std::vector<TH1*> fvhPlabSecStsTrkTofPnt;
373 std::vector<TH1*> fvhPlabSecStsTrkTofHit;
374
375 // Integrated TofHit Efficiency
376 std::vector<ULong64_t> fvulIdxTracksWithPnt;
377 std::vector<ULong64_t> fvulIdxTracksWithHit;
379 std::vector<ULong64_t> fvulIdxPrimTracksWithPnt;
380 std::vector<ULong64_t> fvulIdxPrimTracksWithHit;
382 std::vector<ULong64_t> fvulIdxSecTracksWithPnt;
383 std::vector<ULong64_t> fvulIdxSecTracksWithHit;
385
386 // Integrated TofHit Efficiency: Tracks firing channel but not going to Digi/Hit
387 std::vector<ULong64_t> fvulIdxHiddenTracksWithHit;
389 std::vector<ULong64_t> fvulIdxHiddenPrimTracksWithHit;
391 std::vector<ULong64_t> fvulIdxHiddenSecTracksWithHit;
393
394 // Efficiency dependence on nb crossed gaps
395 UInt_t fuMaxCrossedGaps = 20;
396 std::vector<std::vector<ULong64_t>> fvulIdxTracksWithPntGaps;
397 std::vector<std::vector<ULong64_t>> fvulIdxTracksWithHitGaps;
399 std::vector<std::vector<ULong64_t>> fvulIdxPrimTracksWithPntGaps;
400 std::vector<std::vector<ULong64_t>> fvulIdxPrimTracksWithHitGaps;
402 std::vector<std::vector<ULong64_t>> fvulIdxSecTracksWithPntGaps;
403 std::vector<std::vector<ULong64_t>> fvulIdxSecTracksWithHitGaps;
405
406 // Track length, 1 per particle type
407 // Single track hits
410 // Multiple track hits
413
414 // TOF Debug checks
416
418};
419
420#endif
Parameters class for the CBM ToF digitizer using beam data distributions.
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
void SetNormHistGenerationMode(Bool_t bModeIn=kTRUE)
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)
CbmTofHitFinderQa operator=(const CbmTofHitFinderQa &)
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
void SetNbEventsHitsNbPlots(UInt_t uNbEvents)
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)
ClassDef(CbmTofHitFinderQa, 1)
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
CbmTofHitFinderQa(const CbmTofHitFinderQa &)
TClonesArray * fTofHitMatchColl
std::vector< ULong64_t > fvulIdxSecTracksWithPnt