ATLAS Offline Software
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 
14 #include "MuonNSWAsBuilt/Element.h"
17 
18 namespace NswAsBuilt {
19 
32  public:
34 
38  enum class IsValid {
39  INVALID=0,
40  VALID=1
41  };
42 
47  struct stgcStrip_t {
52  };
53 
60  stgcStrip_t getStgcStrip(ParameterClass iclass, stripIdentifier_t strip_id) const;
61 
67  struct position_t {
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
93  void parseRootElement(json_t j);
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 
NswAsBuilt::StgcStripCalculator::json_t
Definition: StgcStripCalculator.cxx:17
fitman.sy
sy
Definition: fitman.py:524
NswAsBuilt::StgcStripCalculator::position_t
The return object for querying strip positions with the method getPositionAlongStrip: a single point ...
Definition: StgcStripCalculator.h:67
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t
Definition: CathodeBoardElement.h:38
NswAsBuilt::StgcStripCalculator::m_rootElements
std::vector< std::unique_ptr< Element > > m_rootElements
Definition: StgcStripCalculator.h:87
python.compressB64.sx
string sx
Definition: compressB64.py:96
NswAsBuilt::StgcStripCalculator::parseJSON
void parseJSON(const std::string &in)
Parses a std::istream with JSON-formatted configuration of the as-built parameters.
Definition: StgcStripCalculator.cxx:46
NswAsBuilt::StgcStripCalculator::getQuadrupletIdentifier
quadrupletIdentifier_t getQuadrupletIdentifier(json_t j) const
Definition: StgcStripCalculator.cxx:96
NswAsBuilt::StgcStripCalculator::stgcStrip_t::center
Amg::Vector3D center
Definition: StgcStripCalculator.h:49
NswAsBuilt::StgcStripCalculator::m_pcbMap
std::unordered_map< pcbIdentifier_t, CathodeBoardElement > m_pcbMap
Definition: StgcStripCalculator.h:88
NswAsBuilt::StgcStripCalculator::stgcStrip_t::left
Amg::Vector3D left
Definition: StgcStripCalculator.h:50
NswAsBuilt::StgcStripCalculator::IsValid::VALID
@ VALID
NswAsBuilt::pcbIdentifier_t
The indices of a MM PCB.
Definition: MuonSpectrometer/MuonDetDescr/MuonNSWAsBuilt/MuonNSWAsBuilt/Identifier.h:59
Element.h
GeoPrimitives.h
NswAsBuilt::StgcStripCalculator::stgcStrip_t::isvalid
IsValid isvalid
Definition: StgcStripCalculator.h:48
NswAsBuilt::stripIdentifier_t
Athena indices of a MM strip.
Definition: MuonSpectrometer/MuonDetDescr/MuonNSWAsBuilt/MuonNSWAsBuilt/Identifier.h:81
NswAsBuilt::quadrupletIdentifier_t
Athena indices for a MM quadruplet:
Definition: MuonSpectrometer/MuonDetDescr/MuonNSWAsBuilt/MuonNSWAsBuilt/Identifier.h:25
NswAsBuilt::StgcStripCalculator::buildElement
std::unique_ptr< Element > buildElement(json_t j) const
Definition: StgcStripCalculator.cxx:61
NswAsBuilt::StgcStripCalculator::getPositionAlongStgcStrip
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...
Definition: StgcStripCalculator.cxx:34
NswAsBuilt::StgcStripCalculator::collectStrip
void collectStrip(quadrupletIdentifier_t quad_id, Element &element, json_t j)
Definition: StgcStripCalculator.cxx:142
Identifier.h
NswAsBuilt::StgcStripCalculator::parseRootElement
void parseRootElement(json_t j)
Definition: StgcStripCalculator.cxx:150
NswAsBuilt::StgcStripCalculator::getPcbIdentifier
pcbIdentifier_t getPcbIdentifier(quadrupletIdentifier_t quad_id, json_t j) const
Definition: StgcStripCalculator.cxx:112
NswAsBuilt::StgcStripCalculator::getStgcStripConfiguration
CathodeBoardElement::stgcStripConfiguration_t getStgcStripConfiguration(json_t j) const
Definition: StgcStripCalculator.cxx:119
NswAsBuilt::StgcStripCalculator::ParameterClass
Element::ParameterClass ParameterClass
Definition: StgcStripCalculator.h:33
NswAsBuilt::StgcStripCalculator::getStgcStrip
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.
Definition: StgcStripCalculator.cxx:22
NswAsBuilt::StgcStripCalculator::stgcStrip_t::right
Amg::Vector3D right
Definition: StgcStripCalculator.h:51
NswAsBuilt::StgcStripCalculator
The main interface of the NswAsBuilt package: determines strip positions in the frame of the quadrupl...
Definition: StgcStripCalculator.h:31
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
CathodeBoardElement.h
NswAsBuilt::Element::ParameterClass
ParameterClass
Definition: Element.h:63
NswAsBuilt::StgcStripCalculator::stgcStrip_t
The return object for querying strip positions: three points along the strip are provided,...
Definition: StgcStripCalculator.h:47
Run1::Geog::position_t
cool::Int32 position_t
Definition: openCoraCool.cxx:75
NswAsBuilt::StgcStripCalculator::IsValid
IsValid
VALID: strip is found, INVALID: strip is not found.
Definition: StgcStripCalculator.h:38
NswAsBuilt::StgcStripCalculator::position_t::pos
Amg::Vector3D pos
Definition: StgcStripCalculator.h:69
NswAsBuilt
Definition: CathodeBoardElement.h:12
NswAsBuilt::Element
Element: a node in a hierarchy of alignment frames.
Definition: Element.h:52
NswAsBuilt::StgcStripCalculator::position_t::isvalid
IsValid isvalid
Definition: StgcStripCalculator.h:68
NswAsBuilt::StgcStripCalculator::IsValid::INVALID
@ INVALID
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32