Skip to content

Commit f4c1c90

Browse files
committed
ITSMFT: staggered digitization
Signed-off-by: Felix Schlepper <[email protected]>
1 parent 8c0dc71 commit f4c1c90

File tree

12 files changed

+442
-366
lines changed

12 files changed

+442
-366
lines changed

Detectors/ITSMFT/ITS/base/include/ITSBase/GeometryTGeo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
176176
bool getChipId(int index, int& lay, int& hba, int& sta, int& ssta, int& mod, int& chip) const;
177177

178178
/// Get chip layer, from 0
179-
int getLayer(int index) const;
179+
int getLayer(int index) const final;
180180

181181
/// Get chip half barrel, from 0
182182
int getHalfBarrel(int index) const;
@@ -216,7 +216,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
216216
return getSymbolicName(getChipIndex(lay, hba, sta, det));
217217
}
218218

219-
/// Get the transformation matrix for a given chip (NOT A SENSOR!!!) 'index' by quering the TGeoManager
219+
/// Get the transformation matrix for a given chip (NOT A SENSOR!!!) 'index' by querying the TGeoManager
220220
TGeoHMatrix* getMatrix(int index) const { return o2::base::GeometryManager::getMatrix(getDetID(), index); }
221221
TGeoHMatrix* getMatrix(int lay, int hba, int sta, int sens) const { return getMatrix(getChipIndex(lay, hba, sta, sens)); }
222222
bool getOriginalMatrix(int index, TGeoHMatrix& m) const
@@ -336,7 +336,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
336336
TString getMatrixPath(int index) const;
337337

338338
/// Get the transformation matrix of the SENSOR (not necessary the same as the chip)
339-
/// for a given chip 'index' by quering the TGeoManager
339+
/// for a given chip 'index' by querying the TGeoManager
340340
TGeoHMatrix* extractMatrixSensor(int index) const;
341341

342342
// create matrix for transformation from sensor local frame to global one
@@ -407,7 +407,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
407407
std::vector<int> mNumberOfChipsPerStave; ///< number of chips per stave
408408
std::vector<int> mNumberOfChipsPerHalfBarrel; ///< number of chips per halfbarrel
409409
std::vector<int> mNumberOfChipsPerLayer; ///< number of chips per stave
410-
std::vector<int> mLastChipIndex; ///< max ID of the detctor in the layer
410+
std::vector<int> mLastChipIndex; ///< max ID of the detector in the layer
411411
std::array<bool, MAXLAYERS> mIsLayerITS3; ///< flag with the information of the ITS version (ITS2 or ITS3)
412412
std::array<char, MAXLAYERS> mLayerToWrapper; ///< Layer to wrapper correspondence
413413

Detectors/ITSMFT/MFT/base/include/MFTBase/GeometryTGeo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
9595
Int_t getSensorIndex(Int_t half, Int_t disk, Int_t ladder, Int_t sensor) const;
9696

9797
/// get layer index (0:9) from the chip index
98-
Int_t getLayer(Int_t index) const;
98+
Int_t getLayer(Int_t index) const final;
9999

100100
/// This routine computes the half, disk, ladder and sensor number
101101
/// given the sensor index number
@@ -122,7 +122,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
122122
{
123123
return extractNumberOfDisks(half);
124124
}
125-
/// Returns the number of halfs MFT
125+
/// Returns the number of halves MFT
126126
Int_t getNumberOfHalfs()
127127
{
128128
return extractNumberOfHalves();
@@ -181,7 +181,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
181181
Int_t extractVolumeCopy(const Char_t* name, const Char_t* prefix) const;
182182

183183
/// Get the transformation matrix of the sensor [...]
184-
/// for a given sensor 'index' by quering the TGeoManager
184+
/// for a given sensor 'index' by querying the TGeoManager
185185
TGeoHMatrix* extractMatrixSensor(Int_t index) const;
186186

187187
// Create matrix for transformation from sensor local frame to global one

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

Lines changed: 16 additions & 7 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 : 10;
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 continuous 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()] = {}; ///< staggering offsets in BC to reference layer
48+
int roFrameLayerLengthInBC[getNLayers()] = {}; ///< staggering ROF length in BC for continuous mode per layer
4049

