@@ -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// _______________________________________________________________________
155156void 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