143 edm::LogVerbatim(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess() started";
152 if (
gem || ghad || lowEnergyGem || gemHad || ghadHad) {
157 <<
"ParametrisedEMPhysics: GFlash Construct for e+-: " <<
gem <<
" " << ghad <<
" " << lowEnergyGem
158 <<
" for hadrons: " << gemHad <<
" " << ghadHad;
165 }
else if (lowEnergyGem) {
170 if (gemHad || ghadHad) {
172 G4AntiProton::AntiProton()->GetProcessManager()->AddDiscreteProcess(
180 if (
gem || gemHad || lowEnergyGem) {
181 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"EcalRegion",
false);
184 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: " 185 <<
"EcalRegion is not defined, GFlash will not be enabled for ECAL!";
191 std::make_unique<GFlashEMShowerModel>(
"GflashEcalEMShowerModel", aRegion,
theParSet);
192 }
else if (lowEnergyGem) {
195 std::make_unique<LowEnergyFastSimModel>(
"LowEnergyFastSimModel", aRegion,
theParSet);
201 std::make_unique<GFlashHadronShowerModel>(
"GflashEcalHadShowerModel", aRegion,
theParSet);
205 if (ghad || ghadHad) {
206 G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion(
"HcalRegion",
false);
208 edm::LogWarning(
"SimG4CoreApplication") <<
"ParametrisedEMPhysics::ConstructProcess: " 209 <<
"HcalRegion is not defined, GFlash will not be enabled for HCAL!";
215 std::make_unique<GFlashEMShowerModel>(
"GflashHcalEMShowerModel", aRegion,
theParSet);
220 std::make_unique<GFlashHadronShowerModel>(
"GflashHcalHadShowerModel", aRegion,
theParSet);
226 G4PhysicsListHelper*
ph = G4PhysicsListHelper::GetPhysicsListHelper();
236 std::vector<std::string> regnames =
theParSet.
getParameter<std::vector<std::string> >(
"LimitsPerRegion");
241 int nlimits = regnames.size();
243 std::vector<const G4Region*> reg;
244 std::vector<G4double> rlimE;
245 std::vector<G4double> rlimH;
246 std::vector<G4double> factE;
247 std::vector<G4double> rmsvE;
249 G4RegionStore* store = G4RegionStore::GetInstance();
250 for (
int i = 0;
i < nlimits; ++
i) {
252 if (regnames[
i] ==
"all") {
258 reg.emplace_back(
nullptr);
259 rlimE.emplace_back(limitsE[
i] * CLHEP::MeV);
260 rlimH.emplace_back(limitsH[
i] * CLHEP::MeV);
261 factE.emplace_back(facE[
i]);
262 rmsvE.emplace_back(rmsE[
i]);
263 nlimitsH = (limitsH[
i] > 0) ? 1 : 0;
266 const G4Region*
r = store->GetRegion(regnames[
i],
false);
268 if (
r && (limitsE[
i] > 0.0 || limitsH[
i] > 0.0)) {
270 rlimE.emplace_back(limitsE[
i] * CLHEP::MeV);
271 rlimH.emplace_back(limitsH[
i] * CLHEP::MeV);
272 factE.emplace_back(facE[
i]);
273 rmsvE.emplace_back(rmsE[
i]);
274 if (limitsH[
i] > 0) {
279 nlimits = reg.size();
282 if (eLimiter || rLimiter || 0 < nlimits) {
290 if (pLimiter || 0 < nlimits) {
294 ph->RegisterProcess(plim, G4Positron::Positron());
296 if (0 < nlimits && 0 < nlimitsH) {
301 ph->RegisterProcess(plim, G4Proton::Proton());
307 ph->RegisterProcess(plim, G4PionPlus::PionPlus());
311 ph->RegisterProcess(plim, G4PionMinus::PionMinus());
316 if (fluo && !G4LossTableManager::Instance()->AtomDeexcitation()) {
317 G4VAtomDeexcitation* de =
new G4UAtomicDeexcitation();
318 G4LossTableManager::Instance()->SetAtomDeexcitation(de);
328 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