source: trunk/examples/novice/gemc/src/GeneralPhysics.cc @ 811

Last change on this file since 811 was 807, checked in by garnier, 16 years ago

update

File size: 1.4 KB
Line 
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
14GeneralPhysics::GeneralPhysics(gemc_opts Opt) : G4VPhysicsConstructor("General Physics")
15{
16 gemcOpt = Opt;
17}
18
19GeneralPhysics::~GeneralPhysics(){}
20
21void GeneralPhysics::ConstructParticle()
22{
23 // Decay will apply to all particles built so far
24}
25
26void GeneralPhysics::ConstructProcess()
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
Note: See TracBrowser for help on using the repository browser.