diff --git a/algo/unpack/Unpack.cxx b/algo/unpack/Unpack.cxx index 0bfd734e67e35f21d2123fec6dbac814a1d2b9af..f4cd2c884bd337101533ac2065231c97e5e60255 100644 --- a/algo/unpack/Unpack.cxx +++ b/algo/unpack/Unpack.cxx @@ -153,7 +153,7 @@ namespace cbm::algo elinkPar.fTimeOffset = fSystemTimeOffset[fles::SubsystemIdentifier::STS]; elinkPar.fAdcOffset = 1.; elinkPar.fAdcGain = 1.; - elinkPar.fWalk = fStsConfig.WalkMap(elinkPar.fAddress, elinkPar.fAsicNr); + if (fApplyWalkCorrection) elinkPar.fWalk = fStsConfig.WalkMap(elinkPar.fAddress, elinkPar.fAsicNr); // TODO: Add parameters for time and ADC calibration par->fElinkParams.push_back(elinkPar); } @@ -274,7 +274,8 @@ namespace cbm::algo L_(debug) << "--- Configured equipment " << equip << " with " << numAsics << " asics"; } - L_(info) << "--- Configured " << fAlgoSts.size() << " unpacker algorithms for STS."; + L_(info) << "--- Configured " << fAlgoSts.size() + << " unpacker algorithms for STS. (Walk correction = " << fApplyWalkCorrection << ")"; L_(debug) << "Readout map:" << fStsConfig.PrintReadoutMap(); L_(info) << "--- Configured " << fAlgoMuch.size() << " unpacker algorithms for MUCH."; L_(info) << "--- Configured " << fAlgoRich.size() << " unpacker algorithms for RICH."; diff --git a/algo/unpack/Unpack.h b/algo/unpack/Unpack.h index 2d875b490a567683986a3d9917a88416b6c680dd..72b10e66a5c3056ff67c793d9fabd512d134488c 100644 --- a/algo/unpack/Unpack.h +++ b/algo/unpack/Unpack.h @@ -101,6 +101,12 @@ namespace cbm::algo /** @brief Parameters for RICH unpackers **/ RichReadoutConfig fRichConfig {}; + + /** + * @brief Set whether to apply walk correction. Must be set before Init(). (default: true) + **/ + void SetApplyWalkCorrection(bool applyWalkCorrection) { fApplyWalkCorrection = applyWalkCorrection; } + /** @brief Initialize unpackers and fill parameters from config objects * @param subIds: vector of subsystem identifiers to unpack, default: all * @see Init() @@ -128,8 +134,9 @@ namespace cbm::algo std::vector<MonitorData>* monitorMs, uint8_t sys_ver); - private: // members - std::vector<fles::SubsystemIdentifier> fSubIds = {}; ///< Detector identifiers to unpack + private: // members + bool fApplyWalkCorrection = true; ///< Apply walk correction + std::vector<fles::SubsystemIdentifier> fSubIds = {}; ///< Detector identifiers to unpack /** @brief STS unpackers **/ std::map<uint16_t, UnpackSts> fAlgoSts = {}; diff --git a/algo/unpack/UnpackChain.cxx b/algo/unpack/UnpackChain.cxx index b0c56787eb83eb3fdff9e873f17c2ccc469ac203..670964be01deb0c969c49a3822034b3e7390690f 100644 --- a/algo/unpack/UnpackChain.cxx +++ b/algo/unpack/UnpackChain.cxx @@ -7,6 +7,8 @@ using namespace cbm::algo; void UnpackChain::Init() { + // Disable walk correction for now. 2022 data crashes unpacker with hardcoded 2021 params. + fUnpack.SetApplyWalkCorrection(false); fUnpack.Init(std::vector<fles::SubsystemIdentifier> { fles::SubsystemIdentifier::STS, // fles::SubsystemIdentifier::MUCH,