33#include "G4ProcessManager.hh"
34#include "G4ProcessVector.hh"
35#include "G4UnitsTable.hh"
36#include "G4SystemOfUnits.hh"
37#include "QGSP_BERT_HP.hh"
38#include "G4FastSimulationManagerProcess.hh"
39#include "G4PAIPhotModel.hh"
40#include "G4PAIModel.hh"
41#include "G4LossTableManager.hh"
42#include "G4EmConfigurator.hh"
44#include "G4RegionStore.hh"
45#include "G4ProductionCuts.hh"
50 G4VModularPhysicsList() {
52 SetVerboseLevel(verb);
53 defaultCutValue = 1 * CLHEP::mm;
54 QGSP_BERT_HP *physicsList =
new QGSP_BERT_HP;
55 for (G4int i = 0;; ++i) {
56 G4VPhysicsConstructor* elem =
57 const_cast<G4VPhysicsConstructor*
>(physicsList->GetPhysics(i));
60 G4cout <<
"RegisterPhysics: " << elem->GetPhysicsName() << G4endl;
61 RegisterPhysics(elem);
78 G4FastSimulationManagerProcess* fastSimProcess_garfield =
79 new G4FastSimulationManagerProcess(
"G4FSMP_garfield");
81 theParticleIterator->reset();
82 while ((*theParticleIterator)()) {
84 G4ParticleDefinition* particle = theParticleIterator->value();
85 G4ProcessManager* pmanager = particle->GetProcessManager();
86 G4EmConfigurator* config =
87 G4LossTableManager::Instance()->EmConfigurator();
88 G4LossTableManager::Instance()->SetVerbose(1);
92 pmanager->AddDiscreteProcess(fastSimProcess_garfield);
98 particle->GetParticleName(),
"geant4");
100 particle->GetParticleName(),
"geant4");
101 if (ionizationModel ==
"PAI") {
103 G4PAIModel* pai =
new G4PAIModel(particle,
"G4PAIModel");
104 if (particle->GetParticleName() ==
"e-"
105 || particle->GetParticleName() ==
"e+") {
107 config->SetExtraEmModel(particle->GetParticleName(),
108 "eIoni", pai,
"RegionGarfield", minEnergy_MeV * MeV,
109 maxEnergy_MeV * MeV, pai);
111 }
else if (particle->GetParticleName() ==
"mu-"
112 || particle->GetParticleName() ==
"mu+") {
114 config->SetExtraEmModel(particle->GetParticleName(),
115 "muIoni", pai,
"RegionGarfield", minEnergy_MeV * MeV,
116 maxEnergy_MeV * MeV, pai);
118 }
else if (particle->GetParticleName() ==
"proton"
119 || particle->GetParticleName() ==
"pi+"
120 || particle->GetParticleName() ==
"pi-") {
122 config->SetExtraEmModel(particle->GetParticleName(),
123 "hIoni", pai,
"RegionGarfield", minEnergy_MeV * MeV,
124 maxEnergy_MeV * MeV, pai);
126 }
else if (particle->GetParticleName() ==
"alpha"
127 || particle->GetParticleName() ==
"He3"
128 || particle->GetParticleName() ==
"GenericIon") {
130 config->SetExtraEmModel(particle->GetParticleName(),
131 "ionIoni", pai,
"RegionGarfield", minEnergy_MeV * MeV,
132 maxEnergy_MeV * MeV, pai);
136 }
else if (ionizationModel ==
"PAIPhot") {
138 G4PAIPhotModel* paiPhot =
new G4PAIPhotModel(particle,
140 if (particle->GetParticleName() ==
"e-"
141 || particle->GetParticleName() ==
"e+") {
143 config->SetExtraEmModel(particle->GetParticleName(),
144 "eIoni", paiPhot,
"RegionGarfield", minEnergy_MeV * MeV,
145 maxEnergy_MeV * MeV, paiPhot);
147 }
else if (particle->GetParticleName() ==
"mu-"
148 || particle->GetParticleName() ==
"mu+") {
150 config->SetExtraEmModel(particle->GetParticleName(),
151 "muIoni", paiPhot,
"RegionGarfield", minEnergy_MeV * MeV,
152 maxEnergy_MeV * MeV, paiPhot);
154 }
else if (particle->GetParticleName() ==
"proton"
155 || particle->GetParticleName() ==
"pi+"
156 || particle->GetParticleName() ==
"pi-") {
158 config->SetExtraEmModel(particle->GetParticleName(),
159 "hIoni", paiPhot,
"RegionGarfield", minEnergy_MeV * MeV,
160 maxEnergy_MeV * MeV, paiPhot);
162 }
else if (particle->GetParticleName() ==
"alpha"
163 || particle->GetParticleName() ==
"He3"
164 || particle->GetParticleName() ==
"GenericIon") {
166 config->SetExtraEmModel(particle->GetParticleName(),
167 "ionIoni", paiPhot,
"RegionGarfield", minEnergy_MeV * MeV,
168 maxEnergy_MeV * MeV, paiPhot);
178 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100. * eV,
181 SetCutsWithDefault();
183 G4Region *region = G4RegionStore::GetInstance()->GetRegion(
185 G4ProductionCuts * cuts =
new G4ProductionCuts();
186 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex(
"gamma"));
187 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex(
"e-"));
188 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex(
"e+"));
190 region->SetProductionCuts(cuts);
193 DumpCutValuesTable();
197 G4VModularPhysicsList::ConstructParticle();
201 G4VModularPhysicsList::ConstructProcess();
Definition of the GarfieldPhysicsList class.
Definition of the GarfieldPhysics class.
void AddParameterisation()
virtual void ConstructProcess()
virtual void ConstructParticle()
virtual ~GarfieldPhysicsList()
double GetMaxEnergyMeVParticle(std::string name, std::string program="garfield")
static GarfieldPhysics * GetInstance()
double GetMinEnergyMeVParticle(std::string name, std::string program="garfield")
std::string GetIonizationModel()
bool FindParticleName(const std::string name, std::string program="garfield")