Skip to content

Commit a5db2d6

Browse files
Andreas Mathissawenzel
authored andcommitted
Introduce hard time cutoff for triggered mode (#1417)
1 parent 2142597 commit a5db2d6

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Detectors/TPC/simulation/include/TPCSimulation/DigitContainer.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#include "TPCBase/CRU.h"
2020
#include "DataFormatsTPC/Defs.h"
2121
#include "TPCSimulation/DigitTime.h"
22+
#include "TPCBase/ParameterDetector.h"
23+
#include "TPCBase/ParameterElectronics.h"
24+
#include "TPCBase/ParameterGas.h"
2225

2326
namespace o2
2427
{
@@ -76,10 +79,17 @@ class DigitContainer
7679
Sector mSector; ///< ID of the currently processed sector
7780
TimeBin mFirstTimeBin; ///< First time bin to consider
7881
TimeBin mEffectiveTimeBin; ///< Effective time bin of that digit
82+
TimeBin mTmaxTriggered; ///< Maximum time bin in case of triggered mode (TPClength / width of time bin)
7983
std::deque<DigitTime> mTimeBins; ///< Time bin Container for the ADC value
8084
};
8185

82-
inline DigitContainer::DigitContainer() : mSector(-1), mFirstTimeBin(0), mEffectiveTimeBin(0), mTimeBins(500) {}
86+
inline DigitContainer::DigitContainer() : mSector(-1), mFirstTimeBin(0), mEffectiveTimeBin(0), mTmaxTriggered(0), mTimeBins(500)
87+
{
88+
const static ParameterDetector& detParam = ParameterDetector::defaultInstance();
89+
const static ParameterElectronics& eleParam = ParameterElectronics::defaultInstance();
90+
const static ParameterGas& gasParam = ParameterGas::defaultInstance();
91+
mTmaxTriggered = detParam.getTPClength() / (eleParam.getZBinWidth() * gasParam.getVdrift());
92+
}
8393

8494
inline void DigitContainer::setup(const Sector& sector)
8595
{

Detectors/TPC/simulation/src/DigitContainer.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ void DigitContainer::fillOutputContainer(std::vector<Digit>* output,
4646
TimeBin timeBin = mFirstTimeBin;
4747
for (auto& time : mTimeBins) {
4848
/// the time bins between the last event and the timing of this event are uncorrelated and can be written out
49-
/// OR the readout is triggered (i.e. not continuous) and we can dump everything in any case
49+
/// 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
5050
if ((nProcessedTimeBins + mFirstTimeBin < eventTime) || !isContinuous) {
51+
if (!isContinuous && timeBin > mTmaxTriggered)
52+
continue;
5153
++nProcessedTimeBins;
5254
time.fillOutputContainer(output, mcTruth, debug, mSector, timeBin);
5355
} else {

0 commit comments

Comments
 (0)