Skip to content

Commit 6667de8

Browse files
committed
ITS: staggered digitization
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 16abc7e commit 6667de8

4 files changed

Lines changed: 64 additions & 21 deletions

File tree

Detectors/ITSMFT/common/base/include/ITSMFTBase/DPLAlpideParam.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,26 @@ constexpr float DEFStrobeDelay = o2::constants::lhc::LHCBunchSpacingNS * 4; // ~
2626

2727
template <int N>
2828
struct DPLAlpideParam : public o2::conf::ConfigurableParamHelper<DPLAlpideParam<N>> {
29+
static constexpr int getNLayers()
30+
{
31+
return N == o2::detectors::DetID::ITS ? 7 : 5;
32+
}
2933

3034
static constexpr std::string_view getParamName()
3135
{
3236
return N == o2::detectors::DetID::ITS ? ParamName[0] : ParamName[1];
3337
}
34-
int roFrameLengthInBC = DEFROFLengthBC(); ///< ROF length in BC for continuos mode
35-
float roFrameLengthTrig = DEFROFLengthTrig(); ///< length of RO frame in ns for triggered mode
36-
float strobeDelay = DEFStrobeDelay; ///< strobe start (in ns) wrt ROF start
37-
float strobeLengthCont = -1.; ///< if < 0, full ROF length - delay
38-
float strobeLengthTrig = 100.; ///< length of the strobe in ns (sig. over threshold checked in this window only)
39-
int roFrameBiasInBC = DEFROFBiasInBC(); ///< bias of the start of ROF wrt orbit start: t_irof = (irof*roFrameLengthInBC + roFrameBiasInBC)*BClengthMUS
38+
39+
public:
40+
int roFrameLengthInBC = DEFROFLengthBC(); ///< ROF length in BC for continuos mode
41+
float roFrameLengthTrig = DEFROFLengthTrig(); ///< length of RO frame in ns for triggered mode
42+
float strobeDelay = DEFStrobeDelay; ///< strobe start (in ns) wrt ROF start
43+
float strobeLengthCont = -1.; ///< if < 0, full ROF length - delay
44+
float strobeLengthTrig = 100.; ///< length of the strobe in ns (sig. over threshold checked in this window only)
45+
int roFrameBiasInBC = DEFROFBiasInBC(); ///< bias of the start of ROF wrt orbit start: t_irof = (irof*roFrameLengthInBC + roFrameBiasInBC)*BClengthMUS
46+
int roFrameLayerRef = -1; ///< staggering reference layer, if >=0 turn staggering mode on
47+
int roFrameLayerOffsetInBC[getNLayers()] = {0}; ///< staggering offsets in BC to reference layer
48+
int roFrameLayerLengthInBC[getNLayers()] = {DEFROFLengthBC()}; ///< staggering ROF length in BC for continous mode per layer
4049

4150
// boilerplate stuff + make principal key
4251
O2ParamDef(DPLAlpideParam, getParamName().data());

Detectors/ITSMFT/common/simulation/include/ITSMFTSimulation/DigiParams.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
#ifndef ALICEO2_ITSMFT_DIGIPARAMS_H
1616
#define ALICEO2_ITSMFT_DIGIPARAMS_H
1717

18+
#include <vector>
19+
#include <algorithm>
1820
#include <Rtypes.h>
19-
#include <ITSMFTSimulation/AlpideSignalTrapezoid.h>
21+
#include "ITSMFTSimulation/AlpideSignalTrapezoid.h"
2022
#include "ITSMFTBase/DPLAlpideParam.h"
2123

2224
////////////////////////////////////////////////////////////
@@ -96,6 +98,18 @@ class DigiParams
9698
const SignalShape& getSignalShape() const { return mSignalShape; }
9799
SignalShape& getSignalShape() { return (SignalShape&)mSignalShape; }
98100

101+
void setStagROFrameLayerRef(int i) { mROFrameLayerRef = i; }
102+
void setStagROFrameLayerOffsetInBC(const int* a, size_t n) { mROFrameLayerOffsetInBC.insert(mROFrameLayerOffsetInBC.end(), &a[0], &a[n]); }
103+
void setStagROFrameLayerLengthInBC(const int* a, size_t n) { mROFrameLayerLengthInBC.insert(mROFrameLayerLengthInBC.end(), &a[0], &a[n]); }
104+
void setStagROFrameLayerLength(const int* a, size_t n, float fac)
105+
{
106+
std::transform(a, a + n, std::back_inserter(mROFrameLayerLength), [fac](int val) { return val * fac; });
107+
}
108+
void setStagStrobeLength(float delay)
109+
{
110+
std::transform(mROFrameLayerLength.begin(), mROFrameLayerLength.end(), std::back_inserter(mStrobeLayerLength), [delay](float val) { return val - delay; });
111+
}
112+
99113
virtual void print() const;
100114

101115
private:
@@ -117,6 +131,12 @@ class DigiParams
117131
float mIBVbb = 0.0; ///< back bias absolute value for ITS Inner Barrel (in Volt)
118132
float mOBVbb = 0.0; ///< back bias absolute value for ITS Outter Barrel (in Volt)
119133

134+
int mROFrameLayerRef = -1; ///< staggering reference layer, if >=0 turn staggering mode on
135+
std::vector<int> mROFrameLayerOffsetInBC; ///< staggering offsets in BC to reference layer
136+
std::vector<int> mROFrameLayerLengthInBC; ///< staggering ROF length in BC for continous mode per layer
137+
std::vector<int> mROFrameLayerLength; ///< staggering ROF length in ns for continous mode per layer
138+
std::vector<float> mStrobeLayerLength; ///< staggering length of the strobe in ns (sig. over threshold checked in this window only)
139+
120140
o2::itsmft::AlpideSignalTrapezoid mSignalShape; ///< signal timeshape parameterization
121141

122142
const o2::itsmft::AlpideSimResponse* mAlpSimResponse = nullptr; //!< pointer on external response
@@ -125,7 +145,7 @@ class DigiParams
125145
float mROFrameLengthInv = 0; ///< inverse length of RO frame in ns
126146
float mNSimStepsInv = 0; ///< its inverse
127147

128-
ClassDef(DigiParams, 2);
148+
ClassDef(DigiParams, 3);
129149
};
130150
} // namespace itsmft
131151
} // namespace o2

