32 #include <type_traits>
37 #include <TCollection.h>
45 class VectorMultiTrajectory;
52 std::regex reg(
"^map_([0-9]+)-([0-9]+)-([0-9]+)_([xy]_.*)$");
55 if (std::regex_search(mapkey, matches, reg) && matches.size() == 5) {
56 size_t vol = std::stoull(matches[1].
str());
57 size_t lyr = std::stoull(matches[2].
str());
58 size_t mod = std::stoull(matches[3].
str());
67 return std::make_pair(geoId, var);
69 throw std::runtime_error(
"Invalid map key: " + mapkey);
73 std::map<Acts::GeometryIdentifier, ActsExamples::ScalingCalibrator::MapTuple>
75 std::map<Acts::GeometryIdentifier, ActsExamples::ScalingCalibrator::MapTuple>
78 TFile ifile(path.c_str(),
"READ");
79 if (ifile.IsZombie()) {
80 throw std::runtime_error(
"Unable to open TFile: " + path.string());
83 TList* lst = ifile.GetListOfKeys();
86 for (
auto it = lst->begin();
it != lst->end(); ++
it) {
87 TKey* key =
static_cast<TKey*
>(*it);
88 if (std::strcmp(key->GetClassName(),
"TH2D") == 0) {
94 if (var ==
"x_offset") {
95 maps[geoId].x_offset =
hist;
96 }
else if (var ==
"x_scale") {
97 maps[geoId].x_scale =
hist;
98 }
else if (var ==
"y_offset") {
99 maps[geoId].y_offset =
hist;
100 }
else if (var ==
"y_scale") {
101 maps[geoId].y_scale =
hist;
103 throw std::runtime_error(
"Unrecognized var: " + var);
111 TFile ifile(path.c_str(),
"READ");
112 if (ifile.IsZombie()) {
113 throw std::runtime_error(
"Unable to open TFile: " + path.string());
116 TString* tstr = ifile.Get<TString>(
"v_mask");
117 if (tstr ==
nullptr) {
118 throw std::runtime_error(
"Unable to read mask");
138 const IndexSourceLink& idxSourceLink = sourceLink.
get<IndexSourceLink>();
140 assert((idxSourceLink.index() < measurements.size()) and
141 "Source link index is outside the container bounds");
151 const Cluster& cl = clusters->at(idxSourceLink.index());
152 ConstantTuple ct = m_calib_maps.at(mgid).at(cl.sizeLoc0, cl.sizeLoc1);
155 [&](
const auto& meas) {
156 auto E = meas.expander();
157 auto P = meas.projector();
162 E * meas.covariance() *
E.transpose();
169 constexpr
size_t kSize =
171 std::array<Acts::BoundIndices, kSize> indices = meas.indices();
181 (measurements)[idxSourceLink.index()]);