22 auto translateTokenList = [
this, &idHelper](
const std::vector<std::string>& chNames){
24 std::set<Identifier> transcriptedIds{};
25 for (
const std::string& token : chNames) {
26 if (token.size() != 7) {
27 ATH_MSG_WARNING(
"Wrong format given for "<<token<<
". Expecting 7 characters");
31 const std::string statName = token.substr(0, 3);
32 const unsigned statEta = std::atoi(token.substr(3, 1).c_str()) * (token[4] ==
'A' ? 1 : -1);
33 const unsigned statPhi = std::atoi(token.substr(5, 2).c_str());
40 transcriptedIds.insert(eleId);
42 return transcriptedIds;
45 std::vector <std::string>& selectedSt =
m_selectStat.value();
46 const std::vector <std::string>& excludedSt =
m_excludeStat.value();
47 selectedSt.erase(
std::remove_if(selectedSt.begin(), selectedSt.end(),
48 [&excludedSt](
const std::string& token){
49 return std::ranges::find(excludedSt, token) != excludedSt.end();
50 }), selectedSt.end());
52 if (selectedSt.size()) {
54 std::stringstream sstr{};
58 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
60 const std::set<Identifier> excluded = translateTokenList(excludedSt);
64 if (!excluded.count(*itr)) {
69 if (!excluded.empty()) {
70 std::stringstream excluded_report{};
72 excluded_report <<
" *** " <<
m_idHelperSvc->toStringDetEl(
id) << std::endl;
74 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
78 return StatusCode::SUCCESS;
82 return StatusCode::SUCCESS;
85 const EventContext& ctx{Gaudi::Hive::currentContext()};
98 if (reElement->
identify() != test_me) {
101 return StatusCode::FAILURE;
110 return StatusCode::FAILURE;
113 for (
unsigned gasGap = 1; gasGap <= reElement->
nGasGaps(); ++gasGap) {
114 for (
bool isStrip : {
false,
true}) {
116 const unsigned nChan = reElement->
numChannels(layHash);
117 for (
unsigned chan = 1; chan <= nChan ; ++chan) {
120 gasGap, isStrip, chan,
isValid);
122 ATH_MSG_DEBUG(
"No valid Identifier constructed from the fields "
124 <<
"isStrip: "<<(isStrip ?
"yay" :
"nay")<<
" gasGap: "<<gasGap<<
130 if (backCnv != channelId) {
133 return StatusCode::FAILURE;
137 <<
" gave something else than doing it from the measurement hash "<<measHash<<
". "<<
145 return StatusCode::SUCCESS;
165 for (
unsigned gap = 1; gap <= reElement->
nGasGaps(); ++gap) {
189 const Amg::Vector2D locBot2D{layout.rightEdge(
strip).value_or(Amg::Vector2D::Zero())};
190 const Amg::Vector3D globTop{localToGlobal * sensor->to3D(layout.leftEdge(
strip),
true)};
191 const Amg::Vector3D globBot{localToGlobal * sensor->to3D(layout.rightEdge(
strip),
true)};
200 for (
unsigned gang = 1; gang <= reElement->
numWireGangs(layHash); ++gang) {
216 m_locGangPos.push_back(layout.center(gang).value_or(Amg::Vector2D::Zero()));
220 return m_tree.fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
#define ATH_CHECK
Evaluate an expression and check for errors.
#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.
std::set< Identifier > m_testStations
Set of stations to be tested.
const MuonDetectorManager * m_detMgr
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::VectorBranch< uint16_t > & m_layNumWires
MuonVal::CoordTransformBranch m_alignableNode
MuonVal::VectorBranch< float > & m_gangLength
StatusCode finalize() override
MuonVal::ThreeVectorBranch m_stripBottom
MuonVal::VectorBranch< uint8_t > & m_gangNumWires
MuonVal::ScalarBranch< short > & m_stPhi
MuonVal::TwoVectorBranch m_locStripTop
MuonVal::ScalarBranch< float > & m_thickness
MuonVal::CoordSystemsBranch m_layTans
Layer dimensions.
MuonVal::TwoVectorBranch m_locStripCenter
StatusCode initialize() override
StatusCode execute() override
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::VectorBranch< bool > & m_layMeasPhi
MuonVal::ThreeVectorBranch m_gangCenter
Wire gangs.
MuonVal::VectorBranch< uint8_t > & m_gangGasGap
StatusCode dumpToTree(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const TgcReadoutElement *readoutEle)
MuonVal::MuonTesterTree m_tree
MuonVal::ScalarBranch< short > & m_stEta
MuonVal::ScalarBranch< float > & m_height
MuonVal::VectorBranch< unsigned int > & m_gangNum
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
MuonVal::VectorBranch< unsigned int > & m_stripNum
MuonVal::VectorBranch< float > & m_layLongWidth
MuonVal::TwoVectorBranch m_locStripBottom
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
MuonVal::ScalarBranch< float > & m_shortWidth
MuonVal::ThreeVectorBranch m_stripTop
MuonVal::ScalarBranch< unsigned short > & m_stIndex
Identifier of the readout element.
MuonVal::VectorBranch< float > & m_layHeight
MuonVal::VectorBranch< float > & m_layShortWidth
MuonVal::VectorBranch< uint8_t > & m_stripGasGap
MuonVal::VectorBranch< uint8_t > & m_layNumber
MuonVal::ScalarBranch< std::string > & m_stLayout
MuonVal::ScalarBranch< float > & m_longWidth
MuonVal::ThreeVectorBranch m_stripCenter
MuonVal::ScalarBranch< uint8_t > & m_nGasGaps
MuonVal::TwoVectorBranch m_locGangPos
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.
const StripLayerPtr & sensorLayout(const IdentifierHash &hash) const
Returns the pointer to the strip layer associated with the gas gap.
unsigned numWireGangs(const IdentifierHash &layHash) const
Returns the number of wire gangs for a given gasGap [1-3].
Amg::Vector3D channelPosition(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the center of the measurement channel eta measurement: wire gang center phi measurement: stri...
double moduleWidthS() const
Returns the length of the bottom edge of the chamber (short width)
const RadialStripDesign & stripLayout(const IdentifierHash &layHash) const
Returns access to the strip design of the given gasGap [1-3] If the gap does not have strips an excep...
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
static IdentifierHash constructHash(unsigned measCh, unsigned gasGap, const bool isStrip)
Constructs the Hash out of the Identifier fields (channel, gasGap, isStrip)
const WireGroupDesign & wireGangLayout(const IdentifierHash &layHash) const
Returns access to the wire group design of the given gasGap [1-3] If the gap does not have a wires an...
double moduleHeight() const
Returns the height of the chamber (Distance bottom - topWidth)
unsigned numChannels(const IdentifierHash &measHash) const
Returns the number of readout channels.
double moduleWidthL() const
Returns the length of the top edge of the chamber (top width)
unsigned nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
double moduleThickness() const
Returns the thickness of the chamber.
unsigned numStrips(const IdentifierHash &layHash) const
Returns the number of strips for a given gasGap [1-3].
IdentifierHash layerHash(const Identifier &measId) const override final
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) 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.
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
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.