Detectors/ITSMFT/common/simulation/src/DigiParams.cxx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,23 @@ void DigiParams::setChargeThreshold(int v, float frac2Account)
5858
//______________________________________________
5959
void DigiParams::print() const
6060
{
61-
// print settings
62-
printf("Alpide digitization params:\n");
63-
printf("Continuous readout : %s\n", mIsContinuous ? "ON" : "OFF");
64-
printf("Readout Frame Length(ns) : %f\n", mROFrameLength);
65-
printf("Strobe delay (ns) : %f\n", mStrobeDelay);
66-
printf("Strobe length (ns) : %f\n", mStrobeLength);
67-
printf("Threshold (N electrons) : %d\n", mChargeThreshold);
68-
printf("Min N electrons to account : %d\n", mMinChargeToAccount);
69-
printf("Number of charge sharing steps : %d\n", mNSimSteps);
70-
printf("ELoss to N electrons factor : %e\n", mEnergyToNElectrons);
71-
printf("Noise level per pixel : %e\n", mNoisePerPixel);
72-
printf("Charge time-response:\n");
61+
LOGF(info, "Alpide digitization params:");
62+
LOGF(info, "Continuous readout : %s", mIsContinuous ? "ON" : "OFF");
63+
if (mROFrameLayerRef >= 0) {
64+
LOGF(info, "Staggering mode with reference layer : %d", mROFrameLayerRef);
65+
for (int i{0}; i < (int)mROFrameLayerLengthInBC.size(); ++i) {
66+
LOGF(info, " Layer:%d Length(ns)[Offset(BC)] : %f [%d]", i, mROFrameLayerLength[i], mROFrameLayerOffsetInBC[i]);
67+
}
68+
} else {
69+
LOGF(info, "Readout Frame Length(ns) : %f", mROFrameLength);
70+
}
71+
LOGF(info, "Strobe delay (ns) : %f", mStrobeDelay);
72+
LOGF(info, "Strobe length (ns) : %f", mStrobeLength);
73+
LOGF(info, "Threshold (N electrons) : %d", mChargeThreshold);
74+
LOGF(info, "Min N electrons to account : %d", mMinChargeToAccount);
75+
LOGF(info, "Number of charge sharing steps : %d", mNSimSteps);
76+
LOGF(info, "ELoss to N electrons factor : %e", mEnergyToNElectrons);
77+
LOGF(info, "Noise level per pixel : %e", mNoisePerPixel);
78+
LOGF(info, "Charge time-response:");
7379
mSignalShape.print();
7480
}

Steer/DigitizerWorkflow/src/ITSMFTDigitizerSpec.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ class ITSMFTDPLDigitizerTask : BaseDPLDigitizer
262262
digipar.setIBVbb(dopt.IBVbb);
263263
digipar.setOBVbb(dopt.OBVbb);
264264
digipar.setVbb(dopt.Vbb);
265+
// staggering parameters
266+
if (aopt.roFrameLayerRef >= 0 && dopt.continuous) {
267+
digipar.setStagROFrameLayerRef(aopt.roFrameLayerRef);
268+
digipar.setStagROFrameLayerOffsetInBC(aopt.roFrameLayerOffsetInBC, aopt.getNLayers());
269+
digipar.setStagROFrameLayerLengthInBC(aopt.roFrameLayerLengthInBC, aopt.getNLayers());
270+
digipar.setStagROFrameLayerLength(aopt.roFrameLayerOffsetInBC, aopt.getNLayers(), o2::constants::lhc::LHCBunchSpacingNS);
271+
digipar.setStagStrobeLength(aopt.strobeDelay);
272+
}
265273

266274
mROMode = digipar.isContinuous() ? o2::parameters::GRPObject::CONTINUOUS : o2::parameters::GRPObject::PRESENT;
267275
LOG(info) << mID.getName() << " simulated in "
@@ -298,7 +306,7 @@ class ITSMFTDPLDigitizerTask : BaseDPLDigitizer
298306
std::vector<TChain*> mSimChains;
299307
o2::itsmft::NoiseMap* mDeadMap = nullptr;
300308

301-
int mFixMC2ROF = 0; // 1st entry in mc2rofRecordsAccum to be fixed for ROFRecordID
309+
int mFixMC2ROF = 0; // 1st entry in mc2rofRecordsAccum to be fixed for ROFRecordID
302310
bool mTimeDeadMapUpdated = false;
303311
o2::parameters::GRPObject::ROMode mROMode = o2::parameters::GRPObject::PRESENT; // readout mode
304312
};

0 commit comments

Comments
 (0)