VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex02MCStack.h
Go to the documentation of this file.
1#ifndef EX02_STACK_H
2#define EX02_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 Ex02MCStack.h
14/// \brief Definition of the Ex02MCStack class
15///
16/// Geant4 ExampleN02 adapted to Virtual Monte Carlo
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include "Ex02Particle.h"
21
22#include <TVirtualMCStack.h>
23
24#include <stack>
25
26/// \ingroup E02
27/// \brief Implementation of the TVirtualMCStack interface
28///
29/// \date 05/04/2002
30/// \author I. Hrivnacova; IPN, Orsay
31
33{
34 public:
35 Ex02MCStack(Int_t size);
37 virtual ~Ex02MCStack();
38
39 // methods
40 virtual void PushTrack(Int_t toBeDone, Int_t parent, Int_t pdg, Double_t px,
41 Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz,
42 Double_t tof, Double_t polx, Double_t poly, Double_t polz, TMCProcess mech,
43 Int_t& ntr, Double_t weight, Int_t is);
44 virtual TParticle* PopNextTrack(Int_t& track);
45 virtual TParticle* PopPrimaryForTracking(Int_t i);
46 virtual void Print(Option_t* option = "") const;
47 void Reset();
48
49 // set methods
50 virtual void SetCurrentTrack(Int_t track);
51 void SetObjectNumber();
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 Ex02Particle* GetParticle(Int_t id) const;
60
61 private:
62 // data members
63 std::stack<Ex02Particle*> fStack; //!< The stack of particles (transient)
64 TObjArray* fParticles; ///< The array of particle (persistent)
65 Int_t fCurrentTrack; ///< The current track number
66 Int_t fNPrimary; ///< The number of primaries
67 Int_t fObjectNumber; ///< The Root object number counter
68
69 ClassDef(Ex02MCStack, 1) // Ex02MCStack
70};
71
72#endif // EX02_STACK_H
Definition of the Ex02Particle class.
Implementation of the TVirtualMCStack interface.
Definition Ex02MCStack.h:33
virtual ~Ex02MCStack()
virtual void Print(Option_t *option="") const
virtual TParticle * GetCurrentTrack() const
virtual void SetCurrentTrack(Int_t track)
Int_t fCurrentTrack
The current track number.
Definition Ex02MCStack.h:65
virtual TParticle * PopPrimaryForTracking(Int_t i)
virtual Int_t GetNtrack() const
virtual TParticle * PopNextTrack(Int_t &track)
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)
Ex02Particle * GetParticle(Int_t id) const
void SetObjectNumber()
virtual Int_t GetCurrentTrackNumber() const
Int_t fObjectNumber
The Root object number counter.
Definition Ex02MCStack.h:67
virtual Int_t GetCurrentParentTrackNumber() const
virtual Int_t GetNprimary() const
std::stack< Ex02Particle * > fStack
The stack of particles (transient)
Definition Ex02MCStack.h:63
Int_t fNPrimary
The number of primaries.
Definition Ex02MCStack.h:66
TObjArray * fParticles
The array of particle (persistent)
Definition Ex02MCStack.h:64
Extended TParticle with pointers to mother and daughter particles.