12 #include "TLorentzVector.h"
13 #include "TClonesArray.h"
14 #include "TParticle.h"
15 #include "TRefArray.h"
26 fParticles(new TClonesArray(
"TParticle", size)),
27 fTracks(new TClonesArray(
"CbmMCTrack", size)),
38 fStoreSecondaries(kTRUE),
65 Double_t px, Double_t py, Double_t pz,
66 Double_t
e, Double_t vx, Double_t vy, Double_t vz,
67 Double_t
time, Double_t polx, Double_t
poly,
68 Double_t polz, TMCProcess proc, Int_t& ntr,
69 Double_t weight, Int_t is)
83 Double_t px, Double_t py, Double_t pz,
84 Double_t
e, Double_t vx, Double_t vy, Double_t vz,
85 Double_t
time, Double_t polx, Double_t
poly,
86 Double_t polz, TMCProcess proc, Int_t& ntr,
87 Double_t weight, Int_t is,Int_t secondparentID)
97 Int_t daughter1Id = -1;
98 Int_t daughter2Id = -1;
100 new(partArray[
fNParticles++]) TParticle(pdgCode, trackId, parentId,
101 nPoints, daughter1Id,
102 daughter2Id, px, py, pz, e,
104 particle->SetPolarisation(polx, poly, polz);
105 particle->SetWeight(weight);
106 particle->SetUniqueID(proc);
116 if (toBeDone == 1) {
fStack.push(particle); }
134 TParticle* thisParticle =
fStack.top();
137 if ( !thisParticle) {
167 if ( ! (part->GetMother(0) < 0) ) {
182 if ( ! currentPart) {
195 TParticle* newPart =
new(array[
fIndex]) TParticle(*oldPart);
196 newPart->SetWeight(oldPart->GetWeight());
197 newPart->SetUniqueID(oldPart->GetUniqueID());
222 LOG(
FATAL) <<
"Particle " << iPart
225 Bool_t store = (*fStoreIter).second;
232 for (Int_t iDet=
kREF; iDet<=
kPSD; iDet++) {
233 pair<Int_t, Int_t> a(iPart, iDet);
265 LOG(
FATAL) <<
"Particle index " << iMotherOld
272 TIterator* detIter = detList->MakeIterator();
283 Int_t nPoints = hitArray->GetEntriesFast();
286 for (Int_t iPoint=0; iPoint<nPoints; iPoint++) {
292 LOG(
FATAL) <<
"Particle index " << iTrack
337 LOG(
INFO) <<
"Number of primaries = "
339 LOG(
INFO) <<
"Total number of particles = "
341 LOG(
INFO) <<
"Number of tracks in output = "
343 for (Int_t iTrack=0; iTrack<
fNTracks; iTrack++) {
366 if ( iTrack < 0 ) {
return; }
368 pair<Int_t, Int_t> a(iTrack, iDet);
381 if ( currentPart ) {
return currentPart->GetFirstMother(); }
392 LOG(
FATAL) <<
"Particle index " << trackID
412 Bool_t store = kTRUE;
415 Int_t iMother = thisPart->GetMother(0);
417 thisPart->Momentum(p);
418 Double_t energy = p.E();
419 Double_t
mass = p.M();
421 Double_t eKin = energy -
mass;
422 if(eKin < 0.0) { eKin=0.0; }
425 for (Int_t iDet=
kMVD; iDet<=
kPSD; iDet++) {
426 pair<Int_t, Int_t> a(i, iDet);
433 if (iMother < 0) { store = kTRUE; }
451 while(iMother >= 0) {