-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathUploadDummyAlignment.C
More file actions
33 lines (30 loc) · 1.25 KB
/
UploadDummyAlignment.C
File metadata and controls
33 lines (30 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#if !defined(__CLING__) || defined(__ROOTCLING__)
//#define ENABLE_UPGRADES
#include "DetectorsCommonDataFormats/DetID.h"
#include "DetectorsCommonDataFormats/DetectorNameConf.h"
#include "DetectorsCommonDataFormats/AlignParam.h"
#include "CCDB/CcdbApi.h"
#include "Framework/Logger.h"
#include <vector>
#include <fmt/format.h>
#endif
using DetID = o2::detectors::DetID;
// upload dummy alignment objects to CCDB
void UploadDummyAlignment(const std::string& ccdbHost = "http://ccdb-test.cern.ch:8080", long tmin = 0, long tmax = -1, DetID::mask_t msk = DetID::FullMask)
{
DetID::mask_t dets = msk & DetID::FullMask & (~DetID::getMask(DetID::CTP));
LOG(info) << "Mask = " << dets;
o2::ccdb::CcdbApi api;
api.init(ccdbHost.c_str()); // or http://localhost:8080 for a local installation
std::vector<o2::detectors::AlignParam> params;
for (auto id = DetID::First; id <= DetID::Last; id++) {
if (!dets[id]) {
continue;
}
map<string, string> metadata; // can be empty
DetID det(id);
metadata["comment"] = fmt::format("Empty alignment object for {}", det.getName());
api.storeAsTFileAny(¶ms, o2::base::DetectorNameConf::getAlignmentPath(det), metadata, tmin, tmax);
LOG(info) << "Uploaded dummy alignment for " << det.getName();
}
}