4150
// boilerplate stuff + make principal key
4251
O2ParamDef(DPLAlpideParam, getParamName().data());
@@ -46,7 +55,7 @@ struct DPLAlpideParam : public o2::conf::ConfigurableParamHelper<DPLAlpideParam<
4655

4756
static constexpr int DEFROFLengthBC()
4857
{
49-
// default ROF length in BC for continuos mode
58+
// default ROF length in BC for continuous mode
5059
// allowed values: 1,2,3,4,6,9,11,12,18,22,27,33,36
5160
return N == o2::detectors::DetID::ITS ? o2::constants::lhc::LHCMaxBunches / 4 : o2::constants::lhc::LHCMaxBunches / 18;
5261
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/// \file GeometryTGeo.h
1313
/// \brief Definition of the GeometryTGeo class : common part for ITS and MFT
14-
/// \brief collects ITS and MFT common methods to acces matrices
14+
/// \brief collects ITS and MFT common methods to access matrices
1515

1616
/// \author [email protected]
1717
#ifndef ALICEO2_ITSMFT_GEOMETRYTGEO_H_
@@ -37,7 +37,8 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
3737
~GeometryTGeo() override = default;
3838

3939
Int_t getNumberOfChips() const { return mSize; }
40-
/// build detector layout data, must be overriden by detector
40+
virtual Int_t getLayer(Int_t index) const { return -1; };
41+
/// build detector layout data, must be overridden by detector
4142
virtual void Build(int loadTrans) = 0;
4243

4344
bool isOwner() const { return mOwner; }

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

Lines changed: 23 additions & 7 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
////////////////////////////////////////////////////////////
@@ -51,8 +53,8 @@ class DigiParams
5153
void setContinuous(bool v) { mIsContinuous = v; }
5254
bool isContinuous() const { return mIsContinuous; }
5355

54-
int getROFrameLengthInBC() const { return mROFrameLengthInBC; }
55-
void setROFrameLengthInBC(int n) { mROFrameLengthInBC = n; }
56+
int getROFrameLengthInBC(int layer = -1) const { return layer < 0 ? mROFrameLengthInBC : mROFrameLayerLengthInBC[layer]; }
57+
void setROFrameLengthInBC(int n, int layer = -1) { layer < 0 ? mROFrameLengthInBC = n : mROFrameLayerLengthInBC[layer] = n; }
5658

5759
void setROFrameLength(float ns);
5860
float getROFrameLength() const { return mROFrameLength; }
@@ -62,7 +64,7 @@ class DigiParams
6264
float getStrobeDelay() const { return mStrobeDelay; }
6365

6466
void setStrobeLength(float ns) { mStrobeLength = ns; }
65-
float getStrobeLength() const { return mStrobeLength; }
67+
float getStrobeLength(int layer = -1) const { return layer < 0 ? mStrobeLength : mStrobeLayerLength[layer]; }
6668

6769
void setTimeOffset(double sec) { mTimeOffset = sec; }
6870
double getTimeOffset() const { return mTimeOffset; }
@@ -96,13 +98,21 @@ class DigiParams
9698
const SignalShape& getSignalShape() const { return mSignalShape; }
9799
SignalShape& getSignalShape() { return (SignalShape&)mSignalShape; }
98100

101+
void setROFrameLayerRef(int layer) { mROFrameLayerRef = layer; }
102+
bool inStaggeredReadout() const noexcept { return mROFrameLayerRef != -1; }
103+
void addROFrameLayerOffsetInBC(int off) { mROFrameLayerOffsetInBC.push_back(off); }
104+
int getROFrameLayerOffsetInBC(int layer) const { return mROFrameLayerOffsetInBC[layer]; }
105+
void addROFrameLayerLengthInBC(int len) { mROFrameLayerLengthInBC.push_back(len); }
106+
void addROFrameLayerLength(float f) { mROFrameLayerLength.push_back(f); }
107+
void addStrobeLength(float ns) { mStrobeLayerLength.push_back(ns); }
108+
99109
virtual void print() const;
100110

101111
private:
102112
static constexpr double infTime = 1e99;
103113
bool mIsContinuous = false; ///< flag for continuous simulation
104114
float mNoisePerPixel = 1.e-8; ///< ALPIDE Noise per chip
105-
int mROFrameLengthInBC = 0; ///< ROF length in BC for continuos mode
115+
int mROFrameLengthInBC = 0; ///< ROF length in BC for continuous mode
106116
float mROFrameLength = 0; ///< length of RO frame in ns
107117
float mStrobeDelay = 0.; ///< strobe start (in ns) wrt ROF start
108118
float mStrobeLength = 0; ///< length of the strobe in ns (sig. over threshold checked in this window only)
@@ -115,7 +125,13 @@ class DigiParams
115125

116126
float mVbb = 0.0; ///< back bias absolute value for MFT (in Volt)
117127
float mIBVbb = 0.0; ///< back bias absolute value for ITS Inner Barrel (in Volt)
118-
float mOBVbb = 0.0; ///< back bias absolute value for ITS Outter Barrel (in Volt)
128+
float mOBVbb = 0.0; ///< back bias absolute value for ITS Outer Barrel (in Volt)
129+
130+
int mROFrameLayerRef = -1; ///< staggering reference layer, if >=0 turn staggering mode on
131+
std::vector<int> mROFrameLayerOffsetInBC; ///< staggering offsets in BC to reference layer
132+
std::vector<int> mROFrameLayerLengthInBC; ///< staggering ROF length in BC for continuous mode per layer
133+
std::vector<float> mROFrameLayerLength; ///< staggering ROF length in ns for continuous mode per layer
134+
std::vector<float> mStrobeLayerLength; ///< staggering length of the strobe in ns (sig. over threshold checked in this window only)
119135

120136
o2::itsmft::AlpideSignalTrapezoid mSignalShape; ///< signal timeshape parameterization
121137

@@ -125,7 +141,7 @@ class DigiParams
125141
float mROFrameLengthInv = 0; ///< inverse length of RO frame in ns
126142
float mNSimStepsInv = 0; ///< its inverse
127143

128-
ClassDef(DigiParams, 2);
144+
ClassDef(DigiParams, 3);
129145
};
130146
} // namespace itsmft
131147
} // namespace o2

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class Digitizer : public TObject
6666
auto getChipResponse(int chipID);
6767

