Skip to content

Commit 9b1c1e7

Browse files
committed
ITS3: minor changes in Digitizer for float
Signed-off-by: Felix Schlepper <[email protected]>
1 parent e978883 commit 9b1c1e7

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/Digitizer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ class Digitizer : public TObject
106106
uint32_t mEventROFrameMin = 0xffffffff; ///< lowest RO frame for processed events (w/o automatic noise ROFs)
107107
uint32_t mEventROFrameMax = 0; ///< highest RO frame forfor processed events (w/o automatic noise ROFs)
108108

109-
const std::array<o2::its3::SegmentationMosaix, 3> mIBSegmentations{0, 1, 2};
109+
static constexpr std::array<o2::its3::SegmentationMosaix, 3> mIBSegmentations{0, 1, 2};
110110

111111
o2::itsmft::AlpideSimResponse* mSimRespIB = nullptr; // simulated response for IB
112112
o2::itsmft::AlpideSimResponse* mSimRespOB = nullptr; // simulated response for OB
113-
float mSimRespIBShift{0.}; // adjusting the Y-shift in the IB response function to match sensor local coord.
114-
float mSimRespIBScaleX{1.}; // scale x-local coordinate to response function x-coordinate
115-
float mSimRespIBScaleZ{1.}; // scale z-local coordinate to response function z-coordinate
116-
float mSimRespOBShift{0.}; // adjusting the Y-shift in the OB response function to match sensor local coord.
113+
float mSimRespIBShift{0.f}; // adjusting the Y-shift in the IB response function to match sensor local coord.
114+
float mSimRespIBScaleX{1.f}; // scale x-local coordinate to response function x-coordinate
115+
float mSimRespIBScaleZ{1.f}; // scale z-local coordinate to response function z-coordinate
116+
float mSimRespOBShift{0.f}; // adjusting the Y-shift in the OB response function to match sensor local coord.
117117

118118
const o2::its::GeometryTGeo* mGeometry = nullptr; ///< ITS3 geometry
119119

Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ void Digitizer::init()
6565
if (const auto& func = ITS3Params::Instance().chipResponseFunction; func == "Alpide") {
6666
constexpr const char* responseFile = "$(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root";
6767
loadSetResponseFunc("Alpide", responseFile, "response0", responseFile, "response1");
68-
mSimRespIBShift = mSimRespIB->getDepthMax() - SegmentationMosaix::SensorLayerThickness / 2.f + 10.e-4f; // TODO why this offset?
68+
mSimRespIBShift = mSimRespIB->getDepthMax() - SegmentationMosaix::SensorLayerThickness / 2.f + 10.e-4f;
6969
mSimRespOBShift = mSimRespOB->getDepthMax() - SegmentationAlpide::SensorLayerThickness / 2.f;
7070
} else if (func == "APTS") {
7171
constexpr const char* responseFileIB = "$(O2_ROOT)/share/Detectors/Upgrades/ITS3/data/ITS3ChipResponseData/APTSResponseData.root";
7272
constexpr const char* responseFileOB = "$(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root";
7373
loadSetResponseFunc("APTS", responseFileIB, "response1", responseFileOB, "response1");
74-
mSimRespIBShift = mSimRespIB->getDepthMax() - 10.e-4f;
74+
mSimRespIBShift = mSimRespIB->getDepthMax() - 6.5e-4f;
7575
mSimRespOBShift = mSimRespOB->getDepthMax() - SegmentationAlpide::SensorLayerThickness / 2.f;
7676
mSimRespIBScaleX = 0.5 * constants::pixelarray::pixels::apts::pitchX / SegmentationMosaix::PitchRow;
7777
mSimRespIBScaleZ = 0.5 * constants::pixelarray::pixels::apts::pitchZ / SegmentationMosaix::PitchCol;
@@ -328,15 +328,13 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
328328

329329
const int maxNrows{innerBarrel ? SegmentationMosaix::NRows : SegmentationAlpide::NRows};
330330
const int maxNcols{innerBarrel ? SegmentationMosaix::NCols : SegmentationAlpide::NCols};
331-
if (rowE >= maxNrows) {
332-
rowE = maxNrows - 1;
333-
}
331+
332+
rowE = std::min(rowE, maxNrows - 1);
334333
colS -= AlpideRespSimMat::NPix / 2;
335334
colE += AlpideRespSimMat::NPix / 2;
336335
colS = std::max(colS, 0);
337-
if (colE >= maxNcols) {
338-
colE = maxNcols - 1;
339-
}
336+
colE = std::min(colE, maxNcols - 1);
337+
340338
int rowSpan = rowE - rowS + 1, colSpan = colE - colS + 1; // size of plaquet where some response is expected
341339
float respMatrix[rowSpan][colSpan]; // response accumulated here
342340
std::fill(&respMatrix[0][0], &respMatrix[0][0] + rowSpan * colSpan, 0.f);
@@ -379,12 +377,12 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
379377
float rowMax{}, colMax{};
380378
const AlpideRespSimMat* rspmat{nullptr};
381379
if (innerBarrel) {
382-
rowMax = 0.5 * SegmentationMosaix::PitchRow;
383-
colMax = 0.5 * SegmentationMosaix::PitchCol;
380+
rowMax = 0.5f * SegmentationMosaix::PitchRow;
381+
colMax = 0.5f * SegmentationMosaix::PitchCol;
384382
rspmat = mSimRespIB->getResponse(mSimRespIBScaleX * (xyzLocS.X() - cRowPix), mSimRespIBScaleZ * (xyzLocS.Z() - cColPix), xyzLocS.Y(), flipRow, flipCol, rowMax, colMax);
385383
} else {
386-
rowMax = 0.5 * SegmentationAlpide::PitchRow;
387-
colMax = 0.5 * SegmentationAlpide::PitchCol;
384+
rowMax = 0.5f * SegmentationAlpide::PitchRow;
385+
colMax = 0.5f * SegmentationAlpide::PitchCol;
388386
rspmat = mSimRespOB->getResponse(xyzLocS.X() - cRowPix, xyzLocS.Z() - cColPix, xyzLocS.Y(), flipRow, flipCol, rowMax, colMax);
389387
}
390388

0 commit comments

Comments
 (0)