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