11 #include <simulation/kernel/PhysicsList.h>
12 #include <framework/logging/Logger.h>
13 #include <framework/gearbox/Unit.h>
15 #include <CLHEP/Units/SystemOfUnits.h>
17 #include <G4UnitsTable.hh>
18 #include <G4OpticalPhysics.hh>
19 #include <G4PhysListFactory.hh>
21 #include <simulation/kernel/ExtPhysicsConstructor.h>
22 #include <G4ParticleTable.hh>
23 #include <G4ParticleDefinition.hh>
27 using namespace Simulation;
30 PhysicsList::PhysicsList(
const string& physicsListName) : G4VModularPhysicsList()
32 defaultCutValue = 0.7 * CLHEP::mm;
35 G4PhysListFactory physListFactory;
36 G4VModularPhysicsList* physList = NULL;
38 if (physListFactory.IsReferencePhysList(physicsListName)) physList = physListFactory.GetReferencePhysList(physicsListName);
39 if (physList == NULL) B2FATAL(
"Could not load the physics list " << physicsListName);
42 G4VPhysicsConstructor* regPhys =
const_cast<G4VPhysicsConstructor*
>(physList->GetPhysics(0));
43 while (regPhys != NULL) {
44 B2DEBUG(10,
"RegisterPhysics: " << regPhys->GetPhysicsName());
45 RegisterPhysics(regPhys);
46 regPhys =
const_cast<G4VPhysicsConstructor*
>(physList->GetPhysics(iPhysList++));
61 B2INFO(
"B4PhysicsList::SetCuts, CutLength: " << G4BestUnit(defaultCutValue,
"Length"));
67 G4ParticleTable* myParticleTable = G4ParticleTable::GetParticleTable();
69 G4ParticleTable::G4PTblDicIterator* myParticleIterator = myParticleTable->GetIterator();
70 myParticleIterator->reset();
71 while ((*myParticleIterator)()) {
72 G4ParticleDefinition* particle = myParticleIterator->value();
73 if (particle->GetParticleName().substr(0, 4) ==
"g4e_") {
74 SetParticleCuts(1.0E+9 * CLHEP::cm, particle);
84 defaultCutValue = (productionCut /
Unit::mm) * CLHEP::mm;
90 RegisterPhysics(
new G4OpticalPhysics());