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";