![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
15 GeoModelMmTest::GeoModelMmTest(
const std::string&
name, ISvcLocator* pSvcLocator):
26 if (testCham.size() != 6) {
28 return StatusCode::FAILURE;
31 std::string statName = testCham.substr(0, 3);
32 unsigned int statEta =
std::atoi(testCham.substr(3, 1).c_str()) *
33 (testCham[4] ==
'A' ? 1 : -1);
34 unsigned int statPhi =
std::atoi(testCham.substr(5, 1).c_str());
36 const Identifier eleId = id_helper.elementID(statName, statEta, statPhi, is_valid);
38 ATH_MSG_FATAL(
"Failed to deduce a station name for " << testCham);
39 return StatusCode::FAILURE;
42 id_helper.detectorElement_end(),
44 [&](
const Identifier&
id) {
45 return id_helper.elementID(id) == eleId;
50 std::copy(id_helper.detectorElement_begin(),
51 id_helper.detectorElement_end(),
54 std::stringstream sstr{};
58 ATH_MSG_DEBUG(
"Test only the following stations "<<std::endl<<sstr.str());
61 return StatusCode::SUCCESS;
65 return StatusCode::SUCCESS;
68 const EventContext& ctx{Gaudi::Hive::currentContext()};
80 if (reElement->
identify() != test_me) {
83 return StatusCode::FAILURE;
91 return StatusCode::FAILURE;
96 const int numStrips = reElement->
numStrips(layerHash);
97 const int fStrip = reElement->
firstStrip(layerHash);
98 const int lStrip = fStrip+numStrips-1;
100 for (
int strip = fStrip; strip <= lStrip; ++strip) {
103 const Identifier chId = id_helper.channelID(reElement->
identify(),
112 const IdentifierHash layHash = reElement->
layerHash(chId);
113 const Identifier backCnv = reElement->
measurementId(channelHash);
114 if (backCnv != chId) {
117 return StatusCode::FAILURE;
119 if (layHash != reElement->
layerHash(channelHash)) {
120 ATH_MSG_FATAL(
"Constructing the layer hash from the identifier "<<
121 m_idHelperSvc->toString(chId)<<
" leads to different layer hashes "<<
122 layHash<<
" vs. "<< reElement->
layerHash(channelHash));
123 return StatusCode::FAILURE;
129 const double stripLen{design.stripLength(strip)};
130 if (stripLen && (design.stripNumber(stripPos2D) != strip ||
131 design.stripNumber(stripPos2D - 0.49 * stripLen * Amg::Vector2D::UnitY()) != strip ||
132 design.stripNumber(stripPos2D + 0.49 * stripLen * Amg::Vector2D::UnitY()) != strip)) {
133 ATH_MSG_FATAL(
"Conversion channel -> strip -> channel failed for "
135 <<
Amg::toString(locStripPos)<<
" got "<<design.stripNumber(stripPos2D)
136 <<
", first strip: "<<fStrip<<std::endl<<design);
137 return StatusCode::FAILURE;
139 ATH_MSG_VERBOSE(
"first strip "<<fStrip<<
", numStrips "<< numStrips <<
", channel "
146 return StatusCode::SUCCESS;
175 unsigned int numStrips = reElement->
numStrips(layHash);
176 unsigned int fStrip = reElement->
firstStrip(layHash);
177 unsigned int lStrip = fStrip+numStrips-1;
179 for (
unsigned int strip = fStrip; strip <= lStrip ; ++strip) {
181 const Identifier chId = id_helper.channelID(reElement->
identify(),
187 <<
" layer: "<<
layer<<
" strip: "<<strip);
206 if (strip != fStrip)
continue;
219 return m_tree.
fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
def retrieve(aClass, aKey=None)
double moduleWidthS() const
Returns the width at the short edge.
MuonVal::ThreeVectorBranch m_stripRightEdge
double stripLength(const IdentifierHash &measHash) const
Returns the strip length.
MuonVal::VectorBranch< uint > & m_channel
static IdentifierHash createHash(const int gasGap, const int strip)
MuonVal::VectorBranch< int > & m_readoutSide
unsigned int nGasGaps() const
Returns the number of gas gaps.
StatusCode init(OWNER *instance)
Initialize method.
MuonVal::VectorBranch< unsigned > & m_readoutFirstStrip
Eigen::Matrix< double, 2, 1 > Vector2D
MuonVal::ScalarBranch< std::string > & m_chamberDesign
double gapLengthS(const IdentifierHash &layerHash) const
Length of gas Gap on short side.
std::string chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
MuonVal::VectorBranch< bool > & m_isStereo
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
double gapLengthL(const IdentifierHash &layerHash) const
Length of gas Gap on long side.
unsigned int numStrips(const IdentifierHash &layerHash) const
Returns the number of total active strips.
#define ATH_MSG_VERBOSE(x)
MuonVal::ScalarBranch< float > & m_ActiveWidthS
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like MM_<Large/Small Sector + Module type><Quadruplet number>
MuonVal::ScalarBranch< short > & m_stEta
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
MuonVal::ScalarBranch< float > & m_ActiveHeightR
GasGap Lengths for debug.
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
MuonVal::MuonTesterTree m_tree
MuonVal::CoordSystemsBranch m_stripRot
Rotation matrix of the respective strip layers.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
int multilayer() const
Returns the multi layer of the element [1-2].
A muon chamber is a collection of readout elements belonging to the same station.
MuonVal::ScalarBranch< unsigned short > & m_stIndex
Identifier of the readout element.
void push_back(const Amg::Vector2D &vec)
interface using the Amg::Vector3D
Amg::Vector3D stripPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the position of the strip center.
double moduleWidthL() const
Returns the width at the top edge.
MuonVal::VectorBranch< short > & m_gasGap
::StatusCode StatusCode
StatusCode definition for legacy code.
MuonVal::ThreeVectorBranch m_stripCenter
Eigen::Affine3d Transform3D
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
MuonVal::VectorBranch< uint8_t > & m_stripRotGasGap
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
int readoutSide(const IdentifierHash &measHash) const
Returns the readout side.
Out copy_if(In first, const In &last, Out res, const Pred &p)
unsigned int firstStrip(const IdentifierHash &layerHash) const
Returns the first active strip.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
MuonVal::ScalarBranch< short > & m_stML
Include the GeoPrimitives which need to be put first.
MuonVal::ScalarBranch< float > & m_moduleHeight
Chamber Length for debug.
void push_back(const T &value)
Adds a new element at the end of the vector.
MuonVal::CoordTransformBranch m_alignableNode
Amg::Vector3D leftStripEdge(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the strip edge.
const StripLayer & stripLayer(const Identifier &measId) const
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
MuonVal::ScalarBranch< short > & m_stPhi
MuonVal::ThreeVectorBranch m_stripLeftEdge
const GeoAlignableTransform * alignableTransform() const
Returnsthe alignable transform of the readout element.
Identifier identify() const override final
Return the athena identifier.
MuonVal::TwoVectorBranch m_firstStripPos
Eigen::Matrix< double, 3, 1 > Vector3D
const StripDesign & design() const
Returns the underlying strip design.
StatusCode finalize() override
double gapHeight(const IdentifierHash &layerHash) const
Height of gas Gap.
StatusCode dumpToTree(const EventContext &ctx, const ActsGeometryContext &gctx, const MmReadoutElement *readoutEle)
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
MuonVal::VectorBranch< float > & m_stripLength
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
IdentifierHash layerHash(const Identifier &measId) const override final
#define ATH_MSG_WARNING(x)
StatusCode execute() override
MuonVal::ScalarBranch< float > & m_ActiveWidthL
double moduleHeight() const
Returns the height along the z-axis.
void push_back(const Amg::Transform3D &trans)
Amg::Vector3D rightStripEdge(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the strip edge.
bool fill(const EventContext &ctx)
Fills the tree per call.
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
StatusCode write()
Finally write the TTree objects.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
int stationEta() const
Returns the stationEta (positive A site, negative O site)
double stripPitch() const
Distance between two adjacent strips.
StatusCode initialize() override
MuonVal::ScalarBranch< float > & m_moduleWidthL
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))
MuonVal::ScalarBranch< float > & m_moduleWidthS
MuonVal::TwoVectorBranch m_locStripCenter
MuonVal::ScalarBranch< float > & m_stStripPitch
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
const MuonDetectorManager * m_detMgr
std::set< Identifier > m_testStations
Set of stations to be tested.