Skip to content

Commit

Permalink
Introduce hard time cutoff for triggered mode (AliceO2Group#1417)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mathis committed Nov 3, 2018
1 parent 2142597 commit 018e634
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Detectors/TPC/simulation/include/TPCSimulation/DigitContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#include "TPCBase/CRU.h"
#include "DataFormatsTPC/Defs.h"
#include "TPCSimulation/DigitTime.h"
#include "TPCBase/ParameterDetector.h"
#include "TPCBase/ParameterElectronics.h"
#include "TPCBase/ParameterGas.h"

namespace o2
{
Expand Down Expand Up @@ -76,10 +79,17 @@ 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)
std::deque<DigitTime> mTimeBins; ///< Time bin Container for the ADC value
};

inline DigitContainer::DigitContainer() : mSector(-1), mFirstTimeBin(0), mEffectiveTimeBin(0), mTimeBins(500) {}
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());
}

inline void DigitContainer::setup(const Sector& sector)
{
Expand Down
4 changes: 3 additions & 1 deletion Detectors/TPC/simulation/src/DigitContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ void DigitContainer::fillOutputContainer(std::vector<Digit>* output,
TimeBin timeBin = mFirstTimeBin;
for (auto& time : mTimeBins) {
/// the time bins between the last event and the timing of this event are uncorrelated and can be written out
/// OR the readout is triggered (i.e. not continuous) and we can dump everything in any case
/// OR the readout is triggered (i.e. not continuous) and we can dump everything in any case, as long it is within one drift time interval
if ((nProcessedTimeBins + mFirstTimeBin < eventTime) || !isContinuous) {
if (!isContinuous && timeBin > mTmaxTriggered)
continue;
++nProcessedTimeBins;
time.fillOutputContainer(output, mcTruth, debug, mSector, timeBin);
} else {
Expand Down

0 comments on commit 018e634

Please sign in to comment.