Skip to content

Commit

Permalink
ctpdev: scalers orbit shift (AliceO2Group#12706)
Browse files Browse the repository at this point in the history
* fix: cleaning

* clang
  • Loading branch information
lietava authored Feb 15, 2024
1 parent 1704858 commit 05d2989
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions DataFormats/Detectors/CTP/src/Scalers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -780,19 +780,20 @@ std::pair<double, double> CTPRunScalers::getRateGivenT(double timestamp, int cla
//
int CTPRunScalers::addOrbitOffset(uint32_t offset)
{
int over = 0;
LOG(info) << "Subtracting from orbit " << offset;
for (auto& screc : mScalerRecordRaw) {
uint32_t orbit = screc.intRecord.orbit;
uint32_t orbitnew = 0;
if (orbit >= offset) {
orbitnew = orbit - offset;
} else {
orbitnew = 0xffffffff - offset;
orbitnew = orbit + 1 + orbitnew;
LOG(error) << "Orbit overflow - should never happen. Run:" << mRunNumber;
orbitnew = orbit - offset;
if (orbit < offset) {
over++;
}
screc.intRecord.orbit = orbitnew;
}
if (over != 0 && over != mScalerRecordRaw.size()) {
LOG(warning) << "Orbit overflow inside run. Run:" << mRunNumber;
}
return 0;
}
std::vector<std::string> CTPRunScalers::scalerNames =
Expand Down

0 comments on commit 05d2989

Please sign in to comment.