 |
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GeoModelKernel/GeoDefinitions.h"
14 #include "GaudiKernel/SystemOfUnits.h"
21 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;
90 const EventContext& ctx{Gaudi::Hive::currentContext()};
92 if (!detMgr.isValid()) {
95 return StatusCode::FAILURE;
108 <<
m_idHelperSvc->toStringDetEl(test_me) <<
". But got instead "
110 return StatusCode::FAILURE;
114 return StatusCode::SUCCESS;
125 int stML = id_helper.multilayer(roEl->
identify());
134 const Identifier genStripID =id_helper.channelID(stIndex, stEta, stPhi,
135 stML, 1, sTgcIdHelper::sTgcChannelTypes::Strip, 1);
136 const Identifier genPadID =id_helper.channelID(stIndex, stEta, stPhi,
137 stML, 1, sTgcIdHelper::sTgcChannelTypes::Pad, 1);
175 for (
int lay = 1; lay <=
numLayers; ++lay) {
176 const Identifier layWireID =id_helper.channelID(stIndex, stEta, stPhi,
177 stML, lay, sTgcIdHelper::sTgcChannelTypes::Wire, 1);
178 const Identifier layStripID =id_helper.channelID(stIndex, stEta, stPhi,
179 stML, lay, sTgcIdHelper::sTgcChannelTypes::Strip, 1);
180 const Identifier layPadID =id_helper.padID(stIndex, stEta, stPhi,
181 stML, lay, sTgcIdHelper::sTgcChannelTypes::Pad, 1, 1);
201 for (
int wireGroupIndex = 1; wireGroupIndex <= numWireGroups; ++wireGroupIndex) {
203 const Identifier wireGroupID =id_helper.channelID(stIndex, stEta, stPhi, stML, lay,
204 sTgcIdHelper::sTgcChannelTypes::Wire, wireGroupIndex,
isValid);
206 ATH_MSG_WARNING(
"The following wire group ID is not valid: " << wireGroupID);
217 if (wireGroupIndex != 1)
continue;
235 for (
int stripIndex = 1; stripIndex <= numStrips; ++stripIndex) {
237 const Identifier stripID =id_helper.channelID(stIndex, stEta, stPhi, stML, lay,
238 sTgcIdHelper::sTgcChannelTypes::Strip, stripIndex,
isValid);
253 if (stripIndex != 1)
continue;
282 for(
int etaIndex = 1; etaIndex <= numPadEta; ++etaIndex) {
284 const Identifier padID =id_helper.padID(stIndex, stEta, stPhi, stML, lay,
291 std::array<Amg::Vector2D,4> localPadCorners{make_array<Amg::Vector2D, 4>(
Amg::Vector2D::Zero())};
292 std::array<Amg::Vector3D,4> globalPadCorners{make_array<Amg::Vector3D, 4>(
Amg::Vector3D::Zero())};
320 if (etaIndex != 1 ||
phiIndex != 1)
continue;
328 return m_tree.
fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
MuonVal::ScalarBranch< float > & m_chamberHeight
bool padCorners(const Identifier &id, std::array< Amg::Vector2D, 4 > &corners) const
pad corners
MuonVal::VectorBranch< uint8_t > & m_padRotGasGap
MuonVal::ScalarBranch< float > & m_yCutout
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
MuonVal::ScalarBranch< uint > & m_numStrips
Strip dimensions.
MuonVal::ScalarBranch< float > & m_stripWidth
StatusCode execute() override
Ensure that the Athena extensions are properly loaded.
MuonVal::VectorBranch< float > & m_stripLengths
StatusCode init(OWNER *instance)
Initialize method.
MuonVal::VectorBranch< uint8_t > & m_padGasGap
const Amg::Transform3D & getDelta() const
read A-line parameters and include the chamber rotation/translation in the local-to-global (ATLAS) re...
Eigen::Matrix< double, 2, 1 > Vector2D
MuonVal::VectorBranch< uint > & m_padPhi
MuonVal::ThreeVectorBranch m_globalPadCornerTL
MuonVal::TwoVectorBranch m_localWireGroupPos
MuonVal::ThreeVectorBranch m_globalPadCornerBL
MuonVal::VectorBranch< float > & m_firstPadHeight
MuonVal::ScalarBranch< short > & m_stEta
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::VectorBranch< float > & m_firstPadPhiDiv
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
MuonVal::MuonTesterTree m_tree
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::ScalarBranch< float > & m_stripPitch
int numberOfWires(const Identifier &id) const
Get the total number of wires (single wires) of a chamber.
MuonVal::CoordTransformBranch m_alignableNode
MuonVal::ScalarBranch< float > & m_sChamberLength
Chamber Length for debug.
int numberOfPads(const Identifier &layerId) const
Get the number of pad per layer.
MuonVal::TwoVectorBranch m_localPadPos
#define ATH_MSG_VERBOSE(x)
MuonVal::VectorBranch< uint8_t > & m_wireGroupGasGap
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
std::set< Identifier > m_testStations
Set of stations to be tested.
MuonVal::VectorBranch< uint > & m_numPadPhi
double radialDistance
DT-2015-11-29 distance from the beamline to the center of the module.
MuonVal::VectorBranch< uint > & m_numWireGroups
MuonVal::VectorBranch< uint8_t > & m_stripGasGap
bool padGlobalCorners(const Identifier &id, std::array< Amg::Vector3D, 4 > &gcorners) const
pad global corners
MuonVal::ScalarBranch< float > & m_gasTck
MuonVal::VectorBranch< uint > & m_numPads
Pad dimensions.
MuonVal::TwoVectorBranch m_localPadCornerTR
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position - should be renamed to channel position If the strip number is outside the range of va...
int padNumber(const Amg::Vector2D &pos, const Identifier &id) const
pad number corresponding to local position
MuonVal::ThreeVectorBranch m_globalPadCornerBR
MuonVal::ScalarBranch< float > & m_lChamberLength
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
MuonVal::VectorBranch< int > & m_padNumber
MuonVal::ScalarBranch< std::string > & m_chamberDesign
MuonVal::VectorBranch< float > & m_padPhiShift
MuonVal::ScalarBranch< float > & m_beamlineRadius
MuonVal::ThreeVectorBranch m_globalPadPos
void push_back(const Amg::Vector2D &vec)
interface using the Amg::Vector3D
MuonVal::TwoVectorBranch m_localPadCornerTL
bool padGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
pad global position
MuonVal::CoordSystemsBranch m_wireGroupRot
Rotation matrix of the respective wireGroup layers.
::StatusCode StatusCode
StatusCode definition for legacy code.
MuonVal::VectorBranch< uint > & m_padEta
MuonVal::ScalarBranch< uint > & m_wireGroupWidth
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
MuonVal::ScalarBranch< float > & m_sPadLength
Eigen::Affine3d Transform3D
MuonVal::ScalarBranch< float > & m_wireWidth
MuonVal::VectorBranch< uint8_t > & m_wireGroupRotGasGap
bool padPosition(const Identifier &id, Amg::Vector2D &pos) const
pad position
MuonVal::VectorBranch< float > & m_wireCutout
MuonVal::ScalarBranch< float > & m_sGapLength
GasGap Lengths for debug.
MuonVal::ThreeVectorBranch m_globalPadCornerTR
MuonVal::ScalarBranch< float > & m_anglePadPhi
MuonVal::VectorBranch< uint > & m_stripNum
double channelPitch(const Identifier &id) const
Channel pitch.
MuonVal::ScalarBranch< short > & m_stIndex
Identifier of the readout element.
void push_back(const T &value)
Adds a new element at the end of the vector.
MuonVal::ThreeVectorBranch m_globalWireGroupPos
MuonVal::ScalarBranch< float > & m_lPadLength
StatusCode finalize() override
MuonVal::CoordSystemsBranch m_padRot
Rotation matrix of the respective pad layers.
virtual int numberOfLayers(bool) const override final
number of layers in phi/eta projection
virtual Amg::Transform3D AmdbLRSToGlobalTransform() const override final
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
StatusCode initialize(bool used=true)
constexpr unsigned int numLayers()
StatusCode dumpToTree(const EventContext &ctx, const sTgcReadoutElement *readoutEle)
Eigen::Matrix< double, 3, 1 > Vector3D
MuonVal::ScalarBranch< float > & m_gapHeight
MuonVal::ScalarBranch< short > & m_numLayers
double channelLength(int channel) const
STRIPS ONLY: calculate channel length for a given strip number.
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
MuonVal::VectorBranch< uint > & m_numPadEta
MuonVal::TwoVectorBranch m_localPadCornerBL
int getStationIndex() const
MuonVal::VectorBranch< float > & m_firstStripPitch
#define ATH_MSG_WARNING(x)
std::string getStationType() const
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
void push_back(const Amg::Transform3D &trans)
MuonVal::ScalarBranch< short > & m_stPhi
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
MuonDetectorManager from the conditions store.
bool fill(const EventContext &ctx)
Fills the tree per call.
StatusCode write()
Finally write the TTree objects.
MuonVal::TwoVectorBranch m_hitPosition
MuonVal::VectorBranch< uint > & m_numWires
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
MuonVal::TwoVectorBranch m_localStripPos
MuonVal::ThreeVectorBranch m_globalStripPos
const MuonPadDesign * getPadDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
double wirePitch(int gas_gap=1) const
single wire pitch.
MuonVal::TwoVectorBranch m_localPadCornerBR
MuonVal::VectorBranch< uint8_t > & m_stripRotGasGap
MuonVal::ScalarBranch< float > & m_wirePitch
MuonVal::ScalarBranch< short > & m_stML
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
MuonVal::VectorBranch< uint > & m_firstWireGroupWidth
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
MuonVal::CoordSystemsBranch m_stripRot
Rotation matrix of the respective strip layers.
MuonVal::VectorBranch< uint8_t > & m_wireGroupNum
MuonVal::VectorBranch< float > & m_padHeight
int getStationPhi() const
int getStationEta() const
StatusCode initialize() override
MuonVal::ScalarBranch< float > & m_lGapLength