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