Skip to content

Commit 3cbed2e

Browse files
committed
Add GRPLHCIF to AggregatedRunInfo
1 parent 5313031 commit 3cbed2e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

DataFormats/Parameters/include/DataFormatsParameters/AggregatedRunInfo.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ namespace o2::parameters
2323
{
2424

2525
class GRPECSObject;
26+
class GRPLHCIFData;
2627

2728
/// Composite struct where one may collect important global properties of data "runs"
2829
/// aggregated from various sources (GRPECS, RunInformation CCDB entries, etc.).
@@ -39,8 +40,9 @@ struct AggregatedRunInfo {
3940

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

43-
static AggregatedRunInfo buildAggregatedRunInfo(int runnumber, long sorMS, long eorMS, long orbitResetMUS, const o2::parameters::GRPECSObject* grpecs, const std::vector<Long64_t>* ctfFirstRunOrbitVec);
45+
static AggregatedRunInfo buildAggregatedRunInfo(int runnumber, long sorMS, long eorMS, long orbitResetMUS, const o2::parameters::GRPECSObject* grpecs, const std::vector<Long64_t>* ctfFirstRunOrbitVec, const o2::parameters::GRPLHCIFData* grplhcif = nullptr);
4446

4547
// fills and returns AggregatedRunInfo for a given data run number.
4648
static AggregatedRunInfo buildAggregatedRunInfo_DATA(o2::ccdb::CCDBManagerInstance& ccdb, int runnumber);

DataFormats/Parameters/src/AggregatedRunInfo.cxx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "DataFormatsParameters/AggregatedRunInfo.h"
1616
#include "CCDB/BasicCCDBManager.h"
1717
#include "DataFormatsParameters/GRPECSObject.h"
18+
#include "DataFormatsParameters/GRPLHCIFData.h"
1819
#include "CommonConstants/LHCConstants.h"
1920
#include "Framework/Logger.h"
2021
#include <map>
@@ -42,14 +43,15 @@ o2::parameters::AggregatedRunInfo AggregatedRunInfo::buildAggregatedRunInfo_DATA
4243
std::map<std::string, std::string> metadata;
4344
metadata["runNumber"] = Form("%d", runnumber);
4445
auto grpecs = ccdb.getSpecific<o2::parameters::GRPECSObject>("GLO/Config/GRPECS", run_mid_timestamp, metadata);
46+
auto grplhcif = ccdb.getSpecific<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", run_mid_timestamp); // no run metadata here
4547
bool oldFatalState = ccdb.getFatalWhenNull();
4648
ccdb.setFatalWhenNull(false);
4749
auto ctp_first_run_orbit = ccdb.getForTimeStamp<std::vector<Long64_t>>("CTP/Calib/FirstRunOrbit", run_mid_timestamp);
4850
ccdb.setFatalWhenNull(oldFatalState);
49-
return buildAggregatedRunInfo(runnumber, sor, eor, tsOrbitReset, grpecs, ctp_first_run_orbit);
51+
return buildAggregatedRunInfo(runnumber, sor, eor, tsOrbitReset, grpecs, ctp_first_run_orbit, grplhcif);
5052
}
5153

52-
o2::parameters::AggregatedRunInfo AggregatedRunInfo::buildAggregatedRunInfo(int runnumber, long sorMS, long eorMS, long orbitResetMUS, const o2::parameters::GRPECSObject* grpecs, const std::vector<Long64_t>* ctfFirstRunOrbitVec)
54+
o2::parameters::AggregatedRunInfo AggregatedRunInfo::buildAggregatedRunInfo(int runnumber, long sorMS, long eorMS, long orbitResetMUS, const o2::parameters::GRPECSObject* grpecs, const std::vector<Long64_t>* ctfFirstRunOrbitVec, const o2::parameters::GRPLHCIFData* grplhcif)
5355
{
5456
auto nOrbitsPerTF = grpecs->getNHBFPerTF();
5557
// calculate SOR/EOR orbits
@@ -81,7 +83,7 @@ o2::parameters::AggregatedRunInfo AggregatedRunInfo::buildAggregatedRunInfo(int
8183
orbitSOR = (orbitSOR / nOrbitsPerTF + 1) * nOrbitsPerTF;
8284
}
8385
}
84-
return AggregatedRunInfo{runnumber, sorMS, eorMS, nOrbitsPerTF, orbitResetMUS, orbitSOR, orbitEOR, grpecs};
86+
return AggregatedRunInfo{runnumber, sorMS, eorMS, nOrbitsPerTF, orbitResetMUS, orbitSOR, orbitEOR, grpecs, grplhcif};
8587
}
8688

8789
namespace

0 commit comments

Comments
 (0)