Go to the documentation of this file.
10 #include "CbmTofHit.h"
13 #include "FairRootManager.h"
15 #include "TClonesArray.h"
29 , fTofHitsMatches(NULL)
62 std::cout <<
"Event: " <<
fEventNo++ << std::endl;
68 FairRootManager* ioman = FairRootManager::Instance();
69 if (NULL == ioman) { Fatal(
"Init",
"CbmRootManager is not instantiated"); }
71 fMCTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
72 if (NULL ==
fMCTracks) { Fatal(
"Init",
"No MCTrack array!"); }
76 fStsMatches = (TClonesArray*) ioman->GetObject(
"StsTrackMatch");
77 if (NULL ==
fStsMatches) { Fatal(
"Init",
"No StsTrackMatch array!"); }
82 fMuchMatches = (TClonesArray*) ioman->GetObject(
"MuchTrackMatch");
83 if (NULL ==
fMuchMatches) { Fatal(
"Init",
"No MuchTrackMatch array!"); }
88 fTrdMatches = (TClonesArray*) ioman->GetObject(
"TrdTrackMatch");
89 if (NULL ==
fTrdMatches) { Fatal(
"Init",
"No TrdTrackMatch array!"); }
94 fTofMCPoints = (TClonesArray*) ioman->GetObject(
"TofPoint");
95 if (NULL ==
fTofMCPoints) { Fatal(
"Init",
"No TofPoint array!"); }
96 fTofHits = (TClonesArray*) ioman->GetObject(
"TofHit");
97 if (NULL ==
fTofHits) { Fatal(
"Init",
"No TofHit array!"); }
99 if (NULL ==
fTofHitsMatches) { Fatal(
"Init",
"No TofHitMatch array!"); }
104 ioman->Register(
"GlobalTrack",
107 IsOutputBranchPersistent(
"GlobalTrack"));
111 const TClonesArray* matches) {
113 Int_t nofTracks = matches->GetEntriesFast();
114 for (Int_t iTrack = 0; iTrack < nofTracks; iTrack++) {
116 if (trackMatch == NULL) {
continue; }
118 if (mcId == -1) {
continue; }
119 mcMap.insert(std::pair<Int_t, Int_t>(mcId, iTrack));
125 Int_t nofTofHits =
fTofHits->GetEntriesFast();
126 for (Int_t iTofHit = 0; iTofHit < nofTofHits; iTofHit++) {
128 if (tofHit == NULL) {
continue; }
130 if (tofHitMatch == NULL) {
continue; }
133 if (tofPoint == NULL) {
continue; }
134 Int_t mcId = tofPoint->GetTrackID();
135 if (mcId == -1) {
continue; }
136 fMcTofMap.insert(std::pair<Int_t, Int_t>(mcId, iTofHit));
142 Int_t nGlobalTracks = 0;
143 Int_t nofMCTracks =
fMCTracks->GetEntriesFast();
144 for (Int_t iMCTrack = 0; iMCTrack < nofMCTracks; iMCTrack++) {
146 if (mcTrack == NULL) {
continue; }
147 Int_t stsId = -1, trdId = -1, muchId = -1, tofId = -1;
165 if (stsId == -1 && trdId == -1 && muchId == -1 && tofId == -1) {
continue; }
const CbmLink & GetMatchedLink() const
std::map< Int_t, Int_t > fMcTrdMap
TClonesArray * fStsMatches
virtual void Finish()
Derived from FairTask.
virtual ~CbmLitFindGlobalTracksIdeal()
void SetTrdTrackIndex(Int_t iTrd)
virtual void Exec(Option_t *opt)
Derived from FairTask.
TClonesArray * fGlobalTracks
std::map< Int_t, Int_t > fMcStsMap
TClonesArray * fTofMCPoints
@ kTof
Time-of-flight Detector.
FairTask for ideal global track reconstruction.
ClassImp(CbmLitFindGlobalTracksIdeal)
virtual InitStatus Init()
Derived from FairTask.
void SetStsTrackIndex(Int_t iSts)
TClonesArray * fTrdMatches
TClonesArray * fMuchMatches
TClonesArray * fTofHitsMatches
bool GetDet(ECbmModuleId detId) const
Return detector presence in setup.
std::map< Int_t, Int_t > fMcTofMap
@ kTrd
Transition Radiation Detector.
CbmLitFindGlobalTracksIdeal()
void FillTrackMap(std::map< Int_t, Int_t > &mcMap, const TClonesArray *matches)
Fill map from <MC track index> to <reconstructed track index>.
void FillMapTof()
Fill map from <MC track index> to <TOF hit index>.
void SetMuchTrackIndex(Int_t iMuch)
FairTask for ideal global track reconstruction.
void ReadDataBranches()
Read necessary data branches from the input data files.
@ kMuch
Muon detection system.
void SetTofHitIndex(Int_t iTofHit)
Geometric intersection of a MC track with a TOFb detector.
std::map< Int_t, Int_t > fMcMuchMap
void CreateGlobalTracks()
Create output CbmGlobalTracks and write them to output array.
string ToString() const
Return string representation of class.
@ kSts
Silicon Tracking System.
void DetermineSetup()
Determines detector presence using TGeoManager.