21 #include <FairEventManager.h>
22 #include <FairLogger.h>
23 #include <FairRootManager.h>
25 #include <FairTrackParam.h>
28 #include <TClonesArray.h>
29 #include <TEveManager.h>
30 #include <TEvePathMark.h>
31 #include <TEveTrack.h>
32 #include <TEveTrackPropagator.h>
33 #include <TEveVector.h>
34 #include <TGenericClassInfo.h>
35 #include <TObjArray.h>
36 #include <TParticle.h>
45 : FairTask(
"FairMCTracks", 0)
46 , fGlobalTracks(nullptr)
52 , fMuchPixelHits(nullptr)
53 , fMuchTracks(nullptr)
58 , fEventManager(nullptr)
70 : FairTask(name, iVerbose)
71 , fGlobalTracks(nullptr)
77 , fMuchPixelHits(nullptr)
78 , fMuchTracks(nullptr)
83 , fEventManager(nullptr)
84 , fEveTrList(new TObjArray(16))
92 LOG(debug) <<
"FairMCTracks::Init()";
93 FairRootManager* fManager = FairRootManager::Instance();
94 fGlobalTracks = (TClonesArray*) fManager->GetObject(
"GlobalTrack");
95 fStsTracks = (TClonesArray*) fManager->GetObject(
"StsTrack");
96 fMvdHits = (TClonesArray*) fManager->GetObject(
"MvdHit");
97 fStsHits = (TClonesArray*) fManager->GetObject(
"StsHit");
98 fRichRings = (TClonesArray*) fManager->GetObject(
"RichRing");
99 fRichHits = (TClonesArray*) fManager->GetObject(
"RichHit");
100 fMuchPixelHits = (TClonesArray*) fManager->GetObject(
"MuchPixelHit");
101 fMuchTracks = (TClonesArray*) fManager->GetObject(
"MuchTrack");
102 fTrdHits = (TClonesArray*) fManager->GetObject(
"TrdHit");
103 fTrdTracks = (TClonesArray*) fManager->GetObject(
"TrdTrack");
104 fTofHits = (TClonesArray*) fManager->GetObject(
"TofHit");
107 LOG(error) <<
"FairMCTracks::Init() branch " << GetName()
108 <<
"GlobalTrack branch not found! Task will be deactivated";
112 LOG(debug1) <<
"FairMCTracks::Init() get track list" <<
fStsTracks;
113 LOG(debug1) <<
"FairMCTracks::Init() create propagator";
115 LOG(debug1) <<
"FairMCTracks::Init() get instance of FairEventManager ";
130 TEveVector* pMom = 0) {
131 eveTrack->SetPoint(n, hit->
GetX(), hit->
GetY(), hit->
GetZ());
137 if (pMom) path.fP = *pMom;
139 eveTrack->AddPathMark(path);
148 for (Int_t
i = 0;
i < nofHits; ++
i) {
170 default: LOG(warn) <<
"Pixel type " << hitType <<
" not supported.";
187 TEveVector mom = TEveVector(mom3.X(), mom3.Y(), mom3.Z());
200 TEveVector mom = TEveVector(mom3.X(), mom3.Y(), mom3.Z());
211 LOG(debug1) <<
" CbmRecoTracks::Exec ";
217 for (Int_t
i = 0;
i < nofGlobalTracks; ++
i) {
218 LOG(debug3) <<
"CbmRecoTracks::Exec " <<
i;
227 if (0 > stsId)
continue;
232 if (0 == stsTrack)
continue;
238 TEveTrack* eveTrack =
new TEveTrack(&P, pdg,
fTrPr);
253 }
else if (-1 < muchId)
266 LOG(debug3) <<
"track added " << eveTrack->GetName();
271 gEve->Redraw3D(kFALSE);
284 TEveTrackList* ele = (TEveTrackList*)
fEveTrList->At(
i);
292 sprintf(name_buf,
"reco_%s", P->GetName());
295 TEveTrackList* TrListIn = (TEveTrackList*)
fEveTrList->At(
i);
296 if (strcmp(TrListIn->GetName(), name_buf) == 0) {
302 fTrPr =
new TEveTrackPropagator();