forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateCTPOrbitResetObject.C
More file actions
24 lines (21 loc) · 931 Bytes
/
Copy pathCreateCTPOrbitResetObject.C
File metadata and controls
24 lines (21 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#if !defined(__CLING__) || defined(__ROOTCLING__)
#include "CCDB/CcdbApi.h"
#include "Framework/Logger.h"
#include <array>
#endif
// create and upload orbit reset object to CCDB
constexpr Long64_t DummyTime = -1;
void CreateCTPOrbitResetObject(const std::string& ccdbHost = "http://ccdb-test.cern.ch:8080", long t = DummyTime, long tmin = 0, long tmax = -1)
{
if (t == DummyTime) {
t = std::chrono::time_point_cast<std::chrono::microseconds>(std::chrono::system_clock::now()).time_since_epoch().count();
}
std::vector<Long64_t> rt{t};
const std::string objName{"CTP/Calib/OrbitReset"};
o2::ccdb::CcdbApi api;
api.init(ccdbHost.c_str()); // or http://localhost:8080 for a local installation
map<string, string> metadata; // can be empty
metadata["comment"] = "CTP Orbit reset";
api.storeAsTFileAny(&rt, objName, metadata, tmin, tmax);
LOGP(info, "Uploaded CTP Oribt reset time {} to {}", t, objName);
}