12#include "GeoModelKernel/GeoDefinitions.h"
14#include "GaudiKernel/SystemOfUnits.h"
21 return StatusCode::SUCCESS;
28 auto translateTokenList = [
this, &idHelper](
const std::vector<std::string>& chNames){
30 std::set<Identifier> transcriptedIds{};
31 for (
const std::string& token : chNames) {
32 if (token.size() != 6) {
33 ATH_MSG_WARNING(
"Wrong format given for "<<token<<
". Expecting 6 characters");
37 const std::string statName = token.substr(0, 3);
38 const unsigned statEta = std::atoi(token.substr(3, 1).c_str()) * (token[4] ==
'A' ? 1 : -1);
39 const unsigned statPhi = std::atoi(token.substr(5, 1).c_str());
46 transcriptedIds.insert(eleId);
49 transcriptedIds.insert(secMlId);
52 return transcriptedIds;
55 std::vector <std::string>& selectedSt =
m_selectStat.value();
56 const std::vector <std::string>& excludedSt =
m_excludeStat.value();
57 selectedSt.erase(
std::remove_if(selectedSt.begin(), selectedSt.end(),
58 [&excludedSt](
const std::string& token){
59 return std::ranges::find(excludedSt, token) != excludedSt.end();
60 }), selectedSt.end());
62 if (selectedSt.size()) {
64 std::stringstream sstr{};
68 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
70 const std::set<Identifier> excluded = translateTokenList(excludedSt);
74 if (!excluded.count(*itr)) {
79 if (!excluded.empty()) {
80 std::stringstream excluded_report{};
82 excluded_report <<
" *** " <<
m_idHelperSvc->toStringDetEl(
id) << std::endl;
84 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
87 return StatusCode::SUCCESS;
90 const EventContext& ctx{Gaudi::Hive::currentContext()};
95 return StatusCode::FAILURE;
108 <<
m_idHelperSvc->toStringDetEl(test_me) <<
". But got instead "
110 return StatusCode::FAILURE;
114 return StatusCode::SUCCESS;
119 const Amg::Transform3D permute{GeoTrf::GeoRotation{90.*Gaudi::Units::deg,90.*Gaudi::Units::deg, 0.}};
175 for (
int lay = 1; lay <= numLayers; ++lay) {
201 for (
int wireGroupIndex = 1; wireGroupIndex <= numWireGroups; ++wireGroupIndex) {
206 ATH_MSG_WARNING(
"The following wire group ID is not valid: " << wireGroupID);
217 if (wireGroupIndex != 1)
continue;
235 for (
int stripIndex = 1; stripIndex <= numStrips; ++stripIndex) {
253 if (stripIndex != 1)
continue;
281 for (
int phiIndex = 1; phiIndex <= numPadPhi; ++phiIndex) {
282 for(
int etaIndex = 1; etaIndex <= numPadEta; ++etaIndex) {
284 const Identifier padID =id_helper.
padID(stIndex, stEta, stPhi, stML, lay,
320 if (etaIndex != 1 || phiIndex != 1)
continue;
328 return m_tree.fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
#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.
MuonVal::ScalarBranch< short > & m_stIndex
Identifier of the readout element.
MuonVal::VectorBranch< uint8_t > & m_stripRotGasGap
StatusCode finalize() override
StatusCode initialize() override
MuonVal::VectorBranch< float > & m_firstPadHeight
MuonVal::VectorBranch< uint > & m_stripNum
MuonVal::VectorBranch< uint8_t > & m_wireGroupRotGasGap
MuonVal::ScalarBranch< short > & m_stEta
MuonVal::ThreeVectorBranch m_globalPadCornerBL
MuonVal::VectorBranch< uint > & m_numPads
Pad dimensions.
MuonVal::VectorBranch< uint8_t > & m_padRotGasGap
MuonVal::ScalarBranch< std::string > & m_chamberDesign
MuonVal::VectorBranch< uint8_t > & m_wireGroupNum
MuonVal::ScalarBranch< float > & m_anglePadPhi
MuonVal::ScalarBranch< float > & m_sChamberLength
Chamber Length for debug.
MuonVal::ScalarBranch< float > & m_lChamberLength
MuonVal::ThreeVectorBranch m_globalPadCornerTR
MuonVal::VectorBranch< uint > & m_firstWireGroupWidth
MuonVal::TwoVectorBranch m_localPadCornerTL
MuonVal::ScalarBranch< float > & m_wirePitch
MuonVal::ThreeVectorBranch m_globalStripPos
MuonVal::ThreeVectorBranch m_globalPadCornerTL
MuonVal::ScalarBranch< float > & m_stripWidth
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::TwoVectorBranch m_localPadPos
MuonVal::VectorBranch< uint > & m_padPhi
MuonVal::CoordTransformBranch m_alignableNode
MuonVal::ScalarBranch< uint > & m_wireGroupWidth
MuonVal::VectorBranch< uint8_t > & m_padGasGap
MuonVal::CoordSystemsBranch m_stripRot
Rotation matrix of the respective strip layers.
MuonVal::CoordSystemsBranch m_padRot
Rotation matrix of the respective pad layers.
std::set< Identifier > m_testStations
Set of stations to be tested.
MuonVal::VectorBranch< uint8_t > & m_stripGasGap
MuonVal::ScalarBranch< float > & m_lPadLength
MuonVal::ScalarBranch< short > & m_numLayers
MuonVal::VectorBranch< float > & m_firstStripPitch
MuonVal::VectorBranch< float > & m_stripLengths
MuonVal::MuonTesterTree m_tree
MuonVal::TwoVectorBranch m_hitPosition
MuonVal::VectorBranch< float > & m_firstPadPhiDiv
MuonVal::ScalarBranch< float > & m_sGapLength
GasGap Lengths for debug.
MuonVal::VectorBranch< float > & m_padHeight
MuonVal::ScalarBranch< float > & m_stripPitch
MuonVal::VectorBranch< uint > & m_numWires
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
MuonDetectorManager from the conditions store.
MuonVal::ThreeVectorBranch m_globalPadCornerBR
StatusCode dumpToTree(const EventContext &ctx, const sTgcReadoutElement *readoutEle)
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
MuonVal::VectorBranch< uint > & m_padEta
MuonVal::ScalarBranch< float > & m_beamlineRadius
MuonVal::VectorBranch< float > & m_padPhiShift
MuonVal::ScalarBranch< uint > & m_numStrips
Strip dimensions.
MuonVal::ScalarBranch< float > & m_yCutout
MuonVal::ScalarBranch< float > & m_chamberHeight
StatusCode execute() override
MuonVal::TwoVectorBranch m_localStripPos
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::VectorBranch< uint8_t > & m_wireGroupGasGap
MuonVal::ScalarBranch< float > & m_lGapLength
MuonVal::ScalarBranch< float > & m_wireWidth
MuonVal::VectorBranch< float > & m_wireCutout
MuonVal::TwoVectorBranch m_localWireGroupPos
MuonVal::ThreeVectorBranch m_globalPadPos
MuonVal::ScalarBranch< float > & m_sPadLength
MuonVal::ScalarBranch< short > & m_stPhi
MuonVal::CoordSystemsBranch m_wireGroupRot
Rotation matrix of the respective wireGroup layers.
MuonVal::ThreeVectorBranch m_globalWireGroupPos
MuonVal::ScalarBranch< float > & m_gasTck
MuonVal::VectorBranch< uint > & m_numPadEta
MuonVal::VectorBranch< uint > & m_numWireGroups
MuonVal::TwoVectorBranch m_localPadCornerTR
MuonVal::ScalarBranch< float > & m_gapHeight
MuonVal::VectorBranch< int > & m_padNumber
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
MuonVal::VectorBranch< uint > & m_numPadPhi
MuonVal::TwoVectorBranch m_localPadCornerBL
MuonVal::TwoVectorBranch m_localPadCornerBR
MuonVal::ScalarBranch< short > & m_stML
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
int getStationIndex() const
int getStationPhi() const
int getStationEta() const
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
std::string getStationType() const
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
double wirePitch(int gas_gap=1) const
single wire pitch.
bool padPosition(const Identifier &id, Amg::Vector2D &pos) const
pad position
const MuonPadDesign * getPadDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position - should be renamed to channel position If the strip number is outside the range of va...
bool padCorners(const Identifier &id, std::array< Amg::Vector2D, 4 > &corners) const
pad corners
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
int numberOfWires(const Identifier &id) const
Get the total number of wires (single wires) of a chamber.
double channelPitch(const Identifier &id) const
Channel pitch.
const Amg::Transform3D & getDelta() const
read A-line parameters and include the chamber rotation/translation in the local-to-global (ATLAS) re...
bool padGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
pad global position
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
virtual int numberOfLayers(bool) const override final
number of layers in phi/eta projection
virtual Amg::Transform3D AmdbLRSToGlobalTransform() const override final
int numberOfPads(const Identifier &layerId) const
Get the number of pad per layer.
bool padGlobalCorners(const Identifier &id, std::array< Amg::Vector3D, 4 > &gcorners) const
pad global corners
int padNumber(const Amg::Vector2D &pos, const Identifier &id) const
pad number corresponding to local position
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
int multilayer(const Identifier &id) const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Identifier padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
Identifier multilayerID(const Identifier &channeldID) const
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
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.
double channelLength(int channel) const
STRIPS ONLY: calculate channel length for a given strip number.
double radialDistance
DT-2015-11-29 distance from the beamline to the center of the module.