23 auto translateTokenList = [
this, &idHelper](
const std::vector<std::string>& chNames){
25 std::set<Identifier> transcriptedIds{};
26 for (
const std::string& token : chNames) {
27 if (token.size() != 6) {
28 ATH_MSG_WARNING(
"Wrong format given for "<<token<<
". Expecting 6 characters");
32 const std::string statName = token.substr(0, 3);
33 const unsigned statEta = std::atoi(token.substr(3, 1).c_str()) * (token[4] ==
'A' ? 1 : -1);
34 const unsigned statPhi = std::atoi(token.substr(5, 1).c_str());
41 transcriptedIds.insert(eleId);
44 transcriptedIds.insert(secMlId);
47 return transcriptedIds;
50 std::vector <std::string>& selectedSt =
m_selectStat.value();
51 const std::vector <std::string>& excludedSt =
m_excludeStat.value();
52 selectedSt.erase(
std::remove_if(selectedSt.begin(), selectedSt.end(),
53 [&excludedSt](
const std::string& token){
54 return std::ranges::find(excludedSt, token) != excludedSt.end();
55 }), selectedSt.end());
57 if (selectedSt.size()) {
59 std::stringstream sstr{};
63 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
65 const std::set<Identifier> excluded = translateTokenList(excludedSt);
69 if (!excluded.count(*itr)) {
74 if (!excluded.empty()) {
75 std::stringstream excluded_report{};
77 excluded_report <<
" *** " <<
m_idHelperSvc->toStringDetEl(
id) << std::endl;
79 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
83 return StatusCode::SUCCESS;
87 return StatusCode::SUCCESS;
101 if (reElement->
identify() != test_me) {
104 return StatusCode::FAILURE;
112 return StatusCode::FAILURE;
115 for (
unsigned int layer = 1; layer <= reElement->
nGasGaps(); ++layer) {
117 const int numStrips = reElement->
numStrips(layerHash);
118 const int fStrip = reElement->
firstStrip(layerHash);
119 const int lStrip = fStrip+numStrips-1;
135 if (backCnv != chId) {
138 return StatusCode::FAILURE;
140 if (layHash != reElement->
layerHash(channelHash)) {
141 ATH_MSG_FATAL(
"Constructing the layer hash from the identifier "<<
142 m_idHelperSvc->toString(chId)<<
" leads to different layer hashes "<<
143 layHash<<
" vs. "<< reElement->
layerHash(channelHash));
144 return StatusCode::FAILURE;
152 design.
stripNumber(stripPos2D - 0.49 * stripLen * Amg::Vector2D::UnitY()) !=
strip ||
153 design.
stripNumber(stripPos2D + 0.49 * stripLen * Amg::Vector2D::UnitY()) !=
strip)) {
154 ATH_MSG_FATAL(
"Conversion channel -> strip -> channel failed for "
157 <<
", first strip: "<<fStrip<<std::endl<<design);
158 return StatusCode::FAILURE;
160 ATH_MSG_VERBOSE(
"first strip "<<fStrip<<
", numStrips "<< numStrips <<
", channel "
167 return StatusCode::SUCCESS;
193 for (
unsigned int layer = 1; layer <= reElement->
nGasGaps(); ++layer) {
196 unsigned int numStrips = reElement->
numStrips(layHash);
197 unsigned int fStrip = reElement->
firstStrip(layHash);
198 unsigned int lStrip = fStrip+numStrips-1;
208 <<
" layer: "<<layer<<
" strip: "<<
strip);
214 if (
strip == fStrip) {
217 <<
Amg::toString(stripLocalToGlob)<<
", perp: "<<stripLocalToGlob.translation().perp());
244 return m_tree.fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
#define ATH_CHECK
Evaluate an expression and check for errors.
bool isValid() const
Test to see if the link can be dereferenced.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
const ServiceHandle< StoreGateSvc > & detStore() const
This is a "hash" representation of an Identifier.
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Identifier multilayerID(const Identifier &channeldID) const
MuonVal::VectorBranch< unsigned > & m_firstStrip
MuonVal::MuonTesterTree m_tree
MuonVal::ScalarBranch< unsigned short > & m_stIndex
Identifier of the readout element.
MuonVal::VectorBranch< short > & m_gasGap
MuonVal::ScalarBranch< float > & m_ActiveWidthS
const MuonDetectorManager * m_detMgr
MuonVal::ScalarBranch< float > & m_ActiveWidthL
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like MM_<Large/Small Sector + Module type><Quadruplet number>.
MuonVal::VectorBranch< int > & m_readoutSide
StatusCode finalize() override
MuonVal::CoordSystemsBranch m_stripRot
Rotation matrix of the respective strip layers.
StatusCode execute(const EventContext &ctx) override
Execute method.
MuonVal::VectorBranch< unsigned > & m_nStrips
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::ScalarBranch< float > & m_ActiveHeightR
GasGap Lengths for debug.
MuonVal::ScalarBranch< std::string > & m_chamberDesign
MuonVal::VectorBranch< uint > & m_channel
MuonVal::ScalarBranch< float > & m_moduleWidthL
MuonVal::ScalarBranch< short > & m_stPhi
MuonVal::ThreeVectorBranch m_stripLeftEdge
MuonVal::ScalarBranch< float > & m_moduleWidthS
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::ScalarBranch< float > & m_stStripPitch
MuonVal::ThreeVectorBranch m_stripCenter
std::set< Identifier > m_testStations
Set of stations to be tested.
MuonVal::ScalarBranch< float > & m_moduleHeight
Chamber Length for debug.
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ).
MuonVal::VectorBranch< uint8_t > & m_stripRotGasGap
MuonVal::VectorBranch< bool > & m_isStereo
StatusCode initialize() override
MuonVal::TwoVectorBranch m_locStripCenter
MuonVal::ScalarBranch< short > & m_stML
StatusCode dumpToTree(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const MmReadoutElement *readoutEle)
MuonVal::CoordTransformBranch m_alignableNode
MuonVal::ScalarBranch< short > & m_stEta
MuonVal::TwoVectorBranch m_firstStripPos
MuonVal::ThreeVectorBranch m_stripRightEdge
ActsTrk::GeoContextReadKey_t m_geoCtxKey
MuonVal::VectorBranch< float > & m_stripLength
double moduleHeight() const
Returns the height along the z-axis.
const StripLayer & stripLayer(const Identifier &measId) const
double gapLengthS(const IdentifierHash &layerHash) const
Length of gas Gap on short side.
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
unsigned int nGasGaps() const
Returns the number of gas gaps.
unsigned int numStrips(const IdentifierHash &layerHash) const
Returns the number of total active strips.
int multilayer() const
Returns the multi layer of the element [1-2].
Identifier measurementId(const IdentifierHash &measHash) const override final
Back conversion of the measurement hash to a full Athena Identifier The behaviour is undefined if a l...
IdentifierHash layerHash(const Identifier &measId) const override final
The layer hash removes the bits from the IdentifierHash corresponding to the measurement's channel nu...
Amg::Vector3D leftStripEdge(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the global position of the strip edge.
double moduleWidthL() const
Returns the width at the top edge.
double moduleWidthS() const
Returns the width at the short edge.
int readoutSide(const IdentifierHash &measHash) const
Returns the readout side.
double gapLengthL(const IdentifierHash &layerHash) const
Length of gas Gap on long side.
double stripLength(const IdentifierHash &measHash) const
Returns the strip length.
unsigned int firstStrip(const IdentifierHash &layerHash) const
Returns the first active strip.
double gapHeight(const IdentifierHash &layerHash) const
Height of gas Gap.
Amg::Vector3D stripPosition(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the position of the strip center.
Amg::Vector3D rightStripEdge(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the global position of the strip edge.
static IdentifierHash createHash(const int gasGap, const int strip)
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the local coordinate system of the readout element into the global AT...
int stationEta() const
Returns the stationEta (positive A site, negative C site).
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...
const std::string & chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
Identifier identify() const override final
Return the ATLAS identifier.
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall)).
const GeoAlignableTransform * alignableTransform() const
Return the alignable transform node of the readout element.
int firstStripNumber() const
Returns the number of the first strip.
CheckVector2D center(int stripNumb) const
Returns the bisector of the strip (Global numbering scheme).
virtual double stripLength(int stripNumb) const
Returns length of the strip.
const Amg::Vector2D & firstStripPos() const
Vector indicating the first strip position.
double stripPitch() const
Distance between two adjacent strips.
virtual int stripNumber(const Amg::Vector2D &pos) const
Calculates the number of the strip whose center is closest to the given point.
bool hasStereoAngle() const
Returns whether a stereo angle is defined.
virtual int numStrips() const
Number of strips on the panel.
const StripDesign & design(bool phiView=false) const
Returns the underlying strip design.
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.