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