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) {
70 G4EmParameters* param = G4EmParameters::Instance();
72 param->SetVerbose(verb);
75 param->SetBremsstrahlungTh(bremth);
86 <<
"ParametrisedEMPhysics::ConstructProcess: bremsstrahlung threshold Eth= " << bremth /
GeV <<
" GeV"
87 <<
"\n verbosity= " << verb <<
" fluoFlag: " << fluo
88 <<
" modifyTransport: " << modifyT <<
" Ntrials= " <<
nt
89 <<
"\n ThWarning(MeV)= " << th1 <<
" ThException(MeV)= " << th2;
93 if (energyLim > 0.0) {
94 G4double rrfact[
NREG] = {1.0};
102 for (
int i = 0;
i <
NREG; ++
i) {
103 if (rrfact[
i] < 1.0) {
104 param->ActivateSecondaryBiasing(
"eIoni",
rname[
i], rrfact[
i], energyLim);
105 param->ActivateSecondaryBiasing(
"hIoni",
rname[
i], rrfact[
i], energyLim);
107 <<
"ParametrisedEMPhysics: Russian Roulette"
108 <<
" for e- Prob= " << rrfact[
i] <<
" Elimit(MeV)= " << energyLim /
CLHEP::MeV <<
" inside " <<
rname[
i];
122 G4LeptonConstructor pLeptonConstructor;
123 pLeptonConstructor.ConstructParticle();
125 G4BaryonConstructor pBaryonConstructor;
126 pBaryonConstructor.ConstructParticle();
130 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() started";
139 if (
gem || ghad || lowEnergyGem || gemHad || ghadHad) {
144 <<
"ParametrisedEMPhysics: GFlash Construct for e+-: " <<
gem <<
" " << ghad <<
" " << lowEnergyGem
145 <<
" for hadrons: " << gemHad <<
" " << ghadHad;
152 }
else if (lowEnergyGem) {
157 if (gemHad || ghadHad) {
159 G4AntiProton::AntiProton()->GetProcessManager()->AddDiscreteProcess(
167 if (
gem || gemHad || lowEnergyGem) {
168 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"EcalRegion",
false);
171 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: "
172 <<
"EcalRegion is not defined, GFlash will not be enabled for ECAL!";
178 std::make_unique<GFlashEMShowerModel>(
"GflashEcalEMShowerModel", aRegion,
theParSet);
179 }
else if (lowEnergyGem) {
182 std::make_unique<LowEnergyFastSimModel>(
"LowEnergyFastSimModel", aRegion,
theParSet);
188 std::make_unique<GFlashHadronShowerModel>(
"GflashEcalHadShowerModel", aRegion,
theParSet);
192 if (ghad || ghadHad) {
193 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"HcalRegion",
false);
195 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: "
196 <<
"HcalRegion is not defined, GFlash will not be enabled for HCAL!";
202 std::make_unique<GFlashEMShowerModel>(
"GflashHcalEMShowerModel", aRegion,
theParSet);
207 std::make_unique<GFlashHadronShowerModel>(
"GflashHcalHadShowerModel", aRegion,
theParSet);
213 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
223 std::vector<std::string> regnames =
theParSet.
getParameter<std::vector<std::string> >(
"LimitsPerRegion");
228 int nlimits = regnames.size();
230 std::vector<const G4Region*> reg;
231 std::vector<G4double> rlimE;
232 std::vector<G4double> rlimH;
233 std::vector<G4double> factE;
234 std::vector<G4double> rmsvE;
236 G4RegionStore* store = G4RegionStore::GetInstance();
237 for (
int i = 0;
i < nlimits; ++
i) {
239 if (regnames[
i] ==
"all") {
245 reg.emplace_back(
nullptr);
248 factE.emplace_back(facE[
i]);
249 rmsvE.emplace_back(rmsE[
i]);
250 nlimitsH = (limitsH[
i] > 0) ? 1 : 0;
253 const G4Region*
r = store->GetRegion(regnames[
i],
false);
255 if (
r && (limitsE[
i] > 0.0 || limitsH[
i] > 0.0)) {
259 factE.emplace_back(facE[
i]);
260 rmsvE.emplace_back(rmsE[
i]);
261 if (limitsH[
i] > 0) {
266 nlimits = reg.size();
269 if (eLimiter || rLimiter || 0 < nlimits) {
277 if (pLimiter || 0 < nlimits) {
281 ph->RegisterProcess(plim, G4Positron::Positron());
283 if (0 < nlimits && 0 < nlimitsH) {
288 ph->RegisterProcess(plim, G4Proton::Proton());
294 ph->RegisterProcess(plim, G4PionPlus::PionPlus());
298 ph->RegisterProcess(plim, G4PionMinus::PionMinus());
303 if (fluo && !G4LossTableManager::Instance()->AtomDeexcitation()) {
304 G4VAtomDeexcitation* de =
new G4UAtomicDeexcitation();
305 G4LossTableManager::Instance()->SetAtomDeexcitation(de);
315 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() is done";
319 G4ProcessManager* man =
part->GetProcessManager();
320 G4Transportation* trans = (G4Transportation*)((*(man->GetProcessList()))[0]);
322 trans->SetThresholdWarningEnergy(th1);
323 trans->SetThresholdImportantEnergy(th2);
324 trans->SetThresholdTrials(ntry);
326 <<
"ParametrisedEMPhysics: printout level changed for " <<
part->GetParticleName();