CbmRoot
Loading...
Searching...
No Matches
CbmMatchRecoToMC.h
Go to the documentation of this file.
1/* Copyright (C) 2013-2023 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer], Volker Friese */
4
12#ifndef CBMMATCHRECOTOMC_H_
13#define CBMMATCHRECOTOMC_H_
14
15#include "CbmDefs.h" // for ECbmModuleId
16#include "CbmMatch.h"
17#include "CbmTofDigi.h"
18
19#include <FairTask.h> // for FairTask, InitStatus
20
21#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
22#include <RtypesCore.h> // for Int_t, Bool_t, Option_t, kFALSE, kTRUE
23
24#include <utility> // for pair
25#include <vector> // for vector
26
27class CbmDigiManager;
28class CbmMCDataArray;
29class CbmRichHit;
30class TClonesArray;
31
32class CbmMatchRecoToMC : public FairTask {
33 public:
38
42 virtual ~CbmMatchRecoToMC();
43
47 virtual InitStatus Init();
48
52 virtual void Exec(Option_t* opt);
53
57 virtual void Finish();
58
59 private:
64
65
74 void MatchClusters(const TClonesArray* digiMatches, const TClonesArray* clusters, TClonesArray* clusterMatches);
75
76
84 void MatchClusters(ECbmModuleId systemId, const TClonesArray* clusters, TClonesArray* clusterMatches);
85
86
87 void MatchHits(const TClonesArray* matches, const TClonesArray* hits, TClonesArray* hitMatches);
88
100 void MatchHitsSts(const TClonesArray* clusterMmatches, const TClonesArray* hits, TClonesArray* hitMatches);
101
102 void MatchHitsMvd(const TClonesArray* hits, TClonesArray* hitMatches);
103
104 void MatchHitsFsd(const TClonesArray* hits, TClonesArray* hitMatches);
105
106 void MatchHitsTof(const TClonesArray* HitDigiMatches, const TClonesArray* hits, TClonesArray* hitMatches);
107
108 void MatchHitsToPoints(CbmMCDataArray* points, const TClonesArray* hits, TClonesArray* hitMatches);
109
110 void MatchTracks(const TClonesArray* hitMatches, CbmMCDataArray* points, const TClonesArray* tracks,
111 TClonesArray* trackMatches);
112
113 //Special case for STS: now evbased compatible
114 void MatchStsTracks(const TClonesArray* mvdHitMatches, const TClonesArray* stsHitMatches, CbmMCDataArray* mvdPoints,
115 CbmMCDataArray* stsPoints, const TClonesArray* tracks, TClonesArray* trackMatches);
116
117 void MatchRichRings(const TClonesArray* richRings, const TClonesArray* richHits, CbmMCDataArray* richMcPoints,
118 CbmMCDataArray* mcTracks, TClonesArray* ringMatches);
119
120 public:
124 static std::vector<CbmLink> GetMcTrackMotherIdsForRichHit(CbmDigiManager* digiMan, const CbmRichHit* hit,
130 [[deprecated]] static std::vector<std::pair<Int_t, Int_t>>
132 CbmMCDataArray* mcTracks, Int_t eventNumber);
133
138 [[deprecated]] static std::vector<Int_t> GetMcTrackMotherIdsForRichHit(CbmDigiManager* digiMan, const CbmRichHit* hit,
139 const TClonesArray* richPoints,
140 const TClonesArray* mcTracks);
141
151
152 private:
153 static Int_t fEventNumber;
154
155 Bool_t fIsMvdActive = kTRUE; // is the Mvd module active
156 Bool_t fbDigiExpUsed = kTRUE; // Usage of CbmTofDigiExp instead of CbmTofDigi
157 bool fbSuppressHitReMatching = false; // Suppression of MC->hit matching, if the matches are already there
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 const std::vector<CbmTofDigi>* fTofDigis = nullptr; // TOF MC point matches
205 const std::vector<CbmMatch>* fTofDigiMatch = nullptr; // TOF MC point matches
206 TClonesArray* fTofHits = nullptr;
207 TClonesArray* fTofHitDigiMatches = nullptr;
208 TClonesArray* fTofHitMatches = nullptr;
209
210 // FSD
212 TClonesArray* fFsdHits = nullptr;
213 TClonesArray* fFsdHitMatches = nullptr;
214
217
219};
220
221#endif /* CBMMATCHRECOTOMC_H_ */
TClonesArray * tracks
TClonesArray * points
ECbmModuleId
Definition CbmDefs.h:39
static vector< vector< QAMCTrack > > mcTracks
static vector< vector< QAHit > > hits
CbmDigiManager.
Access to a MC data branch for time-based analysis.
const std::vector< CbmTofDigi > * fTofDigis
CbmTofPoint array.
TClonesArray * fMuchPixelHits
Clusters [in].
TClonesArray * fTrdTrackMatches
Hit matches [out].
CbmMCDataArray * fRichMcPoints
Track matches [out].
ClassDef(CbmMatchRecoToMC, 1)
CbmMatchRecoToMC(const CbmMatchRecoToMC &)
Hit matches [out].
void MatchRichRings(const TClonesArray *richRings, const TClonesArray *richHits, CbmMCDataArray *richMcPoints, CbmMCDataArray *mcTracks, TClonesArray *ringMatches)
TClonesArray * fMvdCluster
MC points [in].
CbmMCDataArray * fMvdPoints
Interface to digi branches.
TClonesArray * fStsHitMatches
Cluster matches [out].
void MatchHitsTof(const TClonesArray *HitDigiMatches, const TClonesArray *hits, TClonesArray *hitMatches)
CbmMCDataArray * fTrdPoints
Track matches [out].
void MatchHits(const TClonesArray *matches, const TClonesArray *hits, TClonesArray *hitMatches)
CbmMCDataArray * fStsPoints
Hit matches [out].
void MatchHitsToPoints(CbmMCDataArray *points, const TClonesArray *hits, TClonesArray *hitMatches)
CbmMCDataArray * fTofPoints
Track matches [out].
TClonesArray * fTrdClusters
MC points [in].
TClonesArray * fMuchPixelHitMatches
Cluster matches [out].
TClonesArray * fTrdHits
Clusters [in].
TClonesArray * fMuchTracks
Hits [in].
void ReadAndCreateDataBranches()
Read and create data branches.
void MatchHitsSts(const TClonesArray *clusterMmatches, const TClonesArray *hits, TClonesArray *hitMatches)
Match STS hits, using cluster match objects.
void MatchTracks(const TClonesArray *hitMatches, CbmMCDataArray *points, const TClonesArray *tracks, TClonesArray *trackMatches)
TClonesArray * fRichTrackMatches
Rings [in].
void MatchClusters(const TClonesArray *digiMatches, const TClonesArray *clusters, TClonesArray *clusterMatches)
Generic creation of cluster match objects.
TClonesArray * fStsTrackMatches
Hit matches [out].
void SuppressHitReMatching()
Suppresses cluster and hit matching procedures.
void MatchHitsFsd(const TClonesArray *hits, TClonesArray *hitMatches)
virtual InitStatus Init()
Derived from FairTask.
TClonesArray * fTofHitMatches
Match Hit -> Digi [out].
TClonesArray * fFsdHitMatches
Hits [in].
TClonesArray * fMvdHits
Clusters [in].
CbmMatchRecoToMC & operator=(const CbmMatchRecoToMC &)
CbmDigiManager * fDigiManager
Monte-Carlo tracks.
TClonesArray * fRichHits
MC points [in].
TClonesArray * fMuchTrackMatches
Hit matches [out].
TClonesArray * fFsdHits
MC points [in].
TClonesArray * fMvdClusterMatches
Hits [in].
TClonesArray * fTrdTracks
Hits [in].
TClonesArray * fTofHits
virtual void Exec(Option_t *opt)
Derived from FairTask.
void MatchHitsMvd(const TClonesArray *hits, TClonesArray *hitMatches)
CbmMCDataArray * fMCTracks
const std::vector< CbmMatch > * fTofDigiMatch
TClonesArray * fStsHits
Clusters [in].
static std::vector< CbmLink > GetMcTrackMotherIdsForRichHit(CbmDigiManager *digiMan, const CbmRichHit *hit, CbmMCDataArray *richPoints, CbmMCDataArray *mcTracks)
Get CbmLinks of Mother MC Tracks for RICH hit.
TClonesArray * fStsTracks
Hits [in].
TClonesArray * fTrdHitMatches
Cluster matches [out].
TClonesArray * fTofHitDigiMatches
CbmTofHit array.
TClonesArray * fRichRings
Hits [in].
TClonesArray * fStsClusterMatches
Tracks [in].
TClonesArray * fStsClusters
MC points [in].
void MatchStsTracks(const TClonesArray *mvdHitMatches, const TClonesArray *stsHitMatches, CbmMCDataArray *mvdPoints, CbmMCDataArray *stsPoints, const TClonesArray *tracks, TClonesArray *trackMatches)
virtual void Finish()
Derived from FairTask.
static Int_t fEventNumber
CbmMatchRecoToMC()
Constructor.
TClonesArray * fMuchClusters
MC points [in].
TClonesArray * fTrdClusterMatches
Tracks [in].
TClonesArray * fMuchClusterMatches
Tracks [in].
CbmMCDataArray * fFsdPoints
Match Hit -> MC point [out].
TClonesArray * fMvdHitMatches
Cluster matches [out].
virtual ~CbmMatchRecoToMC()
Destructor.
CbmMCDataArray * fMuchPoints
Match Ring -> MC track [out].