Skip to content

Commit a94d661

Browse files
[ALICE3] Add digitization for forward disks
1 parent 057d6f7 commit a94d661

8 files changed

Lines changed: 43 additions & 22 deletions

File tree

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/AlmiraParam.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ namespace trk
2525
{
2626

2727
struct AlmiraParam : public o2::conf::ConfigurableParamHelper<AlmiraParam> {
28-
static constexpr size_t kNLayers = constants::VD::petal::nLayers + constants::ML::nLayers + constants::OT::nLayers; // TODO: include disks
28+
// This should be part of geometryTGeo
29+
static constexpr size_t kNLayers = constants::VD::petal::nLayers + constants::ML::nLayers + constants::OT::nLayers + constants::MLOTDisks::nLayers;
2930
static constexpr size_t getNLayers() { return kNLayers; }
3031

3132
int roFrameLengthInBCPerLayer[kNLayers] = {0}; ///< ROF length in BC per layer

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
8989
int getNumberOfActivePartsVD() const { return mNumberOfActivePartsVD; }
9090
int getNumberOfHalfStaves(int lay) const { return mNumberOfHalfStaves[lay]; }
9191

92+
int getNumberOfDisksMLOT() const { return mNumberOfDisksMLOT; }
93+
int getNumberOfStavesInDisk(int lay) const { return mFirstStaveIndexDisc[lay+1] - mFirstStaveIndexDisc[lay]; }
9294
bool isOwner() const { return mOwner; }
9395
void setOwner(bool v) { mOwner = v; }
9496

@@ -259,8 +261,8 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
259261
std::vector<unsigned short> mLastChipIndexVD; ///< max ID of the detector in the layer for the VD
260262
// std::vector<unsigned short> mLastChipIndexMLOT; ///< max ID of the detector in the layer for the MLOT
261263
std::vector<unsigned short> mFirstChipIndexMLOTDisc; ///< ID of the first sensor chip in the layer for the MLOT; array size is one larger than the number of disks; last element equals nChips+1
262-
std::vector<int> mFirstStaveIndexDisc; ///< Index of first stave (abs ID) in each MLOT Disc
263-
std::vector<int> mFirstChipIndexStave; ///< Index of first chip on stave (Discs)
264+
std::vector<unsigned short> mFirstStaveIndexDisc; ///< Index of first stave (abs ID) in each MLOT Disc
265+
std::vector<unsigned short> mFirstChipIndexStave; ///< Index of first chip on stave (Discs)
264266
std::array<char, MAXLAYERS> mLayerToWrapper; ///< Layer to wrapper correspondence, not implemented yet
265267

266268
bool mOwner = true; //! is it owned by the singleton?

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/SegmentationChip.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class SegmentationChip
116116
maxWidth = constants::VD::petal::layer::width[layer];
117117
maxLength = constants::VD::petal::layer::length;
118118
// TODO: change this to use the layer and disk
119-
} else if (subDetID == 1) {
119+
} else if (subDetID == 1 || subDetID == 2) {
120120
pitchRow = PitchRowMLOT;
121121
pitchCol = PitchColMLOT;
122122
maxWidth = constants::moduleMLOT::chip::width - constants::moduleMLOT::chip::passiveEdgeReadOut;
@@ -135,7 +135,7 @@ class SegmentationChip
135135
maxWidth = constants::VD::petal::layer::width[layer];
136136
maxLength = constants::VD::petal::layer::length;
137137
// TODO: change this to use the layer and disk
138-
} else if (subDetID == 1) { // ML/OT
138+
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
139139
maxWidth = constants::moduleMLOT::chip::width - constants::moduleMLOT::chip::passiveEdgeReadOut;
140140
maxLength = constants::moduleMLOT::chip::length;
141141
}
@@ -151,7 +151,7 @@ class SegmentationChip
151151
nRows = constants::VD::petal::layer::nRows[layer];
152152
nCols = constants::VD::petal::layer::nCols;
153153
// TODO: change this to use the layer and disk
154-
} else if (subDetID == 1) {
154+
} else if (subDetID == 1 || subDetID == 2) {
155155
nRows = constants::moduleMLOT::chip::nRows;
156156
nCols = constants::moduleMLOT::chip::nCols;
157157
}
@@ -196,7 +196,7 @@ class SegmentationChip
196196
if (subDetID == 0) {
197197
xRow = 0.5 * (constants::VD::petal::layer::width[layer] - PitchRowVD) - (row * PitchRowVD);
198198
zCol = col * PitchColVD + 0.5 * (PitchColVD - constants::VD::petal::layer::length);
199-
} else if (subDetID == 1) { // ML/OT
199+
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
200200
xRow = 0.5 * (constants::moduleMLOT::chip::width - constants::moduleMLOT::chip::passiveEdgeReadOut - PitchRowMLOT) - (row * PitchRowMLOT);
201201
zCol = col * PitchColMLOT + 0.5 * (PitchColMLOT - constants::moduleMLOT::chip::length);
202202
}

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/Specs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ constexpr double pitchZ{10.0 * mu};
142142
constexpr double responseYShift{5 * mu}; /// center of the epitaxial layer
143143
constexpr double thickness{20 * mu};
144144
} // namespace alice3resp
145+
146+
namespace MLOTDisks
147+
{
148+
constexpr int nLayers{12}; // number of disks in the ML and OT
149+
}
150+
145151
} // namespace o2::trk::constants
146152

