Geant4 VMC Version 6.7
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
16#include "TG4StackPopper.h"
17#include "TG4Globals.h"
18
19#include <G4ProcessManager.hh>
20
21//_____________________________________________________________________________
30
31//_____________________________________________________________________________
33 G4int theVerboseLevel, const G4String& name)
34 : TG4VPhysicsConstructor(name, theVerboseLevel),
35 fMessenger(this),
38{
40}
41
42//_____________________________________________________________________________
49
50//
51// protected methods
52//
53
54//_____________________________________________________________________________
59
60//_____________________________________________________________________________
62{
65
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}
Definition of the TG4Globals class and basic container types.
Definition of the TG4StackPopperPhysics class.
Definition of the TG4StackPopper class.
static G4bool Contains(const G4String &name, const G4String &nameList)
TG4StackPopper * fStackPopperProcess
stack popper process
TG4StackPopperMessenger fMessenger
messenger
G4String fSelection
particles selection
virtual void ConstructProcess()
Construct physics processes.
TG4StackPopperPhysics(const G4String &name="StackPopper")
virtual void ConstructParticle()
Construct particles.
The process which pops particles defined by user from the VMC stack and passes them to tracking.
TG4VPhysicsConstructor(const G4String &name)
virtual G4int VerboseLevel() const