DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Geant4PhysicsList.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 // Framework include files
15 #include <DDG4/Geant4PhysicsList.h>
16 #include <DDG4/Geant4UIMessenger.h>
17 #include <DDG4/Geant4Particle.h>
18 #include <DDG4/Geant4Kernel.h>
19 #include <DD4hep/InstanceCount.h>
20 #include <DD4hep/Printout.h>
21 #include <DD4hep/Plugins.h>
22 
23 // Geant4 include files
24 #include <G4VPhysicsConstructor.hh>
25 #include <G4PhysListFactory.hh>
26 #include <G4ProcessManager.hh>
27 #include <G4ParticleTable.hh>
28 #include <G4RunManager.hh>
29 #include <G4VProcess.hh>
30 #include <G4Decay.hh>
31 #include <G4EmParameters.hh>
32 #include <G4HadronicParameters.hh>
33 
34 // C/C++ include files
35 #include <stdexcept>
36 #include <regex.h>
37 
38 using namespace dd4hep::sim;
39 
40 namespace {
41 
42  struct MyPhysics : G4VUserPhysicsList {
43  void AddTransportation() { this->G4VUserPhysicsList::AddTransportation(); }
44  };
45 
46  struct EmptyPhysics : public G4VModularPhysicsList {
47  EmptyPhysics() = default;
48  virtual ~EmptyPhysics() = default;
49  };
50  struct ParticlePhysics : public G4VPhysicsConstructor {
52  G4VUserPhysicsList* phys;
53  ParticlePhysics(Geant4PhysicsListActionSequence* s, G4VUserPhysicsList* p) : seq(s), phys(p) { }
54  virtual ~ParticlePhysics() = default;
55  virtual void ConstructProcess() {
56  seq->constructProcesses(phys);
57  if ( seq->transportation() ) {
58  MyPhysics* ph = (MyPhysics*)phys;
59  ph->AddTransportation();
60  }
61  }
62  virtual void ConstructParticle() {
63  seq->constructParticles(phys);
64  }
65  };
66 }
67 
70  : ordAtRestDoIt(-1), ordAlongSteptDoIt(-1), ordPostStepDoIt(-1) {
71 }
74  : name(p.name), ordAtRestDoIt(p.ordAtRestDoIt), ordAlongSteptDoIt(p.ordAlongSteptDoIt), ordPostStepDoIt(p.ordPostStepDoIt) {
75 }
76 
79  if ( this != &p ) {
80  name = p.name;
81  ordAtRestDoIt = p.ordAtRestDoIt;
82  ordAlongSteptDoIt = p.ordAlongSteptDoIt;
83  ordPostStepDoIt = p.ordPostStepDoIt;
84  }
85  return *this;
86 }
87 
90  : Geant4Action(ctxt, nam) {
92 }
93 
97 }
98 
101  control()->addCall("dump", "Dump content of " + name(), Callback(this).make(&Geant4PhysicsList::dump));
102 }
103 
106  if ( !m_physics.empty() && !m_particles.empty() && !m_processes.empty() ) {
107  printout(ALWAYS,name(),"+++ Geant4PhysicsList Dump");
108  }
109  for ( const auto& p : m_physics)
110  printout(ALWAYS,name(),"+++ PhysicsConstructor: %s",p.c_str());
111  for ( const auto& p : m_particles )
112  printout(ALWAYS,name(),"+++ ParticleConstructor: %s",p.c_str());
113  for ( const auto& p : m_particlegroups )
114  printout(ALWAYS,name(),"+++ ParticleGroupConstructor: %s",p.c_str());
115  for ( const auto& [part_name,procs] : m_discreteProcesses ) {
116  printout(ALWAYS,name(),"+++ DiscretePhysicsProcesses of particle %s",part_name.c_str());
117  for (ParticleProcesses::const_iterator ip = procs.begin(); ip != procs.end(); ++ip) {
118  printout(ALWAYS,name(),"+++ Process %s", (*ip).name.c_str());
119  }
120  }
121  for ( const auto& [part_name, procs] : m_processes ) {
122  printout(ALWAYS,name(),"+++ PhysicsProcesses of particle %s",part_name.c_str());
123  for ( const Process& p : procs ) {
124  printout(ALWAYS,name(),"+++ Process %s ordAtRestDoIt=%d ordAlongSteptDoIt=%d ordPostStepDoIt=%d",
125  p.name.c_str(),p.ordAtRestDoIt,p.ordAlongSteptDoIt,p.ordPostStepDoIt);
126  }
127  }
128 }
129 
131 void Geant4PhysicsList::addParticleConstructor(const std::string& part_name) {
132  particles().emplace_back(part_name);
133 }
134 
136 void Geant4PhysicsList::addParticleGroup(const std::string& part_name) {
137  particlegroups().emplace_back(part_name);
138 }
139 
141 void Geant4PhysicsList::addParticleProcess(const std::string& part_name,
142  const std::string& proc_name,
143  int ordAtRestDoIt,
144  int ordAlongSteptDoIt,
145  int ordPostStepDoIt)
146 {
147  Process p;
148  p.name = proc_name;
149  p.ordAtRestDoIt = ordAtRestDoIt;
150  p.ordAlongSteptDoIt = ordAlongSteptDoIt;
151  p.ordPostStepDoIt = ordPostStepDoIt;
152  processes(part_name).emplace_back(p);
153 }
154 
156 void Geant4PhysicsList::addDiscreteParticleProcess(const std::string& part_name,
157  const std::string& proc_name)
158 {
159  Process p;
160  p.name = proc_name;
161  discreteProcesses(part_name).emplace_back(p);
162 }
163 
165 void Geant4PhysicsList::addPhysicsConstructor(const std::string& phys_name) {
166  physics().emplace_back(phys_name);
167 }
168 
171  if (auto i = m_processes.find(nam); i != m_processes.end())
172  return (*i).second;
173  auto ret = m_processes.emplace(nam, ParticleProcesses());
174  return (*(ret.first)).second;
175 }
176 
179  if (auto i = m_processes.find(nam); i != m_processes.end())
180  return (*i).second;
181  except("Failed to access the physics process '%s' [Unknown-Process]", nam.c_str());
182  throw std::runtime_error("Failed to access the physics process"); // never called anyway
183 }
184 
187  if (auto i = m_discreteProcesses.find(nam); i != m_discreteProcesses.end())
188  return (*i).second;
189  auto ret = m_discreteProcesses.emplace(nam, ParticleProcesses());
190  return (*(ret.first)).second;
191 }
192 
195  if (auto i = m_discreteProcesses.find(nam); i != m_discreteProcesses.end())
196  return (*i).second;
197  except("Failed to access the physics process '%s' [Unknown-Process]", nam.c_str());
198  throw std::runtime_error("Failed to access the physics process"); // never called anyway
199 }
200 
203  for ( const auto& ctor : m_physics ) {
204  if ( ctor == nam ) {
205  if ( nullptr == ctor.pointer )
206  except("Failed to instaniate the physics for constructor '%s'", nam.c_str());
207  return ctor;
208  }
209  }
210  except("Failed to access the physics for constructor '%s' [Unknown physics]", nam.c_str());
211  throw std::runtime_error("Failed to access the physics process"); // never called anyway
212 }
213 
216  if ( 0 != action ) {
217  if ( G4VPhysicsConstructor* p = dynamic_cast<G4VPhysicsConstructor*>(action) ) {
218  PhysicsConstructor ctor(action->name());
219  ctor.pointer = p;
220  action->addRef();
221  m_physics.emplace_back(ctor);
222  return;
223  }
224  except("Failed to adopt action object %s as physics constructor. [Invalid-Base]",action->c_name());
225  }
226  except("Failed to adopt invalid Geant4Action as PhysicsConstructor. [Invalid-object]");
227 }
228 
230 void Geant4PhysicsList::constructPhysics(G4VModularPhysicsList* physics_pointer) {
231  debug("constructPhysics %p", physics_pointer);
232  for ( auto& ctor : m_physics ) {
233  if ( 0 == ctor.pointer ) {
234  if ( G4VPhysicsConstructor* p = PluginService::Create<G4VPhysicsConstructor*>(ctor) )
235  ctor.pointer = p;
236  else
237  except("Failed to create the physics for G4VPhysicsConstructor '%s'", ctor.c_str());
238  }
239  physics_pointer->RegisterPhysics(ctor.pointer);
240  info("Registered Geant4 physics constructor %s to physics list", ctor.c_str());
241  }
242 }
243 
245 void Geant4PhysicsList::constructParticles(G4VUserPhysicsList* physics_pointer) {
246  debug("constructParticles %p", physics_pointer);
248  for ( const auto& ctor : m_particles ) {
249  G4ParticleDefinition* def = PluginService::Create<G4ParticleDefinition*>(ctor);
250  if ( !def ) {
252  long* result = (long*) PluginService::Create<long>(ctor);
253  if ( !result || *result != 1L ) {
254  except("Failed to create particle type '%s' result=%d", ctor.c_str(), result);
255  }
256  info("Constructed Geant4 particle %s [using signature long (*)()]",ctor.c_str());
257  }
258  }
260  for ( const auto& ctor : m_particlegroups ) {
262  long* result = (long*) PluginService::Create<long>(ctor);
263  if ( !result || *result != 1L ) {
264  except("Failed to create particle type '%s' result=%d", ctor.c_str(), result);
265  }
266  info("Constructed Geant4 particle group %s [using signature long (*)()]",ctor.c_str());
267  }
268 }
269 
271 void Geant4PhysicsList::constructProcesses(G4VUserPhysicsList* physics_pointer) {
272  debug("constructProcesses %p", physics_pointer);
273  for ( const auto& [part_name, procs] : m_discreteProcesses ) {
274  std::vector<G4ParticleDefinition*> defs(Geant4ParticleHandle::g4DefinitionsRegEx(part_name));
275  if ( defs.empty() ) {
276  except("Particle:%s Cannot find the corresponding entry in the particle table.", part_name.c_str());
277  }
278  for ( const Process& p : procs ) {
279  if ( G4VProcess* g4 = PluginService::Create<G4VProcess*>(p.name) ) {
280  for ( G4ParticleDefinition* particle : defs ) {
281  G4ProcessManager* mgr = particle->GetProcessManager();
282  mgr->AddDiscreteProcess(g4);
283  info("Particle:%s -> [%s] added discrete process %s",
284  part_name.c_str(), particle->GetParticleName().c_str(), p.name.c_str());
285  }
286  continue;
287  }
288  except("Cannot create discrete physics process %s", p.name.c_str());
289  }
290  }
291  for ( const auto& [part_name, procs] : m_processes ) {
292  std::vector<G4ParticleDefinition*> defs(Geant4ParticleHandle::g4DefinitionsRegEx(part_name));
293  if (defs.empty()) {
294  except("Particle:%s Cannot find the corresponding entry in the particle table.", part_name.c_str());
295  }
296  for ( const Process& p : procs ) {
297  if ( G4VProcess* g4 = PluginService::Create<G4VProcess*>(p.name) ) {
298  for ( G4ParticleDefinition* particle : defs ) {
299  G4ProcessManager* mgr = particle->GetProcessManager();
300  mgr->AddProcess(g4, p.ordAtRestDoIt, p.ordAlongSteptDoIt, p.ordPostStepDoIt);
301  info("Particle:%s -> [%s] added process %s with flags (%d,%d,%d)",
302  part_name.c_str(), particle->GetParticleName().c_str(), p.name.c_str(),
303  p.ordAtRestDoIt, p.ordAlongSteptDoIt, p.ordPostStepDoIt);
304  }
305  continue;
306  }
307  except("Cannot create physics process %s", p.name.c_str());
308  }
309  }
310 }
311 
313 void Geant4PhysicsList::enable(G4VUserPhysicsList* /* physics */) {
314 }
315 
318  : Geant4Action(ctxt, nam), m_rangecut(0.7*CLHEP::mm)
319 {
320  declareProperty("transportation", m_transportation);
321  declareProperty("extends", m_extends);
322  declareProperty("decays", m_decays);
323  declareProperty("rangecut", m_rangecut);
324  declareProperty("verbosity", m_verbosity);
325  m_needsControl = true;
327 }
328 
332  m_actors.clear();
333  m_process.clear();
335 }
336 
337 #include <G4FastSimulationPhysics.hh>
338 
341  G4VModularPhysicsList* physics = ( m_extends.empty() )
342  ? new EmptyPhysics()
343  : G4PhysListFactory().GetReferencePhysList(m_extends);
344 
345 #if 0
346  G4FastSimulationPhysics* fastSimulationPhysics = new G4FastSimulationPhysics();
347  // -- We now configure the fastSimulationPhysics object.
348  // -- The gflash model (GFlashShowerModel, see ExGflashDetectorConstruction.cc)
349  // -- is applicable to e+ and e- : we augment the physics list for these
350  // -- particles (by adding a G4FastSimulationManagerProcess with below's
351  // -- calls), this will make the fast simulation to be activated:
352  fastSimulationPhysics->ActivateFastSimulation("e-");
353  fastSimulationPhysics->ActivateFastSimulation("e+");
354  // -- Register this fastSimulationPhysics to the physicsList,
355  // -- when the physics list will be called by the run manager
356  // -- (will happen at initialization of the run manager)
357  // -- for physics process construction, the fast simulation
358  // -- configuration will be applied as well.
359  physics->RegisterPhysics( fastSimulationPhysics );
360 #endif
361  // Register all physics constructors with the physics list
362  constructPhysics(physics);
363  // Ensure the particles and processes declared are also invoked.
364  // Hence: Create a special physics constructor doing so.
365  // Ownership is transferred to the physics list.
366  // Do not delete this pointer afterwards....
367  physics->RegisterPhysics(new ParticlePhysics(this,physics));
368 
369  //Setting verbosity for pieces of the physics
370  physics->SetVerboseLevel(m_verbosity);
371  G4EmParameters::Instance()->SetVerbose(m_verbosity);
372  G4HadronicParameters::Instance()->SetVerboseLevel(m_verbosity);
373 
374  return physics;
375 }
376 
379  control()->addCall("dump", "Dump content of " + name(), Callback(this).make(&Geant4PhysicsListActionSequence::dump));
380 }
381 
384  printout(ALWAYS,name(),"+++ Dump of physics list component(s)");
385  printout(ALWAYS,name(),"+++ Extension name %s",m_extends.c_str());
386  printout(ALWAYS,name(),"+++ Transportation flag: %d",m_transportation);
387  printout(ALWAYS,name(),"+++ Program decays: %d",m_decays);
388  printout(ALWAYS,name(),"+++ RangeCut: %f",m_rangecut);
389  printout(ALWAYS,name(),"+++ Verbosity: %i",m_verbosity);
391 }
392 
395  if (action) {
396  action->addRef();
397  m_actors.add(action);
398  return;
399  }
400  except("Geant4EventActionSequence: Attempt to add invalid actor!");
401 }
402 
404 void Geant4PhysicsListActionSequence::constructParticles(G4VUserPhysicsList* physics_pointer) {
405  m_particle(physics_pointer);
407 }
408 
410 void Geant4PhysicsListActionSequence::constructPhysics(G4VModularPhysicsList* physics_pointer) {
411  m_physics(physics_pointer);
413 }
414 
416 void Geant4PhysicsListActionSequence::constructProcesses(G4VUserPhysicsList* physics_pointer) {
418  m_process(physics_pointer);
419  if (m_decays) {
420  constructDecays(physics_pointer);
421  }
422 }
423 
425 void Geant4PhysicsListActionSequence::constructDecays(G4VUserPhysicsList* physics_pointer) {
426  G4ParticleTable* pt = G4ParticleTable::GetParticleTable();
427  G4ParticleTable::G4PTblDicIterator* iter = pt->GetIterator();
428  // Add Decay Process
429  G4Decay* decay = new G4Decay();
430  info("ConstructDecays %p",physics_pointer);
431  iter->reset();
432  while ((*iter)()) {
433  G4ParticleDefinition* p = iter->value();
434  G4ProcessManager* mgr = p->GetProcessManager();
435  if (decay->IsApplicable(*p)) {
436  mgr->AddProcess(decay);
437  // set ordering for PostStepDoIt and AtRestDoIt
438  mgr->SetProcessOrdering(decay, idxPostStep);
439  mgr->SetProcessOrdering(decay, idxAtRest);
440  }
441  }
442 }
443 
445 void Geant4PhysicsListActionSequence::enable(G4VUserPhysicsList* physics_pointer) {
446  m_actors(&Geant4PhysicsList::enable, physics_pointer);
447 }
448 
dd4hep::sim::Geant4PhysicsList::PhysicsConstructor::pointer
G4VPhysicsConstructor * pointer
Pointer to physics constructor object.
Definition: Geant4PhysicsList.h:95
dd4hep::sim::Geant4PhysicsList::particlegroups
ParticleConstructors & particlegroups()
Access all physics particlegroups.
Definition: Geant4PhysicsList.h:163
dd4hep::sim::Geant4Action::m_needsControl
bool m_needsControl
Default property: Flag to create control instance.
Definition: Geant4Action.h:123
dd4hep::sim::Geant4PhysicsList::constructPhysics
virtual void constructPhysics(G4VModularPhysicsList *physics)
constructPhysics callback
Definition: Geant4PhysicsList.cpp:230
dd4hep::sim::Geant4PhysicsList::addParticleGroup
void addParticleGroup(const std::string &part_name)
Add physics particle group constructor by name (Leptons, Bosons, Mesons, etc.)
Definition: Geant4PhysicsList.cpp:136
dd4hep::sim::Geant4PhysicsList::constructParticles
virtual void constructParticles(G4VUserPhysicsList *physics)
Callback to construct particles.
Definition: Geant4PhysicsList.cpp:245
dd4hep::sim::Geant4PhysicsList::Process
Structure describing a G4 process.
Definition: Geant4PhysicsList.h:53
dd4hep::sim::Geant4Action::control
Geant4UIMessenger * control() const
Access to the UI messenger.
Definition: Geant4Action.cpp:125
dd4hep::sim::Geant4PhysicsListActionSequence::m_physics
CallbackSequence m_physics
Callback sequence for G4 physics constructors.
Definition: Geant4PhysicsList.h:228
dd4hep::sim::Geant4PhysicsList::Process::ordPostStepDoIt
int ordPostStepDoIt
Definition: Geant4PhysicsList.h:56
dd4hep::sim::Geant4PhysicsList::Process::operator=
Process & operator=(const Process &p)
Assignment operator.
Definition: Geant4PhysicsList.cpp:78
dd4hep::sim::Geant4PhysicsListActionSequence::extensionList
G4VUserPhysicsList * extensionList()
Extend physics list from factory:
Definition: Geant4PhysicsList.cpp:340
dd4hep::sim::Geant4PhysicsList::installCommandMessenger
virtual void installCommandMessenger() override
Install command control messenger if wanted.
Definition: Geant4PhysicsList.cpp:100
dd4hep::sim::Geant4ParticleHandle::g4DefinitionsRegEx
static std::vector< G4ParticleDefinition * > g4DefinitionsRegEx(const std::string &expression)
Access Geant4 particle definitions by regular expression.
Definition: Geant4Particle.cpp:182
dd4hep::sim::Geant4PhysicsListActionSequence::constructProcesses
virtual void constructProcesses(G4VUserPhysicsList *physics)
Execute sequence of G4 physics constructors.
Definition: Geant4PhysicsList.cpp:416
dd4hep::sim::Geant4PhysicsList::Process::ordAtRestDoIt
int ordAtRestDoIt
Definition: Geant4PhysicsList.h:56
dd4hep::sim::Geant4PhysicsListActionSequence::adopt
void adopt(Geant4PhysicsList *action)
Add an actor responding to all callbacks. Sequence takes ownership.
Definition: Geant4PhysicsList.cpp:394
dd4hep::sim::Geant4PhysicsList::Process::Process
Process()
Default constructor.
Definition: Geant4PhysicsList.cpp:69
dd4hep::InstanceCount::increment
static void increment(T *)
Increment count according to type information.
Definition: InstanceCount.h:98
Geant4PhysicsList.h
dd4hep::sim::Geant4PhysicsListActionSequence::m_actors
Actors< Geant4PhysicsList > m_actors
The list of action objects to be called.
Definition: Geant4PhysicsList.h:234
dd4hep::sim::Geant4PhysicsListActionSequence::constructParticles
virtual void constructParticles(G4VUserPhysicsList *physics)
Execute sequence of G4 particle constructors.
Definition: Geant4PhysicsList.cpp:404
dd4hep::sim::Geant4PhysicsListActionSequence::constructPhysics
void constructPhysics(Q *p, void(T::*f)(G4VModularPhysicsList *))
Register physics construction callback.
Definition: Geant4PhysicsList.h:269
dd4hep::sim::Geant4PhysicsList::ParticleProcesses
std::vector< Process > ParticleProcesses
Definition: Geant4PhysicsList.h:64
dd4hep::sim::Geant4PhysicsListActionSequence::m_transportation
bool m_transportation
Flag if particle transportation is to be added.
Definition: Geant4PhysicsList.h:240
dd4hep::sim::Geant4Action::info
void info(const char *fmt,...) const
Support of info messages.
Definition: Geant4Action.cpp:215
dd4hep::sim::Geant4PhysicsList::particles
ParticleConstructors & particles()
Access all physics particles.
Definition: Geant4PhysicsList.h:155
dd4hep::sim::Geant4Action::except
void except(const char *fmt,...) const
Support of exceptions: Print fatal message and throw runtime_error.
Definition: Geant4Action.cpp:256
Geant4UIMessenger.h
dd4hep::sim::Geant4PhysicsListActionSequence::installCommandMessenger
virtual void installCommandMessenger() override
Install command control messenger if wanted.
Definition: Geant4PhysicsList.cpp:378
dd4hep::sim::Geant4PhysicsListActionSequence::m_rangecut
double m_rangecut
global range cut for secondary productions
Definition: Geant4PhysicsList.h:246
dd4hep::sim::Geant4PhysicsList::Geant4PhysicsList
Geant4PhysicsList(Geant4Context *context, const std::string &nam)
Standard constructor with initailization parameters.
Definition: Geant4PhysicsList.cpp:89
dd4hep::sim::Geant4PhysicsListActionSequence::constructDecays
virtual void constructDecays(G4VUserPhysicsList *physics)
Callback to construct particle decays.
Definition: Geant4PhysicsList.cpp:425
dd4hep::sim::Geant4PhysicsListActionSequence::m_particle
CallbackSequence m_particle
Callback sequence for G4 particle constructors.
Definition: Geant4PhysicsList.h:232
dd4hep::sim::Geant4PhysicsList::addPhysicsConstructor
void addPhysicsConstructor(const std::string &physics_name)
Add PhysicsConstructor by name.
Definition: Geant4PhysicsList.cpp:165
dd4hep::sim::Geant4PhysicsList::physics
PhysicsConstructors & physics()
Access all physics constructors.
Definition: Geant4PhysicsList.h:171
dd4hep::sim::Geant4PhysicsList::dump
void dump()
Dump content to stdout.
Definition: Geant4PhysicsList.cpp:105
CLHEP
CLHEP namespace.
Definition: Geant4Random.h:26
dd4hep::Callback
Definition of the generic callback structure for member functions.
Definition: Callback.h:38
dd4hep::sim::Geant4PhysicsList::m_particles
ParticleConstructors m_particles
Definition: Geant4PhysicsList.h:111
dd4hep::sim::Geant4Action::declareProperty
Geant4Action & declareProperty(const std::string &nam, T &val)
Declare property.
Definition: Geant4Action.h:366
dd4hep::sim::Geant4PhysicsList::Process::ordAlongSteptDoIt
int ordAlongSteptDoIt
Definition: Geant4PhysicsList.h:56
dd4hep::InstanceCount::decrement
static void decrement(T *)
Decrement count according to type information.
Definition: InstanceCount.h:102
dd4hep::sim::Geant4PhysicsListActionSequence::m_process
CallbackSequence m_process
Callback sequence for G4 process constructors.
Definition: Geant4PhysicsList.h:230
dd4hep::sim::Geant4PhysicsList::processes
PhysicsProcesses & processes()
Access all physics processes.
Definition: Geant4PhysicsList.h:126
dd4hep::sim::Geant4PhysicsListActionSequence
The implementation of the single Geant4 physics list action sequence.
Definition: Geant4PhysicsList.h:223
Plugins.h
dd4hep::sim::Geant4Action
Default base class for all Geant 4 actions and derivates thereof.
Definition: Geant4Action.h:113
dd4hep::sim::Geant4Action::release
long release()
Decrease reference count. Implicit destruction.
Definition: Geant4Action.cpp:76
dd4hep::sim::Geant4PhysicsList::~Geant4PhysicsList
virtual ~Geant4PhysicsList()
Default destructor.
Definition: Geant4PhysicsList.cpp:95
dd4hep::sim::Geant4Action::name
const std::string & name() const
Access name of the action.
Definition: Geant4Action.h:280
dd4hep::sim::Geant4PhysicsListActionSequence::dump
void dump()
Dump content to stdout.
Definition: Geant4PhysicsList.cpp:383
dd4hep::sim::Geant4PhysicsList::addParticleProcess
void addParticleProcess(const std::string &part_name, const std::string &proc_name, int ordAtRestDoIt, int ordAlongSteptDoIt, int ordPostStepDoIt)
Add particle process by name with arguments.
Definition: Geant4PhysicsList.cpp:141
dd4hep::sim::Geant4PhysicsList::m_processes
PhysicsProcesses m_processes
Definition: Geant4PhysicsList.h:108
dd4hep::CallbackSequence::clear
void clear()
Clear the sequence and remove all callbacks.
Definition: Callback.h:363
dd4hep::sim::Geant4PhysicsList::PhysicsConstructor
Structure describing a G4 physics constructor.
Definition: Geant4PhysicsList.h:92
G4VPhysicsConstructor
Class of the Geant4 toolkit. See http://www-geant4.kek.jp/Reference.
Definition: Geant4Classes.h:51
dd4hep::sim::Geant4PhysicsList::m_discreteProcesses
PhysicsProcesses m_discreteProcesses
Definition: Geant4PhysicsList.h:109
dd4hep::sim::Geant4PhysicsListActionSequence::m_decays
bool m_decays
Flag if particle decays are to be added.
Definition: Geant4PhysicsList.h:242
dd4hep::sim::Geant4PhysicsList
Concrete basic implementation of a Geant4 physics list action.
Definition: Geant4PhysicsList.h:41
dd4hep::sim::Geant4PhysicsListActionSequence::~Geant4PhysicsListActionSequence
virtual ~Geant4PhysicsListActionSequence()
Default destructor.
Definition: Geant4PhysicsList.cpp:330
dd4hep::sim::Geant4PhysicsListActionSequence::transportation
bool transportation() const
Access the transportation flag.
Definition: Geant4PhysicsList.h:264
dd4hep::sim::Geant4PhysicsListActionSequence::Geant4PhysicsListActionSequence
Geant4PhysicsListActionSequence(Geant4Context *context, const std::string &nam)
Standard constructor.
Definition: Geant4PhysicsList.cpp:317
dd4hep::sim::Geant4PhysicsListActionSequence::m_verbosity
int m_verbosity
verbosity level for the physics list
Definition: Geant4PhysicsList.h:248
dd4hep::sim::Geant4PhysicsList::adoptPhysicsConstructor
void adoptPhysicsConstructor(Geant4Action *action)
Add PhysicsConstructor as Geant4Action object.
Definition: Geant4PhysicsList.cpp:215
dd4hep::sim::Geant4PhysicsList::discreteProcesses
PhysicsProcesses & discreteProcesses()
Access all physics discrete processes.
Definition: Geant4PhysicsList.h:139
dd4hep::sim::Geant4Action::addRef
long addRef()
Increase reference count.
Definition: Geant4Action.cpp:71
dd4hep::sim
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Definition: Geant4Output2EDM4hep.cpp:49
dd4hep::sim::Geant4PhysicsList::constructProcesses
virtual void constructProcesses(G4VUserPhysicsList *physics)
Callback to construct processes (uses the G4 particle table)
Definition: Geant4PhysicsList.cpp:271
dd4hep::sim::Geant4Action::c_name
const char * c_name() const
Access name of the action.
Definition: Geant4Action.h:284
dd4hep::sim::Geant4PhysicsList::addDiscreteParticleProcess
void addDiscreteParticleProcess(const std::string &part_name, const std::string &proc_name)
Add discrete particle process by name with arguments.
Definition: Geant4PhysicsList.cpp:156
dd4hep::sim::Geant4PhysicsList::m_physics
PhysicsConstructors m_physics
Definition: Geant4PhysicsList.h:110
dd4hep::sim::Geant4UIMessenger::addCall
void addCall(const std::string &name, const std::string &description, const Callback &cb, size_t npar=0)
Add a new callback structure.
Definition: Geant4UIMessenger.cpp:60
Geant4Particle.h
dd4hep::sim::Geant4Action::debug
void debug(const char *fmt,...) const
Support of debug messages.
Definition: Geant4Action.cpp:207
dd4hep::sim::Geant4PhysicsListActionSequence::enable
virtual void enable(G4VUserPhysicsList *physics)
Enable physics list: actions necessary to be propagated to Geant4.
Definition: Geant4PhysicsList.cpp:445
dd4hep::sim::Geant4PhysicsList::addParticleConstructor
void addParticleConstructor(const std::string &part_name)
Add physics particle constructor by name.
Definition: Geant4PhysicsList.cpp:131
dd4hep::sim::Geant4PhysicsList::m_particlegroups
ParticleConstructors m_particlegroups
Definition: Geant4PhysicsList.h:112
Geant4Kernel.h
dd4hep::sim::Geant4PhysicsList::enable
virtual void enable(G4VUserPhysicsList *physics)
Enable physics list: actions necessary to be propagated to Geant4.
Definition: Geant4PhysicsList.cpp:313
InstanceCount.h
Printout.h
dd4hep::sim::Geant4PhysicsList::Process::name
std::string name
Definition: Geant4PhysicsList.h:55
dd4hep::sim::Geant4Context
Generic context to extend user, run and event information.
Definition: Geant4Context.h:201
dd4hep::sim::Geant4PhysicsListActionSequence::m_extends
std::string m_extends
Property: Store name of basic predefined Geant4 physics list.
Definition: Geant4PhysicsList.h:244