From 4f78c0ed0dcf626d7c24e2f1b34aca1f370efb93 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 22 Jul 2026 14:48:28 +0200 Subject: [PATCH 1/9] Set digitizer parameters as configurables --- .../Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx index 0038163e75c99..d5f718465caf2 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx @@ -52,7 +52,7 @@ void Digitizer::init() LOG(info) << "Initializing IOTOF digitizer"; LOG(info) << " Time resolution: " << mTimeResolution * 1e3 << " ps"; - LOG(info) << " Charge threshold: " << mChargeThreshold << " electrons"; + LOG(info) << " Charge threshold: " << chargeThreshold << " electrons"; LOG(info) << " Detection efficiency: " << mEfficiency * 100 << " %"; LOG(info) << " Continuous mode: " << (mContinuous ? "ON" : "OFF"); sSegmentation = o2::iotof::Segmentation::Instance(); @@ -114,8 +114,8 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, int evID, int srcID) int electronsPerStep = static_cast(charge / digitizerParams.nSimSteps); // Apply charge threshold - if (charge < mChargeThreshold) { - LOG(debug) << "Hit rejected by charge threshold: " << charge << " < " << mChargeThreshold; + if (charge < chargeThreshold) { + LOG(debug) << "Hit rejected by charge threshold: " << charge << " < " << chargeThreshold; return; } @@ -303,7 +303,7 @@ void Digitizer::fillOutputContainer() auto& chipDigits = chip.getDigits(); for (const auto& [key, digit] : chipDigits) { - if (digit.getCharge() < mChargeThreshold) { + if (digit.getCharge() < chargeThreshold) { continue; // skip digits below threshold } From 954c9c52822476244a2540e6f1795e1a00b9d8ba Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 22 Jul 2026 14:53:19 +0200 Subject: [PATCH 2/9] remove hard-coded digitizer parameters --- .../IOTOF/simulation/include/IOTOFSimulation/Digitizer.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h index dc5a38e0b949f..516de0d96f069 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h @@ -134,9 +134,6 @@ class Digitizer : public TObject bool mContinuous = true; ///< continuous readout mode // Digitization parameters - float mChargeThreshold = 100.f; ///< charge threshold for digit creation (electrons) - float mTimeResolution = 0.020f; ///< time resolution sigma in ns (20 ps default) - float mEfficiency = 0.98f; ///< detection efficiency float mEnergyToCharge = 3.6e-9f; ///< energy loss to electrons conversion (3.6 eV per e-h pair in Si) static o2::iotof::Segmentation* sSegmentation; ///< IOTOF segmentation instance (singleton) From 2658bc0a26a41f6f8ef12bca7f66774b3de74f7e Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 22 Jul 2026 14:54:51 +0200 Subject: [PATCH 3/9] use new names from dpldigitizerparames --- .../Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx index d5f718465caf2..979eba4790e91 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx @@ -51,9 +51,9 @@ void Digitizer::init() } LOG(info) << "Initializing IOTOF digitizer"; - LOG(info) << " Time resolution: " << mTimeResolution * 1e3 << " ps"; + LOG(info) << " Time resolution: " << timeResolution * 1e3 << " ps"; LOG(info) << " Charge threshold: " << chargeThreshold << " electrons"; - LOG(info) << " Detection efficiency: " << mEfficiency * 100 << " %"; + LOG(info) << " Detection efficiency: " << efficiency * 100 << " %"; LOG(info) << " Continuous mode: " << (mContinuous ? "ON" : "OFF"); sSegmentation = o2::iotof::Segmentation::Instance(); } @@ -256,8 +256,8 @@ 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); + if (timeResolution > 0) { + return time + gRandom->Gaus(0, timeResolution); } return time; } @@ -275,7 +275,7 @@ int Digitizer::energyToCharge(float energyLoss) const bool Digitizer::isEfficient() const { // Apply efficiency cut using random number - return gRandom->Uniform() < mEfficiency; + return gRandom->Uniform() < efficiency; } //_______________________________________________________________________ From c72bc2d4cd4d137c489ec7bc5cd8f977057849ff Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 22 Jul 2026 14:57:02 +0200 Subject: [PATCH 4/9] set digitizer parameters in the dplconfigurable --- .../simulation/include/IOTOFSimulation/DPLDigitizerParam.h | 2 ++ 1 file changed, 2 insertions(+) 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 Date: Wed, 22 Jul 2026 14:57:42 +0200 Subject: [PATCH 5/9] remove unused parameter --- .../IOTOF/simulation/include/IOTOFSimulation/Digitizer.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h index 516de0d96f069..45a25969ce37a 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h @@ -133,9 +133,6 @@ class Digitizer : public TObject o2::InteractionRecord mROFRecordIR; ///< interaction record assigned to the output ROF bool mContinuous = true; ///< continuous readout mode - // Digitization parameters - float mEnergyToCharge = 3.6e-9f; ///< energy loss to electrons conversion (3.6 eV per e-h pair in Si) - static o2::iotof::Segmentation* sSegmentation; ///< IOTOF segmentation instance (singleton) ClassDefNV(Digitizer, 1); From 6308b3227c813e52be0e314f76c3c1558a417a90 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 22 Jul 2026 15:01:44 +0200 Subject: [PATCH 6/9] use dplparameter to convert energy to electrons --- Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx index 979eba4790e91..224bffc796a62 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx @@ -267,8 +267,8 @@ 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 + return static_cast(energyLoss * energyToNElectrons); } //_______________________________________________________________________ From 2811bd1af19da322696766a4eef67858e622f3a9 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 22 Jul 2026 16:02:03 +0200 Subject: [PATCH 7/9] remove getters/setters --- .../simulation/include/IOTOFSimulation/Digitizer.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h index 45a25969ce37a..ae04346ea5de1 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h @@ -74,17 +74,6 @@ class Digitizer : public TObject // Provide the common iotof::GeometryTGeo to access matrices and segmentation void setGeometry(const o2::iotof::GeometryTGeo* gm) { mGeometry = gm; } - // Setters for digitization parameters - void setChargeThreshold(float thr) { mChargeThreshold = thr; } - void setTimeResolution(float res) { mTimeResolution = res; } - void setEfficiency(float eff) { mEfficiency = eff; } - void setEnergyToCharge(float e2c) { mEnergyToCharge = e2c; } - - // Getters - float getChargeThreshold() const { return mChargeThreshold; } - float getTimeResolution() const { return mTimeResolution; } - float getEfficiency() const { return mEfficiency; } - private: /// Process a single hit void processHit(const o2::itsmft::Hit& hit, int evID, int srcID); From 5d4a873c77f7fc3b204930afbff16e877777d7f5 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 22 Jul 2026 16:04:30 +0200 Subject: [PATCH 8/9] remove call to unused setter --- Steer/DigitizerWorkflow/src/IOTOFDigitizerSpec.cxx | 1 - 1 file changed, 1 deletion(-) 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(); } From f28b1dbd821c8493eab1a0d3fca9b13a4b835fbe Mon Sep 17 00:00:00 2001 From: maciacco Date: Wed, 22 Jul 2026 18:32:59 +0200 Subject: [PATCH 9/9] call digitizer param instance each time it is needed (possibly to be cleaned up in future) --- .../ALICE3/IOTOF/simulation/src/Digitizer.cxx | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx index 224bffc796a62..dbcb306911847 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx @@ -50,10 +50,12 @@ void Digitizer::init() /// } } + const auto& digitizerParams = o2::iotof::DPLDigitizerParam::Instance(); + LOG(info) << "Initializing IOTOF digitizer"; - LOG(info) << " Time resolution: " << timeResolution * 1e3 << " ps"; - LOG(info) << " Charge threshold: " << chargeThreshold << " electrons"; - LOG(info) << " Detection efficiency: " << efficiency * 100 << " %"; + LOG(info) << " Time resolution: " << digitizerParams.timeResolution * 1e3 << " ps"; + LOG(info) << " Charge threshold: " << digitizerParams.chargeThreshold << " electrons"; + LOG(info) << " Detection efficiency: " << digitizerParams.efficiency * 100 << " %"; LOG(info) << " Continuous mode: " << (mContinuous ? "ON" : "OFF"); sSegmentation = o2::iotof::Segmentation::Instance(); } @@ -114,8 +116,8 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, int evID, int srcID) int electronsPerStep = static_cast(charge / digitizerParams.nSimSteps); // Apply charge threshold - if (charge < chargeThreshold) { - LOG(debug) << "Hit rejected by charge threshold: " << charge << " < " << chargeThreshold; + 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 (timeResolution > 0) { - return time + gRandom->Gaus(0, timeResolution); + const auto& digitizerParams = o2::iotof::DPLDigitizerParam::Instance(); + if (digitizerParams.timeResolution > 0) { + return time + gRandom->Gaus(0, digitizerParams.timeResolution); } return time; } @@ -268,14 +271,16 @@ 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, energyToNElectrons is electrons per GeV - return static_cast(energyLoss * energyToNElectrons); + 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() < efficiency; + 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() < chargeThreshold) { + if (digit.getCharge() < digitizerParams.chargeThreshold) { continue; // skip digits below threshold }