Skip to content

Commit 90fbe62

Browse files
authored
[ALICE3] TRK: fix orientation of response function both for APTS and ALICE3 response + set reasonable threshold (#15135)
* ALICE3-TRK: fix orientation of response function, handling both ALICE3 and APTS response + log messages modification * ALICE3-TRK: set more reasonable threshold for the digitization process
1 parent 79f51af commit 90fbe62

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/SegmentationChip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class SegmentationChip
198198
zCol = col * PitchColVD + 0.5 * (PitchColVD - constants::VD::petal::layer::length);
199199
} else if (subDetID == 1) { // ML/OT
200200
xRow = 0.5 * (constants::moduleMLOT::chip::width - constants::moduleMLOT::chip::passiveEdgeReadOut - PitchRowMLOT) - (row * PitchRowMLOT);
201-
zCol = col * PitchRowMLOT + 0.5 * (PitchRowMLOT - constants::moduleMLOT::chip::length);
201+
zCol = col * PitchColMLOT + 0.5 * (PitchColMLOT - constants::moduleMLOT::chip::length);
202202
}
203203
}
204204

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/DPLDigitizerParam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer
3737
float strobeQRiseTime0 = 450.; ///< q @ which strobe rise time is 0
3838

3939
double timeOffset = 0.; ///< time offset (in seconds!) to calculate ROFrame from hit time
40-
int chargeThreshold = 1; ///< charge threshold in Nelectrons
41-
int minChargeToAccount = 1; ///< minimum charge contribution to account
40+
int chargeThreshold = 75; ///< charge threshold in Nelectrons
41+
int minChargeToAccount = 7; ///< minimum charge contribution to account
4242
int nSimSteps = 475; ///< number of steps in response simulation
4343
float energyToNElectrons = 1. / 3.6e-9; // conversion of eloss to Nelectrons
4444

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/DigiParams.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ class DigiParams
110110
float mStrobeLength = 0; ///< length of the strobe in ns (sig. over threshold checked in this window only)
111111
double mTimeOffset = -2 * infTime; ///< time offset (in seconds!) to calculate ROFrame from hit time
112112
int mROFrameBiasInBC = 0; ///< misalignment of the ROF start in BC
113-
int mChargeThreshold = 1; ///< charge threshold in Nelectrons
114-
int mMinChargeToAccount = 1; ///< minimum charge contribution to account
113+
int mChargeThreshold = 75; ///< charge threshold in Nelectrons
114+
int mMinChargeToAccount = 7; ///< minimum charge contribution to account
115115
int mNSimSteps = 475; ///< number of steps in response simulation
116116
float mNSimStepsInv = 1. / mNSimSteps; ///< its inverse
117117

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ void Digitizer::init()
6666
float thicknessMLOT = o2::trk::SegmentationChip::SiliconThicknessMLOT; // 0.01 cm = 100 um --- based on geometry currently present
6767

6868
LOG(info) << "Using response name: " << mRespName;
69+
mSimRespOrientation = false;
6970

7071
if (mRespName == "APTS") { // default
7172
mSimRespVDScaleX = o2::trk::constants::apts::pitchX / o2::trk::SegmentationChip::PitchRowVD;
7273
mSimRespVDScaleZ = o2::trk::constants::apts::pitchZ / o2::trk::SegmentationChip::PitchColVD;
7374
mSimRespVDShift = mChipSimRespVD->getDepthMax(); // the curved, rescaled, sensors have a width from 0 to -45. Must add ~10 um (= max depth) to match the APTS response.
7475
mSimRespMLOTScaleX = o2::trk::constants::apts::pitchX / o2::trk::SegmentationChip::PitchRowMLOT;
7576
mSimRespMLOTScaleZ = o2::trk::constants::apts::pitchZ / o2::trk::SegmentationChip::PitchColMLOT;
77+
mSimRespOrientation = true; /// APTS response function is flipped along x wrt the ones of ALPIDE and ALICE3
7678
} else if (mRespName == "ALICE3") {
7779
mSimRespVDScaleX = o2::trk::constants::alice3resp::pitchX / o2::trk::SegmentationChip::PitchRowVD;
7880
mSimRespVDScaleZ = o2::trk::constants::alice3resp::pitchZ / o2::trk::SegmentationChip::PitchColVD;
@@ -84,7 +86,6 @@ void Digitizer::init()
8486
}
8587

8688
mSimRespMLOTShift = mChipSimRespMLOT->getDepthMax() - thicknessMLOT / 2.f; // the shift should be done considering the rescaling done to adapt to the wrong silicon thickness. TODO: remove the scaling factor for the depth when the silicon thickness match the simulated response
87-
mSimRespOrientation = false;
8889

