@@ -136,37 +136,30 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, int evID, int srcID)
136136 const int roFrameAbs = 0 ; // For now, we can set this to 0 or calculate based on time if needed
137137 const int nROF = 1 ; // For now, we can assume the signal is contained in one ROF, this can be extended to multiple ROFs based on the time
138138
139- if (digitizerParams.performStepping ) {
140- float ** respMatrix = nullptr ;
141- int rowStart = 0 , colStart = 0 , rowSpan = 0 , colSpan = 0 ;
142- stepping (hit, respMatrix, rowStart, colStart, rowSpan, colSpan);
143-
144- for (int irow = rowSpan; irow--;) {
145- uint16_t rowIS = irow + rowStart;
146- for (int icol = colSpan; icol--;) {
147- uint16_t colIS = icol + colStart;
148- float nEleResp = respMatrix[irow][icol];
149- if (!nEleResp) {
150- continue ;
151- }
152- const int nElectronsSampled = gRandom ->Poisson (electronsPerStep * nEleResp);
153- // Noise can be added here if needed
154-
155- registerDigits (chip, roFrameAbs, smearedTime, nROF,
156- static_cast <uint16_t >(rowIS), static_cast <uint16_t >(colIS), nElectronsSampled, label);
139+ float ** respMatrix = nullptr ;
140+ int rowStart = 0 , colStart = 0 , rowSpan = 0 , colSpan = 0 ;
141+ stepping (hit, respMatrix, rowStart, colStart, rowSpan, colSpan);
142+
143+ for (int irow = rowSpan; irow--;) {
144+ uint16_t rowIS = irow + rowStart;
145+ for (int icol = colSpan; icol--;) {
146+ uint16_t colIS = icol + colStart;
147+ float nEleResp = respMatrix[irow][icol];
148+ if (!nEleResp) {
149+ continue ;
157150 }
158- }
151+ const int nElectronsSampled = gRandom ->Poisson (electronsPerStep * nEleResp);
152+ // Noise can be added here if needed
159153
160- for ( int irow = 0 ; irow < rowSpan; ++irow) {
161- delete[] respMatrix[irow] ;
154+ registerDigits (chip, roFrameAbs, smearedTime, nROF,
155+ static_cast < uint16_t >(rowIS), static_cast < uint16_t >(colIS), nElectronsSampled, label) ;
162156 }
163- delete[] respMatrix;
164- } else {
165- int row = 0 , col = 0 ;
166- responseInTheMiddle (hit, row, col);
167- const int nElectronsSampled = gRandom ->Poisson (charge);
168- registerDigits (chip, roFrameAbs, smearedTime, nROF, static_cast <uint16_t >(row), static_cast <uint16_t >(col), nElectronsSampled, label);
169157 }
158+
159+ for (int irow = 0 ; irow < rowSpan; ++irow) {
160+ delete[] respMatrix[irow];
161+ }
162+ delete[] respMatrix;
170163}
171164
172165void Digitizer::stepping (const o2::itsmft::Hit& hit, float **& respMatrix, int & rowStart, int & colStart, int & rowSpan, int & colSpan)
@@ -259,23 +252,6 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, int& r
259252 }
260253}
261254
262- void Digitizer::responseInTheMiddle (const o2::itsmft::Hit& hit, int & row, int & col)
263- {
264- const auto & matrix = mGeometry ->getMatrixL2G (hit.GetDetectorID ());
265- const int chipID = hit.GetDetectorID ();
266-
267- math_utils::Vector3D<float > xyzPositionStart (matrix ^ (hit.GetPosStart ())); // start position in sensor frame
268- math_utils::Vector3D<float > xyzPositionEnd (matrix ^ (hit.GetPos ())); // end position in sensor frame
269-
270- // Calculate the middle position of the hit
271- math_utils::Vector3D<float > xyzPositionMiddle = (xyzPositionStart + xyzPositionEnd) * 0 .5f ;
272-
273- if (!sSegmentation ->localToDetector (xyzPositionMiddle.X (), xyzPositionMiddle.Z (), row, col, mGeometry ->getIOTOFLayer (chipID))) {
274- LOG (debug) << " Hit position out of bounds for detector ID " << chipID;
275- return ; // hit is outside the active area
276- }
277- }
278-
279255// _______________________________________________________________________
280256double Digitizer::smearTime (double time) const
281257{
0 commit comments