Skip to content

Commit 1615b1d

Browse files
sawenzelalcaliva
authored andcommitted
Ship GRPECS as part of AggregatedRunInfo; cleanup
* provide also the GRPECS as part of the struct * use CTP info only when run number is consistent (cherry picked from commit e924004)
1 parent ec0fb2b commit 1615b1d

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

DataFormats/Parameters/include/DataFormatsParameters/AggregatedRunInfo.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
namespace o2::parameters
2323
{
2424

25+
class GRPECSObject;
26+
2527
/// Composite struct where one may collect important global properties of data "runs"
2628
/// aggregated from various sources (GRPECS, RunInformation CCDB entries, etc.).
2729
/// Also offers the authoritative algorithms to collect these information for easy reuse
@@ -36,6 +38,7 @@ struct AggregatedRunInfo {
3638
int64_t orbitEOR; // orbit when run ends after orbit reset
3739

3840
// we may have pointers to actual data source objects GRPECS, ...
41+
o2::parameters::GRPECSObject* grpECS = nullptr; // pointer to GRPECSobject (fetched during struct building)
3942

4043
// fills and returns AggregatedRunInfo for a given run number.
4144
static AggregatedRunInfo buildAggregatedRunInfo(o2::ccdb::CCDBManagerInstance& ccdb, int runnumber);

DataFormats/Parameters/src/AggregatedRunInfo.cxx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,25 @@ o2::parameters::AggregatedRunInfo AggregatedRunInfo::buildAggregatedRunInfo(o2::
6363
int64_t ctp_run_number = (*ctp_first_run_orbit)[1];
6464
int64_t ctp_orbitSOR = (*ctp_first_run_orbit)[2];
6565

66-
if (ctp_run_number != runnumber) {
67-
LOG(error) << "AggregatedRunInfo: run number inconsistency found (asked: " << runnumber << " vs CTP found: " << ctp_run_number << ")";
68-
}
69-
70-
// overwrite orbitSOR
71-
if (ctp_orbitSOR != orbitSOR) {
72-
LOG(warn) << "The calculated orbitSOR " << orbitSOR << " differs from CTP orbitSOR " << ctp_orbitSOR;
73-
// reasons for this is different unit of time storage in RunInformation (ms) and orbitReset (us), etc.
74-
75-
// so we need to adjust the SOR timings to be consistent
76-
auto sor_new = (int64_t)((tsOrbitReset + ctp_orbitSOR * o2::constants::lhc::LHCOrbitMUS) / 1000.);
77-
if (sor_new != sor) {
78-
LOG(warn) << "Adjusting SOR from " << sor << " to " << sor_new;
79-
sor = sor_new;
66+
if (ctp_run_number == runnumber) {
67+
// overwrite orbitSOR
68+
if (ctp_orbitSOR != orbitSOR) {
69+
LOG(warn) << "The calculated orbitSOR " << orbitSOR << " differs from CTP orbitSOR " << ctp_orbitSOR;
70+
// reasons for this is different unit of time storage in RunInformation (ms) and orbitReset (us), etc.
71+
72+
// so we need to adjust the SOR timings to be consistent
73+
auto sor_new = (int64_t)((tsOrbitReset + ctp_orbitSOR * o2::constants::lhc::LHCOrbitMUS) / 1000.);
74+
if (sor_new != sor) {
75+
LOG(warn) << "Adjusting SOR from " << sor << " to " << sor_new;
76+
sor = sor_new;
77+
}
8078
}
79+
orbitSOR = ctp_orbitSOR;
80+
} else {
81+
LOG(error) << "AggregatedRunInfo: run number inconsistency found (asked: " << runnumber << " vs CTP found: " << ctp_run_number << ")";
82+
LOG(error) << " ... not using CTP info";
8183
}
82-
orbitSOR = ctp_orbitSOR;
8384
}
8485

85-
return AggregatedRunInfo{runnumber, sor, eor, nOrbitsPerTF, tsOrbitReset, orbitSOR, orbitEOR};
86+
return AggregatedRunInfo{runnumber, sor, eor, nOrbitsPerTF, tsOrbitReset, orbitSOR, orbitEOR, grpecs};
8687
}

0 commit comments

Comments
 (0)