25#include <FairEventManager.h>
26#include <FairRootManager.h>
28#include <FairTrackParam.h>
32#include <TClonesArray.h>
33#include <TEveManager.h>
34#include <TEvePathMark.h>
36#include <TEveTrackPropagator.h>
37#include <TEveVector.h>
38#include <TGenericClassInfo.h>
49 LOG(debug) <<
"FairMCTracks::Init()";
50 FairRootManager* fManager = FairRootManager::Instance();
51 fGlobalTracks = (TClonesArray*) fManager->GetObject(
"GlobalTrack");
52 fStsTracks = (TClonesArray*) fManager->GetObject(
"StsTrack");
53 fMvdHits = (TClonesArray*) fManager->GetObject(
"MvdHit");
54 fStsHits = (TClonesArray*) fManager->GetObject(
"StsHit");
55 fRichRings = (TClonesArray*) fManager->GetObject(
"RichRing");
56 fRichHits = (TClonesArray*) fManager->GetObject(
"RichHit");
57 fMuchPixelHits = (TClonesArray*) fManager->GetObject(
"MuchPixelHit");
58 fMuchTracks = (TClonesArray*) fManager->GetObject(
"MuchTrack");
59 fTrdHits = (TClonesArray*) fManager->GetObject(
"TrdHit");
60 fTrdTracks = (TClonesArray*) fManager->GetObject(
"TrdTrack");
61 fTofHits = (TClonesArray*) fManager->GetObject(
"TofHit");
62 fTofTracks = (TClonesArray*) fManager->GetObject(
"TofTrack");
65 LOG(error) <<
"FairMCTracks::Init() branch " << GetName()
66 <<
"GlobalTrack branch not found! Task will be deactivated";
70 LOG(debug1) <<
"FairMCTracks::Init() get track list" <<
fStsTracks;
71 LOG(debug1) <<
"FairMCTracks::Init() create propagator";
73 LOG(debug1) <<
"FairMCTracks::Init() get instance of FairEventManager ";
78 if (IsActive()) {
return kSUCCESS; }
86 eveTrack->SetPoint(n, hit->
GetX(), hit->
GetY(), hit->
GetZ());
92 if (pMom) path.fP = *pMom;
94 eveTrack->AddPathMark(path);
102 for (Int_t i = 0; i < nofHits; ++i) {
115 default: LOG(warn) <<
"Pixel type " << hitType <<
" not supported.";
130 TEveVector mom = TEveVector(mom3.X(), mom3.Y(), mom3.Z());
143 TEveVector mom = TEveVector(mom3.X(), mom3.Y(), mom3.Z());
156 LOG(debug1) <<
" CbmRecoTracks::Exec ";
162 for (Int_t i = 0; i < nofGlobalTracks; ++i) {
163 LOG(debug3) <<
"CbmRecoTracks::Exec " << i;
172 if (0 > stsId)
continue;
176 if (0 == stsTrack)
continue;
182 TEveTrack* eveTrack =
new TEveTrack(&P, pdg,
fTrPr);
196 else if (-1 < muchId)
202 else if (-1 < tofHitId)
206 LOG(debug3) <<
"track added " << eveTrack->GetName();
211 gEve->Redraw3D(kFALSE);
224 for (Int_t i = 0; i <
fEveTrList->GetEntriesFast(); i++) {
225 TEveTrackList* ele = (TEveTrackList*)
fEveTrList->At(i);
233 size_t buf_size = 128;
234 char name_buf[buf_size];
235 snprintf(name_buf, buf_size - 1,
"reco_%s", P->GetName());
237 for (Int_t i = 0; i <
fEveTrList->GetEntriesFast(); i++) {
238 TEveTrackList* TrListIn = (TEveTrackList*)
fEveTrList->At(i);
239 if (strcmp(TrListIn->GetName(), name_buf) == 0) {
245 fTrPr =
new TEveTrackPropagator();
ClassImp(CbmConverterManager)
Data class for STS tracks.
int32_t GetStsTrackIndex() const
int32_t GetRichRingIndex() const
int32_t GetTofTrackIndex() const
int32_t GetTofHitIndex() const
int32_t GetMuchTrackIndex() const
int32_t GetTrdTrackIndex() const
TClonesArray * fMuchPixelHits
TClonesArray * fMuchTracks
TClonesArray * fTofTracks
TEveTrackPropagator * fTrPr
virtual void Exec(Option_t *option)
virtual InitStatus Init()
TClonesArray * fStsTracks
FairEventManager * fEventManager
TEveTrackList * GetTrGroup(TParticle *P)
TClonesArray * fGlobalTracks
TClonesArray * fRichRings
virtual void SetParContainers()
void HandleTrack(TEveTrack *eveTrack, Int_t &n, const CbmTrack *recoTrack)
void HandlePixelHit(TEveTrack *eveTrack, Int_t &n, const CbmPixelHit *hit, TEveVector *pMom)
TClonesArray * fTrdTracks
void HandleStsTrack(TEveTrack *eveTrack, Int_t &n, const CbmStsTrack *stsTrack)
uint32_t GetHit(int32_t i) const
Data class with information on a STS local track.
int32_t GetNofMvdHits() const
int32_t GetMvdHitIndex(int32_t iHit) const
int32_t GetStsHitIndex(int32_t iHit) const
int32_t GetNofStsHits() const
int32_t GetPidHypo() const
virtual int32_t GetNofHits() const
const FairTrackParam * GetParamFirst() const
int32_t GetHitIndex(int32_t iHit) const
HitType GetHitType(int32_t iHit) const