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;
90 const EventContext& ctx{Gaudi::Hive::currentContext()};
102 if (reElement->
identify() != test_me) {
105 return StatusCode::FAILURE;
113 return StatusCode::FAILURE;
116 for (
unsigned int layer = 1; layer <= reElement->
nGasGaps(); ++layer) {
118 const int numStrips = reElement->
numStrips(layerHash);
119 const int fStrip = reElement->
firstStrip(layerHash);
120 const int lStrip = fStrip+numStrips-1;
136 if (backCnv != chId) {
139 return StatusCode::FAILURE;
141 if (layHash != reElement->
layerHash(channelHash)) {
142 ATH_MSG_FATAL(
"Constructing the layer hash from the identifier "<<
143 m_idHelperSvc->toString(chId)<<
" leads to different layer hashes "<<
144 layHash<<
" vs. "<< reElement->
layerHash(channelHash));
145 return StatusCode::FAILURE;
153 design.
stripNumber(stripPos2D - 0.49 * stripLen * Amg::Vector2D::UnitY()) !=
strip ||
154 design.
stripNumber(stripPos2D + 0.49 * stripLen * Amg::Vector2D::UnitY()) !=
strip)) {
155 ATH_MSG_FATAL(
"Conversion channel -> strip -> channel failed for "
158 <<
", first strip: "<<fStrip<<std::endl<<design);
159 return StatusCode::FAILURE;
161 ATH_MSG_VERBOSE(
"first strip "<<fStrip<<
", numStrips "<< numStrips <<
", channel "
168 return StatusCode::SUCCESS;
194 for (
unsigned int layer = 1; layer <= reElement->
nGasGaps(); ++layer) {
197 unsigned int numStrips = reElement->
numStrips(layHash);
198 unsigned int fStrip = reElement->
firstStrip(layHash);
199 unsigned int lStrip = fStrip+numStrips-1;
209 <<
" layer: "<<layer<<
" strip: "<<
strip);
215 if (
strip == fStrip) {
218 <<
Amg::toString(stripLocalToGlob)<<
", perp: "<<stripLocalToGlob.translation().perp());
245 return m_tree.fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
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.
StatusCode execute() override
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.
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
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
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
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
Converts the measurement hash back to the full Identifier.
IdentifierHash layerHash(const Identifier &measId) const override final
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)
int stationEta() const
Returns the stationEta (positive A site, negative O site)
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
const std::string & chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
Identifier identify() const override final
Return the athena 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
Returnsthe alignable transform of the readout element.
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
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.