 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GaudiKernel/SystemOfUnits.h"
20 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());
40 const Identifier eleId = idHelper.elementID(statName, statEta, statPhi, 1,
isValid);
45 transcriptedIds.insert(eleId);
46 std::copy_if(idHelper.detectorElement_begin(), idHelper.detectorElement_end(),
47 std::inserter(transcriptedIds, transcriptedIds.end()),
49 return idHelper.stationName(copyMe) == idHelper.stationName(eleId) &&
50 idHelper.stationEta(copyMe) == idHelper.stationEta(eleId) &&
51 idHelper.stationPhi(copyMe) == idHelper.stationPhi(eleId);
54 return transcriptedIds;
57 std::vector <std::string>& selectedSt =
m_selectStat.value();
58 const std::vector <std::string>& excludedSt =
m_excludeStat.value();
59 selectedSt.erase(std::remove_if(selectedSt.begin(), selectedSt.end(),
60 [&excludedSt](
const std::string& token){
61 return std::ranges::find(excludedSt, token) != excludedSt.end();
62 }), selectedSt.end());
64 if (selectedSt.size()) {
66 std::stringstream sstr{};
70 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
72 const std::set<Identifier> excluded = translateTokenList(excludedSt);
74 for(
auto itr = idHelper.detectorElement_begin();
75 itr!= idHelper.detectorElement_end();++itr){
76 if (!excluded.count(*itr)) {
81 if (!excluded.empty()) {
82 std::stringstream excluded_report{};
84 excluded_report <<
" *** " <<
m_idHelperSvc->toStringDetEl(
id) << std::endl;
86 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
89 return StatusCode::SUCCESS;
92 const EventContext& ctx{Gaudi::Hive::currentContext()};
94 if (!detMgr.isValid()) {
97 return StatusCode::FAILURE;
108 if (reElement->
identify() != test_me) {
110 <<
m_idHelperSvc->toStringDetEl(test_me) <<
". But got instead "
112 return StatusCode::FAILURE;
118 for (
int doubPhi = reElement->
getDoubletPhi(); doubPhi <= reElement->NphiStripPanels(); ++doubPhi) {
119 for (
bool measPhi: {
false,
true}) {
120 for (
int strip = 1 ; strip < reElement->
Nstrips(measPhi); ++strip) {
122 const Identifier stripId = idHelper.channelID(test_me,
123 idHelper.doubletZ(test_me),
129 <<
", gasGap:"<<
gasGap<<
", doubletPhi: "<<doubPhi
130 <<
", measurePhi "<<measPhi<<
", strip: "<<strip);
136 return StatusCode::FAILURE;
142 if ( (stripPos - globPos3D).
mag() > std::numeric_limits<float>::epsilon()) {
143 ATH_MSG_FATAL(
"Retrieving the strip position in two different ways leads to two distinct results "
145 return StatusCode::FAILURE;
149 if (!laySurf.insideBounds(locPos2D)){
151 <<
" is outside bounds "<<laySurf.bounds());
152 return StatusCode::FAILURE;
154 if (!laySurf.insideBounds(locPos2D + stripLen * Amg::Vector2D::UnitY())){
156 " of "<<
m_idHelperSvc->toString(stripId)<<
" is outside bounds "<<laySurf.bounds());
157 return StatusCode::FAILURE;
158 }
if (!laySurf.insideBounds(locPos2D - stripLen * Amg::Vector2D::UnitY())){
160 <<
" of "<<
m_idHelperSvc->toString(stripId)<<
" is outside bounds "<<laySurf.bounds());
161 return StatusCode::FAILURE;
168 return StatusCode::SUCCESS;
209 for (
int doubPhi = readoutEle->
getDoubletPhi(); doubPhi <= maxDoubPhi; ++doubPhi) {
211 for (
bool measPhi : {
false,
true}) {
212 unsigned int numStrip = readoutEle->
Nstrips(measPhi);
213 for (
unsigned int strip = 1; strip <= numStrip ; ++strip) {
221 <<
" gap: "<<
gap<<
" strip: "<<strip<<
" meas phi: "<<measPhi);
227 return StatusCode::FAILURE;
237 if (strip != 1)
continue;
249 return m_tree.
fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
MuonVal::ScalarBranch< float > & m_stripEtaWidth
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
StatusCode finalize() override
double getALine_trat() const
Ensure that the Athena extensions are properly loaded.
int NphiStripPanels() const
returns the number of phi strip panels (1 or 2)
const Amg::Transform3D & absTransform() const
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
MuonDetectorManager from the conditions store.
MuonVal::ScalarBranch< float > & m_ALineRotS
double StripLength(bool measphi) const
returns the strip length for the phi or eta plane
MuonVal::ScalarBranch< float > & m_stripPhiWidth
StatusCode init(OWNER *instance)
Initialize method.
Eigen::Matrix< double, 2, 1 > Vector2D
StatusCode execute() override
double getALine_rotz() const
double getALine_traz() const
MuonVal::ScalarBranch< uint8_t > & m_doubletPhi
MuonVal::VectorBranch< uint8_t > & m_stripDblPhi
MuonVal::TwoVectorBranch m_locPos
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
double getALine_tras() const
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
const std::string & getTechnologyName() const
MuonVal::ScalarBranch< uint8_t > & m_doubletR
#define ATH_MSG_VERBOSE(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
MuonVal::ScalarBranch< uint8_t > & m_numPhiPanels
def gap(flags, cells_name, *args, **kw)
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
MuonVal::VectorBranch< uint8_t > & m_stripRotDblPhi
int getDoubletR() const
return DoubletR value for the given readout element
MuonVal::VectorBranch< uint8_t > & m_stripPosGasGap
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
void push_back(const Amg::Vector2D &vec)
interface using the Amg::Vector3D
MuonVal::ScalarBranch< uint8_t > & m_doubletZ
double getALine_rott() const
MuonVal::CoordSystemsBranch m_stripRot
Rotation matrix of the respective layers.
::StatusCode StatusCode
StatusCode definition for legacy code.
const MuonStation * parentMuonStation() const
MuonVal::ScalarBranch< uint8_t > & m_numStripsPhi
Eigen::Affine3d Transform3D
MuonVal::VectorBranch< uint8_t > & m_stripRotGasGap
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::VectorBranch< bool > & m_stripPosMeasPhi
Out copy_if(In first, const In &last, Out res, const Pred &p)
const Amg::Transform3D & getNativeToAmdbLRS() const
int getDoubletPhi() const
return DoubletPhi value for the given readout element, be aware that one RE can contain two DoubletPh...
MuonVal::ScalarBranch< float > & m_stripEtaLength
MuonVal::ScalarBranch< unsigned short > & m_stIndex
Identifier of the readout element.
MuonVal::ScalarBranch< short > & m_stEta
const GeoAlignableTransform * getGeoTransform() const
void push_back(const T &value)
Adds a new element at the end of the vector.
MuonVal::VectorBranch< bool > & m_stripRotMeasPhi
StatusCode dumpToTree(const EventContext &ctx, const RpcReadoutElement *readoutEle)
MuonVal::ScalarBranch< float > & m_stripPhiPitch
MuonVal::ScalarBranch< float > & m_ALineRotT
StatusCode initialize() override
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position If the strip number is outside the range of valid strips, the function will return fal...
Amg::Vector3D stripPos(const Identifier &id) const
MuonVal::ScalarBranch< std::string > & m_chamberDesign
StatusCode initialize(bool used=true)
double StripPitch(bool measphi) const
returns the strip pitch for the phi or eta plane
Eigen::Matrix< double, 3, 1 > Vector3D
virtual int numberOfLayers(bool measphi=true) const override final
number of layers in phi/eta projection, same for eta/phi planes
MuonVal::ScalarBranch< uint8_t > & m_numStripsEta
Number of strips, strip pitch in eta & phi direction.
double StripWidth(bool measphi) const
returns the strip width for the phi or eta plane
MuonVal::ScalarBranch< float > & m_ALineTransZ
int getStationIndex() const
#define ATH_MSG_WARNING(x)
MuonVal::ScalarBranch< float > & m_stripEtaPitch
Strip dimensions.
MuonVal::VectorBranch< uint8_t > & m_stripPosNum
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::ScalarBranch< float > & m_stripPhiLength
MuonVal::ScalarBranch< float > & m_ALineRotZ
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
void push_back(const Amg::Transform3D &trans)
MuonVal::MuonTesterTree m_tree
Write a TTree for validation purposes.
bool fill(const EventContext &ctx)
Fills the tree per call.
int Nstrips(bool measphi) const
returns the number of strips for the phi or eta plane
StatusCode write()
Finally write the TTree objects.
MuonVal::CoordTransformBranch m_alignableNode
MuonVal::ThreeVectorBranch m_stripPos
Strip positions.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
MuonVal::ScalarBranch< uint8_t > & m_numRpcLayers
Number of eta & phi gas gaps.
MuonVal::ScalarBranch< float > & m_ALineTransT
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for PlaneSurface: LocalToGlobal method without dynamic memory allocation.
int getDoubletZ() const
return DoubletZ value for the given readout element
double getALine_rots() const
MuonVal::ScalarBranch< float > & m_ALineTransS
Alignment parameters.
Scalar mag() const
mag method
std::set< Identifier > m_testStations
Set of stations to be tested.
int getStationPhi() const
MuonVal::ScalarBranch< short > & m_stPhi
int getStationEta() const
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)