25 auto translateTokenList = [
this, &idHelper](
const std::vector<std::string>& chNames){
27 std::set<Identifier> transcriptedIds{};
28 for (
const std::string& token : chNames) {
29 if (token.size() != 6) {
30 ATH_MSG_WARNING(
"Wrong format given for "<<token<<
". Expecting 6 characters");
34 const std::string statName = token.substr(0, 3);
35 const unsigned statEta = std::atoi(token.substr(3, 1).c_str()) * (token[4] ==
'A' ? 1 : -1);
36 const unsigned statPhi = std::atoi(token.substr(5, 1).c_str());
43 transcriptedIds.insert(eleId);
46 transcriptedIds.insert(secMlId);
49 return transcriptedIds;
52 std::vector <std::string>& selectedSt =
m_selectStat.value();
53 const std::vector <std::string>& excludedSt =
m_excludeStat.value();
54 selectedSt.erase(
std::remove_if(selectedSt.begin(), selectedSt.end(),
55 [&excludedSt](
const std::string& token){
56 return std::ranges::find(excludedSt, token) != excludedSt.end();
57 }), selectedSt.end());
59 if (selectedSt.size()) {
61 std::stringstream sstr{};
65 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
67 const std::set<Identifier> excluded = translateTokenList(excludedSt);
71 if (!excluded.count(*itr)) {
76 if (!excluded.empty()) {
77 std::stringstream excluded_report{};
79 excluded_report <<
" *** " <<
m_idHelperSvc->toStringDetEl(
id) << std::endl;
81 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
84 return StatusCode::SUCCESS;
87 const EventContext& ctx{Gaudi::Hive::currentContext()};
92 return StatusCode::FAILURE;
96 const std::string detStr =
m_idHelperSvc->toStringDetEl(test_me);
104 if (reElement->
identify() != test_me) {
106 << detStr <<
". But got instead "
108 return StatusCode::FAILURE;
112 return StatusCode::SUCCESS;
116 return StatusCode::SUCCESS;
162 const multilayer_t asBuiltMl = readoutEle->
getMultilayer() == 1 ? multilayer_t::ML1 : multilayer_t::ML2;
184 for (
int lay = 1; lay <= readoutEle->
getNLayers(); ++lay) {
186 bool is_valid{
false};
189 lay, tube, is_valid);
190 if (!is_valid)
continue;
194 }
catch (
const std::runtime_error& err ){
212 if (!cabling->convert(tube_id, translation) ||
213 !cabling->getOnlineId(translation, msgStream())){
215 return StatusCode::FAILURE;
224 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.
float getParameter(const Parameter p) const
Returns a given parameter.
Container classifier the MDT as-built parameters See parameter description in http://atlas-muon-align...
int stagg(multilayer_t iML, tubeSide_t iTubeSide) const
double zpitch(multilayer_t iML, tubeSide_t iTubeSide) const
double ypitch(multilayer_t iML, tubeSide_t iTubeSide) const
double alpha(multilayer_t iML, tubeSide_t iTubeSide) const
multilayer_t
MDT multi-layer index.
double z0(multilayer_t iML, tubeSide_t iTubeSide) const
double y0(multilayer_t iML, tubeSide_t iTubeSide) const
Identifier multilayerID(const Identifier &channeldID) const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
MuonVal::ScalarBranch< float > & m_ALineTransZ
MuonVal::VectorBranch< unsigned short > & m_tubeLay
Readout each tube specifically.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::VectorBranch< uint8_t > & m_cablingMROD
MuonVal::VectorBranch< uint8_t > & m_cablingTdcId
MuonVal::ScalarBranch< unsigned short > & m_numLayers
Number of tubes per layer.
MuonVal::VectorBranch< double > & m_tubeLength
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
MuonVal::ScalarBranch< float > & m_asBuiltNegZ0
MuonVal::ScalarBranch< float > & m_BLineEp
MuonVal::ScalarBranch< float > & m_BLineSn
MuonVal::ScalarBranch< float > & m_BLineBp
MuonVal::ScalarBranch< float > & m_asBuiltNegAlpha
MuonVal::ScalarBranch< double > & m_tubePitch
MuonVal::ScalarBranch< short > & m_stEta
MuonVal::ScalarBranch< float > & m_asBuiltNegPitchZ
MuonVal::ScalarBranch< float > & m_BLineSp
MuonVal::ScalarBranch< float > & m_BLineEn
std::set< Identifier > m_testStations
Set of stations to be tested.
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the underlying GeoModel element (Translation, ColX, ColY, ColZ)
MuonVal::ScalarBranch< float > & m_BLineTr
MuonVal::ScalarBranch< float > & m_ALineRotZ
MuonVal::ScalarBranch< float > & m_asBuiltPosPitchZ
MuonVal::ScalarBranch< float > & m_asBuiltPosZ0
MuonVal::ScalarBranch< int > & m_asBuiltPosStagg
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_cablingKey
MuonVal::ScalarBranch< float > & m_BLineTw
MuonVal::ScalarBranch< float > & m_ALineRotT
MuonVal::ThreeVectorBranch m_roPos
Position of the readout.
MuonVal::CoordSystemsBranch m_tubeTransform
Ideal transformations to the tube rest frame.
StatusCode finalize() override
MuonVal::VectorBranch< double > & m_activeTubeLength
MuonVal::ScalarBranch< float > & m_BLineBn
MuonVal::ScalarBranch< std::string > & m_chamberDesign
StatusCode initialize() override
MuonVal::ScalarBranch< float > & m_ALineTransS
Alignment parameters.
MuonVal::ScalarBranch< short > & m_stML
MuonVal::CoordTransformBranch m_alignableNode
MuonVal::ScalarBranch< int > & m_asBuiltNegStagg
MuonVal::MuonTesterTree m_tree
Write a TTree for validation purposes.
MuonVal::ScalarBranch< float > & m_BLineEg
MuonVal::ScalarBranch< float > & m_ALineRotS
StatusCode dumpToTree(const EventContext &ctx, const MdtReadoutElement *readoutEle)
MuonVal::VectorBranch< uint8_t > & m_cablingTdcCh
MuonVal::ScalarBranch< float > & m_ALineTransT
MuonVal::VectorBranch< uint8_t > & m_cablingCSM
Cabling information.
MuonVal::ScalarBranch< short > & m_stPhi
MuonVal::ScalarBranch< double > & m_tubeRad
StatusCode execute() override
MuonVal::ScalarBranch< float > & m_BLinePg
MuonVal::ScalarBranch< unsigned short > & m_stIndex
Identifier of the readout element.
MuonVal::ScalarBranch< unsigned short > & m_numTubes
Number of tubes per layer.
MuonVal::ScalarBranch< float > & m_asBuiltNegY0
MuonVal::ScalarBranch< float > & m_BLineBz
B Line chamber defomrations.
MuonVal::VectorBranch< unsigned short > & m_tubeNum
MuonVal::ScalarBranch< float > & m_asBuiltPosY0
AS-built parameters.
MuonVal::ScalarBranch< float > & m_asBuiltPosAlpha
MuonVal::VectorBranch< double > & m_wireLength
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::ScalarBranch< float > & m_asBuiltNegPitchY
MuonVal::ScalarBranch< float > & m_asBuiltPosPitchY
double getActiveTubeLength(const int tubeLayer, const int tube) const
Amg::Vector3D ROPos(const int tubelayer, const int tube) const
int getNLayers() const
Returns the number of tube layers inside the multilayer.
int getMultilayer() const
Returns the multilayer represented by the readout element.
const BLinePar * getBLinePar() const
virtual const Amg::Transform3D & transform(const Identifier &id) const override final
Return local to global transform associated with this identifier.
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
double tubePitch() const
Returns the distance between 2 tubes in a tube layer.
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
double tubeLength(const int tubeLayer, const int tube) const
double getWireLength(const int tubeLayer, const int tube) const
const std::string & getTechnologyName() const
int getStationIndex() const
int getStationPhi() const
int getStationEta() const
const MuonStation * parentMuonStation() const
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
double getALine_trat() const
const Amg::Transform3D & getNativeToAmdbLRS() const
double getALine_rott() const
double getALine_rots() const
const GeoAlignableTransform * getGeoTransform() const
const MdtAsBuiltPar * getMdtAsBuiltParams() const
double getALine_tras() const
double getALine_rotz() const
bool hasMdtAsBuiltParams() const
double getALine_traz() const
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the Athena extensions are properly loaded.
std::ostream & operator<<(std::ostream &os, const AlignPos &p)
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.
uint8_t tdcId
Mezzanine type.
uint8_t channelId
Identifier of the corresponding tdc.
uint8_t & csm
MROD number.