15 #include "G4FastSimulationManagerProcess.hh"
16 #include "G4ProcessManager.hh"
17 #include "G4EmBuilder.hh"
19 #include "G4RegionStore.hh"
20 #include "G4Electron.hh"
21 #include "G4Positron.hh"
22 #include "G4MuonMinus.hh"
23 #include "G4MuonPlus.hh"
24 #include "G4PionMinus.hh"
25 #include "G4PionPlus.hh"
26 #include "G4KaonMinus.hh"
27 #include "G4KaonPlus.hh"
28 #include "G4Proton.hh"
29 #include "G4AntiProton.hh"
31 #include "G4EmParameters.hh"
32 #include "G4LossTableManager.hh"
33 #include "G4PhysicsListHelper.hh"
34 #include "G4ProcessManager.hh"
35 #include "G4SystemOfUnits.hh"
36 #include "G4Transportation.hh"
37 #include "G4UAtomicDeexcitation.hh"
50 "DefaultRegionForTheWorld"};
64 : G4VPhysicsConstructor(
name), theParSet(
p) {
65 G4EmParameters* param = G4EmParameters::Instance();
67 param->SetVerbose(verb);
70 param->SetBremsstrahlungTh(bremth);
72 param->SetMuHadBremsstrahlungTh(mubrth);
75 param->SetGeneralProcessActive(
genp);
78 param->SetRetrieveMuDataFromFile(mudat);
89 <<
"ParametrisedEMPhysics::ConstructProcess: bremsstrahlung threshold Eth= " << bremth /
GeV <<
" GeV"
90 <<
"\n verbosity= " << verb <<
" fluoFlag: " << fluo
91 <<
" modifyTransport: " << modifyT <<
" Ntrials= " <<
nt
92 <<
"\n ThWarning(MeV)= " << th1 <<
" ThException(MeV)= " << th2
93 <<
"\n Activation of general process = " <<
genp;
97 if (energyLim > 0.0) {
98 G4double rrfact[
NREG] = {1.0};
106 for (
int i = 0;
i <
NREG; ++
i) {
107 if (rrfact[
i] < 1.0) {
108 param->ActivateSecondaryBiasing(
"eIoni",
rname[
i], rrfact[
i], energyLim);
109 param->ActivateSecondaryBiasing(
"hIoni",
rname[
i], rrfact[
i], energyLim);
111 <<
"ParametrisedEMPhysics: Russian Roulette"
112 <<
" for e- Prob= " << rrfact[
i] <<
" Elimit(MeV)= " << energyLim /
CLHEP::MeV <<
" inside " <<
rname[
i];
125 G4EmBuilder::ConstructMinimalEmSet();
129 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() started";
138 if (
gem || ghad || lowEnergyGem || gemHad || ghadHad) {
143 <<
"ParametrisedEMPhysics: GFlash Construct for e+-: " <<
gem <<
" " << ghad <<
" " << lowEnergyGem
144 <<
" for hadrons: " << gemHad <<
" " << ghadHad;
151 }
else if (lowEnergyGem) {
156 if (gemHad || ghadHad) {
158 G4AntiProton::AntiProton()->GetProcessManager()->AddDiscreteProcess(
166 if (
gem || gemHad || lowEnergyGem) {
167 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"EcalRegion",
false);
170 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: "
171 <<
"EcalRegion is not defined, GFlash will not be enabled for ECAL!";
177 std::make_unique<GFlashEMShowerModel>(
"GflashEcalEMShowerModel", aRegion,
theParSet);
178 }
else if (lowEnergyGem) {
181 std::make_unique<LowEnergyFastSimModel>(
"LowEnergyFastSimModel", aRegion,
theParSet);
187 std::make_unique<GFlashHadronShowerModel>(
"GflashEcalHadShowerModel", aRegion,
theParSet);
191 if (ghad || ghadHad) {
192 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"HcalRegion",
false);
194 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: "
195 <<
"HcalRegion is not defined, GFlash will not be enabled for HCAL!";
201 std::make_unique<GFlashEMShowerModel>(
"GflashHcalEMShowerModel", aRegion,
theParSet);
206 std::make_unique<GFlashHadronShowerModel>(
"GflashHcalHadShowerModel", aRegion,
theParSet);
212 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
222 std::vector<std::string> regnames =
theParSet.
getParameter<std::vector<std::string> >(
"LimitsPerRegion");
227 int nlimits = regnames.size();
229 std::vector<const G4Region*> reg;
230 std::vector<G4double> rlimE;
231 std::vector<G4double> rlimH;
232 std::vector<G4double> factE;
233 std::vector<G4double> rmsvE;
235 G4RegionStore* store = G4RegionStore::GetInstance();
236 for (
int i = 0;
i < nlimits; ++
i) {
238 if (regnames[
i] ==
"all") {
244 reg.emplace_back(
nullptr);
247 factE.emplace_back(facE[
i]);
248 rmsvE.emplace_back(rmsE[
i]);
249 nlimitsH = (limitsH[
i] > 0) ? 1 : 0;
252 const G4Region*
r = store->GetRegion(regnames[
i],
false);
254 if (
r && (limitsE[
i] > 0.0 || limitsH[
i] > 0.0)) {
258 factE.emplace_back(facE[
i]);
259 rmsvE.emplace_back(rmsE[
i]);
260 if (limitsH[
i] > 0) {
265 nlimits = reg.size();
268 if (eLimiter || rLimiter || 0 < nlimits) {
276 if (pLimiter || 0 < nlimits) {
280 ph->RegisterProcess(plim, G4Positron::Positron());
282 if (0 < nlimits && 0 < nlimitsH) {
287 ph->RegisterProcess(plim, G4Proton::Proton());
293 ph->RegisterProcess(plim, G4PionPlus::PionPlus());
297 ph->RegisterProcess(plim, G4PionMinus::PionMinus());
302 if (fluo && !G4LossTableManager::Instance()->AtomDeexcitation()) {
303 G4VAtomDeexcitation* de =
new G4UAtomicDeexcitation();
304 G4LossTableManager::Instance()->SetAtomDeexcitation(de);
314 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() is done";
318 G4ProcessManager* man =
part->GetProcessManager();
319 G4Transportation* trans = (G4Transportation*)((*(man->GetProcessList()))[0]);
321 trans->SetThresholdWarningEnergy(th1);
322 trans->SetThresholdImportantEnergy(th2);
323 trans->SetThresholdTrials(ntry);
325 <<
"ParametrisedEMPhysics: printout level changed for " <<
part->GetParticleName();