VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
E03
E03d
include
Ex03dMCStack.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) 2014 - 2018 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 E03/include/Ex03dMCStack.h
14
/// \brief Definition of the Ex03dMCStack class
15
///
16
/// Geant4 ExampleN03 adapted to Virtual Monte Carlo
17
///
18
/// \author Radoslaw Karabowicz; GSI
19
20
#include <TVirtualMCStack.h>
21
22
#include "
Ex03dParticle.h
"
23
#include "TParticle.h"
24
25
#include <stack>
26
#include <vector>
27
28
/// \ingroup E03
29
/// \brief Implementation of the TVirtualMCStack interface
30
///
31
/// A variant of the Ex03MCStack class
32
/// updated for RNTuple output.
33
///
34
/// \date 07/07/2026
35
/// \author Radoslaw Karabowicz; GSI
36
37
class
Ex03dMCStack
:
public
TVirtualMCStack
38
{
39
public
:
40
Ex03dMCStack
(Int_t size);
41
Ex03dMCStack
();
42
virtual
~Ex03dMCStack
();
43
44
// methods
45
virtual
void
PushTrack
(Int_t toBeDone, Int_t parent, Int_t pdg, Double_t px,
46
Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz,
47
Double_t tof, Double_t polx, Double_t poly, Double_t polz, TMCProcess mech,
48
Int_t& ntr, Double_t weight, Int_t is);
49
virtual
TParticle*
PopNextTrack
(Int_t& track);
50
virtual
TParticle*
PopPrimaryForTracking
(Int_t i);
51
virtual
void
Print
(Option_t* option =
""
)
const
;
52
void
Reset
();
53
54
void
Register
();
55
56
// set methods
57
virtual
void
SetCurrentTrack
(Int_t track);
58
59
// get methods
60
virtual
Int_t
GetNtrack
()
const
;
61
virtual
Int_t
GetNprimary
()
const
;
62
virtual
TParticle*
GetCurrentTrack
()
const
;
63
virtual
Int_t
GetCurrentTrackNumber
()
const
;
64
virtual
Int_t
GetCurrentParentTrackNumber
()
const
;
65
TParticle*
GetParticle
(Int_t
id
)
const
;
66
67
private
:
68
// data members
69
std::stack<TParticle*>
fStack
;
//! < The stack of particles (transient)
70
std::vector<TParticle>*
fParticles
{
71
new
std::vector<TParticle>
72
};
//! < The vector of particle (persistent)
73
// libc++abi: terminating due to uncaught exception of type
74
// ROOT::RException: TParticle cannot be stored natively in RNTuple
75
std::vector<Ex03dParticle>*
fExParticles
{
76
new
std::vector<Ex03dParticle>
77
};
//! < The vector of particle (persistent)
78
Int_t
fCurrentTrack
{ -1 };
/// < The current track number
79
Int_t
fNPrimary
{ 0 };
/// < The number of primaries
80
81
ClassDef(
Ex03dMCStack
, 1)
// Ex03dMCStack
82
};
83
84
#endif
// EX03_STACK_H
Ex03dParticle.h
Definition of the Ex03dParticle class.
Ex03dMCStack
Implementation of the TVirtualMCStack interface.
Definition
Ex03dMCStack.h:38
Ex03dMCStack::GetNprimary
virtual Int_t GetNprimary() const
Definition
Ex03dMCStack.cxx:189
Ex03dMCStack::GetCurrentParentTrackNumber
virtual Int_t GetCurrentParentTrackNumber() const
Definition
Ex03dMCStack.cxx:218
Ex03dMCStack::PopPrimaryForTracking
virtual TParticle * PopPrimaryForTracking(Int_t i)
Definition
Ex03dMCStack.cxx:137
Ex03dMCStack::GetNtrack
virtual Int_t GetNtrack() const
Definition
Ex03dMCStack.cxx:182
Ex03dMCStack::GetCurrentTrack
virtual TParticle * GetCurrentTrack() const
Definition
Ex03dMCStack.cxx:197
Ex03dMCStack::GetCurrentTrackNumber
virtual Int_t GetCurrentTrackNumber() const
Definition
Ex03dMCStack.cxx:210
Ex03dMCStack::Print
virtual void Print(Option_t *option="") const
Definition
Ex03dMCStack.cxx:150
Ex03dMCStack::Ex03dMCStack
Ex03dMCStack(Int_t size)
Definition
Ex03dMCStack.cxx:32
Ex03dMCStack::fParticles
std::vector< TParticle > * fParticles
< The stack of particles (transient)
Definition
Ex03dMCStack.h:70
Ex03dMCStack::SetCurrentTrack
virtual void SetCurrentTrack(Int_t track)
Definition
Ex03dMCStack.cxx:173
Ex03dMCStack::~Ex03dMCStack
virtual ~Ex03dMCStack()
Definition
Ex03dMCStack.cxx:45
Ex03dMCStack::GetParticle
TParticle * GetParticle(Int_t id) const
Definition
Ex03dMCStack.cxx:231
Ex03dMCStack::fExParticles
std::vector< Ex03dParticle > * fExParticles
< The vector of particle (persistent)
Definition
Ex03dMCStack.h:75
Ex03dMCStack::PushTrack
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)
Definition
Ex03dMCStack.cxx:61
Ex03dMCStack::Reset
void Reset()
Definition
Ex03dMCStack.cxx:162
Ex03dMCStack::Ex03dMCStack
Ex03dMCStack()
Definition
Ex03dMCStack.cxx:39
Ex03dMCStack::PopNextTrack
virtual TParticle * PopNextTrack(Int_t &track)
Definition
Ex03dMCStack.cxx:116
Ex03dMCStack::fNPrimary
Int_t fNPrimary
< The current track number
Definition
Ex03dMCStack.h:79
Ex03dMCStack::fStack
std::stack< TParticle * > fStack
Definition
Ex03dMCStack.h:69
Ex03dMCStack::Register
void Register()
Definition
Ex03dMCStack.cxx:55
Ex03dMCStack::fCurrentTrack
Int_t fCurrentTrack
< The vector of particle (persistent)
Definition
Ex03dMCStack.h:78
TVirtualMCStack
Generated on
for VMC Examples by
1.17.0