Skip to content

Commit 79ebfbb

Browse files
committed
Increase TRD dead time from 0.2 to 11 us
And make the TRD trigger settings configurable for simulations
1 parent 4b2ed76 commit 79ebfbb

5 files changed

Lines changed: 18 additions & 15 deletions

File tree

DataFormats/Detectors/TRD/include/DataFormatsTRD/Constants.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ constexpr int NBINSANGLEDIFF = 25; ///< the number of bins for the track an
7070
constexpr double VDRIFTDEFAULT = 1.546; ///< default value for vDrift
7171
constexpr double EXBDEFAULT = 0.0; ///< default value for LorentzAngle
7272

73-
// Trigger parameters
74-
constexpr double READOUT_TIME = 3000; ///< the time the readout takes, as 30 TB = 3 micro-s.
75-
constexpr double DEAD_TIME = 200; ///< trigger deadtime, 2 micro-s
76-
constexpr double BUSY_TIME = READOUT_TIME + DEAD_TIME; ///< the time for which no new trigger can be received in nanoseconds
77-
7873
// array size to store incoming half cru payload.
7974
constexpr int HBFBUFFERMAX = 1048576; ///< max buffer size for data read from a half cru, (all events)
8075
constexpr unsigned int CRUPADDING32 = 0xeeeeeeee; ///< padding word used in the cru.

Detectors/TRD/simulation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ A B
8080
```
8181
In this example, we consider a trigger at `t=A`. The second signal contributes with `(B-C)*samplingRate` bins from its head onto the tail of the first signal. A third signal arrives at `t=E`, with `E>A+BUSY_TIME`, which can trigger the detector and be readout. The third signal will have `(D-E)*samplingRate` from the tail of the second signal onto its head. So, the requirement for a signal to be too old, and be dropped, is:
8282
- new trigger arrives, and
83-
- the time difference between the first time bin of the previous signal and the new trigger is greater than `READOUT_TIME`.
83+
- the time difference between the first time bin of the previous signal and the new trigger is greater than `TRDSimParams.readoutTimeNS`.

Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@ namespace trd
2828
See https://github.com/AliceO2Group/AliceO2/blob/dev/Common/SimConfig/doc/ConfigurableParam.md
2929
*/
3030
struct TRDSimParams : public o2::conf::ConfigurableParamHelper<TRDSimParams> {
31-
int digithreads = 4; // number of digitizer threads
32-
float maxMCStepSize = 0.1; // maximum size of MC steps
33-
bool doTR = true; // switch for transition radiation
34-
SimParam::GasMixture gas = SimParam::GasMixture::Xenon; // the gas mixture in the TRD
31+
// Trigger parameters
32+
float readoutTimeNS = 3000; ///< the time the readout takes in ns (default 30 time bins = 3 us)
33+
float deadTimeNS = 11000; ///< trigger deadtime in ns (default 11 us)
34+
float busyTimeNS = readoutTimeNS + deadTimeNS; ///< the time for which no new trigger can be received in nanoseconds
35+
// digitization settings
36+
int digithreads = 4; ///< number of digitizer threads
37+
float maxMCStepSize = 0.1; ///< maximum size of MC steps
38+
bool doTR = true; ///< switch for transition radiation
39+
SimParam::GasMixture gas = SimParam::GasMixture::Xenon; ///< the gas mixture in the TRD
3540
O2ParamDef(TRDSimParams, "TRDSimParams");
3641
};
3742

Detectors/TRD/simulation/src/PileupTool.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
#include "TRDSimulation/PileupTool.h"
13+
#include "TRDSimulation/TRDSimParams.h"
1314

1415
using namespace o2::trd;
1516
using namespace o2::trd::constants;
@@ -28,7 +29,7 @@ SignalContainer PileupTool::addSignals(std::deque<std::array<SignalContainer, co
2829
// check if the signal is from a previous event
2930
if (signalArray.firstTBtime < triggerTime) {
3031
pileupSignalBecomesObsolete = true;
31-
if ((triggerTime - signalArray.firstTBtime) > constants::READOUT_TIME) { // OS: READOUT_TIME should actually be drift time (we want to ignore signals which don't contribute signal anymore at triggerTime)
32+
if ((triggerTime - signalArray.firstTBtime) > TRDSimParams::Instance().readoutTimeNS) { // OS: READOUT_TIME should actually be drift time (we want to ignore signals which don't contribute signal anymore at triggerTime)
3233
continue; // ignore the signal if it is too old.
3334
}
3435
// add only what's leftover from this signal

Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "TRDBase/Calibrations.h"
3232
#include "TRDSimulation/Digitizer.h"
3333
#include "TRDSimulation/Detector.h" // for the Hit type
34+
#include "TRDSimulation/TRDSimParams.h"
3435
#include <chrono>
3536

3637
using namespace o2::framework;
@@ -106,9 +107,9 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer
106107
firstEvent = false;
107108
} else {
108109
double dT = currentTime.getTimeNS() - triggerTime.getTimeNS();
109-
if (dT < constants::BUSY_TIME) {
110-
// BUSY_TIME = READOUT_TIME + DEAD_TIME, if less than that, pile up the signals and update the last time
111-
LOGF(debug, "Collision %lu Not creating new trigger at time %.2f since dT=%.2f ns < busy time of %.1f us", collID, currentTime.getTimeNS(), dT, constants::BUSY_TIME / 1000);
110+
if (dT < mParams.busyTimeNS) {
111+
// busyTimeNS = readoutTimeNS + deadTimeNS, if less than that, pile up the signals and update the last time
112+
LOGF(debug, "Collision %lu Not creating new trigger at time %.2f since dT=%.2f ns < busy time of %.1f us", collID, currentTime.getTimeNS(), dT, mParams.busyTimeNS / 1000);
112113
isNewTrigger = false;
113114
mDigitizer.pileup();
114115
} else {
@@ -131,7 +132,7 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer
131132
triggerTime = currentTime;
132133
digits.clear();
133134
labels.clear();
134-
if (triggerTime.getTimeNS() - previousTime.getTimeNS() > constants::BUSY_TIME) {
135+
if (triggerTime.getTimeNS() - previousTime.getTimeNS() > mParams.busyTimeNS) {
135136
// we safely clear all pileup signals, because any previous collision cannot contribute signal anymore
136137
mDigitizer.clearPileupSignals();
137138
}
@@ -195,6 +196,7 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer
195196
private:
196197
Digitizer mDigitizer;
197198
std::vector<TChain*> mSimChains;
199+
const TRDSimParams& mParams{TRDSimParams::Instance()};
198200
// RS: at the moment using hardcoded flag for continuos readout
199201
o2::parameters::GRPObject::ROMode mROMode = o2::parameters::GRPObject::PRESENT; // readout mode
200202
}; // namespace trd

0 commit comments

Comments
 (0)