18#include "FairRootManager.h"
19#include "TClonesArray.h"
33 , fTofHitsMatches(NULL)
76 std::cout <<
"Event: " <<
fEventNo++ << std::endl;
83 FairRootManager* ioman = FairRootManager::Instance();
85 LOG(fatal) << GetName() <<
"::Init: CbmRootManager is not instantiated";
88 fMCTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
90 LOG(fatal) << GetName() <<
"::Init: No MCTrack array!";
95 fStsMatches = (TClonesArray*) ioman->GetObject(
"StsTrackMatch");
97 LOG(fatal) << GetName() <<
"::Init: No StsTrackMatch array!";
103 fMuchMatches = (TClonesArray*) ioman->GetObject(
"MuchTrackMatch");
105 LOG(fatal) << GetName() <<
"::Init: No MuchTrackMatch array!";
111 fTrdMatches = (TClonesArray*) ioman->GetObject(
"TrdTrackMatch");
113 LOG(fatal) << GetName() <<
"::Init: No TrdTrackMatch array!";
119 fTofMCPoints = (TClonesArray*) ioman->GetObject(
"TofPoint");
121 LOG(fatal) << GetName() <<
"::Init: No TofPoint array!";
123 fTofHits = (TClonesArray*) ioman->GetObject(
"TofHit");
125 LOG(fatal) << GetName() <<
"::Init: No TofHit array!";
129 LOG(fatal) << GetName() <<
"::Init: No TofHitMatch array!";
135 ioman->Register(
"GlobalTrack",
"Global",
fGlobalTracks, IsOutputBranchPersistent(
"GlobalTrack"));
141 Int_t nofTracks = matches->GetEntriesFast();
142 for (Int_t iTrack = 0; iTrack < nofTracks; iTrack++) {
144 if (trackMatch == NULL) {
151 mcMap.insert(std::pair<Int_t, Int_t>(mcId, iTrack));
158 Int_t nofTofHits =
fTofHits->GetEntriesFast();
159 for (Int_t iTofHit = 0; iTofHit < nofTofHits; iTofHit++) {
161 if (tofHit == NULL) {
165 if (tofHitMatch == NULL) {
170 if (tofPoint == NULL) {
173 Int_t mcId = tofPoint->GetTrackID();
177 fMcTofMap.insert(std::pair<Int_t, Int_t>(mcId, iTofHit));
184 Int_t nGlobalTracks = 0;
185 Int_t nofMCTracks =
fMCTracks->GetEntriesFast();
186 for (Int_t iMCTrack = 0; iMCTrack < nofMCTracks; iMCTrack++) {
188 if (mcTrack == NULL) {
191 Int_t stsId = -1, trdId = -1, muchId = -1, tofId = -1;
205 if (stsId == -1 && trdId == -1 && muchId == -1 && tofId == -1) {
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kSts
Silicon Tracking System.
@ kMuch
Muon detection system.
ClassImp(CbmLitFindGlobalTracksIdeal)
FairTask for ideal global track reconstruction.
void SetMuchTrackIndex(int32_t iMuch)
void SetTofHitIndex(int32_t iTofHit)
void SetTrdTrackIndex(int32_t iTrd)
void SetStsTrackIndex(int32_t iSts)
void DetermineSetup()
Determines detector presence using TGeoManager.
string ToString() const
Return string representation of class.
bool GetDet(ECbmModuleId detId) const
Return detector presence in setup.
FairTask for ideal global track reconstruction.
void ReadDataBranches()
Read necessary data branches from the input data files.
virtual void Exec(Option_t *opt)
Derived from FairTask.
TClonesArray * fMuchMatches
TClonesArray * fTofMCPoints
TClonesArray * fGlobalTracks
virtual InitStatus Init()
Derived from FairTask.
TClonesArray * fTrdMatches
TClonesArray * fStsMatches
virtual void Finish()
Derived from FairTask.
void CreateGlobalTracks()
Create output CbmGlobalTracks and write them to output array.
std::map< Int_t, Int_t > fMcStsMap
void FillMapTof()
Fill map from <MC track index> to <TOF hit index>.
void FillTrackMap(std::map< Int_t, Int_t > &mcMap, const TClonesArray *matches)
Fill map from <MC track index> to <reconstructed track index>.
CbmLitFindGlobalTracksIdeal()
std::map< Int_t, Int_t > fMcTrdMap
std::map< Int_t, Int_t > fMcTofMap
virtual ~CbmLitFindGlobalTracksIdeal()
TClonesArray * fTofHitsMatches
std::map< Int_t, Int_t > fMcMuchMap
const CbmLink & GetMatchedLink() const
Geometric intersection of a MC track with a TOFb detector.