138 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() started";
147 if (
gem || ghad || lowEnergyGem || gemHad || ghadHad) {
152 <<
"ParametrisedEMPhysics: GFlash Construct for e+-: " <<
gem <<
" " << ghad <<
" " << lowEnergyGem
153 <<
" for hadrons: " << gemHad <<
" " << ghadHad;
160 }
else if (lowEnergyGem) {
165 if (gemHad || ghadHad) {
167 G4AntiProton::AntiProton()->GetProcessManager()->AddDiscreteProcess(
175 if (
gem || gemHad || lowEnergyGem) {
176 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"EcalRegion",
false);
179 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: " 180 <<
"EcalRegion is not defined, GFlash will not be enabled for ECAL!";
186 std::make_unique<GFlashEMShowerModel>(
"GflashEcalEMShowerModel", aRegion,
theParSet);
187 }
else if (lowEnergyGem) {
190 std::make_unique<LowEnergyFastSimModel>(
"LowEnergyFastSimModel", aRegion,
theParSet);
196 std::make_unique<GFlashHadronShowerModel>(
"GflashEcalHadShowerModel", aRegion,
theParSet);
200 if (ghad || ghadHad) {
201 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"HcalRegion",
false);
203 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: " 204 <<
"HcalRegion is not defined, GFlash will not be enabled for HCAL!";
210 std::make_unique<GFlashEMShowerModel>(
"GflashHcalEMShowerModel", aRegion,
theParSet);
215 std::make_unique<GFlashHadronShowerModel>(
"GflashHcalHadShowerModel", aRegion,
theParSet);
221 G4PhysicsListHelper*
ph = G4PhysicsListHelper::GetPhysicsListHelper();
231 std::vector<std::string> regnames =
theParSet.
getParameter<std::vector<std::string> >(
"LimitsPerRegion");
236 int nlimits = regnames.size();
238 std::vector<const G4Region*> reg;
239 std::vector<G4double> rlimE;
240 std::vector<G4double> rlimH;
241 std::vector<G4double> factE;
242 std::vector<G4double> rmsvE;
244 G4RegionStore* store = G4RegionStore::GetInstance();
245 for (
int i = 0;
i < nlimits; ++
i) {
247 if (regnames[
i] ==
"all") {
253 reg.emplace_back(
nullptr);
254 rlimE.emplace_back(limitsE[
i] * CLHEP::MeV);
255 rlimH.emplace_back(limitsH[
i] * CLHEP::MeV);
256 factE.emplace_back(facE[
i]);
257 rmsvE.emplace_back(rmsE[
i]);
258 nlimitsH = (limitsH[
i] > 0) ? 1 : 0;
261 const G4Region*
r = store->GetRegion(regnames[
i],
false);
263 if (
r && (limitsE[
i] > 0.0 || limitsH[
i] > 0.0)) {
265 rlimE.emplace_back(limitsE[
i] * CLHEP::MeV);
266 rlimH.emplace_back(limitsH[
i] * CLHEP::MeV);
267 factE.emplace_back(facE[
i]);
268 rmsvE.emplace_back(rmsE[
i]);
269 if (limitsH[
i] > 0) {
274 nlimits = reg.size();
277 if (eLimiter || rLimiter || 0 < nlimits) {
285 if (pLimiter || 0 < nlimits) {
289 ph->RegisterProcess(plim, G4Positron::Positron());
291 if (0 < nlimits && 0 < nlimitsH) {
296 ph->RegisterProcess(plim, G4Proton::Proton());
302 ph->RegisterProcess(plim, G4PionPlus::PionPlus());
306 ph->RegisterProcess(plim, G4PionMinus::PionMinus());
311 if (fluo && !G4LossTableManager::Instance()->AtomDeexcitation()) {
312 G4VAtomDeexcitation* de =
new G4UAtomicDeexcitation();
313 G4LossTableManager::Instance()->SetAtomDeexcitation(de);
323 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() is done";
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
void SetRangeCheckFlag(G4bool)
edm::ParameterSet theParSet
void SetTrackingCutPerRegion(std::vector< const G4Region *> &, std::vector< G4double > &, std::vector< G4double > &, std::vector< G4double > &)
static G4ThreadLocal TLSmod * m_tpmod
void ModifyTransportation(const G4ParticleDefinition *, int ntry, double th1, double th2)
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< G4FastSimulationManagerProcess > theFastSimulationManagerProcess
std::unique_ptr< GFlashEMShowerModel > theEcalEMShowerModel
void SetFieldCheckFlag(G4bool)
std::unique_ptr< LowEnergyFastSimModel > theLowEnergyFastSimModel
std::unique_ptr< GFlashEMShowerModel > theHcalEMShowerModel
std::unique_ptr< GFlashHadronShowerModel > theHcalHadShowerModel
std::unique_ptr< GFlashHadronShowerModel > theEcalHadShowerModel
Log< level::Warning, false > LogWarning