6868
/// Steer conversion of hits to digits
69-
void process(const std::vector<Hit>* hits, int evID, int srcID);
70-
void setEventTime(const o2::InteractionTimeRecord& irt);
69+
void process(const std::vector<Hit>* hits, int evID, int srcID, int layer = -1);
70+
void setEventTime(const o2::InteractionTimeRecord& irt, int layer = -1);
7171
double getEndTimeOfROFMax() const
7272
{
7373
///< return the time corresponding to end of the last reserved ROFrame : mROFrameMax
@@ -76,7 +76,7 @@ class Digitizer : public TObject
7676

7777
void setContinuous(bool v) { mParams.setContinuous(v); }
7878
bool isContinuous() const { return mParams.isContinuous(); }
79-
void fillOutputContainer(uint32_t maxFrame = 0xffffffff);
79+
void fillOutputContainer(uint32_t maxFrame = 0xffffffff, int layer = -1);
8080

8181
void setDigiParams(const o2::itsmft::DigiParams& par) { mParams = par; }
8282
const o2::itsmft::DigiParams& getDigitParams() const { return mParams; }
@@ -91,6 +91,12 @@ class Digitizer : public TObject
9191
mEventROFrameMin = 0xffffffff;
9292
mEventROFrameMax = 0;
9393
}
94+
void resetROFrameBounds()
95+
{
96+
mROFrameMin = 0;
97+
mROFrameMax = 0;
98+
mNewROFrame = 0;
99+
}
94100

95101
private:
96102
void processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID, int srcID);

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)[BC] : %f [%d+%d]", i, mROFrameLayerLength[i], mROFrameLayerLengthInBC[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
}

0 commit comments

Comments
 (0)