diff --git a/Common/SimConfig/include/SimConfig/G4Params.h b/Common/SimConfig/include/SimConfig/G4Params.h index 16547a685c6d4..3c6506bddf801 100644 --- a/Common/SimConfig/include/SimConfig/G4Params.h +++ b/Common/SimConfig/include/SimConfig/G4Params.h @@ -24,7 +24,8 @@ namespace conf enum class EG4Physics { kFTFP_BERT_optical = 0, /* just ordinary */ kFTFP_BERT_optical_biasing = 1, /* with biasing enabled */ - kFTFP_INCLXX_optical = 2 /* special INCL++ version */ + kFTFP_INCLXX_optical = 2, /* special INCL++ version */ + kFTFP_BERT_HP_optical = 3 /* enable low energy neutron transport */ }; // parameters to influence the G4 engine diff --git a/Common/SimConfig/include/SimConfig/SimParams.h b/Common/SimConfig/include/SimConfig/SimParams.h index 2ab355337e45f..2c103f43b2b04 100644 --- a/Common/SimConfig/include/SimConfig/SimParams.h +++ b/Common/SimConfig/include/SimConfig/SimParams.h @@ -37,7 +37,7 @@ struct SimCutParams : public o2::conf::ConfigurableParamHelper { float tunnelZ = 1900; // Z-value from where we apply maxRTrackingZDC (default value taken from standard "hall" dimensions) float globalDensityFactor = 1.f; // global factor that scales all material densities for systematic studies - + bool lowneut = false; O2ParamDef(SimCutParams, "SimCutParams"); }; diff --git a/Common/SimConfig/src/G4Params.cxx b/Common/SimConfig/src/G4Params.cxx index 5c5fe26751cd3..48f7a1c240d7b 100644 --- a/Common/SimConfig/src/G4Params.cxx +++ b/Common/SimConfig/src/G4Params.cxx @@ -19,7 +19,8 @@ namespace conf namespace { -static const std::string confstrings[3] = {"FTFP_BERT_EMV+optical", "FTFP_BERT_EMV+optical+biasing", "FTFP_INCLXX_EMV+optical"}; +static const std::string confstrings[4] = {"FTFP_BERT_EMV+optical", "FTFP_BERT_EMV+optical+biasing", "FTFP_INCLXX_EMV+optical", + "FTFP_BERT_HP_EMV+optical"}; } std::string const& G4Params::getPhysicsConfigString() const diff --git a/Detectors/Base/include/DetectorsBase/MaterialManager.h b/Detectors/Base/include/DetectorsBase/MaterialManager.h index 96f64274d7a4d..4448998ee3d33 100644 --- a/Detectors/Base/include/DetectorsBase/MaterialManager.h +++ b/Detectors/Base/include/DetectorsBase/MaterialManager.h @@ -131,6 +131,9 @@ class MaterialManager /// Custom setting of process or cut given parameter name and value void SpecialCut(const char* modname, int localindex, ECut parID, Float_t val); + /// Set flag fro low energy neutron transport + void SetLowEnergyNeutronTransport(bool flag) { mLowNeut = flag; } + /// load cuts and process flags from a data file (like AliRoot did) void loadCutsAndProcessesFromFile(const char* modname, const char* filename); void loadCutsAndProcessesFromJSON(ESpecial special = ESpecial::kFALSE, std::string const& filename = ""); @@ -264,6 +267,8 @@ class MaterialManager /// Decide whether special process and cut settings should be applied bool mApplySpecialProcesses = true; bool mApplySpecialCuts = true; + /// Flag for low energy neutron transport + bool mLowNeut = false; public: ClassDefNV(MaterialManager, 0); diff --git a/Detectors/Base/src/MaterialManager.cxx b/Detectors/Base/src/MaterialManager.cxx index 1f5bc718a8525..741b69d019871 100644 --- a/Detectors/Base/src/MaterialManager.cxx +++ b/Detectors/Base/src/MaterialManager.cxx @@ -254,6 +254,12 @@ void MaterialManager::Cut(ESpecial special, int globalindex, ECut cut, Float_t v if (val < 0.) { return; } + // if low energy neutron transport is requested setting kCUTNEU will set to 0.005eV + if (mLowNeut && cut == ECut::kCUTNEU) { + LOG(info) << "Due to low energy neutrons, neutron cut value " << val << " discarded and reset to 5e-12"; + val = 5.e-12; + } + auto it = mCutIDToName.find(cut); if (it == mCutIDToName.end()) { return; diff --git a/Detectors/gconfig/src/FlukaRuntimeConfig.macro b/Detectors/gconfig/src/FlukaRuntimeConfig.macro index f80d32ee805f4..86b381e7575d7 100644 --- a/Detectors/gconfig/src/FlukaRuntimeConfig.macro +++ b/Detectors/gconfig/src/FlukaRuntimeConfig.macro @@ -13,6 +13,7 @@ TVirtualMC* FlukaRuntimeConfig() auto inpFile = params.scoringFile; auto userStepping = params.userStepping; auto hadronCut = params.activationHadronCut; + fluka->SetLowEnergyNeutronTransport(lowNeutron); if (!inpFile.empty()) { fluka->SetActivationSimulation(isAct, hadronCut); fluka->SetUserScoringFileName(inpFile.c_str()); diff --git a/Steer/src/O2MCApplication.cxx b/Steer/src/O2MCApplication.cxx index 4528cfa1e36f2..8934ae029bccb 100644 --- a/Steer/src/O2MCApplication.cxx +++ b/Steer/src/O2MCApplication.cxx @@ -133,6 +133,7 @@ void O2MCApplicationBase::InitGeometry() // load special cuts which might be given from the outside first. auto& matMgr = o2::base::MaterialManager::Instance(); matMgr.loadCutsAndProcessesFromJSON(o2::base::MaterialManager::ESpecial::kTRUE); + matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut); // During the following, FairModule::SetSpecialPhysicsCuts will be called for each module FairMCApplication::InitGeometry(); matMgr.writeCutsAndProcessesToJSON();