Skip to content

Commit

Permalink
fix in time slewing object (too slow to be loaded)
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini authored and shahor02 committed Nov 17, 2021
1 parent 8cae15a commit 4ba1dff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ class CalibTimeSlewingParamTOF

private:
// TOF channel calibrations
std::array<std::array<int, NCHANNELXSECTOR>, NSECTORS> mChannelStart; ///< array with the index of the first element of a channel in the time slewing vector (per sector)
std::array<std::array<float, NCHANNELXSECTOR>, NSECTORS> mGlobalOffset; ///< array with the sigma of the peak
std::array<std::vector<std::pair<unsigned short, short>>, NSECTORS> mTimeSlewing; ///< array of sector vectors; first element of the pair is TOT (in ps), second is t-texp_pi (in ps)
std::array<std::array<float, NCHANNELXSECTOR>, NSECTORS> mFractionUnderPeak; ///< array with the fraction of entries below the peak
std::array<std::array<float, NCHANNELXSECTOR>, NSECTORS> mSigmaPeak; ///< array with the sigma of the peak
std::array<int, NCHANNELXSECTOR> mChannelStart[NSECTORS]; ///< array with the index of the first element of a channel in the time slewing vector (per sector)
std::array<float, NCHANNELXSECTOR> mGlobalOffset[NSECTORS]; ///< array with the sigma of the peak
std::vector<std::pair<unsigned short, short>> mTimeSlewing[NSECTORS]; ///< array of sector vectors; first element of the pair is TOT (in ps), second is t-texp_pi (in ps)
std::array<float, NCHANNELXSECTOR> mFractionUnderPeak[NSECTORS]; ///< array with the fraction of entries below the peak
std::array<float, NCHANNELXSECTOR> mSigmaPeak[NSECTORS]; ///< array with the sigma of the peak

ClassDefNV(CalibTimeSlewingParamTOF, 2); // class for TOF time slewing params
};
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TOF/calibration/src/CalibTOFapi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ float CalibTOFapi::getTimeCalibration(int ich, float tot)
LOG(WARNING) << "Either LHC phase or slewing object null: mLHCphase = " << mLHCphase << ", mSlewParam = " << mSlewParam;
return corr;
}
// printf("LHC phase apply\n");
// LHCphase
corr += mLHCphase->getLHCphase(int(mTimeStamp / 1000)); // timestamp that we use in LHCPhase is in seconds, but for CCDB we need it in ms

// time slewing + channel offset
//printf("eval time sleweing calibration: ch=%d tot=%f (lhc phase = %f)\n",ich,tot,corr);
corr += mSlewParam->evalTimeSlewing(ich, tot);
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TOF/reconstruction/src/Clusterer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void Clusterer::calibrateStrip()
dig->setBC(dig->getBC() - mBCOffset); // RS Don't use raw BC, always start from the beginning of the TF
double calib = mCalibApi->getTimeCalibration(dig->getChannel(), dig->getTOT() * Geo::TOTBIN_NS);
//printf("channel %d) isProblematic = %d, fractionUnderPeak = %f\n",dig->getChannel(),mCalibApi->isProblematic(dig->getChannel()),mCalibApi->getFractionUnderPeak(dig->getChannel())); // toberem
dig->setIsProblematic(mCalibApi->isProblematic(dig->getChannel()));
dig->setIsProblematic(0); // to be replaced with -> mCalibApi->isProblematic(dig->getChannel())
dig->setCalibratedTime(dig->getTDC() * Geo::TDCBIN + dig->getBC() * o2::constants::lhc::LHCBunchSpacingNS * 1E3 - Geo::LATENCYWINDOW * 1E3 - calib); //TODO: to be checked that "-" is correct, and we did not need "+" instead :-)
//printf("calibration correction = %f\n",calib); // toberem
}
Expand Down
4 changes: 4 additions & 0 deletions Detectors/TOF/workflow/src/TOFClusterizerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ class TOFDPLClustererTask

o2::tof::CalibTOFapi calibapi(long(0), &lhcPhaseObj, channelCalibObj.get());

calibapi.setURL("http://ccdb-test.cern.ch:8080");
calibapi.setTimeStamp(0);
calibapi.readTimeSlewingParam();

mClusterer.setCalibApi(&calibapi);

mClusterer.clearDiagnostic();
Expand Down

0 comments on commit 4ba1dff

Please sign in to comment.