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