|
16 | 16 | #include <iostream> |
17 | 17 | #include <iomanip> |
18 | 18 | #include "CommonUtils/StringUtils.h" |
| 19 | +#include "CommonConstants/LHCConstants.h" |
19 | 20 | #include <fairlogger/Logger.h> |
20 | 21 |
|
21 | 22 | using namespace o2::ctp; |
@@ -544,8 +545,8 @@ int CTPRunScalers::printRates() |
544 | 545 | CTPScalerRecordO2* scalrec1 = &mScalerRecordO2[i]; |
545 | 546 | double_t tt = (double_t)(scalrec1->intRecord.orbit - scalrec0->intRecord.orbit); |
546 | 547 | 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; |
549 | 550 | std::cout << "==> Time wrt to SOR [s]:" << tinrun << " time intervale[s]:" << tt << std::endl; |
550 | 551 | for (uint32_t j = 0; j < scalrec1->scalers.size(); j++) { |
551 | 552 | CTPScalerO2* s0 = &(scalrec0->scalers[j]); |
@@ -645,7 +646,7 @@ void CTPRunScalers::printLMBRateVsT() const |
645 | 646 | auto prev = &mScalerRecordO2[i - 1]; |
646 | 647 | auto curr = &mScalerRecordO2[i]; |
647 | 648 | 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; |
649 | 650 |
|
650 | 651 | for (int j = 0; j < 1; j++) { // loop over classes |
651 | 652 | auto s0 = &(prev->scalers[j]); // type CTPScalerO2* |
@@ -749,7 +750,7 @@ std::pair<double, double> CTPRunScalers::getRate(uint32_t orbit, int classindex, |
749 | 750 | auto calcRate = [&](auto index1, auto index2) -> double { |
750 | 751 | const auto& snext = mScalerRecordO2[index2]; |
751 | 752 | 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 |
753 | 754 | if (type < 7) { |
754 | 755 | const auto& s0 = sprev.scalers[classindex]; // type CTPScalerO2* |
755 | 756 | const auto& s1 = snext.scalers[classindex]; |
@@ -826,7 +827,7 @@ std::pair<double, double> CTPRunScalers::getRateGivenT(double timestamp, int cla |
826 | 827 | auto calcRate = [&](auto index1, auto index2) -> double { |
827 | 828 | const auto& snext = mScalerRecordO2[index2]; |
828 | 829 | 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 |
830 | 831 | // std::cout << "timedelta:" << timedelta << std::endl; |
831 | 832 | if (type < 7) { |
832 | 833 | const auto& s0 = sprev.scalers[classindex]; // type CTPScalerO2* |
|
0 commit comments