21 #include "TClonesArray.h"
22 #include "TDatabasePDG.h"
27 , fPropagatorSet(false)
42 fTrackParIni->Delete();
46 fTrackParProp->Delete();
50 fTrackParWrong->Delete();
51 delete fTrackParWrong;
54 fTrackParFinal->Delete();
55 delete fTrackParFinal;
67 LOG(error) <<
"FairTutPropTr::Init: RootManager not instantised!";
70 fTrackParIni =
new TClonesArray(
"FairTrackParP");
71 ioman->
Register(
"PropTrackIni",
"Prop", fTrackParIni, kTRUE);
73 fTrackParFinal =
new TClonesArray(
"FairTrackParP");
74 ioman->
Register(
"PropTrackFinal",
"Prop", fTrackParFinal, kTRUE);
76 fTrackParProp =
new TClonesArray(
"FairTrackParP");
77 ioman->
Register(
"PropTrackPar",
"Prop", fTrackParProp, kTRUE);
79 fTrackParWrong =
new TClonesArray(
"FairTrackParP");
80 ioman->
Register(
"PropTrackParWrong",
"Prop", fTrackParWrong, kTRUE);
84 fPointArray =
static_cast<TClonesArray*
>(ioman->
GetObject(
"FairTutPropPoint"));
91 void FairTutPropTr::InitPropagator()
93 TVector3 planePoint(0., 0., 40.);
94 TVector3 planeVectJ(1., 0., 0.);
95 TVector3 planeVectK(0., 1., 0.);
99 fPropagatorSet =
true;
109 if (!fPropagatorSet) {
113 LOG(debug) <<
"FairTutPropTr::Exec";
115 Int_t NoOfEntries = fPointArray->GetEntriesFast();
116 LOG(debug) <<
"fPointArray has " << NoOfEntries <<
" entries";
117 for (Int_t i = 0; i < NoOfEntries; i++) {
119 if (point1->
GetZ() > 15.)
121 LOG(debug) <<
"first loop for " << i <<
"from " << NoOfEntries <<
" entries ";
124 for (Int_t k = 0; k < NoOfEntries; k++) {
126 if (point2->
GetZ() < 35.)
128 LOG(debug) <<
"second loop for " << k;
136 TVector3 StartPos(point1->
GetX(), point1->
GetY(), point1->
GetZ());
137 TVector3 StartPosErr(0, 0, 0);
139 TVector3 StartMomErr(0, 0, 0);
141 TVector3 EndPos(point2->
GetX(), point2->
GetY(), point2->
GetZ());
142 TVector3 EndPosErr(0, 0, 0);
144 TVector3 EndMomErr(0, 0, 0);
148 TDatabasePDG* fdbPDG = TDatabasePDG::Instance();
149 TParticlePDG* fParticle = fdbPDG->GetParticle(PDGCode);
150 Double_t fCharge = fParticle->Charge();
152 TClonesArray& clref1 = *fTrackParIni;
153 Int_t size1 = clref1.GetEntriesFast();
159 TVector3(0., 0., 10.),
160 TVector3(1., 0., 0.),
161 TVector3(0., 1., 0.));
164 TClonesArray& clref = *fTrackParProp;
165 Int_t size = clref.GetEntriesFast();
169 TClonesArray& clrew = *fTrackParWrong;
170 Int_t sizeW = clrew.GetEntriesFast();
174 TClonesArray& clref2 = *fTrackParFinal;
175 Int_t size2 = clref2.GetEntriesFast();
181 TVector3(0., 0., 40.),
182 TVector3(1., 0., 0.),
183 TVector3(0., 1., 0.));
213 void FairTutPropTr::Reset()
216 fTrackParIni->Clear();
218 fTrackParProp->Clear();
220 fTrackParWrong->Clear();
222 fTrackParFinal->Clear();
227 void FairTutPropTr::Finish()
230 fTrackParIni->Delete();
232 fTrackParProp->Delete();
234 fTrackParWrong->Delete();
236 fTrackParFinal->Delete();
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
virtual bool SetDestinationPlane([[gnu::unused]] const TVector3 &v0, [[gnu::unused]] const TVector3 &v1, [[gnu::unused]] const TVector3 &v2)
virtual bool Propagate([[gnu::unused]] FairTrackParH *TStart, [[gnu::unused]] FairTrackParH *TEnd, [[gnu::unused]] int PDG)
TObject * GetObject(const char *BrName)
Int_t GetTrackID() const
event identifier
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
virtual void Exec(Option_t *opt)
virtual InitStatus Init()