From 715579c7b01cf7b85dde911ab53178371549cee0 Mon Sep 17 00:00:00 2001 From: Matthias Kleiner Date: Wed, 18 Nov 2026 11:18:03 +0100 Subject: [PATCH] TPC: read the digitizer gain map from TPC/Calib/PadGainFullMC The digitizer applies the gain map from TPC/Calib/PadGainFullMC, so that MC can be simulated with a different (true) gain map than the one the reconstruction corrects with (TPC/Calib/PadGainFull). Co-Authored-By: Claude Opus 5.5 --- .../baserecsim/include/TPCBaseRecSim/CDBInterface.h | 7 +++++++ .../TPC/baserecsim/include/TPCBaseRecSim/CDBTypes.h | 3 +++ Detectors/TPC/baserecsim/src/CDBInterface.cxx | 11 +++++++++++ Detectors/TPC/simulation/src/GEMAmplification.cxx | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBInterface.h b/Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBInterface.h index 5b2c8e6d48251..0a94d4ad861b3 100644 --- a/Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBInterface.h +++ b/Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBInterface.h @@ -107,6 +107,13 @@ class CDBInterface /// \return gain map object const CalPad& getGainMap(); + /// Return the gain map object applied in the simulation + /// + /// As getGainMap, but from the CCDB the gain map for MC (TPC/Calib/PadGainFullMC) is used, so that the simulation + /// can apply a different gain map than the one the reconstruction corrects with. + /// \return gain map object + const CalPad& getGainMapMC(); + /// Return the ion tail coupling fraction /// /// \return ion tail fraction diff --git a/Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBTypes.h b/Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBTypes.h index 1873b247eb777..38c6181f655f1 100644 --- a/Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBTypes.h +++ b/Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBTypes.h @@ -90,6 +90,7 @@ enum class CDBType { /// DistortionMapMC, ///< full distortions (static + IR dependant) for MC used in the digitizer DistortionMapDerivMC, ///< derivative distortions for MC used in the digitizer for scaling + CalPadGainFullMC, ///< Full pad gain map for MC used in the digitizer AltroSyncSignal ///< timing of Altro chip sync. signal }; @@ -163,6 +164,8 @@ const std::unordered_map CDBTypeMap{ // distortion maps {CDBType::DistortionMapMC, "TPC/Calib/DistortionMapMC"}, {CDBType::DistortionMapDerivMC, "TPC/Calib/DistortionMapDerivativeMC"}, + // gain map for MC + {CDBType::CalPadGainFullMC, "TPC/Calib/PadGainFullMC"}, // AltroSyncSignal {CDBType::AltroSyncSignal, "TPC/Config/AltroSyncSignal"}, }; diff --git a/Detectors/TPC/baserecsim/src/CDBInterface.cxx b/Detectors/TPC/baserecsim/src/CDBInterface.cxx index 2aaf9c58cbe2c..011e832d5c79c 100644 --- a/Detectors/TPC/baserecsim/src/CDBInterface.cxx +++ b/Detectors/TPC/baserecsim/src/CDBInterface.cxx @@ -175,6 +175,17 @@ const CalPad& CDBInterface::getGainMap() return *mGainMap; } +//______________________________________________________________________________ +const CalPad& CDBInterface::getGainMapMC() +{ + // a gain map from file or the default one is the same for the simulation and the reconstruction + if (mGainMapFileName.size() || mUseDefaults) { + return getGainMap(); + } + + return getObjectFromCDB(CDBTypeMap.at(CDBType::CalPadGainFullMC)); +} + //______________________________________________________________________________ const CalPad& CDBInterface::getITFraction() { diff --git a/Detectors/TPC/simulation/src/GEMAmplification.cxx b/Detectors/TPC/simulation/src/GEMAmplification.cxx index 0dadc00ee1f95..302ba7823a471 100644 --- a/Detectors/TPC/simulation/src/GEMAmplification.cxx +++ b/Detectors/TPC/simulation/src/GEMAmplification.cxx @@ -122,7 +122,7 @@ void GEMAmplification::updateParameters() auto& cdb = CDBInterface::instance(); mGEMParam = &(ParameterGEM::Instance()); mGasParam = &(ParameterGas::Instance()); - mGainMap = &(cdb.getGainMap()); + mGainMap = &(cdb.getGainMapMC()); } int GEMAmplification::getStackAmplification(int nElectrons)