Geant4 VMC
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
source
physics_list
src
TG4StackPopperPhysics.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Geant4 Virtual Monte Carlo package
3
// Copyright (C) 2007 - 2015 Ivana Hrivnacova
4
// All rights reserved.
5
//
6
// For the licensing terms see geant4_vmc/LICENSE.
7
// Contact: root-vmc@cern.ch
8
//-------------------------------------------------
9
14
15
#include "
TG4StackPopperPhysics.h
"
16
#include "
TG4StackPopper.h
"
17
#include "
TG4Globals.h
"
18
19
#include <G4ProcessManager.hh>
20
21
//_____________________________________________________________________________
22
TG4StackPopperPhysics::TG4StackPopperPhysics
(
const
G4String& name)
23
:
TG4VPhysicsConstructor
(name),
24
fMessenger
(this),
25
fStackPopperProcess
(0),
26
fSelection
()
27
{
29
}
30
31
//_____________________________________________________________________________
32
TG4StackPopperPhysics::TG4StackPopperPhysics
(
33
G4int theVerboseLevel,
const
G4String& name)
34
:
TG4VPhysicsConstructor
(name, theVerboseLevel),
35
fMessenger
(this),
36
fStackPopperProcess
(0),
37
fSelection
()
38
{
40
}
41
42
//_____________________________________________________________________________
43
TG4StackPopperPhysics::~TG4StackPopperPhysics
()
44
{
46
47
delete
fStackPopperProcess
;
48
}
49
50
//
51
// protected methods
52
//
53
54
//_____________________________________________________________________________
55
void
TG4StackPopperPhysics::ConstructParticle
()
56
{
58
}
59
60
//_____________________________________________________________________________
61
void
TG4StackPopperPhysics::ConstructProcess
()
62
{
65
66
fStackPopperProcess
=
new
TG4StackPopper
();
67
68
auto
aParticleIterator = GetParticleIterator();
69
aParticleIterator->reset();
70
while
((*aParticleIterator)()) {
71
72
G4ParticleDefinition
* particle = aParticleIterator->value();
73
G4ProcessManager* pmanager = particle->GetProcessManager();
74
75
// skip particles which do not have process manager
76
if
(!pmanager)
continue
;
77
78
// add this as an option
79
if
(
fSelection
.size() == 0 ||
80
TG4Globals::Contains
(particle->GetParticleName(),
fSelection
)) {
81
82
if
(
VerboseLevel
() > 1) {
83
G4cout <<
"Adding StackPopper process to "
84
<< particle->GetParticleName() << G4endl;
85
}
86
87
pmanager->AddProcess(
fStackPopperProcess
);
88
pmanager->SetProcessOrdering(
fStackPopperProcess
, idxPostStep);
89
}
90
}
91
92
if
(
VerboseLevel
() > 0) {
93
G4cout <<
"### Stack popper physics constructed."
<< G4endl;
94
}
95
}
TG4Globals.h
Definition of the TG4Globals class and basic container types.
TG4StackPopperPhysics.h
Definition of the TG4StackPopperPhysics class.
TG4StackPopper.h
Definition of the TG4StackPopper class.
G4ParticleDefinition
TG4Globals::Contains
static G4bool Contains(const G4String &name, const G4String &nameList)
Definition
TG4Globals.cxx:153
TG4StackPopperPhysics::fStackPopperProcess
TG4StackPopper * fStackPopperProcess
stack popper process
Definition
TG4StackPopperPhysics.h:55
TG4StackPopperPhysics::fMessenger
TG4StackPopperMessenger fMessenger
messenger
Definition
TG4StackPopperPhysics.h:54
TG4StackPopperPhysics::fSelection
G4String fSelection
particles selection
Definition
TG4StackPopperPhysics.h:56
TG4StackPopperPhysics::ConstructProcess
virtual void ConstructProcess()
Construct physics processes.
Definition
TG4StackPopperPhysics.cxx:61
TG4StackPopperPhysics::TG4StackPopperPhysics
TG4StackPopperPhysics(const G4String &name="StackPopper")
Definition
TG4StackPopperPhysics.cxx:22
TG4StackPopperPhysics::~TG4StackPopperPhysics
virtual ~TG4StackPopperPhysics()
Definition
TG4StackPopperPhysics.cxx:43
TG4StackPopperPhysics::ConstructParticle
virtual void ConstructParticle()
Construct particles.
Definition
TG4StackPopperPhysics.cxx:55
TG4StackPopper
The process which pops particles defined by user from the VMC stack and passes them to tracking.
Definition
TG4StackPopper.h:41
TG4VPhysicsConstructor::TG4VPhysicsConstructor
TG4VPhysicsConstructor(const G4String &name)
Definition
TG4VPhysicsConstructor.cxx:22
TG4VPhysicsConstructor::VerboseLevel
virtual G4int VerboseLevel() const
Definition
TG4VPhysicsConstructor.cxx:63
Generated on
for Geant4 VMC by
1.17.0