ATLAS Offline Software
Loading...
Searching...
No Matches
StgcStripCalculator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONNSWASBUILT_STGCSTRIPCALCULATOR_H
6#define MUONNSWASBUILT_STGCSTRIPCALCULATOR_H
7
8#include <vector>
9#include <unordered_map>
10#include <functional>
11#include <memory>
12
17
18namespace NswAsBuilt {
19
32 public:
34
38 enum class IsValid {
41 };
42
47 struct stgcStrip_t {
49 Amg::Vector3D center{Amg::Vector3D::Zero()};
50 Amg::Vector3D left{Amg::Vector3D::Zero()};
51 Amg::Vector3D right{Amg::Vector3D::Zero()};
52 };
53
60 stgcStrip_t getStgcStrip(ParameterClass iclass, stripIdentifier_t strip_id) const;
61
67 struct position_t {
69 Amg::Vector3D pos{Amg::Vector3D::Zero()};
70 };
71
78 position_t getPositionAlongStgcStrip(ParameterClass iclass, stripIdentifier_t strip_id, double sx, double sy) const;
79
84 void parseJSON(const std::string& in);
85
86 private:
87 std::vector<std::unique_ptr<Element>> m_rootElements;
88 std::unordered_map<pcbIdentifier_t, CathodeBoardElement> m_pcbMap;
89
90 // Follow JSON parsing helper methods
91 struct json_t; // wraps a nlhohman::json in a pimpl struct to hide dependency
92 // Parse the JSON ROOT element
94 // Build a NswAsBuilt::Element, following description in JSON
95 std::unique_ptr<Element> buildElement(json_t j) const;
96 // Parse a quadruplet identifier in JSON
98 // Parse a PCB identidier in JSON
100 // Parse the strip information attached to an element
101 void collectStrip(quadrupletIdentifier_t quad_id, Element& element, json_t j);
102 // Parse the strip configuration parameters in JSON
104
105 };
106}
107
108#endif
109
Element: a node in a hierarchy of alignment frames.
Definition Element.h:52
The main interface of the NswAsBuilt package: determines strip positions in the frame of the quadrupl...
CathodeBoardElement::stgcStripConfiguration_t getStgcStripConfiguration(json_t j) const
void parseJSON(const std::string &in)
Parses a std::istream with JSON-formatted configuration of the as-built parameters.
void collectStrip(quadrupletIdentifier_t quad_id, Element &element, json_t j)
quadrupletIdentifier_t getQuadrupletIdentifier(json_t j) const
Element::ParameterClass ParameterClass
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...
IsValid
VALID: strip is found, INVALID: strip is not found.
std::unordered_map< pcbIdentifier_t, CathodeBoardElement > m_pcbMap
std::vector< std::unique_ptr< Element > > m_rootElements
pcbIdentifier_t getPcbIdentifier(quadrupletIdentifier_t quad_id, json_t j) const
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.
std::unique_ptr< Element > buildElement(json_t j) const
Eigen::Matrix< double, 3, 1 > Vector3D
The return object for querying strip positions with the method getPositionAlongStrip: a single point ...
The return object for querying strip positions: three points along the strip are provided,...