84 void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e,
85 Double_t vx, Double_t vy, Double_t vz, Double_t
time, Double_t polx, Double_t poly, Double_t polz,
86 TMCProcess proc, Int_t& ntr, Double_t
weight, Int_t is)
override;
88 void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e,
89 Double_t vx, Double_t vy, Double_t vz, Double_t
time, Double_t polx, Double_t poly, Double_t polz,
90 TMCProcess proc, Int_t& ntr, Double_t
weight, Int_t is, Int_t secondParentId)
override;
92 void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e,
93 Double_t vx, Double_t vy, Double_t vz, Double_t
time, Double_t polx, Double_t poly, Double_t polz,
94 TMCProcess proc, Int_t& ntr, Double_t
weight, Int_t is, Int_t secondParentId, Int_t daughter1Id, Int_t daughter2Id,
119 Int_t
GetNtrack()
const override {
return mNumberOfEntriesInParticles; }
122 Int_t
GetNprimary()
const override {
return mNumberOfPrimaryParticles; }
128 return const_cast<TParticle*
>(&mCurrentParticle);
136 Int_t GetCurrentParentTrackNumber()
const override;
139 TMCProcess GetProdProcessOfCurrentTrack()
const;
142 void FillTrackArray()
override;
145 void UpdateTrackIndex(TRefArray* detArray =
nullptr)
override;
148 void FinishPrimary()
override;
151 void Reset()
override;
154 void Register()
override;
159 virtual void Print(Int_t iVerbose = 0)
const;
163 void Print(Option_t* option =
nullptr)
const override;
165 void ReorderKine(std::vector<MCTrack>& particles, std::vector<int>& reOrderedIndices);
174 void addHit(
int iDet);
176 TClonesArray* GetListOfParticles()
override;
178 std::vector<MCTrack>
const*
const getMCTracks()
const {
return mTracks; }
187 const std::vector<TParticle>&
getPrimaries()
const {
return mPrimaryParticles; }
194 for (
auto p : primaries) {
199 PushTrack(doTrack, p);
201 mNumberOfPrimaryParticles = primaries.size();
202 mNumberOfEntriesInParticles = mNumberOfPrimaryParticles;
208 int getMotherTrackId(
int )
const;
212 bool isTrackDaughterOf(
int ,
int )
const;
214 bool isCurrentTrackDaughterOf(
int parentid)
const;
217 int getCurrentPrimaryIndex()
const;
221 void fillParentIDs(std::vector<int>&
ids)
const;
229 void updateEventStats();
240 typedef std::function<bool(
const TParticle& p,
const std::vector<TParticle>& particles)>
TransportFcn;
245 std::stack<TParticle> mStack;
249 std::vector<o2::MCTrack> mParticles;
250 std::vector<int> mTransportedIDs;
251 std::vector<int> mIndexOfPrimaries;
252 std::vector<int> mTrackIDtoParticlesEntry;
254 TParticle mCurrentParticle;
255 TParticle mCurrentParticle0;
259 std::vector<TParticle> mPrimaryParticles;
262 std::vector<o2::MCTrack>* mTracks;
265 std::map<Int_t, Int_t> mIndexMap;
268 std::vector<o2::base::Detector*> mActiveDetectors;
271 Int_t mIndexOfCurrentTrack;
272 Int_t mIndexOfCurrentPrimary;
273 Int_t mNumberOfPrimaryParticles;
274 Int_t mNumberOfEntriesInParticles;
275 Int_t mNumberOfEntriesInTracks;
276 Int_t mNumberOfPrimariesforTracking;
277 Int_t mNumberOfPrimariesPopped;
281 Bool_t mStoreMothers;
282 Bool_t mStoreSecondaries;
283 bool mPruneKinematics =
false;
285 Int_t mHitCounter = 0;
286 Double32_t mEnergyCut;
289 Int_t mCleanupCounter = 0;
290 Int_t mCleanupThreshold = 1;
291 Int_t mPrimariesDone = 0;
292 Int_t mTracksDone = 0;
294 bool mIsG4Like =
false;
296 bool mIsExternalMode =
false;
297 bool mDoTrackSeeding =
false;
299 TransportFcn mTransportPrimary = [](
const TParticle& p,
const std::vector<TParticle>& particles) {
return false; };
302 std::vector<o2::TrackReference>* mTrackRefs =
nullptr;
312 bool isPrimary(
const MCTrack& part);
313 bool isFromPrimaryDecayChain(
const MCTrack& part);
314 bool isFromPrimaryPairProduction(
const MCTrack& part);
316 bool keepPhysics(
const MCTrack& part);
325 void addHit(
int iDet, Int_t iTrack);
327 void handleTransportPrimary(TParticle& p);
329 ClassDefOverride(
Stack, 1);
void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is) override