15 #include "G4FastSimulationManagerProcess.hh"
16 #include "G4ProcessManager.hh"
18 #include "G4LeptonConstructor.hh"
19 #include "G4MesonConstructor.hh"
20 #include "G4BaryonConstructor.hh"
21 #include "G4ShortLivedConstructor.hh"
22 #include "G4IonConstructor.hh"
23 #include "G4RegionStore.hh"
24 #include "G4Electron.hh"
25 #include "G4Positron.hh"
26 #include "G4MuonMinus.hh"
27 #include "G4MuonPlus.hh"
28 #include "G4PionMinus.hh"
29 #include "G4PionPlus.hh"
30 #include "G4KaonMinus.hh"
31 #include "G4KaonPlus.hh"
32 #include "G4Proton.hh"
33 #include "G4AntiProton.hh"
35 #include "G4EmParameters.hh"
36 #include "G4LossTableManager.hh"
37 #include "G4PhysicsListHelper.hh"
38 #include "G4ProcessManager.hh"
39 #include "G4SystemOfUnits.hh"
40 #include "G4Transportation.hh"
41 #include "G4UAtomicDeexcitation.hh"
54 "DefaultRegionForTheWorld"};
68 : G4VPhysicsConstructor(
name), theParSet(
p) {
69 G4EmParameters* param = G4EmParameters::Instance();
71 param->SetVerbose(verb);
74 param->SetBremsstrahlungTh(bremth);
76 param->SetMuHadBremsstrahlungTh(mubrth);
79 param->SetGeneralProcessActive(
genp);
82 param->SetRetrieveMuDataFromFile(mudat);
93 <<
"ParametrisedEMPhysics::ConstructProcess: bremsstrahlung threshold Eth= " << bremth /
GeV <<
" GeV"
94 <<
"\n verbosity= " << verb <<
" fluoFlag: " << fluo
95 <<
" modifyTransport: " << modifyT <<
" Ntrials= " <<
nt
96 <<
"\n ThWarning(MeV)= " << th1 <<
" ThException(MeV)= " << th2;
100 if (energyLim > 0.0) {
101 G4double rrfact[
NREG] = {1.0};
109 for (
int i = 0;
i <
NREG; ++
i) {
110 if (rrfact[
i] < 1.0) {
111 param->ActivateSecondaryBiasing(
"eIoni",
rname[
i], rrfact[
i], energyLim);
112 param->ActivateSecondaryBiasing(
"hIoni",
rname[
i], rrfact[
i], energyLim);
114 <<
"ParametrisedEMPhysics: Russian Roulette"
115 <<
" for e- Prob= " << rrfact[
i] <<
" Elimit(MeV)= " << energyLim /
CLHEP::MeV <<
" inside " <<
rname[
i];
129 G4LeptonConstructor pLeptonConstructor;
130 pLeptonConstructor.ConstructParticle();
132 G4BaryonConstructor pBaryonConstructor;
133 pBaryonConstructor.ConstructParticle();
137 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() started";
146 if (
gem || ghad || lowEnergyGem || gemHad || ghadHad) {
151 <<
"ParametrisedEMPhysics: GFlash Construct for e+-: " <<
gem <<
" " << ghad <<
" " << lowEnergyGem
152 <<
" for hadrons: " << gemHad <<
" " << ghadHad;
159 }
else if (lowEnergyGem) {
164 if (gemHad || ghadHad) {
166 G4AntiProton::AntiProton()->GetProcessManager()->AddDiscreteProcess(
174 if (
gem || gemHad || lowEnergyGem) {
175 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"EcalRegion",
false);
178 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: "
179 <<
"EcalRegion is not defined, GFlash will not be enabled for ECAL!";
185 std::make_unique<GFlashEMShowerModel>(
"GflashEcalEMShowerModel", aRegion,
theParSet);
186 }
else if (lowEnergyGem) {
189 std::make_unique<LowEnergyFastSimModel>(
"LowEnergyFastSimModel", aRegion,
theParSet);
195 std::make_unique<GFlashHadronShowerModel>(
"GflashEcalHadShowerModel", aRegion,
theParSet);
199 if (ghad || ghadHad) {
200 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"HcalRegion",
false);
202 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: "
203 <<
"HcalRegion is not defined, GFlash will not be enabled for HCAL!";
209 std::make_unique<GFlashEMShowerModel>(
"GflashHcalEMShowerModel", aRegion,
theParSet);
214 std::make_unique<GFlashHadronShowerModel>(
"GflashHcalHadShowerModel", aRegion,
theParSet);
220 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
230 std::vector<std::string> regnames =
theParSet.
getParameter<std::vector<std::string> >(
"LimitsPerRegion");
235 int nlimits = regnames.size();
237 std::vector<const G4Region*> reg;
238 std::vector<G4double> rlimE;
239 std::vector<G4double> rlimH;
240 std::vector<G4double> factE;
241 std::vector<G4double> rmsvE;
243 G4RegionStore* store = G4RegionStore::GetInstance();
244 for (
int i = 0;
i < nlimits; ++
i) {
246 if (regnames[
i] ==
"all") {
252 reg.emplace_back(
nullptr);
255 factE.emplace_back(facE[
i]);
256 rmsvE.emplace_back(rmsE[
i]);
257 nlimitsH = (limitsH[
i] > 0) ? 1 : 0;
260 const G4Region*
r = store->GetRegion(regnames[
i],
false);
262 if (
r && (limitsE[
i] > 0.0 || limitsH[
i] > 0.0)) {
266 factE.emplace_back(facE[
i]);
267 rmsvE.emplace_back(rmsE[
i]);
268 if (limitsH[
i] > 0) {
273 nlimits = reg.size();
276 if (eLimiter || rLimiter || 0 < nlimits) {
284 if (pLimiter || 0 < nlimits) {
288 ph->RegisterProcess(plim, G4Positron::Positron());
290 if (0 < nlimits && 0 < nlimitsH) {
295 ph->RegisterProcess(plim, G4Proton::Proton());
301 ph->RegisterProcess(plim, G4PionPlus::PionPlus());
305 ph->RegisterProcess(plim, G4PionMinus::PionMinus());
310 if (fluo && !G4LossTableManager::Instance()->AtomDeexcitation()) {
311 G4VAtomDeexcitation* de =
new G4UAtomicDeexcitation();
312 G4LossTableManager::Instance()->SetAtomDeexcitation(de);
322 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() is done";
326 G4ProcessManager* man =
part->GetProcessManager();
327 G4Transportation* trans = (G4Transportation*)((*(man->GetProcessList()))[0]);
329 trans->SetThresholdWarningEnergy(th1);
330 trans->SetThresholdImportantEnergy(th2);
331 trans->SetThresholdTrials(ntry);
333 <<
"ParametrisedEMPhysics: printout level changed for " <<
part->GetParticleName();