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 "G4PhysicsListHelper.hh"
37 #include "G4SystemOfUnits.hh"
38 #include "G4UAtomicDeexcitation.hh"
39 #include "G4LossTableManager.hh"
40 #include "G4ProcessManager.hh"
41 #include "G4Transportation.hh"
52 "DefaultRegionForTheWorld"};
66 : G4VPhysicsConstructor(
name), theParSet(
p) {
68 G4EmParameters* param = G4EmParameters::Instance();
70 param->SetVerbose(verb);
73 param->SetBremsstrahlungTh(bremth);
84 <<
"ParametrisedEMPhysics::ConstructProcess: bremsstrahlung threshold Eth= " << bremth /
GeV <<
" GeV"
85 <<
"\n verbosity= " << verb <<
" fluoFlag: " << fluo
86 <<
" modifyTransport: " << modifyT <<
" Ntrials= " <<
nt
87 <<
"\n ThWarning(MeV)= " << th1 <<
" ThException(MeV)= " << th2;
91 if (energyLim > 0.0) {
92 G4double rrfact[
NREG] = {1.0};
100 for (
int i = 0;
i <
NREG; ++
i) {
101 if (rrfact[
i] < 1.0) {
102 param->ActivateSecondaryBiasing(
"eIoni",
rname[
i], rrfact[
i], energyLim);
103 param->ActivateSecondaryBiasing(
"hIoni",
rname[
i], rrfact[
i], energyLim);
105 <<
"ParametrisedEMPhysics: Russian Roulette"
106 <<
" for e- Prob= " << rrfact[
i] <<
" Elimit(MeV)= " << energyLim /
CLHEP::MeV <<
" inside " <<
rname[
i];
120 G4LeptonConstructor pLeptonConstructor;
121 pLeptonConstructor.ConstructParticle();
123 G4MesonConstructor pMesonConstructor;
124 pMesonConstructor.ConstructParticle();
126 G4BaryonConstructor pBaryonConstructor;
127 pBaryonConstructor.ConstructParticle();
129 G4ShortLivedConstructor pShortLivedConstructor;
130 pShortLivedConstructor.ConstructParticle();
132 G4IonConstructor pConstructor;
133 pConstructor.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) {
163 if (gemHad || ghadHad) {
165 G4AntiProton::AntiProton()->GetProcessManager()->AddDiscreteProcess(
173 if (
gem || gemHad || lowEnergyGem) {
174 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"EcalRegion",
false);
177 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: "
178 <<
"EcalRegion is not defined, GFlash will not be enabled for ECAL!";
184 }
else if (lowEnergyGem) {
197 if (ghad || ghadHad) {
198 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"HcalRegion",
false);
200 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: "
201 <<
"HcalRegion is not defined, GFlash will not be enabled for HCAL!";
217 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
227 std::vector<std::string> regnames =
theParSet.
getParameter<std::vector<std::string> >(
"LimitsPerRegion");
232 int nlimits = regnames.size();
234 std::vector<const G4Region*> reg;
235 std::vector<G4double> rlimE;
236 std::vector<G4double> rlimH;
237 std::vector<G4double> factE;
238 std::vector<G4double> rmsvE;
240 G4RegionStore* store = G4RegionStore::GetInstance();
241 for (
int i = 0;
i < nlimits; ++
i) {
243 if (regnames[
i] ==
"all") {
249 reg.emplace_back(
nullptr);
252 factE.emplace_back(facE[
i]);
253 rmsvE.emplace_back(rmsE[
i]);
254 nlimitsH = (limitsH[
i] > 0) ? 1 : 0;
257 const G4Region*
r = store->GetRegion(regnames[
i],
false);
259 if (
r && (limitsE[
i] > 0.0 || limitsH[
i] > 0.0)) {
263 factE.emplace_back(facE[
i]);
264 rmsvE.emplace_back(rmsE[
i]);
265 if (limitsH[
i] > 0) {
270 nlimits = reg.size();
273 if (eLimiter || rLimiter || 0 < nlimits) {
281 if (pLimiter || 0 < nlimits) {
285 ph->RegisterProcess(plim, G4Positron::Positron());
287 if (0 < nlimits && 0 < nlimitsH) {
292 ph->RegisterProcess(plim, G4Proton::Proton());
298 ph->RegisterProcess(plim, G4PionPlus::PionPlus());
302 ph->RegisterProcess(plim, G4PionMinus::PionMinus());
307 if (fluo && !G4LossTableManager::Instance()->AtomDeexcitation()) {
308 G4VAtomDeexcitation* de =
new G4UAtomicDeexcitation();
309 G4LossTableManager::Instance()->SetAtomDeexcitation(de);
321 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() is done";
325 G4ProcessManager* man =
part->GetProcessManager();
326 G4Transportation* trans = (G4Transportation*)((*(man->GetProcessList()))[0]);
328 trans->SetThresholdWarningEnergy(th1);
329 trans->SetThresholdImportantEnergy(th2);
330 trans->SetThresholdTrials(ntry);
332 <<
"ParametrisedEMPhysics: printout level changed for " <<
part->GetParticleName();