|
ATLAS Offline Software
|
Go to the documentation of this file.
15 GeoModelMmTest::GeoModelMmTest(
const std::string&
name, ISvcLocator* pSvcLocator):
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, 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.elementID(id) == eleId;
56 std::set<Identifier> excludedStations{};
59 if (testCham.size() != 6) {
61 return StatusCode::FAILURE;
64 std::string statName = testCham.substr(0, 3);
65 unsigned int statEta =
std::atoi(testCham.substr(3, 1).c_str()) * (testCham[4] ==
'A' ? 1 : -1);
66 unsigned int statPhi =
std::atoi(testCham.substr(5, 1).c_str());
68 const Identifier eleId = id_helper.elementID(statName, statEta, statPhi, is_valid);
70 ATH_MSG_FATAL(
"Failed to deduce a station name for " << testCham);
71 return StatusCode::FAILURE;
75 id_helper.detectorElement_end(),
76 std::inserter(excludedStations, excludedStations.end()),
78 return id_helper.elementID(id) == eleId;
83 id_helper.detectorElement_end(),
86 return excludedStations.count(id) == 0;
89 if (!excludedStations.empty()) {
90 std::stringstream excluded_report{};
92 excluded_report <<
" *** " <<
m_idHelperSvc->toString(
id) << std::endl;
94 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
97 std::stringstream sstr{};
101 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
104 return StatusCode::SUCCESS;
108 return StatusCode::SUCCESS;
111 const EventContext& ctx{Gaudi::Hive::currentContext()};
123 if (reElement->
identify() != test_me) {
126 return StatusCode::FAILURE;
134 return StatusCode::FAILURE;
139 const int numStrips = reElement->
numStrips(layerHash);
140 const int fStrip = reElement->
firstStrip(layerHash);
141 const int lStrip = fStrip+numStrips-1;
143 for (
int strip = fStrip; strip <= lStrip; ++strip) {
155 const IdentifierHash layHash = reElement->
layerHash(chId);
157 if (backCnv != chId) {
160 return StatusCode::FAILURE;
162 if (layHash != reElement->
layerHash(channelHash)) {
163 ATH_MSG_FATAL(
"Constructing the layer hash from the identifier "<<
164 m_idHelperSvc->toString(chId)<<
" leads to different layer hashes "<<
165 layHash<<
" vs. "<< reElement->
layerHash(channelHash));
166 return StatusCode::FAILURE;
172 const double stripLen{design.stripLength(strip)};
173 if (stripLen && (design.stripNumber(stripPos2D) != strip ||
174 design.stripNumber(stripPos2D - 0.49 * stripLen * Amg::Vector2D::UnitY()) != strip ||
175 design.stripNumber(stripPos2D + 0.49 * stripLen * Amg::Vector2D::UnitY()) != strip)) {
176 ATH_MSG_FATAL(
"Conversion channel -> strip -> channel failed for "
178 <<
Amg::toString(locStripPos)<<
" got "<<design.stripNumber(stripPos2D)
179 <<
", first strip: "<<fStrip<<std::endl<<design);
180 return StatusCode::FAILURE;
182 ATH_MSG_VERBOSE(
"first strip "<<fStrip<<
", numStrips "<< numStrips <<
", channel "
189 return StatusCode::SUCCESS;
218 unsigned int numStrips = reElement->
numStrips(layHash);
219 unsigned int fStrip = reElement->
firstStrip(layHash);
220 unsigned int lStrip = fStrip+numStrips-1;
222 for (
unsigned int strip = fStrip; strip <= lStrip ; ++strip) {
230 <<
" layer: "<<
layer<<
" strip: "<<strip);
249 if (strip != fStrip)
continue;
262 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.
std::string find(const std::string &s)
return a remapped string
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].
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
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
Gaudi::Property< std::vector< std::string > > m_excludeStat
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.