 |
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GeoModelKernel/GeoDefinitions.h"
14 #include "GaudiKernel/SystemOfUnits.h"
20 return StatusCode::SUCCESS;
28 auto translateTokenList = [
this, &idHelper](
const std::vector<std::string>& chNames){
30 std::set<Identifier> transcriptedIds{};
31 for (
const std::string& token : chNames) {
32 if (token.size() != 6) {
33 ATH_MSG_WARNING(
"Wrong format given for "<<token<<
". Expecting 6 characters");
37 const std::string statName = token.substr(0, 3);
38 const unsigned statEta =
std::atoi(token.substr(3, 1).c_str()) * (token[4] ==
'A' ? 1 : -1);
39 const unsigned statPhi =
std::atoi(token.substr(5, 1).c_str());
46 transcriptedIds.insert(eleId);
49 transcriptedIds.insert(secMlId);
52 return transcriptedIds;
55 std::vector <std::string>& selectedSt =
m_selectStat.value();
56 const std::vector <std::string>& excludedSt =
m_excludeStat.value();
57 selectedSt.erase(std::remove_if(selectedSt.begin(), selectedSt.end(),
58 [&excludedSt](
const std::string& token){
59 return std::ranges::find(excludedSt, token) != excludedSt.end();
60 }), selectedSt.end());
62 if (selectedSt.size()) {
64 std::stringstream sstr{};
68 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
70 const std::set<Identifier> excluded = translateTokenList(excludedSt);
72 for(
auto itr = idHelper.detectorElement_begin();
73 itr!= idHelper.detectorElement_end();++itr){
74 if (!excluded.count(*itr)) {
79 if (!excluded.empty()) {
80 std::stringstream excluded_report{};
82 excluded_report <<
" *** " <<
m_idHelperSvc->toStringDetEl(
id) << std::endl;
84 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
87 return StatusCode::SUCCESS;
91 const EventContext& ctx{Gaudi::Hive::currentContext()};
93 if (!detMgr.isValid()) {
96 return StatusCode::FAILURE;
111 <<
m_idHelperSvc->toStringDetEl(test_me) <<
". But got instead "
113 return StatusCode::FAILURE;
116 const Identifier layerId = id_helper.channelID(test_me, id_helper.multilayer(test_me),
gasGap, 1024);
121 bool is_valid{
false};
122 const Identifier strip_id = id_helper.channelID(test_me, id_helper.multilayer(test_me),
132 const double stripLength = 0.49 * reElement->
stripLength(strip_id);
133 if (design.channelNumber(locPos) !=
channel ||
134 design.channelNumber(locPos + stripLength *Amg::Vector2D::UnitY()) !=
channel ||
135 design.channelNumber(locPos - stripLength *Amg::Vector2D::UnitY()) !=
channel ){
136 ATH_MSG_FATAL(
"Conversion of channel -> strip -> channel failed for "
139 <<
", backward channel: "<<design.channelNumber(locPos));
140 return StatusCode::FAILURE;
147 return StatusCode::SUCCESS;
159 const int multilayer = id_helper.
multilayer(detElId);
171 for (
int gasgap = 1; gasgap <= 4; ++gasgap) {
179 bool is_valid{
false};
182 if (!is_valid)
continue;
199 if (!design.leftEdge(
channel, l_left) || !design.center(
channel, l_cen) ||
200 !design.rightEdge(
channel, l_right)){
224 if (
channel != fStrip)
continue;
226 <<
", "<<roEl->
transform(strip_id).translation().perp());
235 return m_tree.
fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for PlaneSurface: GlobalToLocal method without dynamic memory allocation - boolean checks i...
MuonVal::ScalarBranch< float > & m_ActiveHeightR
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
Ensure that the Athena extensions are properly loaded.
StatusCode execute() override
MuonVal::CoordTransformBranch m_alignableNode
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like MM<L or S><1 or 2><A/C><layer> Example string MML1A6 ,...
MuonVal::MuonTesterTree m_tree
MuonVal::ScalarBranch< float > & m_ActiveWidthS
StatusCode init(OWNER *instance)
Initialize method.
StatusCode initialize() override
MuonVal::VectorBranch< float > & m_stripActiveLengthRight
virtual Amg::Transform3D AmdbLRSToGlobalTransform() const override final
Eigen::Matrix< double, 2, 1 > Vector2D
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
MuonVal::VectorBranch< uint > & m_channel
MuonVal::TwoVectorBranch m_locStripCenter
std::set< Identifier > m_testStations
Set of stations to be tested.
MuonVal::VectorBranch< float > & m_stripActiveLength
MuonVal::ScalarBranch< float > & m_moduleHeight
int stationName(const Identifier &id) const
#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.
double getLongSsize() const
MuonVal::ScalarBranch< float > & m_moduleWidthL
MuonVal::ScalarBranch< short > & m_stationEta
double stripActiveLength(const Identifier &id) const
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
MuonVal::ScalarBranch< short > & m_stationPhi
MuonVal::ThreeVectorBranch m_stripRightEdge
int multilayer(const Identifier &id) const
MuonVal::VectorBranch< uint8_t > & m_stripRotGasGap
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
double stripActiveLengthRight(const Identifier &id) const
MuonVal::ThreeVectorBranch m_stripCenter
MuonVal::VectorBranch< short > & m_gasGap
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
void push_back(const Amg::Vector2D &vec)
interface using the Amg::Vector3D
MuonVal::ScalarBranch< float > & m_ActiveWidthL
MuonVal::VectorBranch< unsigned > & m_firstStrip
::StatusCode StatusCode
StatusCode definition for legacy code.
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
Eigen::Affine3d Transform3D
MuonVal::ThreeVectorBranch m_stripLeftEdge
MuonVal::ScalarBranch< unsigned short > & m_stationIndex
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::ScalarBranch< float > & m_stStripPitch
MuonVal::TwoVectorBranch m_firstStripPos
void push_back(const T &value)
Adds a new element at the end of the vector.
MuonVal::VectorBranch< unsigned > & m_nStrips
const Amg::Transform3D & getDelta() const
read A-line parameters and include the chamber rotation/translation in the local-to-global (ATLAS) re...
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
MuonVal::CoordSystemsBranch m_stripRot
Rotation matrix of the respective strip layers.
StatusCode initialize(bool used=true)
const std::array< int, 4 > & getReadoutSide() const
Eigen::Matrix< double, 3, 1 > Vector3D
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
MuonDetectorManager from the conditions store.
int getStationIndex() const
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
int numberOfMissingBottomStrips(const Identifier &layerId) const
#define ATH_MSG_WARNING(x)
double stripLength(const Identifier &id) const
strip length Wrappers to MuonChannelDesign::channelLength() taking into account the passivated width
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
MuonVal::ScalarBranch< short > & m_multilayer
void push_back(const Amg::Transform3D &trans)
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
bool fill(const EventContext &ctx)
Fills the tree per call.
StatusCode write()
Finally write the TTree objects.
StatusCode finalize() override
int numberOfMissingTopStrips(const Identifier &layerId) const
Number of missing bottom and top strips (not read out)
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
StatusCode dumpToTree(const EventContext &ctx, const MuonGM::MMReadoutElement *detEl)
MuonVal::ScalarBranch< int > & m_stationName
MuonVal::VectorBranch< int > & m_readoutSide
MuonVal::VectorBranch< float > & m_stripLength
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.
MuonVal::ScalarBranch< float > & m_moduleWidthS
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
MuonVal::VectorBranch< float > & m_stripActiveLengthLeft
int getStationPhi() const
int getStationEta() const
MuonVal::VectorBranch< bool > & m_isStereo
double stripActiveLengthLeft(const Identifier &id) const