Skip to content

Commit feb5872

Browse files
committed
Consistency fix in G4 physics model - fix EMCAL sampling factor
improvement for G4 physics model (options): - offer all physics lists with and without EMV (fast em physics) mode - better consistency between enum name and actual physics string - possibility that user gives own string for physics list EMCAL detector: - provide a reasonable sampling factor also for Geant4 physics lists not mentioned so far (fixing a problem when we switch from FTFP_BERT_EMV to FTFP_BERT for instance)
1 parent 6c44a3f commit feb5872

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

Common/SimConfig/include/SimConfig/G4Params.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,24 @@ namespace conf
2222

2323
// enumerating the possible G4 physics settings
2424
enum class EG4Physics {
25-
kFTFP_BERT_optical = 0, /* just ordinary */
26-
kFTFP_BERT_optical_biasing = 1, /* with biasing enabled */
27-
kFTFP_INCLXX_optical = 2, /* special INCL++ version */
28-
kFTFP_BERT_HP_optical = 3 /* enable low energy neutron transport */
25+
kFTFP_BERT_optical = 0, /* just ordinary */
26+
kFTFP_BERT_optical_biasing = 1, /* with biasing enabled */
27+
kFTFP_INCLXX_optical = 2, /* special INCL++ version */
28+
kFTFP_BERT_HP_optical = 3, /* enable low energy neutron transport */
29+
kFTFP_BERT_EMV_optical = 4, /* just ordinary with faster electromagnetic physics */
30+
kFTFP_BERT_EMV_optical_biasing = 5, /* with biasing enabled with faster electromagnetic physics */
31+
kFTFP_INCLXX_EMV_optical = 6, /* special INCL++ version */
32+
kFTFP_BERT_EMV_HP_optical = 7, /* enable low energy neutron transport */
33+
kUSER = 8 /* allows to give own string combination */
2934
};
3035

3136
// parameters to influence the G4 engine
3237
struct G4Params : public o2::conf::ConfigurableParamHelper<G4Params> {
33-
EG4Physics physicsmode = EG4Physics::kFTFP_BERT_optical; // physics mode with which to configure G4
38+
EG4Physics physicsmode = EG4Physics::kFTFP_BERT_EMV_optical; // default physics mode with which to configure G4
3439

3540
std::string configMacroFile = ""; // a user provided g4Config.in file (otherwise standard one fill be taken)
41+
std::string userPhysicsList = ""; // possibility to directly give physics list as string
42+
3643
std::string const& getPhysicsConfigString() const;
3744

3845
O2ParamDef(G4Params, "G4");

Common/SimConfig/src/G4Params.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,21 @@ namespace conf
1919

2020
namespace
2121
{
22-
static const std::string confstrings[4] = {"FTFP_BERT_EMV+optical", "FTFP_BERT_EMV+optical+biasing", "FTFP_INCLXX_EMV+optical",
22+
static const std::string confstrings[8] = {"FTFP_BERT+optical",
23+
"FTFP_BERT+optical+biasing",
24+
"FTFP_INCLXX+optical",
25+
"FTFP_BERT_HP+optical",
26+
"FTFP_BERT_EMV+optical",
27+
"FTFP_BERT_EMV+optical+biasing",
28+
"FTFP_INCLXX_EMV+optical",
2329
"FTFP_BERT_HP_EMV+optical"};
2430
}
2531

2632
std::string const& G4Params::getPhysicsConfigString() const
2733
{
34+
if (physicsmode == o2::conf::EG4Physics::kUSER) {
35+
return userPhysicsList;
36+
}
2837
return confstrings[(int)physicsmode];
2938
}
3039

Detectors/EMCAL/base/src/Geometry.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ void Geometry::DefineSamplingFraction(const std::string_view mcname, const std::
309309
}
310310

311311
Float_t samplingFactorTranportModel = 1.;
312+
// Note: The sampling factors are chosen so that results from the simulation
313+
// engines correspond well with testbeam data
314+
312315
if (contains(mcname, "Geant3")) {
313316
samplingFactorTranportModel = 1.; // 0.988 // Do nothing
314317
} else if (contains(mcname, "Fluka")) {
@@ -318,6 +321,9 @@ void Geometry::DefineSamplingFraction(const std::string_view mcname, const std::
318321
LOG(info) << "Selected physics list: " << physicslist;
319322
// sampling factors for different Geant4 physics list
320323
// GEANT4 10.7 -> EMCAL-784
324+
325+
// set a default (there may be many physics list strings)
326+
samplingFactorTranportModel = 0.81;
321327
if (physicslist == "FTFP_BERT_EMV+optical") {
322328
samplingFactorTranportModel = 0.821;
323329
} else if (physicslist == "FTFP_BERT_EMV+optical+biasing") {

0 commit comments

Comments
 (0)