|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include <nlohmann/json.hpp>
31 auto strip =
it->second.getStgcStrip(iclass, strip_id.
istrip);
50 for (
const json& jmodule : jroot.at(
"elementarray")) {
54 throw std::runtime_error(
e.what());
63 std::unique_ptr<ElementModel> deformation_model;
65 if (
model ==
"nodefo") {
66 deformation_model = std::make_unique<ElementModelRigid>();
68 else if (
model ==
"stgc") {
71 const auto& jc = j.
json.at(
"model_constant_pars");
72 jc.at(
"len_x").get_to(lenX);
73 jc.at(
"len_y").get_to(lenY);
74 jc.at(
"defo0_x").get_to(defo0[0]);
75 jc.at(
"defo0_y").get_to(defo0[1]);
76 jc.at(
"defo0_z").get_to(defo0[2]);
77 deformation_model = std::make_unique<ElementModelSTGC>(lenX, lenY, defo0);
80 throw std::runtime_error(
"Unknown model: "+
model);
84 std::unique_ptr<Element>
el = std::make_unique<Element>(std::move(deformation_model));
87 std::map<std::string, double> correctionPars, nominalPars;
88 j.
json.at(
"pars_corrected").get_to(correctionPars);
89 j.
json.at(
"pars_nominal").get_to(nominalPars);
105 throw std::runtime_error(
"StgcStripCalculator: stationName not implemented: "+
stationName);
121 double xpos, ypos, xpitch, ypitch;
122 j.at(
"pos").at(
"x").get_to(xpos);
123 j.at(
"pos").at(
"y").get_to(ypos);
124 j.at(
"pitch").at(
"x").get_to(xpitch);
125 j.at(
"pitch").at(
"y").get_to(ypitch);
143 if (j.
json.contains(
"strip_configuration") && j.
json.contains(
"identifier")) {
153 json::const_iterator
it;
154 json::const_iterator
end;
157 if (!j.
json.contains(
"identifier")) {
165 const std::string KEY =
"zdaughters";
168 std::list<tree_t> jtree;
169 jtree.push_back({j.
json.at(KEY).
begin(), j.
json.at(KEY).end()});
170 while (!jtree.empty()) {
171 auto&
it = jtree.back().it;
172 if (
it != jtree.back().end) {
175 Element* daugref =
mom->addDaughter(std::move(daughter));
176 if (
it->contains(KEY)) {
177 jtree.push_back({
it->at(KEY).
begin(),
it->at(KEY).end()});
The return object for querying strip positions with the method getPositionAlongStrip: a single point ...
quadrupletIdentifier_t quadruplet
stgcStripPoint_t fCenterPoint
std::vector< std::unique_ptr< Element > > m_rootElements
void parseJSON(const std::string &in)
Parses a std::istream with JSON-formatted configuration of the as-built parameters.
quadrupletIdentifier_t getQuadrupletIdentifier(json_t j) const
std::unordered_map< pcbIdentifier_t, CathodeBoardElement > m_pcbMap
stgcStripPoint_t sRightPoint
json_t(const nlohmann::json &j)
Helper class saving all the needed information to compute strips for a particular cathode board.
stgcStripPoint_t fLeftPoint
quadrupletIdentifier_t quadruplet
Athena indices of a MM strip.
Athena indices for a MM quadruplet:
std::unique_ptr< Element > buildElement(json_t j) const
stgcStripPoint_t sLeftPoint
position_t getPositionAlongStgcStrip(ParameterClass iclass, stripIdentifier_t strip_id, double sx, double sy) const
Returns a the position of a point along the strip, parameterized by s, in the coordinate system of th...
void collectStrip(quadrupletIdentifier_t quad_id, Element &element, json_t j)
stgcStripPoint_t sCenterPoint
stgcStripPoint_t lLeftPoint
void parseRootElement(json_t j)
pcbIdentifier_t getPcbIdentifier(quadrupletIdentifier_t quad_id, json_t j) const
CathodeBoardElement::stgcStripConfiguration_t getStgcStripConfiguration(json_t j) const
stgcStripPoint_t lRightPoint
stgcStrip_t getStgcStrip(ParameterClass iclass, stripIdentifier_t strip_id) const
Computes 3 reference points along a strip identified by strip_id, in coordinate system of quadruplet.
Eigen::Matrix< double, 3, 1 > Vector3D
The return object for querying strip positions: three points along the strip are provided,...
const nlohmann::json & json
stgcStripPoint_t fRightPoint
Element: a node in a hierarchy of alignment frames.
stgcStripPoint_t lCenterPoint