Skip to content

Commit 42f544b

Browse files
change resolution computation at digit level, add relative information from resolution map
1 parent 2503e9a commit 42f544b

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,18 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer
3030
float timeResolution = 0.020f; ///< time resolution sigma in ns (20 ps default)
3131
float tdcBin = 0.010f; ///< TDC time bin (10 ps default)
3232
float efficiency = 0.98f; ///< detection efficiency
33+
3334
std::string efficiencyFilePath{}; ///< optional efficiency map file path.
3435
///< The efficiency map is currently available at /alice/cern.ch/user/g/glucia/ALICE3/IOTOF/pixelEfficiency/PixelEfficiencyMap_TH2.root. FIXME to be removed once switch to CCDBFetcher
3536
std::string efficiencyCcdbPath{}; ///< optional efficiency map CCDB path.
3637
///< The efficiency map is currently available at Users/g/glucia/tmp/ALICE3/IOTOF/pixelEfficiency
38+
std::string resolutionFilePath{}; ///< optional resolution map file path.
39+
///< The resolution map is currently available at /alice/cern.ch/user/g/glucia/ALICE3/IOTOF/pixelEfficiency/PixelResolutionMap_TH2.root. FIXME to be removed once switch to CCDBFetcher
40+
std::string resolutionCcdbPath{}; ///< optional resolution map CCDB path.
41+
std::string timeOfArrivalFilePath{}; ///< optional time of arrival map file path.
42+
///< The time of arrival map is currently available at /alice/cern.ch/user/g
43+
std::string timeOfArrivalCcdbPath{}; ///< optional time of arrival map CCDB path.
44+
3745
int chargeThreshold = 100; ///< charge threshold in Nelectrons
3846
int minChargeToAccount = 7; ///< minimum charge contribution to account
3947
int nSimSteps = 10; ///< number of steps in response simulation

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

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,26 @@ void Digitizer::init()
7373
LOG(info) << "No efficiency map provided, using uniform efficiency: " << digitizerParams.efficiency * 100 << " %";
7474
}
7575

76+
if (!digitizerParams.resolutionCcdbPath.empty()) {
77+
LOG(info) << "Loading resolution map from CCDB: " << digitizerParams.resolutionCcdbPath;
78+
loadMapFromCCDB(mResolutionMap, digitizerParams.resolutionCcdbPath);
79+
} else if (!digitizerParams.resolutionFilePath.empty()) {
80+
LOG(info) << "Loading resolution map from file: " << digitizerParams.resolutionFilePath;
81+
loadMap(mResolutionMap, digitizerParams.resolutionFilePath, "hResolutionMap");
82+
} else {
83+
LOG(info) << "No resolution map provided, using uniform time resolution: " << digitizerParams.timeResolution * 1e3 << " ps";
84+
}
85+
86+
if (!digitizerParams.timeOfArrivalCcdbPath.empty()) {
87+
LOG(info) << "Loading time of arrival map from CCDB: " << digitizerParams.timeOfArrivalCcdbPath;
88+
loadMapFromCCDB(mTimeOfArrivalMap, digitizerParams.timeOfArrivalCcdbPath);
89+
} else if (!digitizerParams.timeOfArrivalFilePath.empty()) {
90+
LOG(info) << "Loading time of arrival map from file: " << digitizerParams.timeOfArrivalFilePath;
91+
loadMap(mTimeOfArrivalMap, digitizerParams.timeOfArrivalFilePath, "hTimeOfArrivalMap");
92+
} else {
93+
LOG(info) << "No time of arrival map provided";
94+
}
95+
7696
sSegmentation = o2::iotof::Segmentation::Instance();
7797
}
7898

@@ -171,6 +191,7 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, int evID, int srcID)
171191
LOG(debug) << "Hit rejected by efficiency cut at pixel (row,col) = (" << rowIS << ", " << colIS << ")";
172192
continue;
173193
}
194+
double smearedTime = smearTime(hitTimeWrtBC, avgHitLocalX[irow][icol], avgHitLocalZ[irow][icol]);
174195

175196
const int nElectronsSampled = gRandom->Poisson(electronsPerStep * nEleResp);
176197
// Noise can be added here if needed
@@ -324,12 +345,22 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
324345
}
325346

326347
//_______________________________________________________________________
327-
double Digitizer::smearTime(double time) const
348+
double Digitizer::smearTime(double time, const float x, const float y) const
328349
{
329350
// Apply Gaussian smearing to simulate detector time resolution
330351
const auto& digitizerParams = o2::iotof::DPLDigitizerParam::Instance();
352+
353+
float resolutionScaling = 1.;
354+
if (mResolutionMap) {
355+
const float minimumResolution = mResolutionMap->GetMinimum();
356+
int bin = mResolutionMap->FindBin(x * o2::iotof::Digitizer::cm2um, y * o2::iotof::Digitizer::cm2um);
357+
resolutionScaling = mResolutionMap->GetBinContent(bin) / minimumResolution;
358+
LOG(debug) << "Time resolution map check: x=" << x * o2::iotof::Digitizer::cm2um << ", y=" << y * o2::iotof::Digitizer::cm2um << ", bin=" << bin << ", resolution=" << minimumResolution;
359+
LOG(debug) << "Time resolution scaling: " << resolutionScaling;
360+
}
361+
331362
if (digitizerParams.timeResolution > 0) {
332-
return time + gRandom->Gaus(0, digitizerParams.timeResolution);
363+
return time + gRandom->Gaus(0, digitizerParams.timeResolution * resolutionScaling);
333364
}
334365
return time;
335366
}

0 commit comments

Comments
 (0)