CbmRoot
CbmMatchRecoToMC.h
Go to the documentation of this file.
1 
8 #ifndef CBMMATCHRECOTOMC_H_
9 #define CBMMATCHRECOTOMC_H_
10 
11 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
12 #include <RtypesCore.h> // for Int_t, Bool_t, Option_t, kFALSE, kTRUE
13 
14 #include <FairTask.h> // for FairTask, InitStatus
15 
16 #include <utility> // for pair
17 #include <vector> // for vector
18 
19 #include "CbmDefs.h" // for ECbmModuleId
20 
21 class CbmDigiManager;
22 class CbmMCDataArray;
23 class CbmRichHit;
24 class TClonesArray;
25 
26 class CbmMatchRecoToMC : public FairTask {
27 public:
32 
36  virtual ~CbmMatchRecoToMC();
37 
41  virtual InitStatus Init();
42 
46  virtual void Exec(Option_t* opt);
47 
51  virtual void Finish();
52 
53  void SetIncludeMvdHitsInStsTrack(Bool_t includeMvdHitsInStsTrack);
54 
55 private:
60 
61 
70  void MatchClusters(const TClonesArray* digiMatches,
71  const TClonesArray* clusters,
72  TClonesArray* clusterMatches);
73 
74 
82  void MatchClusters(ECbmModuleId systemId,
83  const TClonesArray* clusters,
84  TClonesArray* clusterMatches);
85 
86 
87  void MatchHits(const TClonesArray* matches,
88  const TClonesArray* hits,
89  TClonesArray* hitMatches);
90 
102  void MatchHitsSts(const TClonesArray* clusterMmatches,
103  const TClonesArray* hits,
104  TClonesArray* hitMatches);
105 
106  void MatchHitsMvd(const TClonesArray* hits, TClonesArray* hitMatches);
107 
108  void MatchHitsTof(const TClonesArray* HitDigiMatches,
109  const TClonesArray* hits,
110  TClonesArray* hitMatches);
111 
113  const TClonesArray* hits,
114  TClonesArray* hitMatches);
115 
116  void MatchTracks(const TClonesArray* hitMatches,
118  const TClonesArray* tracks,
119  TClonesArray* trackMatches);
120 
121  //Special case for STS: now evbased compatible
122  void MatchStsTracks(const TClonesArray* mvdHitMatches,
123  const TClonesArray* stsHitMatches,
124  CbmMCDataArray* mvdPoints,
125  CbmMCDataArray* stsPoints,
126  const TClonesArray* tracks,
127  TClonesArray* trackMatches);
128 
129  void MatchRichRings(const TClonesArray* richRings,
130  const TClonesArray* richHits,
131  CbmMCDataArray* richMcPoints,
133  TClonesArray* ringMatches);
134 
135 public:
140  static std::vector<std::pair<Int_t, Int_t>>
142  const CbmRichHit* hit,
143  CbmMCDataArray* richPoints,
145  Int_t eventNumber);
146 
147  static std::vector<Int_t>
149  const CbmRichHit* hit,
150  const TClonesArray* richPoints,
151  const TClonesArray* mcTracks);
152 
153 private:
154  static Int_t fEventNumber;
155 
156  Bool_t fIncludeMvdHitsInStsTrack = kFALSE;
157  Bool_t fbDigiExpUsed = kTRUE; // Usage of CbmTofDigiExp instead of CbmTofDigi
158 
161 
162  // MVD
164  TClonesArray* fMvdCluster = nullptr;
165  TClonesArray* fMvdHits = nullptr;
166  TClonesArray* fMvdClusterMatches = nullptr;
167  TClonesArray* fMvdHitMatches = nullptr;
168 
169  // STS
171  TClonesArray* fStsClusters = nullptr;
172  TClonesArray* fStsHits = nullptr;
173  TClonesArray* fStsTracks = nullptr;
174  TClonesArray* fStsClusterMatches = nullptr;
175  TClonesArray* fStsHitMatches = nullptr;
176  TClonesArray* fStsTrackMatches = nullptr;
177 
178  // RICH
180  TClonesArray* fRichHits = nullptr;
181  TClonesArray* fRichRings = nullptr;
182  TClonesArray* fRichTrackMatches = nullptr;
183 
184  // MUCH
186  TClonesArray* fMuchClusters = nullptr;
187  TClonesArray* fMuchPixelHits = nullptr;
188  TClonesArray* fMuchTracks = nullptr;
189  TClonesArray* fMuchClusterMatches = nullptr;
190  TClonesArray* fMuchPixelHitMatches = nullptr;
191  TClonesArray* fMuchTrackMatches = nullptr;
192 
193  // TRD
195  TClonesArray* fTrdClusters = nullptr;
196  TClonesArray* fTrdHits = nullptr;
197  TClonesArray* fTrdTracks = nullptr;
198  TClonesArray* fTrdClusterMatches = nullptr;
199  TClonesArray* fTrdHitMatches = nullptr;
200  TClonesArray* fTrdTrackMatches = nullptr;
201 
202  // TOF
204  TClonesArray* fTofHits = nullptr;
205  TClonesArray* fTofHitDigiMatches = nullptr;
206  TClonesArray* fTofHitMatches = nullptr;
207 
208 
211 
213 };
214 
215 #endif /* CBMMATCHRECOTOMC_H_ */
CbmMatchRecoToMC::SetIncludeMvdHitsInStsTrack
void SetIncludeMvdHitsInStsTrack(Bool_t includeMvdHitsInStsTrack)
Definition: CbmMatchRecoToMC.cxx:107
CbmMatchRecoToMC::ReadAndCreateDataBranches
void ReadAndCreateDataBranches()
Read and create data branches.
Definition: CbmMatchRecoToMC.cxx:193
CbmMatchRecoToMC::CbmMatchRecoToMC
CbmMatchRecoToMC()
Constructor.
Definition: CbmMatchRecoToMC.cxx:45
CbmMatchRecoToMC::fMvdClusterMatches
TClonesArray * fMvdClusterMatches
Hits [in].
Definition: CbmMatchRecoToMC.h:166
CbmMatchRecoToMC::fMvdHits
TClonesArray * fMvdHits
Clusters [in].
Definition: CbmMatchRecoToMC.h:165
CbmMatchRecoToMC::fMvdCluster
TClonesArray * fMvdCluster
MC points [in].
Definition: CbmMatchRecoToMC.h:164
CbmMatchRecoToMC::fbDigiExpUsed
Bool_t fbDigiExpUsed
Definition: CbmMatchRecoToMC.h:157
CbmMatchRecoToMC::fTrdClusterMatches
TClonesArray * fTrdClusterMatches
Tracks [in].
Definition: CbmMatchRecoToMC.h:198
CbmMatchRecoToMC::Finish
virtual void Finish()
Derived from FairTask.
Definition: CbmMatchRecoToMC.cxx:191
CbmMatchRecoToMC::~CbmMatchRecoToMC
virtual ~CbmMatchRecoToMC()
Destructor.
Definition: CbmMatchRecoToMC.cxx:47
CbmMatchRecoToMC::CbmMatchRecoToMC
CbmMatchRecoToMC(const CbmMatchRecoToMC &)
Match Hit -> MC point [out].
CbmMatchRecoToMC::fTrdHits
TClonesArray * fTrdHits
Clusters [in].
Definition: CbmMatchRecoToMC.h:196
CbmMatchRecoToMC::fStsHits
TClonesArray * fStsHits
Clusters [in].
Definition: CbmMatchRecoToMC.h:172
CbmMatchRecoToMC::fRichMcPoints
CbmMCDataArray * fRichMcPoints
Track matches [out].
Definition: CbmMatchRecoToMC.h:179
CbmMatchRecoToMC::fMuchPoints
CbmMCDataArray * fMuchPoints
[out]
Definition: CbmMatchRecoToMC.h:185
CbmMatchRecoToMC::Exec
virtual void Exec(Option_t *opt)
Derived from FairTask.
Definition: CbmMatchRecoToMC.cxx:118
CbmMatchRecoToMC::fStsTrackMatches
TClonesArray * fStsTrackMatches
Hit matches [out].
Definition: CbmMatchRecoToMC.h:176
CbmMatchRecoToMC::fRichHits
TClonesArray * fRichHits
MC points [in].
Definition: CbmMatchRecoToMC.h:180
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmMCDataArray
Access to a MC data branch for time-based analysis.
Definition: CbmMCDataArray.h:35
CbmMatchRecoToMC::fMuchClusterMatches
TClonesArray * fMuchClusterMatches
Tracks [in].
Definition: CbmMatchRecoToMC.h:189
CbmMatchRecoToMC::fStsTracks
TClonesArray * fStsTracks
Hits [in].
Definition: CbmMatchRecoToMC.h:173
CbmMatchRecoToMC
Definition: CbmMatchRecoToMC.h:26
CbmMatchRecoToMC::fStsPoints
CbmMCDataArray * fStsPoints
Hit matches [out].
Definition: CbmMatchRecoToMC.h:170
CbmMatchRecoToMC::MatchHits
void MatchHits(const TClonesArray *matches, const TClonesArray *hits, TClonesArray *hitMatches)
Definition: CbmMatchRecoToMC.cxx:447
CbmMatchRecoToMC::ClassDef
ClassDef(CbmMatchRecoToMC, 1)
CbmMatchRecoToMC::fMvdPoints
CbmMCDataArray * fMvdPoints
Interface to digi branches.
Definition: CbmMatchRecoToMC.h:163
CbmMatchRecoToMC::fTrdTracks
TClonesArray * fTrdTracks
Hits [in].
Definition: CbmMatchRecoToMC.h:197
CbmMatchRecoToMC::fMuchPixelHitMatches
TClonesArray * fMuchPixelHitMatches
Cluster matches [out].
Definition: CbmMatchRecoToMC.h:190
CbmMatchRecoToMC::Init
virtual InitStatus Init()
Derived from FairTask.
Definition: CbmMatchRecoToMC.cxx:112
CbmMatchRecoToMC::fTofPoints
CbmMCDataArray * fTofPoints
Track matches [out].
Definition: CbmMatchRecoToMC.h:203
CbmMatchRecoToMC::fMvdHitMatches
TClonesArray * fMvdHitMatches
Cluster matches [out].
Definition: CbmMatchRecoToMC.h:167
CbmMatchRecoToMC::fMuchTrackMatches
TClonesArray * fMuchTrackMatches
Hit matches [out].
Definition: CbmMatchRecoToMC.h:191
CbmMatchRecoToMC::fMCTracks
CbmMCDataArray * fMCTracks
Definition: CbmMatchRecoToMC.h:159
CbmMatchRecoToMC::fDigiManager
CbmDigiManager * fDigiManager
Monte-Carlo tracks.
Definition: CbmMatchRecoToMC.h:160
tracks
TClonesArray * tracks
Definition: Analyze_matching.h:17
mcTracks
static vector< vector< QAMCTrack > > mcTracks
Definition: CbmTofHitFinderTBQA.cxx:112
CbmMatchRecoToMC::fTofHits
TClonesArray * fTofHits
CbmTofPoint array.
Definition: CbmMatchRecoToMC.h:204
CbmMatchRecoToMC::fTrdHitMatches
TClonesArray * fTrdHitMatches
Cluster matches [out].
Definition: CbmMatchRecoToMC.h:199
CbmMatchRecoToMC::fTrdTrackMatches
TClonesArray * fTrdTrackMatches
Hit matches [out].
Definition: CbmMatchRecoToMC.h:200
CbmMatchRecoToMC::fRichTrackMatches
TClonesArray * fRichTrackMatches
Rings [in].
Definition: CbmMatchRecoToMC.h:182
CbmMatchRecoToMC::GetMcTrackMotherIdsForRichHit
static std::vector< std::pair< Int_t, Int_t > > GetMcTrackMotherIdsForRichHit(CbmDigiManager *digiMan, const CbmRichHit *hit, CbmMCDataArray *richPoints, CbmMCDataArray *mcTracks, Int_t eventNumber)
Return McTrack Ids for RICH hit C++11 efficient way to return vector.
Definition: CbmMatchRecoToMC.cxx:821
CbmMatchRecoToMC::fStsHitMatches
TClonesArray * fStsHitMatches
Cluster matches [out].
Definition: CbmMatchRecoToMC.h:175
CbmDigiManager
CbmDigiManager.
Definition: CbmDigiManager.h:37
CbmMatchRecoToMC::fMuchClusters
TClonesArray * fMuchClusters
MC points [in].
Definition: CbmMatchRecoToMC.h:186
CbmMatchRecoToMC::MatchHitsSts
void MatchHitsSts(const TClonesArray *clusterMmatches, const TClonesArray *hits, TClonesArray *hitMatches)
Match STS hits, using cluster match objects.
Definition: CbmMatchRecoToMC.cxx:461
CbmMatchRecoToMC::fRichRings
TClonesArray * fRichRings
Hits [in].
Definition: CbmMatchRecoToMC.h:181
CbmMatchRecoToMC::fTofHitDigiMatches
TClonesArray * fTofHitDigiMatches
CbmTofHit array.
Definition: CbmMatchRecoToMC.h:205
CbmMatchRecoToMC::fEventNumber
static Int_t fEventNumber
Definition: CbmMatchRecoToMC.h:154
CbmMatchRecoToMC::fTrdClusters
TClonesArray * fTrdClusters
MC points [in].
Definition: CbmMatchRecoToMC.h:195
points
TClonesArray * points
Definition: Analyze_matching.h:18
CbmMatchRecoToMC::MatchHitsTof
void MatchHitsTof(const TClonesArray *HitDigiMatches, const TClonesArray *hits, TClonesArray *hitMatches)
Definition: CbmMatchRecoToMC.cxx:491
CbmMatchRecoToMC::MatchRichRings
void MatchRichRings(const TClonesArray *richRings, const TClonesArray *richHits, CbmMCDataArray *richMcPoints, CbmMCDataArray *mcTracks, TClonesArray *ringMatches)
Definition: CbmMatchRecoToMC.cxx:756
CbmMatchRecoToMC::fStsClusterMatches
TClonesArray * fStsClusterMatches
Tracks [in].
Definition: CbmMatchRecoToMC.h:174
CbmMatchRecoToMC::fMuchPixelHits
TClonesArray * fMuchPixelHits
Clusters [in].
Definition: CbmMatchRecoToMC.h:187
CbmMatchRecoToMC::MatchTracks
void MatchTracks(const TClonesArray *hitMatches, CbmMCDataArray *points, const TClonesArray *tracks, TClonesArray *trackMatches)
Definition: CbmMatchRecoToMC.cxx:559
CbmMatchRecoToMC::fStsClusters
TClonesArray * fStsClusters
MC points [in].
Definition: CbmMatchRecoToMC.h:171
hits
static vector< vector< QAHit > > hits
Definition: CbmTofHitFinderTBQA.cxx:114
CbmMatchRecoToMC::MatchStsTracks
void MatchStsTracks(const TClonesArray *mvdHitMatches, const TClonesArray *stsHitMatches, CbmMCDataArray *mvdPoints, CbmMCDataArray *stsPoints, const TClonesArray *tracks, TClonesArray *trackMatches)
Definition: CbmMatchRecoToMC.cxx:637
CbmMatchRecoToMC::MatchHitsToPoints
void MatchHitsToPoints(CbmMCDataArray *points, const TClonesArray *hits, TClonesArray *hitMatches)
Definition: CbmMatchRecoToMC.cxx:544
CbmMatchRecoToMC::fTrdPoints
CbmMCDataArray * fTrdPoints
Track matches [out].
Definition: CbmMatchRecoToMC.h:194
CbmMatchRecoToMC::MatchClusters
void MatchClusters(const TClonesArray *digiMatches, const TClonesArray *clusters, TClonesArray *clusterMatches)
Generic creation of cluster match objects.
Definition: CbmMatchRecoToMC.cxx:412
CbmMatchRecoToMC::fMuchTracks
TClonesArray * fMuchTracks
Hits [in].
Definition: CbmMatchRecoToMC.h:188
CbmMatchRecoToMC::fTofHitMatches
TClonesArray * fTofHitMatches
Match Hit -> Digi [out].
Definition: CbmMatchRecoToMC.h:206
eventNumber
Int_t eventNumber
Definition: riplet/Lx.cxx:78
CbmMatchRecoToMC::operator=
CbmMatchRecoToMC & operator=(const CbmMatchRecoToMC &)
CbmMatchRecoToMC::MatchHitsMvd
void MatchHitsMvd(const TClonesArray *hits, TClonesArray *hitMatches)
Definition: CbmMatchRecoToMC.cxx:478
CbmMatchRecoToMC::fIncludeMvdHitsInStsTrack
Bool_t fIncludeMvdHitsInStsTrack
Definition: CbmMatchRecoToMC.h:156
CbmRichHit
Definition: CbmRichHit.h:19
CbmDefs.h