16 #include <TClonesArray.h>
17 #include <TDatabasePDG.h>
23 , fPointsArrayName(
"FairTutPropPoint")
24 , fHitsArrayName(
"FairTutPropHits")
25 , fPointsArray(nullptr)
26 , fTracksArray(nullptr)
27 , fHitsArray(new TClonesArray(
"FairTutPropHit", 100))
29 LOG(debug) <<
"Default Constructor of FairTutPropHitProducer";
34 LOG(debug) <<
"Destructor of FairTutPropHitProducer";
41 LOG(debug) <<
"SetParContainers of FairTutPropHitProducer";
54 LOG(debug) <<
"Initilization of FairTutPropHitProducer";
60 fPointsArray =
static_cast<TClonesArray*
>(ioman->
GetObject(fPointsArrayName.data()));
61 fTracksArray =
static_cast<TClonesArray*
>(ioman->
GetObject(
"MCTrack"));
62 if (!fPointsArray || !fTracksArray) {
63 LOG(error) <<
"No InputDataLevelName array!";
64 LOG(error) <<
"FairTutPropHitProducer will be inactive";
70 ioman->
Register(fHitsArrayName.data(),
"TutProp", fHitsArray, kTRUE);
81 LOG(debug) <<
"Reinitilization of FairTutPropHitProducer";
87 LOG(debug) <<
"Exec of FairTutPropHitProducer";
94 for (
int iPoint = 0; iPoint < fPointsArray->GetEntriesFast(); iPoint++) {
109 dposition.SetXYZ(0.05, 0.05, 0.);
110 position.SetXYZ(gRandom->Gaus(position.X(), 0.05), gRandom->Gaus(position.Y(), 0.05), position.Z());
111 dmomentum.SetXYZ(0.05, 0.05, 0.05);
113 gRandom->Gaus(momentum.X(), 0.05), gRandom->Gaus(momentum.Y(), 0.05), gRandom->Gaus(momentum.Z(), 0.05));
117 TDatabasePDG* dbPDG = TDatabasePDG::Instance();
118 TParticlePDG* particle = dbPDG->GetParticle(track->
GetPdgCode());
121 charge = particle->Charge();
void Momentum(TVector3 &mom) const
virtual InitStatus Init()
virtual void Exec(Option_t *opt)
~FairTutPropHitProducer()
void Position(TVector3 &pos) const
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
TObject * GetObject(const char *BrName)
virtual void SetParContainers()
Int_t GetTrackID() const
event identifier
virtual InitStatus ReInit()
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
Int_t GetDetectorID() const