146 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() started";
155 if (
gem || ghad || lowEnergyGem || gemHad || ghadHad) {
160 <<
"ParametrisedEMPhysics: GFlash Construct for e+-: " <<
gem <<
" " << ghad <<
" " << lowEnergyGem
161 <<
" for hadrons: " << gemHad <<
" " << ghadHad;
168 }
else if (lowEnergyGem) {
173 if (gemHad || ghadHad) {
175 G4AntiProton::AntiProton()->GetProcessManager()->AddDiscreteProcess(
183 if (
gem || gemHad || lowEnergyGem) {
184 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"EcalRegion",
false);
187 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: " 188 <<
"EcalRegion is not defined, GFlash will not be enabled for ECAL!";
194 std::make_unique<GFlashEMShowerModel>(
"GflashEcalEMShowerModel", aRegion,
theParSet);
195 }
else if (lowEnergyGem) {
198 std::make_unique<LowEnergyFastSimModel>(
"LowEnergyFastSimModel", aRegion,
theParSet);
204 std::make_unique<GFlashHadronShowerModel>(
"GflashEcalHadShowerModel", aRegion,
theParSet);
208 if (ghad || ghadHad) {
209 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"HcalRegion",
false);
211 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: " 212 <<
"HcalRegion is not defined, GFlash will not be enabled for HCAL!";
218 std::make_unique<GFlashEMShowerModel>(
"GflashHcalEMShowerModel", aRegion,
theParSet);
223 std::make_unique<GFlashHadronShowerModel>(
"GflashHcalHadShowerModel", aRegion,
theParSet);
229 G4PhysicsListHelper*
ph = G4PhysicsListHelper::GetPhysicsListHelper();
239 std::vector<std::string> regnames =
theParSet.
getParameter<std::vector<std::string> >(
"LimitsPerRegion");
244 int nlimits = regnames.size();
246 std::vector<const G4Region*> reg;
247 std::vector<G4double> rlimE;
248 std::vector<G4double> rlimH;
249 std::vector<G4double> factE;
250 std::vector<G4double> rmsvE;
252 G4RegionStore* store = G4RegionStore::GetInstance();
253 for (
int i = 0;
i < nlimits; ++
i) {
255 if (regnames[
i] ==
"all") {
261 reg.emplace_back(
nullptr);
262 rlimE.emplace_back(limitsE[
i] * CLHEP::MeV);
263 rlimH.emplace_back(limitsH[
i] * CLHEP::MeV);
264 factE.emplace_back(facE[
i]);
265 rmsvE.emplace_back(rmsE[
i]);
266 nlimitsH = (limitsH[
i] > 0) ? 1 : 0;
269 const G4Region*
r = store->GetRegion(regnames[
i],
false);
271 if (
r && (limitsE[
i] > 0.0 || limitsH[
i] > 0.0)) {
273 rlimE.emplace_back(limitsE[
i] * CLHEP::MeV);
274 rlimH.emplace_back(limitsH[
i] * CLHEP::MeV);
275 factE.emplace_back(facE[
i]);
276 rmsvE.emplace_back(rmsE[
i]);
277 if (limitsH[
i] > 0) {
282 nlimits = reg.size();
285 if (eLimiter || rLimiter || 0 < nlimits) {
293 if (pLimiter || 0 < nlimits) {
297 ph->RegisterProcess(plim, G4Positron::Positron());
299 if (0 < nlimits && 0 < nlimitsH) {
304 ph->RegisterProcess(plim, G4Proton::Proton());
310 ph->RegisterProcess(plim, G4PionPlus::PionPlus());
314 ph->RegisterProcess(plim, G4PionMinus::PionMinus());
319 if (fluo && !G4LossTableManager::Instance()->AtomDeexcitation()) {
320 G4VAtomDeexcitation* de =
new G4UAtomicDeexcitation();
321 G4LossTableManager::Instance()->SetAtomDeexcitation(de);
331 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