From 227e816c21653ff8fb61e90b2511988bb028e622 Mon Sep 17 00:00:00 2001 From: Florian Uhlig <f.uhlig@gsi.de> Date: Wed, 6 Dec 2023 08:55:02 +0100 Subject: [PATCH] Allow flexible setting of the mvd digitizer latency The latency defines the time how much can happen between digi creation and readout. Only after this time the daq buffer can be written to the output timeslice without timly disordered digis. Increase the default time and allow to set the time from the macro. Add info output to the CbmDaq when the latency is changed. --- core/base/CbmDaq.cxx | 10 ++++++++++ core/base/CbmDaq.h | 6 +----- sim/detectors/mvd/CbmMvdDigitizer.h | 6 +++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/core/base/CbmDaq.cxx b/core/base/CbmDaq.cxx index e9efc440bc..7369824bdd 100644 --- a/core/base/CbmDaq.cxx +++ b/core/base/CbmDaq.cxx @@ -508,5 +508,15 @@ void CbmDaq::StartNextTimeSlice() } // =========================================================================== +// ===== Set the maximum allowed time for disordered digis================== +void CbmDaq::SetLatency(Double_t time) +{ + if (time > fLatency) { + LOG(info) << "The latency was set from " << fLatency + << "ns to " << time << "ns"; + fLatency = time; + } +} +// =========================================================================== ClassImp(CbmDaq) diff --git a/core/base/CbmDaq.h b/core/base/CbmDaq.h index 52c62c1c49..a8b2813108 100644 --- a/core/base/CbmDaq.h +++ b/core/base/CbmDaq.h @@ -92,11 +92,7 @@ class CbmDaq : public FairTask { ** The current default of 2,000 ns corresponds to the STS with ** dead time of 800 ns and time resolution of 5 ns. **/ - void SetLatency(Double_t time) - { - if (time > fLatency) fLatency = time; - } - + void SetLatency(Double_t time); /** @brief Set the digitizer for a given system ** @param system System Id (ECbmModuleId) diff --git a/sim/detectors/mvd/CbmMvdDigitizer.h b/sim/detectors/mvd/CbmMvdDigitizer.h index d393047a41..8988488125 100644 --- a/sim/detectors/mvd/CbmMvdDigitizer.h +++ b/sim/detectors/mvd/CbmMvdDigitizer.h @@ -62,7 +62,9 @@ public: /** @brief Detector specific latency ** @return latency **/ - Double_t GetLatency() const { return 110000.; } + Double_t GetLatency() const { return fLatency; } + + void SetLatency(Float_t latency) { fLatency = latency;} void SetPileUp(Int_t pileUp) { fNPileup = pileUp; } void SetDeltaEvents(Int_t deltaEvents) { fNDeltaElect = deltaEvents; } @@ -164,6 +166,8 @@ private: TStopwatch fTimer; ///< ROOT timer + Float_t fLatency{150000.}; // maximum time of digi disordering + /** Pileup manager **/ CbmMvdPileupManager* fPileupManager; CbmMvdPileupManager* fDeltaManager; -- GitLab