19 return StatusCode::SUCCESS;
27 auto translateTokenList = [
this, &idHelper](
const std::vector<std::string>& chNames){
29 std::set<Identifier> transcriptedIds{};
30 for (
const std::string& token : chNames) {
31 if (token.size() != 6) {
32 ATH_MSG_WARNING(
"Wrong format given for "<<token<<
". Expecting 6 characters");
36 const std::string statName = token.substr(0, 3);
37 const unsigned statEta = std::atoi(token.substr(3, 1).c_str()) * (token[4] ==
'A' ? 1 : -1);
38 const unsigned statPhi = std::atoi(token.substr(5, 1).c_str());
45 transcriptedIds.insert(eleId);
51 return transcriptedIds;
54 std::vector <std::string>& selectedSt =
m_selectStat.value();
55 const std::vector <std::string>& excludedSt =
m_excludeStat.value();
56 selectedSt.erase(
std::remove_if(selectedSt.begin(), selectedSt.end(),
57 [&excludedSt](
const std::string& token){
58 return std::ranges::find(excludedSt, token) != excludedSt.end();
59 }), selectedSt.end());
61 if (selectedSt.size()) {
63 std::stringstream sstr{};
67 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
69 const std::set<Identifier> excluded = translateTokenList(excludedSt);
73 if (!excluded.count(*itr)) {
78 if (!excluded.empty()) {
79 std::stringstream excluded_report{};
81 excluded_report <<
" *** " <<
m_idHelperSvc->toStringDetEl(
id) << std::endl;
83 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
86 return StatusCode::SUCCESS;
89 const EventContext& ctx{Gaudi::Hive::currentContext()};
94 return StatusCode::FAILURE;
105 if (reElement->
identify() != test_me) {
107 <<
m_idHelperSvc->toStringDetEl(test_me) <<
". But got instead "
109 return StatusCode::FAILURE;
113 return StatusCode::SUCCESS;
135 for (
bool measPhi : {
false,
true}) {
136 for (
int layer = 1 ; layer <= readoutEle->
numberOfLayers(measPhi); ++layer){
143 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.
Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip) const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
virtual int numberOfLayers(bool) const override final
number of layers in phi/eta projection
Amg::Transform3D localToGlobalTransf(const Identifier &id) const
MuonVal::CoordSystemsBranch m_layerTrans
MuonVal::ScalarBranch< float > & m_ALineTransT
StatusCode dumpToTree(const EventContext &ctx, const CscReadoutElement *readoutEle)
MuonVal::VectorBranch< bool > & m_layMeasPhi
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
MuonDetectorManager from the conditions store.
MuonVal::ScalarBranch< float > & m_ALineRotZ
MuonVal::ScalarBranch< short > & m_stEta
MuonVal::ScalarBranch< float > & m_ALineRotT
StatusCode finalize() override
Gaudi::Property< std::vector< std::string > > m_excludeStat
StatusCode initialize() override
MuonVal::ScalarBranch< float > & m_ALineTransS
Alignment parameters.
MuonVal::ScalarBranch< float > & m_ALineTransZ
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
MuonVal::ScalarBranch< float > & m_ALineRotS
MuonVal::ScalarBranch< short > & m_stMultiLayer
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::set< Identifier > m_testStations
Set of stations to be tested.
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
MuonVal::ScalarBranch< unsigned short > & m_stIndex
Identifier of the readout element.
MuonVal::MuonTesterTree m_tree
MuonVal::VectorBranch< uint8_t > & m_layNumber
MuonVal::ScalarBranch< short > & m_stPhi
StatusCode execute() override
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
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
double getALine_rott() const
double getALine_rots() const
double getALine_tras() const
double getALine_rotz() const
double getALine_traz() const
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
Eigen::Affine3d Transform3D
Ensure that the Athena extensions are properly loaded.
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.