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