147153
#endif

Detectors/Upgrades/ALICE3/TRK/base/src/GeometryTGeo.cxx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,19 @@ int GeometryTGeo::getLayerTRK(int index) const
302302
return -1; /// disks do not have a global layer index
303303
}
304304
int subDetID = getSubDetID(index);
305-
return subDetID * o2::trk::constants::VD::petal::nLayers + getLayer(index); // MLOT: offset by number of VD layers
305+
int firstDetLayer = 0;
306+
307+
// NOTE: taking these from o2::trk::constants, instead
308+
// of the geometry that is constructed in the 'Build' function
309+
// risks inconsistencies...
310+
311+
if (subDetID == 1) {
312+
firstDetLayer = o2::trk::constants::VD::petal::nLayers;
313+
}
314+
else if (subDetID == 2) {
315+
firstDetLayer = o2::trk::constants::VD::petal::nLayers + o2::trk::constants::ML::nLayers + o2::trk::constants::OT::nLayers;
316+
}
317+
return firstDetLayer + getLayer(index);
306318
}
307319
//__________________________________________________________________________
308320
int GeometryTGeo::getStave(int index) const

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Digitizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Digitizer
113113
{
114114
if (subDetID == 0) { // VD
115115
return constants::VD::petal::layer::nCols;
116-
} else if (subDetID == 1) { // ML/OT: the smallest element is a chip of 470 rows and 640 cols
116+
} else if (subDetID == 1 || subDetID == 2) { // ML/OT: the smallest element is a chip of 470 rows and 640 cols
117117
return constants::moduleMLOT::chip::nCols;
118118
}
119119
return 0;
@@ -127,7 +127,7 @@ class Digitizer
127127
{
128128
if (subDetID == 0) { // VD
129129
return constants::VD::petal::layer::nRows[layer];
130-
} else if (subDetID == 1) { // ML/OT
130+
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
131131
return constants::moduleMLOT::chip::nRows;
132132
}
133133
return 0;

Detectors/Upgrades/ALICE3/TRK/simulation/src/Digitizer.cxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const o2::trk::ChipSimResponse* Digitizer::getChipResponse(int chipID)
107107
return mChipSimRespVD;
108108
}
109109

110-
else if (mGeometry->getSubDetID(chipID) == 1) { /// ML/OT
110+
else if (mGeometry->getSubDetID(chipID) == 1 || mGeometry->getSubDetID(chipID) == 2) { /// ML/OT
111111
return mChipSimRespMLOT;
112112
}
113113
return nullptr;
@@ -121,12 +121,12 @@ void Digitizer::process(const std::vector<Hit>* hits, int evID, int srcID, int l
121121
LOG(info) << " Digitizing " << mGeometry->getName() << " (ID: " << mGeometry->getDetID()
122122
<< ") hits of event " << evID << " from source " << srcID
123123
<< " at time " << mEventTime.getTimeNS() << " ROFrame = " << mNewROFrame
124-
<< " Min/Max ROFrames " << mROFrameMin << "/" << mROFrameMax;
124+
<< " Min/Max ROFrames " << mROFrameMin << "/" << mROFrameMax << " layer " << layer;
125125

126-
std::cout << "Printing segmentation info: " << std::endl;
127-
SegmentationChip::Print();
126+
//std::cout << "Printing segmentation info: " << std::endl;
127+
//SegmentationChip::Print();
128128

129-
// // is there something to flush ?
129+
// is there something to flush ?
130130
if (mNewROFrame > mROFrameMin) {
131131
fillOutputContainer(mNewROFrame - 1, layer); // flush out all frames preceding the new one
132132
}
@@ -257,11 +257,11 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
257257
int chipID = hit.GetDetectorID(); //// the chip ID at the moment is not referred to the chip but to a wider detector element (e.g. quarter of layer or disk in VD, stave in ML, half stave in OT)
258258
int subDetID = mGeometry->getSubDetID(chipID);
259259

260-
int layer = mGeometry->getLayer(chipID);
260+
int layer = mGeometry->getLayer(chipID); // local layer nr for response
261261
int disk = mGeometry->getDisk(chipID);
262262

263263
if (disk != -1) {
264-
LOG(debug) << "Skipping disk " << disk;
264+
LOG(debug) << "Skipping VD disk " << disk;
265265
return; // skipping hits on disks for the moment
266266
}
267267

@@ -310,7 +310,7 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
310310

311311
const auto& matrix = mGeometry->getMatrixL2G(hit.GetDetectorID());
312312
// matrix.print();
313-
313+
314314
/// transorm from the global detector coordinates to the local detector coordinates
315315
math_utils::Vector3D<float> xyzLocS(matrix ^ (hit.GetPosStart())); // start position in sensor frame
316316
math_utils::Vector3D<float> xyzLocE(matrix ^ (hit.GetPos())); // end position in sensor frame
@@ -403,8 +403,8 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
403403
float cRowPix = 0.f, cColPix = 0.f; // local coordinate of the current pixel center
404404

405405
const o2::trk::ChipSimResponse* resp = getChipResponse(chipID);
406-
// std::cout << "Printing chip response:" << std::endl;
407-
// resp->print();
406+
//std::cout << "Printing chip response:" << std::endl;
407+
//resp->print();
408408

409409
// take into account that the ChipSimResponse depth defintion has different min/max boundaries
410410
// although the max should coincide with the surface of the epitaxial layer, which in the chip
@@ -463,7 +463,7 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
463463
}
464464
}
465465
}
466-
466+
LOG(info) << "Response done; adding labels; making digits";
467467
// fire the pixels assuming Poisson(n_response_electrons)
468468
o2::MCCompLabel lbl(hit.GetTrackID(), evID, srcID, false);
469469
auto roFrameAbs = mNewROFrame + roFrameRel;

Steer/DigitizerWorkflow/src/TRKDigitizerSpec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class TRKDPLDigitizerTask : BaseDPLDigitizer
279279
const auto& dopt = o2::trk::DPLDigitizerParam<o2::detectors::DetID::TRK>::Instance();
280280
// pc.inputs().get<o2::trk::AlmiraParam*>("TRK_almiraparam");
281281
const auto& aopt = o2::trk::AlmiraParam::Instance();
282-
mLayers = constants::VD::petal::nLayers + geom->getNumberOfLayersMLOT();
282+
mLayers = constants::VD::petal::nLayers + geom->getNumberOfLayersMLOT() + geom->getNumberOfDisksMLOT();
283283
mDigits.resize(mLayers);
284284
mROFRecords.resize(mLayers);
285285
mROFRecordsAccum.resize(mLayers);

0 commit comments

Comments
 (0)