20#include <fairlogger/Logger.h>
28 stream <<
"Counter errorrs: lmB:" <<
lmB <<
" l0B:" <<
l0B <<
" l1B:" <<
l1B <<
" lmA:" <<
lmA <<
" l0A:" <<
l0A <<
" l1A:" <<
l1A;
70 for (
auto const& cnts :
scalers) {
73 std::cout <<
"Inputs:" <<
scalersInps.size() << std::endl;
83 for (
auto const& cnts :
scalers) {
86 std::cout <<
"Inputs:" <<
scalersInps.size() << std::endl;
107 stream <<
"CTP Scalers (version:" << mVersion <<
") Run:" << mRunNumber << std::endl;
109 stream <<
"Detector mask:" << mDetectorMask << std::endl;
110 for (
auto const&
rec : mScalerRecordRaw) {
113 stream <<
"O2 Counters:" << std::endl;
114 for (
auto const&
rec : mScalerRecordO2) {
120 stream <<
"CTP Scalers (version:" << mVersion <<
") Run:" << mRunNumber << std::endl;
121 stream <<
"O2 Counters:" << std::endl;
122 for (
auto const&
rec : mScalerRecordO2) {
128 stream <<
"CTP Scalers (version:" << mVersion <<
") Run:" << mRunNumber << std::endl;
129 stream <<
"O2 Counters:" << std::endl;
131 for (
auto const&
rec : mScalerRecordO2) {
147 std::vector<uint32_t> indexes;
150 indexes.push_back(
i);
159 LOG(
error) <<
"Class index out of range:" << cls;
164 for (
auto const& clsl : clslist) {
170 LOG(
error) <<
" Class not found:" << cls;
175 LOG(info) <<
"Loading CTP scalers.";
176 std::istringstream iss(rawscalers);
182 while (std::getline(iss, line)) {
184 if ((ret = processScalerLine(line,
level, nclasses)) != 0) {
190 LOG(
error) <<
"Input string seems too small:\n"
195 LOG(
error) <<
"Wrong number of classes in final record";
200int CTPRunScalers::processScalerLine(
const std::string& line,
int&
level, uint32_t& nclasses)
203 if (line.size() == 0) {
206 if (line.at(0) ==
'#') {
210 size_t ntokens = tokens.size();
218 LOG(
error) <<
"Expected version in the first line";
221 mVersion = std::stoi(tokens[0]);
229 LOG(
error) <<
"Wrong syntax of second line in CTP scalers";
232 mRunNumber = std::stol(tokens[0]);
233 uint32_t numofclasses = std::stoi(tokens[1]);
234 if ((numofclasses + 2) != ntokens) {
235 LOG(
error) <<
"Wrong syntax of second line in CTP scalers";
240 int index = std::stoi(tokens[
i + 2]);
241 mClassMask[
index] = 1;
251 LOG(
error) <<
"Wrong syntax of time stamp line in CTP scalers";
256 rec.intRecord.bc = std::stol(tokens[1]);
258 rec.epochTime = std::stoll(tokens[2]);
260 mScalerRecordRaw.push_back(
rec);
267 LOG(
error) <<
"Wrong syntax of counters line in CTP scalers";
273 scaler.
lmBefore = std::stol(tokens[0]);
274 scaler.
lmAfter = std::stol(tokens[1]);
275 scaler.
l0Before = std::stol(tokens[2]);
276 scaler.
l0After = std::stol(tokens[3]);
277 scaler.
l1Before = std::stol(tokens[4]);
278 scaler.
l1After = std::stol(tokens[5]);
279 (mScalerRecordRaw.back()).scalers.push_back(scaler);
281 if (nclasses >= mClassMask.count()) {
295 overflows_t overflows;
298 overflows[
i] = {0, 0, 0, 0, 0, 0};
302 std::array<uint32_t, 48> overflowsInputs = {48 * 0};
306 copyRawToO2ScalerRecord(mScalerRecordRaw[0], o2rec, overflows, overflowsInputs);
307 mScalerRecordO2.push_back(o2rec);
309 for (
uint32_t i = 1;
i < mScalerRecordRaw.size();
i++) {
311 int ret = updateOverflows(mScalerRecordRaw[
i - 1], mScalerRecordRaw[
i], overflows);
320 ret = updateOverflowsInps(mScalerRecordRaw[
i - 1], mScalerRecordRaw[
i], overflowsInputs);
321 copyRawToO2ScalerRecord(mScalerRecordRaw[
i], o2rec, overflows, overflowsInputs);
322 mScalerRecordO2.push_back(o2rec);
333 if (rawrec.
scalers.size() != (mClassMask.count())) {
334 LOG(
error) <<
"Inconsistent scaler record size:" << rawrec.
scalers.size() <<
" Expected:" << mClassMask.count();
342 for (uint32_t
i = 0;
i < rawrec.
scalers.size();
i++) {
347 o2rec.
scalers.push_back(o2scal);
405 int64_t difThres = 6;
407 if (dif <= difThres) {
409 }
else if (dif > difThres) {
412 LOG(
error) <<
"LMA > LMB error:" << dif;
417 if (dif <= difThres) {
419 }
else if (dif > difThres) {
422 LOG(
error) <<
"L0A > L0B error:" << dif;
427 if (dif <= difThres) {
429 }
else if (dif > difThres) {
432 LOG(
error) <<
"L1A > L1B error:" << dif;
442 if (dif <= difThres) {
444 }
else if (dif > difThres) {
448 LOG(warning) <<
"L1B > L0A Before error:" << dif;
461 if (rec1.
scalers.size() != mClassMask.count()) {
462 LOG(
error) <<
"Inconsistent scaler record size:" << rec1.
scalers.size() <<
" Expected:" << mClassMask.count();
511 static int iPrint = 0;
515 LOG(warning) <<
"Input scalers not available. Size:" << rec0.
scalersInps.size();
522 LOG(warning) <<
"Input scalers not available. Size:" << rec0.
scalersInps.size();
537 if (mScalerRecordO2.size() == 0) {
538 LOG(info) <<
"ScalerRecord is empty, doing nothing";
541 LOG(info) <<
"Scaler rates for run:" << mRunNumber;
544 for (
uint32_t i = 1;
i < mScalerRecordO2.size();
i++) {
548 tt =
tt * o2::constants::lhc::LHCOrbitMUS * 1.e-6;
549 tinrun = tinrun * o2::constants::lhc::LHCOrbitMUS * 1.e-6;
550 std::cout <<
"==> Time wrt to SOR [s]:" << tinrun <<
" time intervale[s]:" <<
tt << std::endl;
554 double_t rMB = (
s1->lmBefore -
s0->lmBefore) /
tt;
555 double_t rMA = (
s1->lmAfter -
s0->lmAfter) /
tt;
556 double_t r0B = (
s1->l0Before -
s0->l0Before) /
tt;
557 double_t r0A = (
s1->l0After -
s0->l0After) /
tt;
558 double_t r1B = (
s1->l1Before -
s0->l1Before) /
tt;
559 double_t r1A = (
s1->l1After -
s0->l1After) /
tt;
560 std::cout <<
"Class:" <<
s0->classIndex <<
": ";
561 std::cout << rMB <<
" " << rMA <<
" ";
562 std::cout << r0B <<
" " << r0A <<
" ";
563 std::cout << r1B <<
" " << r1A;
564 std::cout << std::endl;
572 if (mScalerRecordO2.size() == 0) {
573 LOG(info) <<
"ScalerRecord is empty, doing nothing";
576 double_t time0 = mScalerRecordO2[0].epochTime;
577 double_t timeL = mScalerRecordO2[mScalerRecordO2.size() - 1].epochTime;
578 LOG(info) <<
"Scaler Integrals for run:" << mRunNumber <<
" duration:" << timeL - time0;
580 for (
uint32_t i = 0;
i < mScalerRecordO2[0].scalers.size();
i++) {
581 std::cout <<
i <<
" LMB " << mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].lmBefore - mScalerRecordO2[0].scalers[
i].lmBefore << std::endl;
582 std::cout <<
i <<
" LMA " << mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].lmAfter - mScalerRecordO2[0].scalers[
i].lmAfter << std::endl;
583 std::cout <<
i <<
" L0B " << mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].l0Before - mScalerRecordO2[0].scalers[
i].l0Before << std::endl;
584 std::cout <<
i <<
" L0A " << mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].l0After - mScalerRecordO2[0].scalers[
i].l0After << std::endl;
585 std::cout <<
i <<
" L1B " << mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].l1Before - mScalerRecordO2[0].scalers[
i].l1Before << std::endl;
586 std::cout <<
i <<
" L1A " << mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].l1After - mScalerRecordO2[0].scalers[
i].l1After << std::endl;
594 if (mScalerRecordO2.size() == 0) {
595 LOG(info) <<
"ScalerRecord is empty, doing nothing";
598 double_t time0 = mScalerRecordO2[0].epochTime;
599 double_t timeL = mScalerRecordO2[mScalerRecordO2.size() - 1].epochTime;
600 int integral = mScalerRecordO2[mScalerRecordO2.size() - 1].scalersInps[inp - 1] - mScalerRecordO2[0].scalersInps[inp - 1];
601 std::cout <<
"Scaler Integrals for run:" << mRunNumber <<
" duration:" << timeL - time0;
602 std::cout <<
" Input " << inp <<
" integral:" << integral <<
" rate:" << integral / (timeL - time0) << std::endl;
609 if (mScalerRecordO2.size() == 0) {
610 LOG(info) <<
"ScalerRecord is empty, doing nothing";
613 double_t time0 = mScalerRecordO2[0].epochTime;
614 double_t timeL = mScalerRecordO2[mScalerRecordO2.size() - 1].epochTime;
616 if (iscalerindex != 255) {
617 int integral = mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[iscalerindex].lmBefore - mScalerRecordO2[0].scalers[iscalerindex].lmBefore;
618 std::cout <<
"Scaler Integrals for run:" << mRunNumber <<
" duration:" << timeL - time0;
619 std::cout <<
" Class index" << iclsindex <<
" integral:" << integral <<
" rate:" << integral / (timeL - time0) << std::endl;
629 if (mScalerRecordO2.size() == 0) {
630 LOG(info) <<
"ScalerRecord is empty, doing nothing";
633 double_t time0 = mScalerRecordO2[0].epochTime;
634 double_t timeL = mScalerRecordO2[mScalerRecordO2.size() - 1].epochTime;
636 int integral = mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[iclsscalerindex - 1].lmBefore - mScalerRecordO2[0].scalers[iclsscalerindex - 1].lmBefore;
637 std::cout <<
"Scaler Integrals for run:" << mRunNumber <<
" duration:" << timeL - time0;
638 std::cout <<
" Class scaler index:" << iclsscalerindex <<
" integral:" << integral <<
" rate:" << integral / (timeL - time0) << std::endl;
645 for (
uint32_t i = 1;
i < mScalerRecordO2.size();
i++) {
646 auto prev = &mScalerRecordO2[
i - 1];
647 auto curr = &mScalerRecordO2[
i];
648 double_t
tt = (double_t)(curr->intRecord.orbit - prev->intRecord.orbit);
649 tt =
tt * o2::constants::lhc::LHCOrbitMUS * 1.e-6;
651 for (
int j = 0;
j < 1;
j++) {
652 auto s0 = &(prev->scalers[
j]);
653 auto s1 = &(curr->scalers[
j]);
654 double_t rMB = (
s1->lmBefore -
s0->lmBefore) /
tt;
655 auto delta = curr->epochTime - prev->epochTime;
656 double rMB2 = (
s1->lmBefore -
s0->lmBefore) / delta;
657 std::cout <<
"Class " <<
j <<
" " << (
unsigned long long)(prev->epochTime) <<
" " << (
unsigned long long)(curr->epochTime) <<
" DeltaTime " << delta <<
" tt " <<
tt <<
" interactions / s " << rMB <<
" in Hz " << rMB2 <<
"\n";
665 const auto s0 = mScalerRecordO2[0].scalers[classindex];
666 const auto s1 = mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[classindex];
669 return (
s1.lmBefore -
s0.lmBefore);
671 return (
s1.lmAfter -
s0.lmAfter);
673 return (
s1.l0Before -
s0.l0Before);
675 return (
s1.l0After -
s0.l0After);
677 return (
s1.l1Before -
s0.l1Before);
679 return (
s1.l1After -
s0.l1After);
684 }
else if (
type == 7) {
685 auto s0 = mScalerRecordO2[0].scalersInps[classindex];
686 auto s1 = mScalerRecordO2[mScalerRecordO2.size() - 1].scalersInps[classindex];
696 std::vector<std::pair<double_t, double_t>> scals;
697 for (
int i = 0;
i < mScalerRecordO2.size() - 1;
i++) {
700 double_t timeDiff = (mScalerRecordO2[
i + 1].intRecord.orbit - mScalerRecordO2[
i].intRecord.orbit) * o2::constants::lhc::LHCOrbitMUS / 1.e6;
702 const auto s0 = mScalerRecordO2[
i].scalers[classindex];
703 const auto s1 = mScalerRecordO2[
i + 1].scalers[classindex];
705 diff =
s1.lmBefore -
s0.lmBefore;
706 }
else if (
type == 2) {
707 diff =
s1.lmAfter -
s0.lmAfter;
708 }
else if (
type == 3) {
709 diff =
s1.l0Before -
s0.l0Before;
710 }
else if (
type == 4) {
711 diff =
s1.l0After -
s0.l0After;
712 }
else if (
type == 5) {
713 diff =
s1.l1Before -
s0.l1Before;
714 }
else if (
type == 6) {
715 diff =
s1.l1After -
s0.l1After;
720 }
else if (
type == 7) {
721 auto s0 = mScalerRecordO2[
i].scalersInps[classindex];
722 auto s1 = mScalerRecordO2[
i + 1].scalersInps[classindex];
728 scals.emplace_back(std::pair<double_t, double_t>{diff, timeDiff});
738 if (mScalerRecordO2.size() <= 1) {
740 return std::make_pair(-1., -1.);
748 auto nextindex = std::distance(mScalerRecordO2.begin(), iter);
750 auto calcRate = [&](
auto index1,
auto index2) ->
double {
751 const auto& snext = mScalerRecordO2[index2];
752 const auto& sprev = mScalerRecordO2[index1];
753 auto timedelta = (snext.intRecord.orbit - sprev.intRecord.orbit) * o2::constants::lhc::LHCOrbitMUS * 1.e-6;
755 const auto&
s0 = sprev.scalers[classindex];
756 const auto&
s1 = snext.scalers[classindex];
759 return (
s1.lmBefore -
s0.lmBefore) / timedelta;
761 return (
s1.lmAfter -
s0.lmAfter) / timedelta;
763 return (
s1.l0Before -
s0.l0Before) / timedelta;
765 return (
s1.l0After -
s0.l0After) / timedelta;
767 return (
s1.l1Before -
s0.l1Before) / timedelta;
769 return (
s1.l1After -
s0.l1After) / timedelta;
774 }
else if (
type == 7) {
775 auto s0 = sprev.scalersInps[classindex];
776 auto s1 = snext.scalersInps[classindex];
777 return (
s1 -
s0) / timedelta;
784 if (nextindex == 0) {
787 LOG(info) <<
"query orbit " <<
orbit <<
" before first record; Just returning the global rate";
788 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), -1);
790 LOG(info) <<
"query orbit " <<
orbit <<
" before first record; Returning the first rate";
791 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), calcRate(0, 1));
793 }
else if (nextindex == mScalerRecordO2.size()) {
795 LOG(info) <<
"query orbit " <<
orbit <<
" after last record; Just returning the global rate";
796 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), -1);
798 LOG(info) <<
"query orbit " <<
orbit <<
" after last record; Returning the last rate";
799 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), calcRate(mScalerRecordO2.size() - 2, mScalerRecordO2.size() - 1));
802 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), calcRate(nextindex - 1, nextindex));
804 return std::make_pair(-1., -1.);
812 if (mScalerRecordO2.size() <= 1) {
814 return std::make_pair(-1., -1.);
821 auto iter = std::lower_bound(mScalerRecordO2.begin(), mScalerRecordO2.end(), timestamp, [&](
CTPScalerRecordO2 const&
a,
double value) { return a.epochTime <= value; });
825 auto nextindex = std::distance(mScalerRecordO2.begin(), iter);
827 auto calcRate = [&](
auto index1,
auto index2) ->
double {
828 const auto& snext = mScalerRecordO2[index2];
829 const auto& sprev = mScalerRecordO2[index1];
830 auto timedelta = (snext.intRecord.orbit - sprev.intRecord.orbit) * o2::constants::lhc::LHCOrbitMUS * 1.e-6;
833 const auto&
s0 = sprev.scalers[classindex];
834 const auto&
s1 = snext.scalers[classindex];
837 return (
s1.lmBefore -
s0.lmBefore) / timedelta;
839 return (
s1.lmAfter -
s0.lmAfter) / timedelta;
841 return (
s1.l0Before -
s0.l0Before) / timedelta;
843 return (
s1.l0After -
s0.l0After) / timedelta;
845 return (
s1.l1Before -
s0.l1Before) / timedelta;
847 return (
s1.l1After -
s0.l1After) / timedelta;
852 }
else if (
type == 7) {
854 auto s0 = sprev.scalersInps[classindex];
855 auto s1 = snext.scalersInps[classindex];
856 return (
s1 -
s0) / timedelta;
862 if (nextindex == 0) {
865 LOG(info) <<
"query timestamp " << (
long)timestamp <<
" before first record; Just returning the global rate";
866 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), -1);
868 LOG(info) <<
"query timestamp " << (
long)timestamp <<
" before first record; Returning the first rate";
869 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), calcRate(0, 1));
871 }
else if (nextindex == mScalerRecordO2.size()) {
873 LOG(info) <<
"query timestamp " << (
long)timestamp <<
" after last record; Just returning the global rate";
874 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), -1);
876 LOG(info) <<
"query timestamp " << (
long)timestamp <<
" after last record; Returning the last rate";
877 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), calcRate(mScalerRecordO2.size() - 2, mScalerRecordO2.size() - 1));
880 return std::make_pair( calcRate(0, mScalerRecordO2.size() - 1), calcRate(nextindex - 1, nextindex));
882 return std::make_pair(-1., -1.);
889 LOG(info) <<
"Subtracting from orbit " <<
offset;
890 for (
auto& screc : mScalerRecordRaw) {
897 screc.intRecord.orbit = orbitnew;
899 if (over != 0 && over != mScalerRecordRaw.size()) {
900 LOG(warning) <<
"Orbit overflow inside run. Run:" << mRunNumber;
906 "runn0",
"runn1",
"runn2",
"runn3",
"runn4",
"runn5",
"runn6",
"runn7",
"runn8",
"runn9",
"runn10",
"runn11",
"runn12",
"runn13",
"runn14",
"runn15",
"ltg1_ORB",
"ltg1_HB",
"ltg1_HBr",
"ltg1_HC",
"ltg1_PH",
"ltg1_PP",
"ltg1_CAL",
"ltg1_SOT",
"ltg1_EOT",
"ltg1_SOC",
"ltg1_EOC",
"ltg1_TF",
"ltg1_FERST",
"ltg1_RT",
"ltg1_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg1_GAP1",
"ltg1_GAP2",
"ltg1_TPC_sync",
"ltg1_TPC_rst",
"ltg1_TOF",
"ltg2_ORB",
"ltg2_HB",
"ltg2_HBr",
"ltg2_HC",
"ltg2_PH",
"ltg2_PP",
"ltg2_CAL",
"ltg2_SOT",
"ltg2_EOT",
"ltg2_SOC",
"ltg2_EOC",
"ltg2_TF",
"ltg2_FERST",
"ltg2_RT",
"ltg2_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg2_GAP1",
"ltg2_GAP2",
"ltg2_TPC_sync",
"ltg2_TPC_rst",
"ltg2_TOF",
"ltg3_ORB",
"ltg3_HB",
"ltg3_HBr",
"ltg3_HC",
"ltg3_PH",
"ltg3_PP",
"ltg3_CAL",
"ltg3_SOT",
"ltg3_EOT",
"ltg3_SOC",
"ltg3_EOC",
"ltg3_TF",
"ltg3_FERST",
"ltg3_RT",
"ltg3_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg3_GAP1",
"ltg3_GAP2",
"ltg3_TPC_sync",
"ltg3_TPC_rst",
"ltg3_TOF",
"ltg4_ORB",
"ltg4_HB",
"ltg4_HBr",
"ltg4_HC",
"ltg4_PH",
"ltg4_PP",
"ltg4_CAL",
"ltg4_SOT",
"ltg4_EOT",
"ltg4_SOC",
"ltg4_EOC",
"ltg4_TF",
"ltg4_FERST",
"ltg4_RT",
"ltg4_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg4_GAP1",
"ltg4_GAP2",
"ltg4_TPC_sync",
"ltg4_TPC_rst",
"ltg4_TOF",
"ltg5_ORB",
"ltg5_HB",
"ltg5_HBr",
"ltg5_HC",
"ltg5_PH",
"ltg5_PP",
"ltg5_CAL",
"ltg5_SOT",
"ltg5_EOT",
"ltg5_SOC",
"ltg5_EOC",
"ltg5_TF",
"ltg5_FERST",
"ltg5_RT",
"ltg5_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg5_GAP1",
"ltg5_GAP2",
"ltg5_TPC_sync",
"ltg5_TPC_rst",
"ltg5_TOF",
"ltg6_ORB",
"ltg6_HB",
"ltg6_HBr",
"ltg6_HC",
"ltg6_PH",
"ltg6_PP",
"ltg6_CAL",
"ltg6_SOT",
"ltg6_EOT",
"ltg6_SOC",
"ltg6_EOC",
"ltg6_TF",
"ltg6_FERST",
"ltg6_RT",
"ltg6_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg6_GAP1",
"ltg6_GAP2",
"ltg6_TPC_sync",
"ltg6_TPC_rst",
"ltg6_TOF",
"ltg7_ORB",
"ltg7_HB",
"ltg7_HBr",
"ltg7_HC",
"ltg7_PH",
"ltg7_PP",
"ltg7_CAL",
"ltg7_SOT",
"ltg7_EOT",
"ltg7_SOC",
"ltg7_EOC",
"ltg7_TF",
"ltg7_FERST",
"ltg7_RT",
"ltg7_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg7_GAP1",
"ltg7_GAP2",
"ltg7_TPC_sync",
"ltg7_TPC_rst",
"ltg7_TOF",
"ltg8_ORB",
"ltg8_HB",
"ltg8_HBr",
"ltg8_HC",
"ltg8_PH",
"ltg8_PP",
"ltg8_CAL",
"ltg8_SOT",
"ltg8_EOT",
"ltg8_SOC",
"ltg8_EOC",
"ltg8_TF",
"ltg8_FERST",
"ltg8_RT",
"ltg8_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg8_GAP1",
"ltg8_GAP2",
"ltg8_TPC_sync",
"ltg8_TPC_rst",
"ltg8_TOF",
"ltg9_ORB",
"ltg9_HB",
"ltg9_HBr",
"ltg9_HC",
"ltg9_PH",
"ltg9_PP",
"ltg9_CAL",
"ltg9_SOT",
"ltg9_EOT",
"ltg9_SOC",
"ltg9_EOC",
"ltg9_TF",
"ltg9_FERST",
"ltg9_RT",
"ltg9_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg9_GAP1",
"ltg9_GAP2",
"ltg9_TPC_sync",
"ltg9_TPC_rst",
"ltg9_TOF",
"ltg10_ORB",
"ltg10_HB",
"ltg10_HBr",
"ltg10_HC",
"ltg10_PH",
"ltg10_PP",
"ltg10_CAL",
"ltg10_SOT",
"ltg10_EOT",
"ltg10_SOC",
"ltg10_EOC",
"ltg10_TF",
"ltg10_FERST",
"ltg10_RT",
"ltg10_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg10_GAP1",
"ltg10_GAP2",
"ltg10_TPC_sync",
"ltg10_TPC_rst",
"ltg10_TOF",
"ltg11_ORB",
"ltg11_HB",
"ltg11_HBr",
"ltg11_HC",
"ltg11_PH",
"ltg11_PP",
"ltg11_CAL",
"ltg11_SOT",
"ltg11_EOT",
"ltg11_SOC",
"ltg11_EOC",
"ltg11_TF",
"ltg11_FERST",
"ltg11_RT",
"ltg11_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg11_GAP1",
"ltg11_GAP2",
"ltg11_TPC_sync",
"ltg11_TPC_rst",
"ltg11_TOF",
"ltg12_ORB",
"ltg12_HB",
"ltg12_HBr",
"ltg12_HC",
"ltg12_PH",
"ltg12_PP",
"ltg12_CAL",
"ltg12_SOT",
"ltg12_EOT",
"ltg12_SOC",
"ltg12_EOC",
"ltg12_TF",
"ltg12_FERST",
"ltg12_RT",
"ltg12_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg12_GAP1",
"ltg12_GAP2",
"ltg12_TPC_sync",
"ltg12_TPC_rst",
"ltg12_TOF",
"ltg13_ORB",
"ltg13_HB",
"ltg13_HBr",
"ltg13_HC",
"ltg13_PH",
"ltg13_PP",
"ltg13_CAL",
"ltg13_SOT",
"ltg13_EOT",
"ltg13_SOC",
"ltg13_EOC",
"ltg13_TF",
"ltg13_FERST",
"ltg13_RT",
"ltg13_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg13_GAP1",
"ltg13_GAP2",
"ltg13_TPC_sync",
"ltg13_TPC_rst",
"ltg13_TOF",
"ltg14_ORB",
"ltg14_HB",
"ltg14_HBr",
"ltg14_HC",
"ltg14_PH",
"ltg14_PP",
"ltg14_CAL",
"ltg14_SOT",
"ltg14_EOT",
"ltg14_SOC",
"ltg14_EOC",
"ltg14_TF",
"ltg14_FERST",
"ltg14_RT",
"ltg14_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg14_GAP1",
"ltg14_GAP2",
"ltg14_TPC_sync",
"ltg14_TPC_rst",
"ltg14_TOF",
"ltg15_ORB",
"ltg15_HB",
"ltg15_HBr",
"ltg15_HC",
"ltg15_PH",
"ltg15_PP",
"ltg15_CAL",
"ltg15_SOT",
"ltg15_EOT",
"ltg15_SOC",
"ltg15_EOC",
"ltg15_TF",
"ltg15_FERST",
"ltg15_RT",
"ltg15_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg15_GAP1",
"ltg15_GAP2",
"ltg15_TPC_sync",
"ltg15_TPC_rst",
"ltg15_TOF",
"ltg16_ORB",
"ltg16_HB",
"ltg16_HBr",
"ltg16_HC",
"ltg16_PH",
"ltg16_PP",
"ltg16_CAL",
"ltg16_SOT",
"ltg16_EOT",
"ltg16_SOC",
"ltg16_EOC",
"ltg16_TF",
"ltg16_FERST",
"ltg16_RT",
"ltg16_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg16_GAP1",
"ltg16_GAP2",
"ltg16_TPC_sync",
"ltg16_TPC_rst",
"ltg16_TOF",
"ltg17_ORB",
"ltg17_HB",
"ltg17_HBr",
"ltg17_HC",
"ltg17_PH",
"ltg17_PP",
"ltg17_CAL",
"ltg17_SOT",
"ltg17_EOT",
"ltg17_SOC",
"ltg17_EOC",
"ltg17_TF",
"ltg17_FERST",
"ltg17_RT",
"ltg17_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg17_GAP1",
"ltg17_GAP2",
"ltg17_TPC_sync",
"ltg17_TPC_rst",
"ltg17_TOF",
"ltg18_ORB",
"ltg18_HB",
"ltg18_HBr",
"ltg18_HC",
"ltg18_PH",
"ltg18_PP",
"ltg18_CAL",
"ltg18_SOT",
"ltg18_EOT",
"ltg18_SOC",
"ltg18_EOC",
"ltg18_TF",
"ltg18_FERST",
"ltg18_RT",
"ltg18_RS",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ltg18_GAP1",
"ltg18_GAP2",
"ltg18_TPC_sync",
"ltg18_TPC_rst",
"ltg18_TOF",
"bc40",
"clk240",
"extorb",
"PLSRin",
"FastLMin",
"BUSYin",
"SPAREin",
"inp1",
"inp2",
"inp3",
"inp4",
"inp5",
"inp6",
"inp7",
"inp8",
"inp9",
"inp10",
"inp11",
"inp12",
"inp13",
"inp14",
"inp15",
"inp16",
"inp17",
"inp18",
"inp19",
"inp20",
"inp21",
"inp22",
"inp23",
"inp24",
"inp25",
"inp26",
"inp27",
"inp28",
"inp29",
"inp30",
"inp31",
"inp32",
"inp33",
"inp34",
"inp35",
"inp36",
"inp37",
"inp38",
"inp39",
"inp40",
"inp41",
"inp42",
"inp43",
"inp44",
"inp45",
"inp46",
"inp47",
"inp48",
"clamb1",
"clamb2",
"clamb3",
"clamb4",
"clamb5",
"clamb6",
"clamb7",
"clamb8",
"clamb9",
"clamb10",
"clamb11",
"clamb12",
"clamb13",
"clamb14",
"clamb15",
"clamb16",
"clamb17",
"clamb18",
"clamb19",
"clamb20",
"clamb21",
"clamb22",
"clamb23",
"clamb24",
"clamb25",
"clamb26",
"clamb27",
"clamb28",
"clamb29",
"clamb30",
"clamb31",
"clamb32",
"clamb33",
"clamb34",
"clamb35",
"clamb36",
"clamb37",
"clamb38",
"clamb39",
"clamb40",
"clamb41",
"clamb42",
"clamb43",
"clamb44",
"clamb45",
"clamb46",
"clamb47",
"clamb48",
"clamb49",
"clamb50",
"clamb51",
"clamb52",
"clamb53",
"clamb54",
"clamb55",
"clamb56",
"clamb57",
"clamb58",
"clamb59",
"clamb60",
"clamb61",
"clamb62",
"clamb63",
"clamb64",
"clama1",
"clama2",
"clama3",
"clama4",
"clama5",
"clama6",
"clama7",
"clama8",
"clama9",
"clama10",
"clama11",
"clama12",
"clama13",
"clama14",
"clama15",
"clama16",
"clama17",
"clama18",
"clama19",
"clama20",
"clama21",
"clama22",
"clama23",
"clama24",
"clama25",
"clama26",
"clama27",
"clama28",
"clama29",
"clama30",
"clama31",
"clama32",
"clama33",
"clama34",
"clama35",
"clama36",
"clama37",
"clama38",
"clama39",
"clama40",
"clama41",
"clama42",
"clama43",
"clama44",
"clama45",
"clama46",
"clama47",
"clama48",
"clama49",
"clama50",
"clama51",
"clama52",
"clama53",
"clama54",
"clama55",
"clama56",
"clama57",
"clama58",
"clama59",
"clama60",
"clama61",
"clama62",
"clama63",
"clama64",
"cla0b1",
"cla0b2",
"cla0b3",
"cla0b4",
"cla0b5",
"cla0b6",
"cla0b7",
"cla0b8",
"cla0b9",
"cla0b10",
"cla0b11",
"cla0b12",
"cla0b13",
"cla0b14",
"cla0b15",
"cla0b16",
"cla0b17",
"cla0b18",
"cla0b19",
"cla0b20",
"cla0b21",
"cla0b22",
"cla0b23",
"cla0b24",
"cla0b25",
"cla0b26",
"cla0b27",
"cla0b28",
"cla0b29",
"cla0b30",
"cla0b31",
"cla0b32",
"cla0b33",
"cla0b34",
"cla0b35",
"cla0b36",
"cla0b37",
"cla0b38",
"cla0b39",
"cla0b40",
"cla0b41",
"cla0b42",
"cla0b43",
"cla0b44",
"cla0b45",
"cla0b46",
"cla0b47",
"cla0b48",
"cla0b49",
"cla0b50",
"cla0b51",
"cla0b52",
"cla0b53",
"cla0b54",
"cla0b55",
"cla0b56",
"cla0b57",
"cla0b58",
"cla0b59",
"cla0b60",
"cla0b61",
"cla0b62",
"cla0b63",
"cla0b64",
"cla0a1",
"cla0a2",
"cla0a3",
"cla0a4",
"cla0a5",
"cla0a6",
"cla0a7",
"cla0a8",
"cla0a9",
"cla0a10",
"cla0a11",
"cla0a12",
"cla0a13",
"cla0a14",
"cla0a15",
"cla0a16",
"cla0a17",
"cla0a18",
"cla0a19",
"cla0a20",
"cla0a21",
"cla0a22",
"cla0a23",
"cla0a24",
"cla0a25",
"cla0a26",
"cla0a27",
"cla0a28",
"cla0a29",
"cla0a30",
"cla0a31",
"cla0a32",
"cla0a33",
"cla0a34",
"cla0a35",
"cla0a36",
"cla0a37",
"cla0a38",
"cla0a39",
"cla0a40",
"cla0a41",
"cla0a42",
"cla0a43",
"cla0a44",
"cla0a45",
"cla0a46",
"cla0a47",
"cla0a48",
"cla0a49",
"cla0a50",
"cla0a51",
"cla0a52",
"cla0a53",
"cla0a54",
"cla0a55",
"cla0a56",
"cla0a57",
"cla0a58",
"cla0a59",
"cla0a60",
"cla0a61",
"cla0a62",
"cla0a63",
"cla0a64",
"cla1b1",
"cla1b2",
"cla1b3",
"cla1b4",
"cla1b5",
"cla1b6",
"cla1b7",
"cla1b8",
"cla1b9",
"cla1b10",
"cla1b11",
"cla1b12",
"cla1b13",
"cla1b14",
"cla1b15",
"cla1b16",
"cla1b17",
"cla1b18",
"cla1b19",
"cla1b20",
"cla1b21",
"cla1b22",
"cla1b23",
"cla1b24",
"cla1b25",
"cla1b26",
"cla1b27",
"cla1b28",
"cla1b29",
"cla1b30",
"cla1b31",
"cla1b32",
"cla1b33",
"cla1b34",
"cla1b35",
"cla1b36",
"cla1b37",
"cla1b38",
"cla1b39",
"cla1b40",
"cla1b41",
"cla1b42",
"cla1b43",
"cla1b44",
"cla1b45",
"cla1b46",
"cla1b47",
"cla1b48",
"cla1b49",
"cla1b50",
"cla1b51",
"cla1b52",
"cla1b53",
"cla1b54",
"cla1b55",
"cla1b56",
"cla1b57",
"cla1b58",
"cla1b59",
"cla1b60",
"cla1b61",
"cla1b62",
"cla1b63",
"cla1b64",
"cla1a1",
"cla1a2",
"cla1a3",
"cla1a4",
"cla1a5",
"cla1a6",
"cla1a7",
"cla1a8",
"cla1a9",
"cla1a10",
"cla1a11",
"cla1a12",
"cla1a13",
"cla1a14",
"cla1a15",
"cla1a16",
"cla1a17",
"cla1a18",
"cla1a19",
"cla1a20",
"cla1a21",
"cla1a22",
"cla1a23",
"cla1a24",
"cla1a25",
"cla1a26",
"cla1a27",
"cla1a28",
"cla1a29",
"cla1a30",
"cla1a31",
"cla1a32",
"cla1a33",
"cla1a34",
"cla1a35",
"cla1a36",
"cla1a37",
"cla1a38",
"cla1a39",
"cla1a40",
"cla1a41",
"cla1a42",
"cla1a43",
"cla1a44",
"cla1a45",
"cla1a46",
"cla1a47",
"cla1a48",
"cla1a49",
"cla1a50",
"cla1a51",
"cla1a52",
"cla1a53",
"cla1a54",
"cla1a55",
"cla1a56",
"cla1a57",
"cla1a58",
"cla1a59",
"cla1a60",
"cla1a61",
"cla1a62",
"cla1a63",
"cla1a64",
"l0_trigger",
"l1_trigger",
"l2_trigger",
"clum1",
"clum2",
"clum3",
"clum4",
"clum5",
"clum6",
"clu01",
"clu02",
"clu03",
"clu04",
"clu05",
"clu06",
"clu11",
"clu12",
"clu13",
"clu14",
"clu15",
"clu16",
907 "ltg1_busy",
"ltg2_busy",
"ltg3_busy",
"ltg4_busy",
"ltg5_busy",
"ltg6_busy",
"ltg7_busy",
"ltg8_busy",
"ltg9_busy",
908 "ltg10_busy",
"ltg11_busy",
"ltg12_busy",
"ltg13_busy",
"ltg14_busy",
"ltg15_busy",
"ltg16_busy",
"ltg17_busy",
"ltg18_busy",
"orbitid",
"clum7",
"clum8",
"clu07",
"clu08",
"clu17",
"clu18",
"clu_busy1",
"clu_busy2",
"clu_busy3",
"clu_busy4",
"clu_busy5",
"clu_busy6",
"clu_busy7",
"clu_busy8"};
o2::raw::RawFileWriter * raw
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
char error[CURL_ERROR_SIZE]
Header to collect LHC related constants.
definition of CTPScalerRaw, CTPScalerO2
int printClassBRateAndIntegral(int iclsinscalers)
std::vector< uint32_t > getClassIndexes() const
int printClassBRateAndIntegralII(int icls)
uint64_t getLumiNoPuCorr(int classindex, int type) const
retrieves integral - same interface as getRate, no pileup correction
int readScalers(const std::string &rawscalers)
void printClasses(std::ostream &stream) const
void printLMBRateVsT() const
int printInputRateAndIntegral(int inp)
static std::vector< std::string > scalerNames
std::pair< double, double > getRate(uint32_t orbit, int classindex, int type, bool qc=0) const
std::pair< double, double > getRateGivenT(double timestamp, int classindex, int type, bool qc=0) const
same with absolute timestamp (not orbit) as argument
void printO2(std::ostream &stream) const
int checkConsistency(const CTPScalerO2 &scal0, const CTPScalerO2 &scal1, errorCounters &eCnts) const
void printStream(std::ostream &stream) const
int addOrbitOffset(uint32_t offset)
int getScalerIndexForClass(uint32_t cls) const
std::vector< std::pair< double_t, double_t > > getRatesForIndex(int classindex, int type) const
retrieves vector of counters - same interface as getRate, needed for
void printFromZero(std::ostream &stream) const
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLsizei const GLfloat * value
GLint GLint GLsizei GLint GLenum GLenum type
GLboolean GLboolean GLboolean GLboolean a
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s0
uint16_t bc
bunch crossing ID of interaction
Scalers produced from raw scalers corrected for overflow.
void printFromZero(std::ostream &stream, CTPScalerO2 &scaler0) const
void createCTPScalerO2FromRaw(const CTPScalerRaw &raw, const std::array< uint32_t, 6 > &overfow)
void printStream(std::ostream &stream) const
void printStream(std::ostream &stream) const
o2::InteractionRecord intRecord
std::vector< uint64_t > scalersInps
std::vector< CTPScalerO2 > scalers
void printFromZero(std::ostream &stream, CTPScalerRecordO2 &record0) const
void printStream(std::ostream &stream) const
std::vector< CTPScalerRaw > scalers
void printStream(std::ostream &stream) const
o2::InteractionRecord intRecord
std::vector< uint32_t > scalersInps
void printStream(std::ostream &stream) const
static void trim(std::string &s)
static std::vector< std::string > tokenize(const std::string &src, char delim, bool trimToken=true, bool skipEmpty=true)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"