From c7872cb4035bff6179881a0d57fa2f45ad81cc8d Mon Sep 17 00:00:00 2001 From: Andreas Mathis Date: Sat, 10 Nov 2018 10:29:22 +0100 Subject: [PATCH] Enable hard cut off for triggered mode (#1417) o at average drift speed with additional margin o cut off value stored as a parameter in ParameterDetector --- Detectors/TPC/base/include/TPCBase/ParameterDetector.h | 10 ++++++++++ Detectors/TPC/base/src/ParameterDetector.cxx | 2 +- .../simulation/include/TPCSimulation/DigitContainer.h | 6 ++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Detectors/TPC/base/include/TPCBase/ParameterDetector.h b/Detectors/TPC/base/include/TPCBase/ParameterDetector.h index 0f3756c1cfc0e..fdcbc761f5de4 100644 --- a/Detectors/TPC/base/include/TPCBase/ParameterDetector.h +++ b/Detectors/TPC/base/include/TPCBase/ParameterDetector.h @@ -16,6 +16,7 @@ #define ALICEO2_TPC_ParameterDetector_H_ #include +#include "DataFormatsTPC/Defs.h" namespace o2 { @@ -47,6 +48,10 @@ class ParameterDetector /// \param cpad Pad capacitance [pF] void setPadCapacitance(float cpad) { mPadCapacitance = cpad; } + /// Set maximum time bin in case of triggered readout mode + /// \param Maximum time bin in case of triggered readout mode + void setMaxTimeBinTriggered(TimeBin binMax) { mTmaxTriggered = binMax; } + /// Get the TPC length /// \return TPC length [cm] float getTPClength() const { return mTPClength; } @@ -55,9 +60,14 @@ class ParameterDetector /// \return Pad capacitance [pF] float getPadCapacitance() const { return mPadCapacitance; } + /// Get maximum time bin in case of triggered readout mode + /// \return Maximum time bin in case of triggered readout mode + int getMaxTimeBinTriggered() const { return mTmaxTriggered; } + private: float mTPClength; ///< Length of the TPC [cm] float mPadCapacitance; ///< Capacitance of a single pad [pF] + TimeBin mTmaxTriggered; ///< Maximum time bin in case of triggered readout mode }; } } diff --git a/Detectors/TPC/base/src/ParameterDetector.cxx b/Detectors/TPC/base/src/ParameterDetector.cxx index 1f3557a474d43..824cd68e773f1 100644 --- a/Detectors/TPC/base/src/ParameterDetector.cxx +++ b/Detectors/TPC/base/src/ParameterDetector.cxx @@ -16,4 +16,4 @@ using namespace o2::TPC; -ParameterDetector::ParameterDetector() : mTPClength(250.f), mPadCapacitance(0.1f) {} +ParameterDetector::ParameterDetector() : mTPClength(250.f), mPadCapacitance(0.1f), mTmaxTriggered(550) {} diff --git a/Detectors/TPC/simulation/include/TPCSimulation/DigitContainer.h b/Detectors/TPC/simulation/include/TPCSimulation/DigitContainer.h index 36b3f69478e04..410ea74f45053 100644 --- a/Detectors/TPC/simulation/include/TPCSimulation/DigitContainer.h +++ b/Detectors/TPC/simulation/include/TPCSimulation/DigitContainer.h @@ -79,16 +79,14 @@ class DigitContainer Sector mSector; ///< ID of the currently processed sector TimeBin mFirstTimeBin; ///< First time bin to consider TimeBin mEffectiveTimeBin; ///< Effective time bin of that digit - TimeBin mTmaxTriggered; ///< Maximum time bin in case of triggered mode (TPClength / width of time bin) + TimeBin mTmaxTriggered; ///< Maximum time bin in case of triggered mode (hard cut at average drift speed with additional margin) std::deque mTimeBins; ///< Time bin Container for the ADC value }; inline DigitContainer::DigitContainer() : mSector(-1), mFirstTimeBin(0), mEffectiveTimeBin(0), mTmaxTriggered(0), mTimeBins(500) { const static ParameterDetector& detParam = ParameterDetector::defaultInstance(); - const static ParameterElectronics& eleParam = ParameterElectronics::defaultInstance(); - const static ParameterGas& gasParam = ParameterGas::defaultInstance(); - mTmaxTriggered = detParam.getTPClength() / (eleParam.getZBinWidth() * gasParam.getVdrift()); + mTmaxTriggered = detParam.getMaxTimeBinTriggered(); } inline void DigitContainer::setup(const Sector& sector)