Skip to content

Commit 2598071

Browse files
sawenzelclaude
andcommitted
Use the LHC orbit duration for CTP scaler rates
This fixes the orbit-to-time conversion in the CTP scaler rates. - Rates used 88 us per orbit instead of 88.92 us, so they were 1.05 % too high. - For run 569757 (2 colliding bunches) this put the TVX rate above the colliding-bunch rate. - The conversion now uses o2::constants::lhc::LHCOrbitMUS, as getRatesForIndex already does. https://its.cern.ch/jira/browse/O2-7064 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 86a1ec8 commit 2598071

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎DataFormats/Detectors/CTP/src/Scalers.cxx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <iostream>
1717
#include <iomanip>
1818
#include "CommonUtils/StringUtils.h"
19+
#include "CommonConstants/LHCConstants.h"
1920
#include <fairlogger/Logger.h>
2021

2122
using namespace o2::ctp;
@@ -544,8 +545,8 @@ int CTPRunScalers::printRates()
544545
CTPScalerRecordO2* scalrec1 = &mScalerRecordO2[i];
545546
double_t tt = (double_t)(scalrec1->intRecord.orbit - scalrec0->intRecord.orbit);
546547
double_t tinrun = (double_t)(scalrec1->intRecord.orbit - orbit0);
547-
tt = tt * 88e-6;
548-
tinrun = tinrun * 88e-6;
548+
tt = tt * o2::constants::lhc::LHCOrbitMUS * 1.e-6;
549+
tinrun = tinrun * o2::constants::lhc::LHCOrbitMUS * 1.e-6;
549550
std::cout << "==> Time wrt to SOR [s]:" << tinrun << " time intervale[s]:" << tt << std::endl;
550551
for (uint32_t j = 0; j < scalrec1->scalers.size(); j++) {
551552
CTPScalerO2* s0 = &(scalrec0->scalers[j]);
@@ -645,7 +646,7 @@ void CTPRunScalers::printLMBRateVsT() const
645646
auto prev = &mScalerRecordO2[i - 1];
646647
auto curr = &mScalerRecordO2[i];
647648
double_t tt = (double_t)(curr->intRecord.orbit - prev->intRecord.orbit);
648-
tt = tt * 88e-6;
649+
tt = tt * o2::constants::lhc::LHCOrbitMUS * 1.e-6;
649650

650651
for (int j = 0; j < 1; j++) { // loop over classes
651652
auto s0 = &(prev->scalers[j]); // type CTPScalerO2*
@@ -749,7 +750,7 @@ std::pair<double, double> CTPRunScalers::getRate(uint32_t orbit, int classindex,
749750
auto calcRate = [&](auto index1, auto index2) -> double {
750751
const auto& snext = mScalerRecordO2[index2];
751752
const auto& sprev = mScalerRecordO2[index1];
752-
auto timedelta = (snext.intRecord.orbit - sprev.intRecord.orbit) * 88.e-6; // converts orbits into time
753+
auto timedelta = (snext.intRecord.orbit - sprev.intRecord.orbit) * o2::constants::lhc::LHCOrbitMUS * 1.e-6; // converts orbits into time
753754
if (type < 7) {
754755
const auto& s0 = sprev.scalers[classindex]; // type CTPScalerO2*
755756
const auto& s1 = snext.scalers[classindex];
@@ -826,7 +827,7 @@ std::pair<double, double> CTPRunScalers::getRateGivenT(double timestamp, int cla
826827
auto calcRate = [&](auto index1, auto index2) -> double {
827828
const auto& snext = mScalerRecordO2[index2];
828829
const auto& sprev = mScalerRecordO2[index1];
829-
auto timedelta = (snext.intRecord.orbit - sprev.intRecord.orbit) * 88.e-6; // converts orbits into time
830+
auto timedelta = (snext.intRecord.orbit - sprev.intRecord.orbit) * o2::constants::lhc::LHCOrbitMUS * 1.e-6; // converts orbits into time
830831
// std::cout << "timedelta:" << timedelta << std::endl;
831832
if (type < 7) {
832833
const auto& s0 = sprev.scalers[classindex]; // type CTPScalerO2*

0 commit comments

Comments
 (0)