14 #include "TLorentzVector.h"
15 #include "TParticle.h"
16 #include "TRefArray.h"
28 fStack(), fParticles(), fTracks(), fStoreMap(), fStoreIter(), fIndexMap(), fIndexIter(), fPointsMap(), fCurrentTrack(-1), fNPrimaries(0), fNParticles(0), fNTracks(0), fIndex(0), fStoreSecondaries(kTRUE), fMinPoints(1), fEnergyCut(0), fStoreMothers(kTRUE)
33 fParticles =
new TClonesArray(
"TParticle", size);
34 fTracks =
new TClonesArray(
"PndMCTrack", size);
58 Double_t px, Double_t py, Double_t pz,
59 Double_t
e, Double_t vx, Double_t vy, Double_t vz,
60 Double_t
time, Double_t polx, Double_t
poly,
61 Double_t polz, TMCProcess proc, Int_t& ntr,
62 Double_t weight, Int_t is) {
74 Double_t px, Double_t py, Double_t pz,
75 Double_t
e, Double_t vx, Double_t vy, Double_t vz,
76 Double_t
time, Double_t polx, Double_t
poly,
77 Double_t polz, TMCProcess proc, Int_t& ntr,
78 Double_t weight, Int_t is,Int_t secondparentID) {
86 Int_t daughter1Id = -1;
87 Int_t daughter2Id = -1;
89 new(partArray[
fNParticles++]) TParticle(pdgCode, trackId, parentId,
91 daughter2Id, px, py, pz, e,
93 particle->SetLastMother(secondparentID);
94 particle->SetPolarisation(polx, poly, polz);
95 particle->SetWeight(weight);
96 particle->SetUniqueID(proc);
105 if (toBeDone == 1)
fStack.push(particle);
122 TParticle* thisParticle =
fStack.top();
125 if ( !thisParticle) {
149 Fatal(
"PndStack::PopPrimaryForTracking",
"Index out of range");
155 if ( ! (part->GetMother(0) < 0) ) {
157 Fatal(
"PndStack::PopPrimaryForTracking",
"Not a primary track");
170 if ( ! currentPart) {
172 Warning(
"PndStack::GetCurrentTrack",
"Track not found in stack");
183 TParticle* newPart =
new(array[
fIndex]) TParticle(*oldPart);
184 newPart->SetWeight(oldPart->GetWeight());
185 newPart->SetUniqueID(oldPart->GetUniqueID());
210 Fatal(
"PndStack::FillTrackArray",
"Particle not found in storage map.");
212 Bool_t store = (*fStoreIter).second;
219 for (Int_t iDet=
kRICH; iDet<=
kHYP; iDet++) {
220 pair<Int_t, Int_t> a(iPart, iDet);
259 Int_t daughters=0, daughtersp=0;
262 for (Int_t i=0; i<
n; i++) {
265 m=part->GetMother(0);
269 m=part->GetMother(1);
282 if( ((TParticle*)
fParticles->At(myid))->GetMother(0)!=mymo1){
286 if(daughters!=0 && daughtersp!=0){
287 gLogger->
Error(
MESSAGE_ORIGIN,
"=== Problem: particle with index %i has daughters= %i && daughtersp= %i ",myid,daughters,daughtersp);
312 Fatal(
"PndStack::UpdateTrackIndex",
"Particle index not found in map");
320 Fatal(
"PndStack::UpdateTrackIndex",
"Particle index not found in map");
327 TIterator* detIter = detList->MakeIterator();
337 Int_t nPoints = hitArray->GetEntriesFast();
340 for (Int_t iPoint = 0; iPoint < nPoints; iPoint++) {
347 "PndStack: Particle index %i not found in index map! ",
349 Fatal(
"PndStack::UpdateTrackIndex",
350 "Particle index not found in map");
396 for (Int_t iTrack=0; iTrack<
fNTracks; iTrack++)
417 if ( iTrack < 0 )
return;
419 pair<Int_t, Int_t> a(iTrack, iDet);
431 if ( currentPart )
return currentPart->GetFirstMother();
442 Fatal(
"PndStack::GetParticle",
"Index out of range");
460 Bool_t store = kTRUE;
463 Int_t iMother = thisPart->GetMother(0);
465 thisPart->Momentum(p);
466 Double_t energy = p.E();
467 Double_t
mass = p.M();
469 Double_t eKin = energy -
mass;
470 if(eKin < 0.0) eKin=0.0;
473 for (Int_t iDet=
kRICH; iDet<=
kHYP; iDet++) {
474 pair<Int_t, Int_t> a(i, iDet);
480 if (iMother < 0) store = kTRUE;
497 while(iMother >= 0) {