VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex03cMCStack.h
Go to the documentation of this file.
1#ifndef EX03_STACK_H
2#define EX03_STACK_H
3
4//------------------------------------------------
5// The Virtual Monte Carlo examples
6// Copyright (C) 2014 - 2018 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
13/// \file Ex03cMCStack.h
14/// \brief Definition of the Ex03cMCStack class
15///
16/// Geant4 ExampleN03 adapted to Virtual Monte Carlo
17///
18/// \author Benedikt Volkel, CERN
19
20#include <TVirtualMCStack.h>
21
22#include <stack>
23
24class TParticle;
25class TClonesArray;
26
27/// \ingroup E03
28/// \brief Implementation of the TVirtualMCStack interface
29///
30/// A variant of the Ex03CalorimeterSD class
31/// updated for multiple engine runs.
32///
33/// \date 21/08/2019
34/// \author Benedikt Volkel, CERN
35
37{
38 public:
39 Ex03cMCStack(Int_t size);
41 virtual ~Ex03cMCStack();
42
43 // methods
44 virtual void PushTrack(Int_t toBeDone, Int_t parent, Int_t pdg, Double_t px,
45 Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz,
46 Double_t tof, Double_t polx, Double_t poly, Double_t polz, TMCProcess mech,
47 Int_t& ntr, Double_t weight, Int_t is);
48 virtual TParticle* PopNextTrack(Int_t& track);
49 virtual TParticle* PopPrimaryForTracking(Int_t i);
50 virtual void Print(Option_t* option = "") const;
51 void Reset();
52
53 // set methods
54 virtual void SetCurrentTrack(Int_t track);
55
56 // get methods
57 virtual Int_t GetNtrack() const;
58 virtual Int_t GetNprimary() const;
59 virtual TParticle* GetCurrentTrack() const;
60 virtual Int_t GetCurrentTrackNumber() const;
61 virtual Int_t GetCurrentParentTrackNumber() const;
62 TParticle* GetParticle(Int_t id) const;
63
64 private:
65 // data members
66 std::stack<TParticle*> fStack; //!< The stack of particles (transient)
67 TClonesArray* fParticles; ///< The array of particle (persistent)
68 Int_t fCurrentTrack; ///< The current track number
69 Int_t fNPrimary; ///< The number of primaries
70
71 ClassDef(Ex03cMCStack, 1) // Ex03cMCStack
72};
73
74#endif // EX03_STACK_H
Implementation of the TVirtualMCStack interface.
std::stack< TParticle * > fStack
The stack of particles (transient)
virtual TParticle * GetCurrentTrack() const
virtual Int_t GetCurrentParentTrackNumber() const
TClonesArray * fParticles
The array of particle (persistent)
virtual Int_t GetCurrentTrackNumber() const
Int_t fCurrentTrack
The current track number.
virtual TParticle * PopPrimaryForTracking(Int_t i)
virtual void SetCurrentTrack(Int_t track)
TParticle * GetParticle(Int_t id) const
virtual void Print(Option_t *option="") const
virtual void PushTrack(Int_t toBeDone, Int_t parent, Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t tof, Double_t polx, Double_t poly, Double_t polz, TMCProcess mech, Int_t &ntr, Double_t weight, Int_t is)
Int_t fNPrimary
The number of primaries.
virtual Int_t GetNprimary() const
virtual Int_t GetNtrack() const
virtual TParticle * PopNextTrack(Int_t &track)
virtual ~Ex03cMCStack()