diff --git a/core/base/CbmDaq.cxx b/core/base/CbmDaq.cxx index be7cd8f21d90244df9c840da00f5a52e8892b48f..9b02abaa8435e66390ddb81a496fde2185b3ae78 100644 --- a/core/base/CbmDaq.cxx +++ b/core/base/CbmDaq.cxx @@ -47,7 +47,6 @@ CbmDaq::CbmDaq(Bool_t eventMode) : FairTask("Daq") , fIsEventByEvent(eventMode) , fTimeSliceLength(-1.) - , fLatency(5000.) , fStoreEmptySlices(kFALSE) , fTimeEventPrevious(-1.) , fNofEvents(0) @@ -76,7 +75,6 @@ CbmDaq::CbmDaq(Double_t tsLength) : FairTask("Daq") , fIsEventByEvent(kFALSE) , fTimeSliceLength(tsLength) - , fLatency(2000.) , fStoreEmptySlices(kFALSE) , fTimeEventPrevious(-1.) , fNofEvents(0) diff --git a/core/base/CbmDaq.h b/core/base/CbmDaq.h index 4e5dec84b189e8338e00ad0e0680baef6d8bddee..7fb9248232f08f2344828e7e209187a24967647d 100644 --- a/core/base/CbmDaq.h +++ b/core/base/CbmDaq.h @@ -86,10 +86,13 @@ public: ** at least be the maximum dead time of all detectors plus ** some safety margin accounting for the time resolution of the ** detectors. + ** The latency is only changed if the latency passed as argument + ** is larger than the current value to avoid that a call from + ** a second digitizer lowers the latency set by a first digitizer. ** 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) { fLatency = time; } + void SetLatency(Double_t time) { if (time > fLatency) fLatency = time; } /** @brief Set the digitizer for a given system @@ -116,7 +119,7 @@ public: private: Bool_t fIsEventByEvent; ///< Flag for event-by-event mode Double_t fTimeSliceLength; ///< Time-slice length [ns] - Double_t fLatency; ///< Maximal time disorder of input data [ns] + Double_t fLatency = 5000.; ///< Maximal time disorder of input data [ns] Bool_t fStoreEmptySlices; ///< Flag to store also empty time slices Double_t fTimeEventPrevious; ///< Time of previous event [ns] diff --git a/core/base/CbmDigitize.h b/core/base/CbmDigitize.h index 286180bd277626a3caf78a712ce21455930a5143..4a4db9f9f41f2a7ed15186eecf0c513a82226b2a 100644 --- a/core/base/CbmDigitize.h +++ b/core/base/CbmDigitize.h @@ -82,6 +82,14 @@ public: } // -------------------------------------------------------------------------- + /** @brief Return the detector specific latency + ** @value latency + ** + ** If there is no detector sopecific implementation the return + ** value is 0. which does not change the default value set in + ** CbmDaq. + **/ + Double_t GetLatency() const { return 0.;} // -------------------------------------------------------------------------- /** @brief Clear the output arrays **/ diff --git a/core/base/CbmDigitizeBase.h b/core/base/CbmDigitizeBase.h index b0321af639993a75c724777a8081f7672f7efaf7..172dd6e5a2ac054b7ebcc22181ff041a6f1da76c 100644 --- a/core/base/CbmDigitizeBase.h +++ b/core/base/CbmDigitizeBase.h @@ -136,6 +136,11 @@ public: **/ virtual ECbmModuleId GetSystemId() const = 0; + /** @brief Detector system ID + ** @return Detector specific latency + **/ + virtual Double_t GetLatency() const = 0; + /** @brief Time of last datum in DAQ buffer ** @value Time of last datum in DAQ buffer diff --git a/sim/response/base/CbmDigitization.cxx b/sim/response/base/CbmDigitization.cxx index ab6e14216e729d2885cd2eab42c06c8c3b74f23c..7c54d1fcf55a60f3814153ed7bba532c99cddc54 100644 --- a/sim/response/base/CbmDigitization.cxx +++ b/sim/response/base/CbmDigitization.cxx @@ -390,6 +390,7 @@ void CbmDigitization::Run(Int_t event1, Int_t event2) digitizer->SetProduceNoise(fProduceNoise); digitizer->SetCreateMatches(fCreateMatches); digitizer->SetRunStartTime(fSource->GetStartTime()); + fDaq->SetLatency(digitizer->GetLatency()); run->AddTask(digitizer); LOG(info) << fName << ": Added task " << digitizer->GetName(); } //? active and digitizer instance present