68 {
70
72
73 auto fastSimProcess_garfield = new G4FastSimulationManagerProcess("G4FSMP_garfield");
74
75 auto theParticleIterator = GetParticleIterator();
76 theParticleIterator->reset();
77 while ((*theParticleIterator)()) {
78 G4ParticleDefinition* particle = theParticleIterator->value();
79 G4ProcessManager* pmanager = particle->GetProcessManager();
80 G4EmConfigurator* config = G4LossTableManager::Instance()->EmConfigurator();
81 G4LossTableManager::Instance()->SetVerbose(1);
82
83 auto particleName = particle->GetParticleName();
85 pmanager->AddDiscreteProcess(fastSimProcess_garfield);
86 }
87
90 particleName, "geant4");
92 particleName, "geant4");
93 if (ionizationModel == "PAI") {
94 G4PAIModel* pai = new G4PAIModel(particle, "G4PAIModel");
95 if (particleName == "e-" || particleName == "e+") {
96 config->SetExtraEmModel(particleName, "eIoni", pai,
97 "RegionGarfield", eMin, eMax, pai);
98 } else if (particleName == "mu-" || particleName == "mu+") {
99 config->SetExtraEmModel(particleName, "muIoni", pai,
100 "RegionGarfield", eMin, eMax, pai);
101 } else if (particleName == "proton" ||
102 particleName == "pi+" || particleName == "pi-") {
103 config->SetExtraEmModel(particleName, "hIoni", pai,
104 "RegionGarfield", eMin, eMax, pai);
105 } else if (particleName == "alpha" || particleName == "He3" ||
106 particleName == "GenericIon") {
107 config->SetExtraEmModel(particleName, "ionIoni", pai,
108 "RegionGarfield", eMin, eMax, pai);
109 }
110 } else if (ionizationModel == "PAIPhot") {
111 G4PAIPhotModel* paiPhot = new G4PAIPhotModel(particle, "G4PAIModel");
112 if (particleName == "e-" || particleName == "e+") {
113 config->SetExtraEmModel(particleName, "eIoni", paiPhot,
114 "RegionGarfield", eMin, eMax, paiPhot);
115 } else if (particleName == "mu-" || particleName == "mu+") {
116 config->SetExtraEmModel(particleName, "muIoni", paiPhot,
117 "RegionGarfield", eMin, eMax, paiPhot);
118 } else if (particleName == "proton" ||
119 particleName == "pi+" || particleName == "pi-") {
120 config->SetExtraEmModel(particleName, "hIoni", paiPhot,
121 "RegionGarfield", eMin, eMax, paiPhot);
122 } else if (particleName == "alpha" || particleName == "He3" ||
123 particleName == "GenericIon") {
124 config->SetExtraEmModel(particleName, "ionIoni", paiPhot,
125 "RegionGarfield", eMin, eMax, paiPhot);
126 }
127 }
128 }
129 }
130}
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")