VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex01MCStack.h
Go to the documentation of this file.
1#ifndef Ex01_STACK_H
2#define Ex01_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 Ex01MCStack.h
14/// \brief Definition of the Ex01MCStack class
15///
16/// Geant4 ExampleN01 adapted to Virtual Monte Carlo
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include "Ex01Particle.h"
21
22#include <TVirtualMCStack.h>
23
24#include <stack>
25
26/// \ingroup E01
27/// \brief Implementation of the TVirtualMCStack interface
28///
29/// \date 05/04/2002
30/// \author I. Hrivnacova; IPN, Orsay
31
33{
34 public:
35 Ex01MCStack(Int_t size);
37 virtual ~Ex01MCStack();
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& itrack);
45 virtual TParticle* PopPrimaryForTracking(Int_t i);
46
47 // set methods
48 virtual void SetCurrentTrack(Int_t itrack);
49
50 // get methods
51 virtual Int_t GetNtrack() const;
52 virtual Int_t GetNprimary() const;
53 virtual TParticle* GetCurrentTrack() const;
54 virtual Int_t GetCurrentTrackNumber() const;
55 virtual Int_t GetCurrentParentTrackNumber() const;
56
57 private:
58 // methods
59 Ex01Particle* GetParticle(Int_t id) const;
60
61 // data members
62 std::stack<Ex01Particle*> fStack; //!< The stack of particles (transient)
63 TObjArray* fParticles; ///< The array of particle (persistent)
64 Int_t fCurrentTrack; ///< The current track number
65 Int_t fNPrimary; ///< The number of primaries
66
67 ClassDef(Ex01MCStack, 1) // Ex01MCStack
68};
69
70#endif // Ex01_STACK_H
Definition of the Ex01Particle class.
Implementation of the TVirtualMCStack interface.
Definition Ex01MCStack.h:33
virtual TParticle * PopPrimaryForTracking(Int_t i)
virtual void SetCurrentTrack(Int_t itrack)
virtual Int_t GetCurrentTrackNumber() const
TObjArray * fParticles
The array of particle (persistent)
Definition Ex01MCStack.h:63
virtual Int_t GetNtrack() const
Int_t fNPrimary
The number of primaries.
Definition Ex01MCStack.h:65
Ex01Particle * GetParticle(Int_t id) const
Int_t fCurrentTrack
The current track number.
Definition Ex01MCStack.h:64
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)
std::stack< Ex01Particle * > fStack
The stack of particles (transient)
Definition Ex01MCStack.h:62
virtual Int_t GetCurrentParentTrackNumber() const
virtual TParticle * GetCurrentTrack() const
virtual Int_t GetNprimary() const
virtual TParticle * PopNextTrack(Int_t &itrack)
virtual ~Ex01MCStack()
Extended TParticle with pointers to mother and daughter particles.