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 auto theParticleIterator = GetParticleIterator();
82 theParticleIterator->reset();
83 while ((*theParticleIterator)()) {
85 G4ParticleDefinition* particle = theParticleIterator->value();
86 G4ProcessManager* pmanager = particle->GetProcessManager();
87 G4EmConfigurator* config =
88 G4LossTableManager::Instance()->EmConfigurator();
89 G4LossTableManager::Instance()->SetVerbose(1);
93 pmanager->AddDiscreteProcess(fastSimProcess_garfield);
99 particle->GetParticleName(),
"geant4");
101 particle->GetParticleName(),
"geant4");
102 if (ionizationModel ==
"PAI") {
104 G4PAIModel* pai =
new G4PAIModel(particle,
"G4PAIModel");
105 if (particle->GetParticleName() ==
"e-"
106 || particle->GetParticleName() ==
"e+") {
108 config->SetExtraEmModel(particle->GetParticleName(),
109 "eIoni", pai,
"RegionGarfield", minEnergy_MeV * MeV,
110 maxEnergy_MeV * MeV, pai);
112 }
else if (particle->GetParticleName() ==
"mu-"
113 || particle->GetParticleName() ==
"mu+") {
115 config->SetExtraEmModel(particle->GetParticleName(),
116 "muIoni", pai,
"RegionGarfield", minEnergy_MeV * MeV,
117 maxEnergy_MeV * MeV, pai);
119 }
else if (particle->GetParticleName() ==
"proton"
120 || particle->GetParticleName() ==
"pi+"
121 || particle->GetParticleName() ==
"pi-") {
123 config->SetExtraEmModel(particle->GetParticleName(),
124 "hIoni", pai,
"RegionGarfield", minEnergy_MeV * MeV,
125 maxEnergy_MeV * MeV, pai);
127 }
else if (particle->GetParticleName() ==
"alpha"
128 || particle->GetParticleName() ==
"He3"
129 || particle->GetParticleName() ==
"GenericIon") {
131 config->SetExtraEmModel(particle->GetParticleName(),
132 "ionIoni", pai,
"RegionGarfield", minEnergy_MeV * MeV,
133 maxEnergy_MeV * MeV, pai);
137 }
else if (ionizationModel ==
"PAIPhot") {
139 G4PAIPhotModel* paiPhot =
new G4PAIPhotModel(particle,
141 if (particle->GetParticleName() ==
"e-"
142 || particle->GetParticleName() ==
"e+") {
144 config->SetExtraEmModel(particle->GetParticleName(),
145 "eIoni", paiPhot,
"RegionGarfield", minEnergy_MeV * MeV,
146 maxEnergy_MeV * MeV, paiPhot);
148 }
else if (particle->GetParticleName() ==
"mu-"
149 || particle->GetParticleName() ==
"mu+") {
151 config->SetExtraEmModel(particle->GetParticleName(),
152 "muIoni", paiPhot,
"RegionGarfield", minEnergy_MeV * MeV,
153 maxEnergy_MeV * MeV, paiPhot);
155 }
else if (particle->GetParticleName() ==
"proton"
156 || particle->GetParticleName() ==
"pi+"
157 || particle->GetParticleName() ==
"pi-") {
159 config->SetExtraEmModel(particle->GetParticleName(),
160 "hIoni", paiPhot,
"RegionGarfield", minEnergy_MeV * MeV,
161 maxEnergy_MeV * MeV, paiPhot);
163 }
else if (particle->GetParticleName() ==
"alpha"
164 || particle->GetParticleName() ==
"He3"
165 || particle->GetParticleName() ==
"GenericIon") {
167 config->SetExtraEmModel(particle->GetParticleName(),
168 "ionIoni", paiPhot,
"RegionGarfield", minEnergy_MeV * MeV,
169 maxEnergy_MeV * MeV, paiPhot);
179 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100. * eV,
182 SetCutsWithDefault();
184 G4Region *region = G4RegionStore::GetInstance()->GetRegion(
186 G4ProductionCuts * cuts =
new G4ProductionCuts();
187 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex(
"gamma"));
188 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex(
"e-"));
189 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex(
"e+"));
191 region->SetProductionCuts(cuts);
194 DumpCutValuesTable();
198 G4VModularPhysicsList::ConstructParticle();
202 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")