diff --git a/algo/detectors/trd2d/ReadoutConfig.cxx b/algo/detectors/trd2d/ReadoutConfig.cxx index 7d3dc97ef78c991aa2049beb83a5deb1373ccf34..a65ca1e2c05b08085fe9ed80dcd1fb274f92ea95 100644 --- a/algo/detectors/trd2d/ReadoutConfig.cxx +++ b/algo/detectors/trd2d/ReadoutConfig.cxx @@ -119,7 +119,7 @@ namespace cbm::algo::trd2d // --- Initialise the mapping structure -------------------------------------------- void ReadoutSetup::InitChannelMap( - const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint8_t, uint16_t>>>>& + const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, int16_t, uint16_t>>>>& channelMap) { // Constructing the map (equipId, asicId, chanId) -> (pad address, mask flag, daq offset) @@ -132,7 +132,7 @@ namespace cbm::algo::trd2d fChannelMap[equipmentId][asicId].resize(16); for (auto chanMap : asicMap.second) { uint16_t chanId = chanMap.first; - std::tuple<int32_t, bool, uint8_t, uint16_t> chanPars = chanMap.second; + std::tuple<int32_t, bool, int8_t, uint16_t> chanPars = chanMap.second; const ChanMapping entry = {std::get<0>(chanPars), std::get<1>(chanPars), std::get<2>(chanPars), std::get<3>(chanPars)}; fChannelMap[equipmentId][asicId][chanId] = entry; diff --git a/algo/detectors/trd2d/ReadoutConfig.h b/algo/detectors/trd2d/ReadoutConfig.h index f63026808fca972c0f5214a94def28349da9052e..673b55f876c9bcebd5ed15cd832a18b35882ffd4 100644 --- a/algo/detectors/trd2d/ReadoutConfig.h +++ b/algo/detectors/trd2d/ReadoutConfig.h @@ -44,7 +44,7 @@ namespace cbm::algo::trd2d struct ChanMapping { int32_t padAddress; /// map pad and pairing to FASP channel bool maskFlag; /// HW mask flag for channel - uint8_t tOffset; /// time correction in clk + int8_t tOffset; /// time correction in clk uint16_t lThreshold; /// SW threshold for ringing channels CBM_YAML_FORMAT(YAML::Flow); @@ -116,7 +116,7 @@ namespace cbm::algo::trd2d /** @brief Initialisation of channel map **/ void InitChannelMap( - const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint8_t, uint16_t>>>>& + const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, int16_t, uint16_t>>>>& channelMap); /** @brief Get system time offset **/ @@ -149,8 +149,8 @@ namespace cbm::algo::trd2d public: struct ChanNoise { - uint8_t tDelay; /// time [clk] delay wrt to causing primary signal - uint8_t tWindow; /// time [clk] window to search for noisy signal + uint16_t tDelay; /// time [clk] delay wrt to causing primary signal + uint16_t tWindow; /// time [clk] window to search for noisy signal uint16_t lDThres; /// Threshold [ADU] for dynamic channel noise uint16_t lSThres; /// threshold [ADU] for static channel noise (happens independently) @@ -162,7 +162,7 @@ namespace cbm::algo::trd2d }; struct ChanDescriptor { bool maskFlag; /// HW mask flag for channel - uint8_t tOffset; /// time [clk] correction + int8_t tOffset; /// time [clk] correction float baseline; /// Baseline correction for channel float gainfee; /// ASIC gain deviation for channel ChanNoise noise; /// noise descriptor [ChanNoise] diff --git a/algo/detectors/trd2d/Unpack.cxx b/algo/detectors/trd2d/Unpack.cxx index 5cc2d37bca409192ee37a1a267642e6934308ef3..b0b57c45d5c8af23dd6bbffc78cedc3fa2560727 100644 --- a/algo/detectors/trd2d/Unpack.cxx +++ b/algo/detectors/trd2d/Unpack.cxx @@ -51,6 +51,7 @@ Unpack::Unpack(const Config& config) : fConfig(config) {calCh.noise.tDelay, calCh.noise.tWindow, calCh.noise.lDThres, calCh.noise.lSThres}}; chanPar.fMask = pars.maskFlag; // Flag channel mask chanPar.fDaqOffset = pars.tOffset; // Time calibration parameter + par.toff[ch / 2] = pars.tOffset; chanPar.fSignalThres = pars.lThreshold; // Threshold cut asicPar.fChanParams.push_back(chanPar); } diff --git a/algo/detectors/trd2d/UnpackMS.cxx b/algo/detectors/trd2d/UnpackMS.cxx index 24fb88e6656fb77fdd65823a4d8a2edfe362eb66..b143ea98cbd904037deace010190a169ee2ce220 100644 --- a/algo/detectors/trd2d/UnpackMS.cxx +++ b/algo/detectors/trd2d/UnpackMS.cxx @@ -187,14 +187,9 @@ namespace cbm::algo::trd2d MsContext ctx = {}; - // define time wrt start of time slice in TRD/FASP clks [80 MHz]. Contains: - // - relative offset of the MS wrt the TS - // - FASP epoch offset for current CROB - // - TRD2D system offset wrt to experiment time (e.g. Bmon) - uint64_t time = uint64_t((msDescr.idx - tTimeslice - fParams.fSystemTimeOffset) / 12.5); - - // Get parameters for current eq id. - //const uint8_t crob_id = fParams.fEqId; + // define time wrt start of time slice in TRD/FASP clks [80 MHz]. + uint64_t time = uint64_t((msDescr.idx - tTimeslice) / 25); // guaranteed by CBM-DAQ + time <<= 1; // time expressed in 12.5 ns clks // Get the number of complete words in the input MS buffer. const uint32_t nwords = msDescr.size / 4; @@ -280,7 +275,7 @@ namespace cbm::algo::trd2d // No need to extra check double r, t; int32_t dt; - const int32_t dtime = (*id).GetTimeDAQ() - lTime; + const int32_t dtime = (*id).GetTime() - lTime; bool use(false); if (abs(dtime) < 5) { // test message part of (last) digi @@ -291,7 +286,7 @@ namespace cbm::algo::trd2d } else if (lchT && t < 0.1) { // set T charge on an empty slot (*id).SetCharge(lchT, r, +dtime); - (*id).SetTimeDAQ(uint64_t((*id).GetTimeDAQ() - dtime)); + (*id).SetTime(lTime); use = true; } } @@ -343,6 +338,12 @@ namespace cbm::algo::trd2d // reset flags as they were used only to mark the correctly setting of the charge/digi (*id).SetFlag(0, false); (*id).SetFlag(1, false); + /** Convert global time from clk temporary representation to the finale version in [ns] + * Correct the time with the system time offset which is derived in calibration.*/ + uint64_t gtime = (*id).GetTime() * fAsicClockPeriod; + gtime >>= 1; + if (gtime >= uint64_t(fParams.fSystemTimeOffset)) gtime -= fParams.fSystemTimeOffset; + (*id).SetTime(gtime); outputDigis.emplace_back(std::move((*id))); } // clear digi buffer wrt the digi which was forwarded to higher structures @@ -369,11 +370,16 @@ namespace cbm::algo::trd2d Result_t result = {}; MsContext ctx = {}; - // define time wrt start of time slice in TRD/FASP clks [80 MHz]. Contains: - // - relative offset of the MS wrt the TS - // - FASP epoch offset for current CROB - // - TRD2D system offset wrt to experiment time - uint64_t time = uint64_t((msDescr.idx - tTimeslice - fParams.fSystemTimeOffset) * fAsicClockFreq); + // // define time wrt start of time slice in TRD/FASP clks [80 MHz]. Contains: + // // - relative offset of the MS wrt the TS + // // - FASP epoch offset for current CROB + // // - TRD2D system offset wrt to experiment time + // uint64_t time = uint64_t((msDescr.idx - tTimeslice - fParams.fSystemTimeOffset) * fAsicClockFreq); + + //define the time in run as function of CBM 40MHz clk + uint64_t timeClk = (msDescr.idx - tTimeslice) / 25; + //convert to TRD2D 80MHz clk + timeClk <<= 1; // Get the number of complete words in the input MS buffer. const uint32_t nwords = msDescr.size / 4; @@ -399,12 +405,12 @@ namespace cbm::algo::trd2d if (ctx.fMess.ch == 0) { // check word integrity // clear buffer if (vMess.size()) { - pushDigis(vMess, time, ctx); + pushDigis(vMess, timeClk, ctx); } vMess.clear(); lFaspOld = 0xff; - time += FASP_EPOCH_LENGTH; + timeClk += FASP_EPOCH_LENGTH; } else { L_(error) << "FASP message[Epoch] with wrong signature."; @@ -416,7 +422,7 @@ namespace cbm::algo::trd2d // PROCESS DATA MESSAGES // clear buffer when switching to other FASP if (ctx.fMess.fasp != lFaspOld) { - if (vMess.size()) pushDigis(vMess, time, ctx); + if (vMess.size()) pushDigis(vMess, timeClk, ctx); vMess.clear(); lFaspOld = ctx.fMess.fasp; } @@ -432,6 +438,16 @@ namespace cbm::algo::trd2d for (uint16_t ipad(0); ipad < NFASPMOD * NFASPPAD; ipad++) { if (!ctx.fRobDigi[ipad].size()) continue; for (auto id : ctx.fRobDigi[ipad]) { + /** Convert global time from clk temporary representation to the finale version in [ns] + * Correct the time with the system time offset which is derived in calibration.*/ + uint64_t gtime = id.GetTime() * fAsicClockPeriod; + gtime >>= 1; + int toffGlobalCorrection = fParams.fSystemTimeOffset + fParams.toff[ipad]; + if (toffGlobalCorrection > 0 && gtime < uint64_t(toffGlobalCorrection)) + gtime = 0; + else + gtime -= (fParams.fSystemTimeOffset + fParams.toff[ipad]); + id.SetTime(gtime); outputDigis.emplace_back(std::move(id)); } } @@ -462,7 +478,7 @@ namespace cbm::algo::trd2d if (calPar.noise.fSignalThres && imess.data <= calPar.noise.fSignalThres) continue; const uint32_t pad = mch / 2; const bool hasPairingR = bool(chPar.fPadAddress > 0); - const uint64_t lTime = time + calPar.fDaqOffset + imess.tlab; + const uint64_t lTime = time + imess.tlab; const uint16_t sgn = uint16_t((imess.data - fParams.fRefSignal) * calPar.fGainFee - calPar.fBaseline + fParams.fRefSignal); const uint16_t lchR = hasPairingR ? sgn : 0; @@ -482,8 +498,8 @@ namespace cbm::algo::trd2d // No need to extra check double r, t; int32_t dt; - const int32_t dtime = id.GetTimeDAQ() - lTime; - bool use(false); + const int32_t dtime = id.GetTime() - lTime; + bool use(false), noise(false); if (abs(dtime) < 5) { // test message part of (last) digi r = id.GetCharge(t, dt); if (lchR && r < 0.1) { // set R charge on an empty slot @@ -492,13 +508,25 @@ namespace cbm::algo::trd2d } else if (lchT && t < 0.1) { // set T charge on an empty slot id.SetCharge(lchT, r, +dtime); - id.SetTimeDAQ(uint64_t(id.GetTimeDAQ() - dtime)); + id.SetTime(lTime); use = true; } } + // check if signal can be flagged as dynamic noise + if (!use && calPar.noise.tWindow > 0) { + if (lchR) { + if (lchR < calPar.noise.lThreshold && std::abs(-dtime * 12.5 - calPar.noise.tDelay) < calPar.noise.tWindow) + noise = true; + } + else { + if (lchT < calPar.noise.lThreshold && std::abs(-dtime * 12.5 - calPar.noise.tDelay) < calPar.noise.tWindow) + noise = true; + } + } + // build digi for message when update failed - if (!use) { + if (!use && !noise) { digiBuffer.emplace_back(pad, lchT, lchR, lTime); digiBuffer.back().SetAddressModule(fParams.fModId); } diff --git a/algo/detectors/trd2d/UnpackMS.h b/algo/detectors/trd2d/UnpackMS.h index 8bf64c43c166b543774f1c821029b01db7511a42..9696671b6ad792e4da97a19987d68770354d65c9 100644 --- a/algo/detectors/trd2d/UnpackMS.h +++ b/algo/detectors/trd2d/UnpackMS.h @@ -44,6 +44,9 @@ namespace cbm::algo::trd2d kNone }; + /** @brief Clock period of FASP 12.5ns. Use 25ns follow by division by 2*/ + static constexpr uint fAsicClockPeriod = 25; + /** @brief Data structure for unpacking the FASP word */ // Constants /** @brief Bytes per FASP frame stored in the microslices (32 bits words) @@ -116,7 +119,7 @@ namespace cbm::algo::trd2d struct UnpackChannelPar { int32_t fPadAddress; ///< Pad address for channel bool fMask; ///< Flag for channel masking - uint8_t fDaqOffset = 0; ///< Time calibration parameter + int8_t fDaqOffset = 0; ///< Time calibration parameter uint16_t fSignalThres = 0; ///< Signal threshold to remove ringing channels }; @@ -135,8 +138,8 @@ namespace cbm::algo::trd2d ** @brief TRD2D noise parameters for one Asic channel **/ struct NoiseChannelPar { - uint8_t tDelay = 0; /// time [clk] delay wrt to causing primary signal - uint8_t tWindow = 0; /// time [clk] window to search for noisy signal + uint16_t tDelay = 0; /// time [clk] delay wrt to causing primary signal + uint16_t tWindow = 0; /// time [clk] window to search for noisy signal uint16_t lThreshold = 0; ///< Signal threshold for induced - dynamic noise uint16_t fSignalThres = 0; ///< Signal threshold for independent - static noise }; @@ -148,7 +151,7 @@ namespace cbm::algo::trd2d **/ struct CalibChannelPar { bool fMask = false; ///< Flag for channel masking - uint8_t fDaqOffset = 0; ///< Time calibration parameter + int8_t fDaqOffset = 0; ///< Time calibration parameter float fBaseline = 0.; ///< baseline correction float fGainFee = -1.; ///< gain correction wrt to reference NoiseChannelPar noise = {}; ///< noise channel parametrisation @@ -168,6 +171,7 @@ namespace cbm::algo::trd2d std::map<uint8_t, UnpackAsicPar> fAsicParams = {}; ///< Parameters for each ASIC std::array<CalibChannelPar, NFASPMOD* NFASPCH> fCalibParams = {}; ///< Parameters for each ASIC channel for each module + int toff[NFASPMOD * NFASPPAD]; /** \brief Write to the debug stream the content of the current param object*/ void dump() const; @@ -308,9 +312,6 @@ namespace cbm::algo::trd2d bool pushDigis(std::vector<FaspMessage> messages, const uint64_t time, MsContext& ctx) const; UnpackPar fParams = {}; ///< Parameter container - - /** @brief Clock frequency of FASP in 0.08 GHz. HW also supports 0.04 GHz*/ - static constexpr float fAsicClockFreq = 0.08; }; } // namespace cbm::algo::trd2d diff --git a/core/data/trd/CbmTrdDigi.cxx b/core/data/trd/CbmTrdDigi.cxx index 88f5b183d591d1889f75af62f00f5c0b096f3793..67196924971083fe371b38931d4eaffe6fb68c34 100644 --- a/core/data/trd/CbmTrdDigi.cxx +++ b/core/data/trd/CbmTrdDigi.cxx @@ -251,22 +251,6 @@ void CbmTrdDigi::SetFlag(const int32_t iflag, bool set) CLRBIT(fInfo, fgkFlgOffset + iflag); } -//_________________________________________________________________________________ -void CbmTrdDigi::SetTime(double t) -{ - switch (GetType()) { - case eCbmTrdAsicType::kFASP: { - fTime = uint64_t(ceil(t / Clk(GetType()))); - break; - } - case eCbmTrdAsicType::kSPADIC: { - fTime = static_cast<uint64_t>(t); - break; - } - case eCbmTrdAsicType::kNTypes: return; - } -} - //_________________________________________________________________________________ void CbmTrdDigi::SetTimeOffset(int8_t t) { diff --git a/core/data/trd/CbmTrdDigi.h b/core/data/trd/CbmTrdDigi.h index 664e0cfcb3c9588d01c89a3374a1f68a3bbd19dd..0e50f16088d836843d677d44c36412dbd3e850de 100644 --- a/core/data/trd/CbmTrdDigi.h +++ b/core/data/trd/CbmTrdDigi.h @@ -54,6 +54,7 @@ public: * \param[in] chargeT Charge for tilt pad parring. * \param[in] chargeR Charge for rectangle pad parring. * \param[in] time Absolute time [ASIC clocks]. + * \sa CbmTrdModuleSim2D::AddDigi(), cbm::algo::trd2d::UnpackMS::pushDigis(), [legacy] CbmTrdUnpackFaspAlgo::pushDigis() */ CbmTrdDigi(int32_t padChNr, float chargeT, float chargeR, uint64_t time); /** @@ -137,7 +138,6 @@ public: **/ static ECbmModuleId GetSystem() { return ECbmModuleId::kTrd; } - /** @brief Class name (static) ** @return CbmTrdDigi **/ @@ -149,16 +149,13 @@ public: static const char* GetBranchName() { return "TrdDigi"; } - /** \brief Getter for physical time [ns]. Accounts for clock representation of each ASIC. In SPADIC case physical time is already stored in fTime. */ - double GetTime() const - { - return (GetType() == eCbmTrdAsicType::kFASP) ? fTime * fgClk[static_cast<size_t>(GetType())] : fTime; - } - /** \brief Getter for global DAQ time [clk]. Differs for each ASIC. In FASP case DAQ time is already stored in fTime.*/ - uint64_t GetTimeDAQ() const - { - return (GetType() == eCbmTrdAsicType::kFASP) ? fTime : fTime / fgClk[static_cast<size_t>(GetType())]; - } + /** \brief Getter for physical time [ns]. Accounts for clock representation of each ASIC. In SPADIC case physical time is already stored in fTime. + * Applies also to FASP starting with mCBM2025/02 (\sa FinalizeTime()) + */ + double GetTime() const { return fTime; } + /** \brief Getter for global DAQ time [clk]. Differs for each ASIC. [In FASP case DAQ time is already stored in fTime. - to be removed] + */ + uint64_t GetTimeDAQ() const { return fTime / fgClk[static_cast<size_t>(GetType())]; } /** \brief Channel trigger type. SPADIC specific see CbmTrdTriggerType*/ int32_t GetTriggerType() const { return (fInfo >> fgkTrgOffset) & 0x3; } @@ -217,10 +214,17 @@ public: { if (GetType() == eCbmTrdAsicType::kFASP) SetFlag(kFlag2, set); } - /** \brief Set global digi time (ns)*/ - void SetTime(double t); - /** \brief Set global digi time (clk)*/ - void SetTimeDAQ(uint64_t t) { fTime = t; } + /** \brief Set global digi time (ns) + * !! Use this function if you know what you are doing ! + * \sa CbmTrdFasp::WriteDigi(), + * \sa cbm::algo::trd2d::UnpackMS::operator(), + * \sa cbm::algo::trd2d::UnpackMS::pushDigis(), + * \sa cbm::algo::trd2d::UnpackMS::FinalizeComponent() + * \sa CbmTrdUnpackFaspAlgo::unpack(), + * \sa CbmTrdUnpackFaspAlgo::pushDigis(), + * \sa CbmTrdUnpackFaspAlgo::FinalizeComponent() + */ + void SetTime(double t) { fTime = static_cast<uint64_t>(t); } /** \brief Set time offset of rectangular to tilt pads for FASP (clk)*/ void SetTimeOffset(int8_t t); /** \brief Set digi trigger type */ @@ -267,7 +271,7 @@ protected: uint32_t fInfo = 0; //< pad address and extra information uint32_t fCharge = 0; //< measured charge. For SPADIC is int32_t(charge*1eN) where N is the precission while //< for FASP it contains the R and T charges each on 12bits and the time difference between R and T pads in CLK (8 bits). - uint64_t fTime = 0; //< global time of the digi: For SPADIC in ns, for FASP in ASIC clock + uint64_t fTime = 0; //< global time of the digi: For SPADIC & FASP in ns /** * @brief clock length in ns for acquisition diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.cxx b/reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.cxx index 17ab8334de8ed1dafdc927efa274f74a7eab1c90..9885486b6cb55126bd53a1ad8f4e8a201101dea6 100644 --- a/reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.cxx +++ b/reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.cxx @@ -171,7 +171,7 @@ bool CbmTrdUnpackFaspAlgo::pushDigis(std::vector<CbmTrdUnpackFaspAlgo::CbmTrdFas // No need to extra check Double_t r, t; Int_t dt; - const Int_t dtime = (*id).GetTimeDAQ() - lTime; + const Int_t dtime = (*id).GetTime() - lTime; bool use(false); if (TMath::Abs(dtime) < 5) { // test message part of (last) digi @@ -182,7 +182,7 @@ bool CbmTrdUnpackFaspAlgo::pushDigis(std::vector<CbmTrdUnpackFaspAlgo::CbmTrdFas } else if (lchT && t < 0.1) { // set T charge on an empty slot (*id).SetCharge(lchT, r, +dtime); - (*id).SetTimeDAQ(ULong64_t((*id).GetTimeDAQ() - dtime)); + (*id).SetTime(lTime); use = true; } } @@ -259,6 +259,11 @@ void CbmTrdUnpackFaspAlgo::FinalizeComponent() // reset flags as they were used only to mark the correctly setting of the charge/digi (*id).SetFlag(0, false); (*id).SetFlag(1, false); + /** Convert global time from clk temporary representation to the finale version in [ns] + * Correct the time with the system time offset which is derived in calibration.*/ + uint64_t gtime = (*id).GetTime() * 12.5; // fAsicClockPeriod; + if (gtime >= uint64_t(fSystemTimeOffset)) gtime -= fSystemTimeOffset; + (*id).SetTime(gtime); fOutputVec.emplace_back(std::move((*id))); } // clear digi buffer wrt the digi which was forwarded to higher structures @@ -300,7 +305,8 @@ bool CbmTrdUnpackFaspAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp } } // define time wrt start of time slice in TRD/FASP clks [80 MHz] - fTime = ULong64_t((msdesc.idx - fTsStartTime - fSystemTimeOffset) / 12.5); + fTime = uint64_t((msdesc.idx - fTsStartTime) / 25); + fTime <<= 1; // get MOD_id and ROB id from the equipment, using the comp map: eq_id -> (mod_id, rob_id) fMess->mod = fAsicSet.FindModuleByEqId(msdesc.eq_id, fMess->rob, fMess->elink); diff --git a/reco/tasks/CbmTaskTrdUnpackParWrite.cxx b/reco/tasks/CbmTaskTrdUnpackParWrite.cxx index 078d7f32bf656d541598ed3cee0db5da577cfb6b..6679dc59958d92b6a44e010ad992276a813e980f 100644 --- a/reco/tasks/CbmTaskTrdUnpackParWrite.cxx +++ b/reco/tasks/CbmTaskTrdUnpackParWrite.cxx @@ -39,7 +39,7 @@ InitStatus CbmTaskTrdUnpackParWrite::Init() // Map (moduleId) -> (array of crobId) std::map<uint32_t, std::vector<uint16_t>> crobMap; // Map (equipId, asicId, chanId) -> (pad address, mask flag, daq offset [FASP clk]) - std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint8_t, uint16_t>>>> channelMap; + std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, int16_t, uint16_t>>>> channelMap; // Loop through a list of module IDs from the .digi file (can in principle contradict crob_map). for (auto entry : digiparset.GetModuleMap()) { diff --git a/sim/detectors/trd/CbmTrdModuleSim2D.cxx b/sim/detectors/trd/CbmTrdModuleSim2D.cxx index eb96e40625d5ccb7c1eb02e3db93d7a1eaf275a6..1152308b08c4001b132b4f0cfe07c8785b5bcaa9 100644 --- a/sim/detectors/trd/CbmTrdModuleSim2D.cxx +++ b/sim/detectors/trd/CbmTrdModuleSim2D.cxx @@ -561,8 +561,7 @@ void CbmTrdModuleSim2D::AddDigi(Int_t pad, Double_t* charge, Double_t time /*, D // make digi CbmTrdDigi *digi(NULL), *sdigi(NULL); CbmMatch* digiMatch(NULL); - digi = new CbmTrdDigi(pad, charge[0], charge[1], - ULong64_t(TMath::Ceil(time / CbmTrdDigi::Clk(CbmTrdDigi::eCbmTrdAsicType::kFASP)))); + digi = new CbmTrdDigi(pad, charge[0], charge[1], uint64_t(time)); digi->SetAddressModule(fModAddress); // may not be needed in the future digiMatch = new CbmMatch(); Double_t weighting = fChmbPar->EfCkeV(charge[0] * 0.1); // save th. energy which is seen by pads;