72 {
73
75
77
78 G4FastSimulationManagerProcess* fastSimProcess_garfield =
79 new G4FastSimulationManagerProcess("G4FSMP_garfield");
80
81 auto theParticleIterator = GetParticleIterator();
82 theParticleIterator->reset();
83 while ((*theParticleIterator)()) {
84
85 G4ParticleDefinition* particle = theParticleIterator->value();
86 G4ProcessManager* pmanager = particle->GetProcessManager();
87 G4EmConfigurator* config =
88 G4LossTableManager::Instance()->EmConfigurator();
89 G4LossTableManager::Instance()->SetVerbose(1);
90
92 "garfield")) {
93 pmanager->AddDiscreteProcess(fastSimProcess_garfield);
94 }
95
97 "geant4")) {
99 particle->GetParticleName(), "geant4");
101 particle->GetParticleName(), "geant4");
102 if (ionizationModel == "PAI") {
103
104 G4PAIModel* pai = new G4PAIModel(particle, "G4PAIModel");
105 if (particle->GetParticleName() == "e-"
106 || particle->GetParticleName() == "e+") {
107
108 config->SetExtraEmModel(particle->GetParticleName(),
109 "eIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
110 maxEnergy_MeV * MeV, pai);
111
112 } else if (particle->GetParticleName() == "mu-"
113 || particle->GetParticleName() == "mu+") {
114
115 config->SetExtraEmModel(particle->GetParticleName(),
116 "muIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
117 maxEnergy_MeV * MeV, pai);
118
119 } else if (particle->GetParticleName() == "proton"
120 || particle->GetParticleName() == "pi+"
121 || particle->GetParticleName() == "pi-") {
122
123 config->SetExtraEmModel(particle->GetParticleName(),
124 "hIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
125 maxEnergy_MeV * MeV, pai);
126
127 } else if (particle->GetParticleName() == "alpha"
128 || particle->GetParticleName() == "He3"
129 || particle->GetParticleName() == "GenericIon") {
130
131 config->SetExtraEmModel(particle->GetParticleName(),
132 "ionIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
133 maxEnergy_MeV * MeV, pai);
134
135 }
136
137 } else if (ionizationModel == "PAIPhot") {
138
139 G4PAIPhotModel* paiPhot = new G4PAIPhotModel(particle,
140 "G4PAIModel");
141 if (particle->GetParticleName() == "e-"
142 || particle->GetParticleName() == "e+") {
143
144 config->SetExtraEmModel(particle->GetParticleName(),
145 "eIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
146 maxEnergy_MeV * MeV, paiPhot);
147
148 } else if (particle->GetParticleName() == "mu-"
149 || particle->GetParticleName() == "mu+") {
150
151 config->SetExtraEmModel(particle->GetParticleName(),
152 "muIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
153 maxEnergy_MeV * MeV, paiPhot);
154
155 } else if (particle->GetParticleName() == "proton"
156 || particle->GetParticleName() == "pi+"
157 || particle->GetParticleName() == "pi-") {
158
159 config->SetExtraEmModel(particle->GetParticleName(),
160 "hIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
161 maxEnergy_MeV * MeV, paiPhot);
162
163 } else if (particle->GetParticleName() == "alpha"
164 || particle->GetParticleName() == "He3"
165 || particle->GetParticleName() == "GenericIon") {
166
167 config->SetExtraEmModel(particle->GetParticleName(),
168 "ionIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
169 maxEnergy_MeV * MeV, paiPhot);
170
171 }
172 }
173 }
174 }
175}
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")