diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h index fbff3330865db..b629f79c23424 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h @@ -27,6 +27,8 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper(charge / digitizerParams.nSimSteps); // Apply charge threshold - if (charge < mChargeThreshold) { - LOG(debug) << "Hit rejected by charge threshold: " << charge << " < " << mChargeThreshold; + if (charge < digitizerParams.chargeThreshold) { + LOG(debug) << "Hit rejected by charge threshold: " << charge << " < " << digitizerParams.chargeThreshold; return; } @@ -256,8 +258,9 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, int& r double Digitizer::smearTime(double time) const { // Apply Gaussian smearing to simulate detector time resolution - if (mTimeResolution > 0) { - return time + gRandom->Gaus(0, mTimeResolution); + const auto& digitizerParams = o2::iotof::DPLDigitizerParam::Instance(); + if (digitizerParams.timeResolution > 0) { + return time + gRandom->Gaus(0, digitizerParams.timeResolution); } return time; } @@ -267,15 +270,17 @@ int Digitizer::energyToCharge(float energyLoss) const { // Convert energy loss (GeV) to number of electrons // Typical value: 3.6 eV per electron-hole pair in silicon - // energyLoss is in GeV, mEnergyToCharge is GeV per electron - return static_cast(energyLoss / mEnergyToCharge); + // energyLoss is in GeV, energyToNElectrons is electrons per GeV + const auto& digitizerParams = o2::iotof::DPLDigitizerParam::Instance(); + return static_cast(energyLoss * digitizerParams.energyToNElectrons); } //_______________________________________________________________________ bool Digitizer::isEfficient() const { // Apply efficiency cut using random number - return gRandom->Uniform() < mEfficiency; + const auto& digitizerParams = o2::iotof::DPLDigitizerParam::Instance(); + return gRandom->Uniform() < digitizerParams.efficiency; } //_______________________________________________________________________ @@ -284,6 +289,8 @@ void Digitizer::fillOutputContainer() LOG(info) << "Filling output container with digits from chips"; LOG(debug) << "Number of chips: " << mChips.size(); + const auto& digitizerParams = o2::iotof::DPLDigitizerParam::Instance(); + o2::itsmft::ROFRecord rof; rof.setFirstEntry(mDigits->size()); // index of the first digit @@ -303,7 +310,7 @@ void Digitizer::fillOutputContainer() auto& chipDigits = chip.getDigits(); for (const auto& [key, digit] : chipDigits) { - if (digit.getCharge() < mChargeThreshold) { + if (digit.getCharge() < digitizerParams.chargeThreshold) { continue; // skip digits below threshold } diff --git a/Steer/DigitizerWorkflow/src/IOTOFDigitizerSpec.cxx b/Steer/DigitizerWorkflow/src/IOTOFDigitizerSpec.cxx index 97f292332ecdb..008b2bff841c5 100644 --- a/Steer/DigitizerWorkflow/src/IOTOFDigitizerSpec.cxx +++ b/Steer/DigitizerWorkflow/src/IOTOFDigitizerSpec.cxx @@ -59,7 +59,6 @@ class IOTOFDPLDigitizerTask : o2::base::BaseDPLDigitizer geom->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)); // make sure L2G matrices are loaded mDigitizer.setGeometry(geom); - mDigitizer.setChargeThreshold(-1000.f); mDigitizer.init(); }