|
ATLAS Offline Software
|
Go to the documentation of this file.
16 GeoModelMdtTest::GeoModelMdtTest(
const std::string&
name, ISvcLocator* pSvcLocator):
33 if (testCham.size() != 6) {
35 return StatusCode::FAILURE;
38 std::string statName = testCham.substr(0, 3);
39 unsigned int statEta =
std::atoi(testCham.substr(3, 1).c_str()) *
40 (testCham[4] ==
'A' ? 1 : -1);
41 unsigned int statPhi =
std::atoi(testCham.substr(5, 1).c_str());
44 id_helper.elementID(statName, statEta, statPhi, is_valid);
46 ATH_MSG_FATAL(
"Failed to deduce a station name for " << testCham);
47 return StatusCode::FAILURE;
51 const Identifier secMl = id_helper.multilayerID(eleId, 2, is_valid);
58 std::set<Identifier> excludedStations{};
61 if (testCham.size() != 6) {
63 return StatusCode::FAILURE;
66 std::string statName = testCham.substr(0, 3);
67 unsigned int statEta =
std::atoi(testCham.substr(3, 1).c_str()) * (testCham[4] ==
'A' ? 1 : -1);
68 unsigned int statPhi =
std::atoi(testCham.substr(5, 1).c_str());
70 const Identifier eleId = id_helper.elementID(statName, statEta, statPhi, is_valid);
72 ATH_MSG_FATAL(
"Failed to deduce a station name for " << testCham);
73 return StatusCode::FAILURE;
76 excludedStations.insert(eleId);
78 const Identifier secMl = id_helper.multilayerID(eleId, 2, is_valid);
80 excludedStations.insert(secMl);
84 for(
auto itr = id_helper.detectorElement_begin();
85 itr!= id_helper.detectorElement_end();++itr){
86 if (excludedStations.count(*itr) == 0) {
91 if (!excludedStations.empty()) {
92 std::stringstream excluded_report{};
94 excluded_report <<
" *** " <<
m_idHelperSvc->toString(
id) << std::endl;
96 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
99 std::stringstream sstr{};
103 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
106 return StatusCode::SUCCESS;
110 return StatusCode::SUCCESS;
113 const EventContext& ctx{Gaudi::Hive::currentContext()};
121 const int ml = id_helper.multilayer(test_me);
122 const std::string detStr =
m_idHelperSvc->toStringDetEl(test_me);
123 ATH_MSG_DEBUG(
"Test retrieval of Mdt detector element "<<detStr);
129 if (reElement->
identify() != test_me) {
131 return StatusCode::FAILURE;
140 return StatusCode::FAILURE;
142 for (
unsigned int lay = 1 ; lay <= reElement->
numLayers() ; ++lay ) {
150 return StatusCode::FAILURE;
156 return StatusCode::SUCCESS;
161 if (!swapReadXML.good()) {
165 std::set<Identifier> chamberIDs{};
167 swapReadXML<<
"<Table name=\"MdtTubeROSides\">"<<std::endl;
170 itr != idHelper.detectorElement_end();
174 if(!readoutEle)
continue;
175 if (!chamberIDs.insert(idHelper.elementID(
swap)).second)
continue;
177 swapReadXML<<
" <Row ";
178 swapReadXML<<
"MDTTUBEROSIDES_DATA_ID=\""<<
counter<<
"\" ";
182 swapReadXML<<
"side=\""<<
side<<
"\" ";
183 swapReadXML<<
"/>"<<std::endl;
186 swapReadXML<<
"</Table>"<<std::endl;
211 for (
unsigned int lay = 1; lay <= readoutEle->
numLayers(); ++lay) {
214 if (!readoutEle->
isValid(measHash))
continue;
220 readoutEle->
center(gctx, measHash));
228 return m_tree.
fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
def retrieve(aClass, aKey=None)
MuonVal::ScalarBranch< unsigned short > & m_stIndex
Identifier of the readout element.
const SpectrometerSector * msSector() const
Returns the pointer to the envelope volume enclosing all chambers in the sector.
unsigned int numTubesInLay() const
Returns the number of tubes per layer.
StatusCode init(OWNER *instance)
Initialize method.
std::string find(const std::string &s)
return a remapped string
double tubeLength(const IdentifierHash &hash) const
static IdentifierHash measurementHash(unsigned int layerNumber, unsigned int tubeNumber)
Transform the layer and tube number to the measurementHash.
std::string chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
void dumpReadoutSideXML() const
double activeTubeLength(const IdentifierHash &hash) const
Amg::Vector3D readOutPos(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the readout card.
MuonVal::ScalarBranch< short > & m_stML
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
Gaudi::Property< std::string > m_swapRead
MuonVal::ScalarBranch< unsigned short > & m_numTubes
Number of tubes per layer.
MuonVal::VectorBranch< unsigned short > & m_tubeNum
MuonVal::MuonTesterTree m_tree
MuonVal::CoordTransformBranch m_alignableNode
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
MuonVal::ScalarBranch< short > & m_stPhi
double readoutSide
Is the readout chip at positive or negative Z?
StatusCode execute() override
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
unsigned int multilayer() const
Returns the multi layer of the MdtReadoutElement.
double wireLength(const IdentifierHash &hash) const
std::set< Identifier > m_testStations
Set of stations to be tested.
const MuonDetectorManager * m_detMgr
MuonVal::ScalarBranch< std::string > & m_chamberDesign
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
MuonVal::ScalarBranch< unsigned short > & m_numLayers
Number of tubes per layer.
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::ScalarBranch< short > & m_stEta
::StatusCode StatusCode
StatusCode definition for legacy code.
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
unsigned int numLayers() const
Returns the number of tube layer.
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.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
Amg::Vector3D center(const ActsGeometryContext &ctx) const
Returns the detector center (Which is the same as the detector center of the first measurement layer)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
MuonVal::VectorBranch< double > & m_wireLength
Include the GeoPrimitives which need to be put first.
double innerTubeRadius() const
Returns the inner tube radius.
void push_back(const T &value)
Adds a new element at the end of the vector.
MuonVal::VectorBranch< double > & m_tubeLength
MuonVal::CoordSystemsBranch m_tubeTransform
Transformation to each tube.
MuonVal::ThreeVectorBranch m_tubePosInCh
Position of the tube in the sector frame.
const GeoAlignableTransform * alignableTransform() const
Returnsthe alignable transform of the readout element.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::VectorBranch< unsigned short > & m_tubeLay
Readout each tube specifically.
Identifier identify() const override final
Return the athena identifier.
double tubePitch() const
Returns the pitch between 2 tubes in a layer.
MuonVal::VectorBranch< double > & m_activeTubeLength
StatusCode initialize() override
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
void push_back(const Amg::Transform3D &trans)
MuonVal::ScalarBranch< double > & m_tubePitch
bool fill(const EventContext &ctx)
Fills the tree per call.
MuonVal::ThreeVectorBranch m_roPos
Position of the readout.
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.
std::vector< Identifier >::const_iterator const_id_iterator
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...
StatusCode finalize() override
int stationEta() const
Returns the stationEta (positive A site, negative O site)
const parameterBook & getParameters() const
MuonVal::ScalarBranch< double > & m_tubeRad
bool isValid(const IdentifierHash &measHash) const
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))
StatusCode dumpToTree(const EventContext &ctx, const ActsGeometryContext &gctx, const MdtReadoutElement *readoutEle)