|
19 | 19 |
|
20 | 20 | #include "CommonUtils/ShmAllocator.h" |
21 | 21 | #include "DetectorsBase/MaterialManager.h" |
| 22 | +#include "SimConfig/G4Params.h" |
22 | 23 | #include "DetectorsBase/Stack.h" |
23 | 24 | #include "FairVolume.h" |
24 | 25 | #include "FairRootManager.h" |
@@ -124,15 +125,20 @@ void Detector::InitializeParams() |
124 | 125 | mMaxMCStepDef = TRDSimParams::Instance().maxMCStepSize; |
125 | 126 |
|
126 | 127 | const auto& simParams = TRDSimParams::Instance(); |
127 | | - if (simParams.ionisationModel == 1) { |
| 128 | + const bool g4HepEm = o2::conf::G4Params::Instance().isG4HepEmActive(); |
| 129 | + const int ionisationModel = simParams.activeIonisationModel(g4HepEm); |
| 130 | + if (g4HepEm && ionisationModel == 0) { |
| 131 | + LOG(warning) << "TRD: energy-deposit charge with G4HepEm, which has no PAI model for e-/e+ in the gas"; |
| 132 | + } |
| 133 | + if (ionisationModel == 1) { |
128 | 134 | mIonisation = std::make_unique<IonisationModel>(simParams.gas); |
129 | 135 | // the tables start at minBetaGamma; below it the energy deposit is used |
130 | 136 | mIonMinBetaGamma = std::max<double>(simParams.ionisationMinBetaGamma, IonisationModel::minBetaGamma()); |
131 | 137 | mIonMinEkin = simParams.ionisationMinEkin; |
132 | 138 | LOG(info) << "TRD: ionisation from collision tables, energy deposit below beta*gamma " << mIonMinBetaGamma |
133 | 139 | << " or kinetic energy " << mIonMinEkin << " eV"; |
134 | | - } else if (simParams.ionisationModel != 0) { |
135 | | - LOG(fatal) << "TRD: unknown ionisationModel " << simParams.ionisationModel; |
| 140 | + } else if (ionisationModel != 0) { |
| 141 | + LOG(fatal) << "TRD: unknown ionisationModel " << ionisationModel; |
136 | 142 | } |
137 | 143 | } |
138 | 144 |
|
|
0 commit comments