Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
namespace o2::parameters
{

class GRPECSObject;

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

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

// fills and returns AggregatedRunInfo for a given run number.
static AggregatedRunInfo buildAggregatedRunInfo(o2::ccdb::CCDBManagerInstance& ccdb, int runnumber);
Expand Down
33 changes: 17 additions & 16 deletions DataFormats/Parameters/src/AggregatedRunInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,25 @@ o2::parameters::AggregatedRunInfo AggregatedRunInfo::buildAggregatedRunInfo(o2::
int64_t ctp_run_number = (*ctp_first_run_orbit)[1];
int64_t ctp_orbitSOR = (*ctp_first_run_orbit)[2];

if (ctp_run_number != runnumber) {
LOG(error) << "AggregatedRunInfo: run number inconsistency found (asked: " << runnumber << " vs CTP found: " << ctp_run_number << ")";
}

// overwrite orbitSOR
if (ctp_orbitSOR != orbitSOR) {
LOG(warn) << "The calculated orbitSOR " << orbitSOR << " differs from CTP orbitSOR " << ctp_orbitSOR;
// reasons for this is different unit of time storage in RunInformation (ms) and orbitReset (us), etc.

// so we need to adjust the SOR timings to be consistent
auto sor_new = (int64_t)((tsOrbitReset + ctp_orbitSOR * o2::constants::lhc::LHCOrbitMUS) / 1000.);
if (sor_new != sor) {
LOG(warn) << "Adjusting SOR from " << sor << " to " << sor_new;
sor = sor_new;
if (ctp_run_number == runnumber) {
// overwrite orbitSOR
if (ctp_orbitSOR != orbitSOR) {
LOG(warn) << "The calculated orbitSOR " << orbitSOR << " differs from CTP orbitSOR " << ctp_orbitSOR;
// reasons for this is different unit of time storage in RunInformation (ms) and orbitReset (us), etc.

// so we need to adjust the SOR timings to be consistent
auto sor_new = (int64_t)((tsOrbitReset + ctp_orbitSOR * o2::constants::lhc::LHCOrbitMUS) / 1000.);
if (sor_new != sor) {
LOG(warn) << "Adjusting SOR from " << sor << " to " << sor_new;
sor = sor_new;
}
}
orbitSOR = ctp_orbitSOR;
} else {
LOG(error) << "AggregatedRunInfo: run number inconsistency found (asked: " << runnumber << " vs CTP found: " << ctp_run_number << ")";
LOG(error) << " ... not using CTP info";
}
orbitSOR = ctp_orbitSOR;
}

return AggregatedRunInfo{runnumber, sor, eor, nOrbitsPerTF, tsOrbitReset, orbitSOR, orbitEOR};
return AggregatedRunInfo{runnumber, sor, eor, nOrbitsPerTF, tsOrbitReset, orbitSOR, orbitEOR, grpecs};
}