GEMC  1.8
Geant4 Monte-Carlo Framework
GeneralPhysics.cc
Go to the documentation of this file.
1 // %%%%%%%%%%
2 // G4 headers
3 // %%%%%%%%%%
4 //#include "G4ParticleDefinition.hh"
5 #include "G4ProcessManager.hh"
6 #include "G4Decay.hh"
7 
8 // %%%%%%%%%%%%
9 // gemc headers
10 // %%%%%%%%%%%%
11 #include "GeneralPhysics.h"
12 
13 
15 {
16  gemcOpt = Opt;
17 }
18 
20 
22 {
23  // Decay will apply to all particles built so far
24 }
25 
27 {
28  string hd_msg = gemcOpt.args["LOG_MSG"].args + " General Physics List: <<< ";
29  double VERB = gemcOpt.args["PHY_VERBOSITY"].arg ;
30  cout << hd_msg << " Building Decay processes " << endl;
31 
32  G4Decay*fDecayProcess = new G4Decay();
33 
34  // Add Decay Process
35  theParticleIterator->reset();
36  while( (*theParticleIterator)() )
37  {
38  G4ParticleDefinition* particle = theParticleIterator->value();
39  G4ProcessManager* pmanager = particle->GetProcessManager();
40  string pname = particle->GetParticleName();
41  if (fDecayProcess->IsApplicable(*particle))
42  {
43  if(VERB > 2) cout << hd_msg << " Adding Decay Process for " << pname << endl;
44  pmanager ->AddProcess(fDecayProcess);
45  // set ordering for PostStepDoIt and AtRestDoIt
46  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
47  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
48  }
49  }
50 }
51 
52 
GeneralPhysics(gemc_opts)
gemc_opts gemcOpt
map< string, opts > args
Options map.
Definition: usage.h:68
virtual void ConstructParticle()
virtual void ConstructProcess()
virtual ~GeneralPhysics()