@@ -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