Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

o2-sim: Support for low energy neutron transport (Geant4 and Fluka) #10585

Merged
merged 2 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Common/SimConfig/include/SimConfig/G4Params.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Common/SimConfig/include/SimConfig/SimParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct SimCutParams : public o2::conf::ConfigurableParamHelper<SimCutParams> {
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");
};

Expand Down
3 changes: 2 additions & 1 deletion Common/SimConfig/src/G4Params.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Detectors/Base/include/DetectorsBase/MaterialManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "");
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions Detectors/Base/src/MaterialManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions Detectors/gconfig/src/FlukaRuntimeConfig.macro
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions Steer/src/O2MCApplication.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down