1616// / \since 2026-03-17
1717// /
1818
19- #include < CCDB/BasicCCDBManager.h>
2019#include " IOTOFSimulation/Digitizer.h"
2120#include " IOTOFSimulation/DPLDigitizerParam.h"
2221#include " DetectorsRaw/HBFUtils.h"
22+ #include " CCDB/BasicCCDBManager.h"
2323
2424#include < TCollection.h>
2525#include < TFile.h>
@@ -55,16 +55,16 @@ void Digitizer::init()
5555 // / mChips[i].setDeadChanMap(mDeadChanMap);
5656 // / }
5757 }
58-
59- const auto & digitizerParams = o2::iotof::DPLDigitizerParam::Instance ();
6058
59+ const auto & digitizerParams = o2::iotof::DPLDigitizerParam::Instance ();
60+
6161 LOG (info) << " Initializing IOTOF digitizer" ;
6262 LOG (info) << " Time resolution: " << digitizerParams.timeResolution * 1e3 << " ps" ;
6363 LOG (info) << " Charge threshold: " << digitizerParams.chargeThreshold << " electrons" ;
6464 LOG (info) << " Continuous mode: " << (mContinuous ? " ON" : " OFF" );
6565
6666 if (!digitizerParams.efficiencyCcdbPath .empty ()) {
67- LOG (info) << " Loading efficiency map from CCDB path : " << digitizerParams.efficiencyCcdbPath ;
67+ LOG (info) << " Loading efficiency map from CCDB: " << digitizerParams.efficiencyCcdbPath ;
6868 loadEfficiencyMapFromCCDB (digitizerParams.efficiencyCcdbPath );
6969 } else if (!digitizerParams.efficiencyFilePath .empty ()) {
7070 LOG (info) << " Loading efficiency map from file: " << digitizerParams.efficiencyFilePath ;
@@ -111,10 +111,7 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, int evID, int srcID)
111111{
112112 LOG (debug) << " \n Processing hit with detector ID: " << hit.GetDetectorID () << " , track ID: " << hit.GetTrackID () << " , energy loss: " << hit.GetEnergyLoss () << " GeV, time: " << hit.GetTime () * sec2ns << " ns" ;
113113 // Process a single hit and create a digit if it passes all cuts
114- <<<<<<< HEAD
115- =======
116114
117- >>>>>>> b8b8f45953 (clang-format)
118115 // Get detector element ID
119116 const int chipID = hit.GetDetectorID ();
120117 if (chipID < 0 || chipID >= mGeometry ->getSize () || mGeometry ->getSize () < 1 ) {
@@ -129,26 +126,6 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, int evID, int srcID)
129126 return ;
130127 }
131128
132- // middle position of the hit in the sensor frame
133- const auto & matrix = mGeometry ->getMatrixL2G (chipID);
134- auto xyzPositionStart = matrix ^ hit.GetPosStart ();
135- auto xyzPositionEnd = matrix ^ hit.GetPos ();
136- const auto xMid = 0 .5f * (xyzPositionStart.X () + xyzPositionEnd.X ());
137- const auto zMid = 0 .5f * (xyzPositionStart.Z () + xyzPositionEnd.Z ());
138- // move this to the local pixel coordinates for the efficiency map
139- int row, col;
140- float xPixelCenter, zPixelCenter;
141- if (!sSegmentation ->localToDetector (xMid, zMid, row, col, mGeometry ->getIOTOFLayer (chipID))) {
142- LOG (debug) << " Hit rejected because position (" << xMid << " , " << zMid << " ) is outside the active area of chip " << chipID;
143- return ; // hit is outside the active area
144- }
145- sSegmentation ->detectorToLocalUnchecked (row, col, xPixelCenter, zPixelCenter, mGeometry ->getIOTOFLayer (chipID));
146-
147- if (!isEfficient (xMid - xPixelCenter, zMid - zPixelCenter)) {
148- LOG (debug) << " Hit rejected by efficiency cut" ;
149- return ;
150- }
151-
152129 // Convert energy loss to charge (number of electrons)
153130 float energyLoss = hit.GetEnergyLoss (); // in GeV
154131 int charge = energyToCharge (energyLoss);
@@ -395,11 +372,11 @@ void Digitizer::loadEfficiencyMap(const std::string& filePath)
395372 file->Close ();
396373}
397374
398- // _______________________________________________________________________
399375void Digitizer::loadEfficiencyMapFromCCDB (const std::string& ccdbPath)
400376{
401377 // Load the efficiency map from CCDB
402378 auto rawMap = o2::ccdb::BasicCCDBManager::instance ().get <TH2D >(ccdbPath);
379+
403380 if (!rawMap) {
404381 LOG (error) << " Failed to retrieve efficiency map from CCDB path: " << ccdbPath;
405382 return ;
0 commit comments