VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex03MCStack.h
Go to the documentation of this file.
1#ifndef EX03_MC_STACK_H
2#define EX03_MC_STACK_H
3
4//------------------------------------------------
5// The Virtual Monte Carlo examples
6// Copyright (C) 2007 - 2015 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 TR/include/ E03/include/Ex03MCStack.h
14/// \brief Definition of the Ex03MCStack class
15///
16/// Geant4 ExampleN03 adapted to Virtual Monte Carlo
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <TVirtualMCStack.h>
21
22#include <stack>
23
24class TParticle;
25class TClonesArray;
26
27/// \ingroup TR
28/// \brief Implementation of the TVirtualMCStack interface
29///
30/// \date 06/03/2003
31/// \author I. Hrivnacova; IPN, Orsay
32
33class Ex03MCStack : public TVirtualMCStack
34{
35 public:
36 Ex03MCStack(Int_t size);
38 virtual ~Ex03MCStack();
39
40 // methods
41 virtual void PushTrack(Int_t toBeDone, Int_t parent, Int_t pdg, Double_t px,
42 Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz,
43 Double_t tof, Double_t polx, Double_t poly, Double_t polz, TMCProcess mech,
44 Int_t& ntr, Double_t weight, Int_t is);
45 virtual TParticle* PopNextTrack(Int_t& track);
46 virtual TParticle* PopPrimaryForTracking(Int_t i);
47 virtual void Print(Option_t* option = "") const;
48 void Reset();
49
50 // set methods
51 virtual void SetCurrentTrack(Int_t track);
52
53 // get methods
54 virtual Int_t GetNtrack() const;
55 virtual Int_t GetNprimary() const;
56 virtual TParticle* GetCurrentTrack() const;
57 virtual Int_t GetCurrentTrackNumber() const;
58 virtual Int_t GetCurrentParentTrackNumber() const;
59 TParticle* GetParticle(Int_t id) const;
60
61 private:
62 // data members
63 std::stack<TParticle*> fStack; //!< The stack of particles (transient)
64 TClonesArray* fParticles; ///< The array of particle (persistent)
65 Int_t fCurrentTrack; ///< The current track number
66 Int_t fNPrimary; ///< The number of primaries
67
68 ClassDef(Ex03MCStack, 1) // Ex03MCStack
69};
70
71#endif // EX03_MC_STACK_H
Implementation of the TVirtualMCStack interface.
Definition Ex03MCStack.h:36
void Reset()
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)
virtual void SetCurrentTrack(Int_t track)
virtual Int_t GetNprimary() const
virtual TParticle * PopPrimaryForTracking(Int_t i)
virtual TParticle * GetCurrentTrack() const
virtual TParticle * PopNextTrack(Int_t &track)
virtual Int_t GetCurrentParentTrackNumber() const
Int_t fCurrentTrack
The current track number.
Definition Ex03MCStack.h:67
virtual ~Ex03MCStack()
std::stack< TParticle * > fStack
The stack of particles (transient)
Definition Ex03MCStack.h:65
virtual Int_t GetNtrack() const
TClonesArray * fParticles
The array of particle (persistent)
Definition Ex03MCStack.h:66
Ex03MCStack(Int_t size)
TParticle * GetParticle(Int_t id) const
virtual void Print(Option_t *option="") const
virtual Int_t GetCurrentTrackNumber() const
Int_t fNPrimary
The number of primaries.
Definition Ex03MCStack.h:68