8990
// importing the parameters from DPLDigitizerParam.h
9091
auto& dOptTRK = DPLDigitizerParam<o2::detectors::DetID::TRK>::Instance();
@@ -116,11 +117,11 @@ void Digitizer::process(const std::vector<Hit>* hits, int evID, int srcID)
116117
{
117118
// digitize single event, the time must have been set beforehand
118119

119-
LOG(debug) << " Digitizing " << mGeometry->getName() << " (ID: " << mGeometry->getDetID()
120-
<< ") hits of entry " << evID << " from source " << srcID
121-
<< " at time " << mEventTime << " ROFrame= " << mNewROFrame << ")"
122-
<< " cont.mode: " << isContinuous()
123-
<< " Min/Max ROFrames " << mROFrameMin << "/" << mROFrameMax;
120+
LOG(info) << " Digitizing " << mGeometry->getName() << " (ID: " << mGeometry->getDetID()
121+
<< ") hits of event " << evID << " from source " << srcID
122+
<< " at time " << mEventTime.getTimeNS() << " ROFrame = " << mNewROFrame
123+
<< " cont.mode: " << isContinuous()
124+
<< " Min/Max ROFrames " << mROFrameMin << "/" << mROFrameMax;
124125

125126
std::cout << "Printing segmentation info: " << std::endl;
126127
SegmentationChip::Print();
@@ -154,7 +155,7 @@ void Digitizer::process(const std::vector<Hit>* hits, int evID, int srcID)
154155
//_______________________________________________________________________
155156
void Digitizer::setEventTime(const o2::InteractionTimeRecord& irt)
156157
{
157-
LOG(info) << "Setting event time ";
158+
LOG(info) << "Setting event time to " << irt.getTimeNS() << " ns after orbit 0 bc 0";
158159
// assign event time in ns
159160
mEventTime = irt;
160161
if (!mParams.isContinuous()) {
@@ -279,7 +280,7 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
279280
return;
280281
}
281282
float timeInROF = hit.GetTime() * sec2ns;
282-
LOG(debug) << "timeInROF: " << timeInROF;
283+
LOG(debug) << "Hit time: " << timeInROF << " ns";
283284
if (timeInROF > 20e3) {
284285
const int maxWarn = 10;
285286
static int warnNo = 0;
@@ -292,7 +293,7 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
292293
if (isContinuous()) {
293294
timeInROF += mCollisionTimeWrtROF;
294295
}
295-
if (timeInROF < 0) {
296+
if (mIsBeforeFirstRO && timeInROF < 0) {
296297
// disregard this hit because it comes from an event byefore readout starts and it does not effect this RO
297298
LOG(debug) << "Ignoring hit with timeInROF = " << timeInROF;
298299
return;
@@ -468,7 +469,7 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
468469
if (colDest < 0 || colDest >= colSpan) {
469470
continue;
470471
}
471-
respMatrix[rowDest][colDest] += rspmat->getValue(irow, icol, mSimRespOrientation ? !flipRow : flipRow, !flipCol);
472+
respMatrix[rowDest][colDest] += rspmat->getValue(irow, icol, mSimRespOrientation ? !flipRow : flipRow, flipCol);
472473
}
473474
}
474475
}
@@ -501,7 +502,6 @@ void Digitizer::processHit(const o2::trk::Hit& hit, uint32_t& maxFr, int evID, i
501502
if (mDeadChanMap && mDeadChanMap->isNoisy(chipID, rowIS, colIS)) {
502503
continue;
503504
}
504-
505505
registerDigits(chip, roFrameAbs, timeInROF, nFrames, rowIS, colIS, nEle, lbl);
506506
}
507507
}
@@ -517,7 +517,7 @@ void Digitizer::registerDigits(o2::trk::ChipDigitsContainer& chip, uint32_t roFr
517517
LOG(debug) << "Registering digits for chip " << chip.getChipIndex() << " at ROFrame " << roFrame
518518
<< " row " << row << " col " << col << " nEle " << nEle << " label " << lbl;
519519
float tStrobe = mParams.getStrobeDelay() - tInROF; // strobe start wrt signal start
520-
for (int i = 0; i < nROF; i++) {
520+
for (int i = 0; i < nROF; i++) { // loop on all the ROFs occupied by the same signal to calculate the charge accumulated in that ROF
521521
uint32_t roFr = roFrame + i;
522522
int nEleROF = mParams.getSignalShape().getCollectedCharge(nEle, tStrobe, tStrobe + mParams.getStrobeLength());
523523
tStrobe += mParams.getROFrameLength(); // for the next ROF
@@ -536,8 +536,9 @@ void Digitizer::registerDigits(o2::trk::ChipDigitsContainer& chip, uint32_t roFr
536536
o2::itsmft::PreDigit* pd = chip.findDigit(key);
537537
if (!pd) {
538538
chip.addDigit(key, roFr, row, col, nEleROF, lbl);
539-
LOG(debug) << "Added digit " << key << " " << roFr << " " << row << " " << col << " " << nEleROF;
539+
LOG(debug) << "Added digit with key: " << key << " ROF: " << roFr << " row: " << row << " col: " << col << " charge: " << nEleROF;
540540
} else { // there is already a digit at this slot, account as PreDigitExtra contribution
541+
LOG(debug) << "Added to pre-digit with key: " << key << " ROF: " << roFr << " row: " << row << " col: " << col << " charge: " << nEleROF;
541542
pd->charge += nEleROF;
542543
if (pd->labelRef.label == lbl) { // don't store the same label twice
543544
continue;

0 commit comments

Comments
 (0)