Skip to content

Commit d10e8e9

Browse files
removed redundant hit response in the middle, nsteps=1 is now default
1 parent 23f1486 commit d10e8e9

3 files changed

Lines changed: 21 additions & 47 deletions

File tree

Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer
2929
double timeOffset = 0.; ///< time offset (in seconds!) to calculate ROFrame from hit time
3030
int chargeThreshold = 75; ///< charge threshold in Nelectrons
3131
int minChargeToAccount = 7; ///< minimum charge contribution to account
32-
int nSimSteps = 475; ///< number of steps in response simulation
32+
int nSimSteps = 1; ///< number of steps in response simulation
3333
float energyToNElectrons = 1. / 3.6e-9; // conversion of eloss to Nelectrons
3434
int responseMatrixSize = 1; ///< size of the response matrix (odd number)
35-
bool performStepping = true; ///< flag to perform stepping simulation
3635

3736
std::string noiseFilePath{}; ///< optional noise masks file path. FIXME to be removed once switch to CCDBFetcher
3837

Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Digitizer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class Digitizer : public TObject
9494
uint16_t row, uint16_t col, int nElectrons, o2::MCCompLabel& label);
9595

9696
void stepping(const o2::itsmft::Hit& hit, float**& respMatrix, int& rowStart, int& colStart, int& rowSpan, int& colSpan);
97-
void responseInTheMiddle(const o2::itsmft::Hit& hit, int& row, int& col);
9897

9998
/// Apply time smearing to simulate detector resolution
10099
double smearTime(double time) const;

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

Lines changed: 20 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -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

172165
void 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
//_______________________________________________________________________
280256
double Digitizer::smearTime(double time) const
281257
{

0 commit comments

Comments
 (0)