|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GaudiKernel/SystemOfUnits.h"
23 return StatusCode::SUCCESS;
31 if (testCham.size() != 6) {
33 return StatusCode::FAILURE;
36 std::string statName = testCham.substr(0, 3);
37 unsigned int statEta =
std::atoi(testCham.substr(3, 1).c_str()) *
38 (testCham[4] ==
'A' ? 1 : -1);
39 unsigned int statPhi =
std::atoi(testCham.substr(5, 1).c_str());
41 const Identifier eleId = id_helper.elementID(statName, statEta, statPhi, 1, is_valid);
43 ATH_MSG_FATAL(
"Failed to deduce a station name for " << testCham);
44 return StatusCode::FAILURE;
47 id_helper.detectorElement_end(),
50 return id_helper.stationName(id) == id_helper.stationName(eleId) &&
51 id_helper.stationEta(id) == id_helper.stationEta(eleId) &&
52 id_helper.stationPhi(id) == id_helper.stationPhi(eleId);
57 std::copy(id_helper.detectorElement_begin(),
58 id_helper.detectorElement_end(),
61 std::stringstream sstr{};
65 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
67 return StatusCode::SUCCESS;
70 const EventContext& ctx{Gaudi::Hive::currentContext()};
72 if (!detMgr.isValid()) {
75 return StatusCode::FAILURE;
86 if (reElement->
identify() != test_me) {
88 <<
m_idHelperSvc->toStringDetEl(test_me) <<
". But got instead "
90 return StatusCode::FAILURE;
96 for (
int doubPhi = reElement->
getDoubletPhi(); doubPhi <= reElement->NphiStripPanels(); ++doubPhi) {
97 for (
bool measPhi: {
false,
true}) {
98 for (
int strip = 1 ; strip < reElement->
Nstrips(measPhi); ++strip) {
100 const Identifier stripId = idHelper.channelID(test_me,
101 idHelper.doubletZ(test_me),
107 <<
", gasGap:"<<
gasGap<<
", doubletPhi: "<<doubPhi
108 <<
", measurePhi "<<measPhi<<
", strip: "<<strip);
114 return StatusCode::FAILURE;
120 if ( (stripPos - globPos3D).
mag() > std::numeric_limits<float>::epsilon()) {
121 ATH_MSG_FATAL(
"Retrieving the strip position in two different ways leads to two distinct results "
123 return StatusCode::FAILURE;
127 if (!laySurf.insideBounds(locPos2D)){
129 <<
" is outside bounds "<<laySurf.bounds());
130 return StatusCode::FAILURE;
132 if (!laySurf.insideBounds(locPos2D + stripLen * Amg::Vector2D::UnitY())){
134 " of "<<
m_idHelperSvc->toString(stripId)<<
" is outside bounds "<<laySurf.bounds());
135 return StatusCode::FAILURE;
136 }
if (!laySurf.insideBounds(locPos2D - stripLen * Amg::Vector2D::UnitY())){
138 <<
" of "<<
m_idHelperSvc->toString(stripId)<<
" is outside bounds "<<laySurf.bounds());
139 return StatusCode::FAILURE;
146 return StatusCode::SUCCESS;
187 for (
int doubPhi = readoutEle->
getDoubletPhi(); doubPhi <= maxDoubPhi; ++doubPhi) {
189 for (
bool measPhi : {
false,
true}) {
190 unsigned int numStrip = readoutEle->
Nstrips(measPhi);
191 for (
unsigned int strip = 1; strip <= numStrip ; ++strip) {
199 <<
" gap: "<<
gap<<
" strip: "<<strip<<
" meas phi: "<<measPhi);
205 return StatusCode::FAILURE;
215 if (strip != 1)
continue;
227 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
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
GeoModelRpcTest(const std::string &name, ISvcLocator *pSvcLocator)
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)