21 auto translateTokenList = [
this, &idHelper](
const std::vector<std::string>& chNames){
23 std::set<Identifier> transcriptedIds{};
24 for (
const std::string& token : chNames) {
25 if (token.size() != 6) {
26 ATH_MSG_WARNING(
"Wrong format given for "<<token<<
". Expecting 6 characters");
30 const std::string statName = token.substr(0, 3);
31 const unsigned statEta = std::atoi(token.substr(3, 1).c_str()) * (token[4] ==
'A' ? 1 : -1);
32 const unsigned statPhi = std::atoi(token.substr(5, 1).c_str());
39 transcriptedIds.insert(eleId);
42 transcriptedIds.insert(secMlId);
45 return transcriptedIds;
48 std::vector <std::string>& selectedSt =
m_selectStat.value();
49 const std::vector <std::string>& excludedSt =
m_excludeStat.value();
50 selectedSt.erase(
std::remove_if(selectedSt.begin(), selectedSt.end(),
51 [&excludedSt](
const std::string& token){
52 return std::ranges::find(excludedSt, token) != excludedSt.end();
53 }), selectedSt.end());
55 if (selectedSt.size()) {
57 std::stringstream sstr{};
61 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
63 const std::set<Identifier> excluded = translateTokenList(excludedSt);
67 if (!excluded.count(*itr)) {
72 if (!excluded.empty()) {
73 std::stringstream excluded_report{};
75 excluded_report <<
" *** " <<
m_idHelperSvc->toStringDetEl(
id) << std::endl;
77 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
81 return StatusCode::SUCCESS;
85 return StatusCode::SUCCESS;
88 const EventContext& ctx{Gaudi::Hive::currentContext()};
105 return StatusCode::FAILURE;
112 for (
Amg::Vector3D axis :{Amg::Vector3D::UnitX(),Amg::Vector3D::UnitY(),Amg::Vector3D::UnitZ()}) {
113 const double closure_mag = std::abs( (transClosure*axis).
dot(axis) - 1.);
114 if (closure_mag > std::numeric_limits<float>::epsilon() ) {
117 return StatusCode::FAILURE;
121 for (
unsigned int layer = 1; layer <= reElement->
numLayers(); ++layer) {
123 bool isValidLay{
false};
126 layer,
chType, 1, isValidLay);
130 const unsigned int numChannel = reElement->
numChannels(layID);
132 for (
unsigned int channel = 1; channel < numChannel ; ++channel) {
133 bool isValidCh{
false};
136 layer,
chType, channel, isValidCh);
144 <<
" --> layerHash: "<<
static_cast<unsigned>(layHash));
146 if (backCnv != chID) {
149 return StatusCode::FAILURE;
151 if (layHash != reElement->
layerHash(measHash)) {
152 ATH_MSG_FATAL(
"Constructing the layer hash from the identifier "<<
153 m_idHelperSvc->toString(chID)<<
" leads to different layer hashes "<<
154 layHash<<
" vs. "<< reElement->
layerHash(measHash));
155 return StatusCode::FAILURE;
174 return StatusCode::SUCCESS;
200 for (
unsigned int layer = 1; layer <= reElement->
numLayers(); ++layer) {
202 unsigned int numWireGroup = 0;
204 bool isValidLay{
false};
207 layer,
chType, 1, isValidLay);
230 for (
unsigned int phiIndex = 1; phiIndex <= reElement->
numPadPhi(layID); ++phiIndex) {
231 for(
unsigned int etaIndex = 1; etaIndex <= reElement->
numPadEta(layID); ++etaIndex) {
232 bool isValidPad{
false};
235 layer,
chType, etaIndex, phiIndex, isValidPad);
239 <<
" layer: "<<layer<<
" pad: ("<<etaIndex <<
", " << phiIndex<<
") channelType: "<<
chType);
242 if (etaIndex == 1 && phiIndex == 1) {
245 else if (etaIndex == 2 && phiIndex == 1) {
280 if (!(etaIndex == 1 && phiIndex == 1))
continue;
295 bool isValidStrip{
false};
302 <<
" layer: "<<layer<<
" strip: "<<
strip<<
" channelType: "<<
chType);
311 if (
strip != 1)
continue;
329 for (
unsigned int wireGroup = 1; wireGroup <= numWireGroup; ++wireGroup) {
330 bool isValidWire{
false};
333 layer,
chType, wireGroup, isValidWire);
337 <<
" layer: "<<layer<<
" wireGroup: "<<wireGroup<<
" channelType: "<<
chType);
345 if (wireGroup != 1)
continue;
356 return m_tree.fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
sTgcIdHelper::sTgcChannelTypes chType
const ServiceHandle< StoreGateSvc > & detStore() const
This is a "hash" representation of an Identifier.
MuonVal::VectorBranch< uint > & m_padEta
MuonVal::CoordTransformBranch m_alignableNode
MuonVal::VectorBranch< uint8_t > & m_padGasGap
MuonVal::VectorBranch< uint > & m_numPads
Pad dimensions.
MuonVal::VectorBranch< int > & m_padNumber
MuonVal::ScalarBranch< float > & m_yCutout
MuonVal::VectorBranch< uint > & m_numPadPhi
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
MuonVal::TwoVectorBranch m_localStripPos
MuonVal::ScalarBranch< float > & m_lChamberLength
MuonVal::CoordSystemsBranch m_stripRot
Rotation matrix of the respective strip layers.
MuonVal::ScalarBranch< float > & m_gasTck
MuonVal::TwoVectorBranch m_localPadCornerBR
MuonVal::VectorBranch< float > & m_padPhiShift
MuonVal::ScalarBranch< short > & m_stEta
MuonVal::VectorBranch< float > & m_firstPadHeight
MuonVal::ScalarBranch< uint > & m_wireGroupWidth
MuonVal::VectorBranch< uint > & m_numWires
MuonVal::VectorBranch< uint > & m_stripNum
MuonVal::VectorBranch< uint8_t > & m_wireGroupGasGap
MuonVal::ThreeVectorBranch m_globalPadCornerTR
StatusCode finalize() override
StatusCode dumpToTree(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const sTgcReadoutElement *readoutEle)
MuonVal::ScalarBranch< float > & m_stripWidth
Gaudi::Property< std::vector< std::string > > m_excludeStat
MuonVal::TwoVectorBranch m_localPadPos
MuonVal::ThreeVectorBranch m_globalStripPos
MuonVal::ScalarBranch< float > & m_anglePadPhi
MuonVal::ScalarBranch< float > & m_lGapLength
MuonVal::ThreeVectorBranch m_globalPadCornerTL
MuonVal::ThreeVectorBranch m_globalPadCornerBR
MuonVal::ScalarBranch< float > & m_wireWidth
MuonVal::VectorBranch< float > & m_wireCutout
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::VectorBranch< uint > & m_padPhi
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
MuonVal::ScalarBranch< short > & m_numLayers
MuonVal::VectorBranch< uint8_t > & m_wireGroupRotGasGap
MuonVal::TwoVectorBranch m_localPadCornerBL
MuonVal::MuonTesterTree m_tree
MuonVal::VectorBranch< float > & m_firstPadPhiDiv
MuonVal::VectorBranch< uint8_t > & m_wireGroupNum
const MuonDetectorManager * m_detMgr
MuonVal::ThreeVectorBranch m_globalPadCornerBL
MuonVal::VectorBranch< float > & m_padHeight
MuonVal::ScalarBranch< short > & m_stML
MuonVal::TwoVectorBranch m_localPadCornerTR
MuonVal::TwoVectorBranch m_hitPosition
MuonVal::TwoVectorBranch m_localWireGroupPos
MuonVal::VectorBranch< uint > & m_numWireGroups
MuonVal::ScalarBranch< float > & m_sPadLength
MuonVal::ScalarBranch< float > & m_lPadLength
StatusCode execute() override
MuonVal::ScalarBranch< uint > & m_numStrips
Strip dimensions.
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
MuonVal::VectorBranch< uint > & m_numPadEta
std::set< Identifier > m_testStations
Set of stations to be tested.
StatusCode initialize() override
MuonVal::VectorBranch< uint8_t > & m_stripRotGasGap
MuonVal::ScalarBranch< float > & m_sGapLength
GasGap Lengths for debug.
MuonVal::ScalarBranch< float > & m_stripPitch
MuonVal::ScalarBranch< float > & m_sChamberLength
Chamber Length for debug.
MuonVal::TwoVectorBranch m_localPadCornerTL
MuonVal::CoordSystemsBranch m_wireGroupRot
Rotation matrix of the respective wireGroup layers.
MuonVal::VectorBranch< uint > & m_firstWireGroupWidth
MuonVal::ScalarBranch< short > & m_stPhi
MuonVal::ScalarBranch< float > & m_wirePitch
MuonVal::ThreeVectorBranch m_globalWireGroupPos
MuonVal::VectorBranch< uint8_t > & m_padRotGasGap
MuonVal::VectorBranch< uint8_t > & m_stripGasGap
MuonVal::VectorBranch< float > & m_stripLengths
MuonVal::ThreeVectorBranch m_globalPadPos
MuonVal::ScalarBranch< float > & m_gapHeight
MuonVal::CoordSystemsBranch m_padRot
Rotation matrix of the respective pad layers.
MuonVal::ScalarBranch< std::string > & m_chamberDesign
MuonVal::ScalarBranch< float > & m_beamlineRadius
MuonVal::ScalarBranch< float > & m_chamberHeight
MuonVal::ScalarBranch< short > & m_stIndex
Identifier of the readout element.
int stationEta() const
Returns the stationEta (positive A site, negative O site)
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
const std::string & chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
Identifier identify() const override final
Return the athena identifier.
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))
const GeoAlignableTransform * alignableTransform() const
Returnsthe alignable transform of the readout element.
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
double firstPadPhiDiv() const
Returns the angle of the first pad outer edge w.r.t. the gasGap center from the beamline.
double halfWidth() const
Returns the half height of the strip panel.
double yCutout() const
Returns the cutout of the diamond.
double stripPitch() const
Distance between two adjacent strips.
double stripWidth() const
Width of a strip.
double shortHalfHeight() const
Returns the shorter half height of the panel.
double longHalfHeight() const
Returns the longer half height of the panel.
virtual int numStrips() const
Number of strips on the panel.
unsigned int numWiresInGroup(unsigned int groupNum) const
Returns the number of wires in a given group.
double wireCutout() const
Extract the wireCutout for a wireGroup layer.
unsigned int nAllWires() const
Returns the number of all wires.
Amg::Vector2D localChannelPosition(const Identifier &measId) const
Returns the local pad/strip/wireGroup position.
Amg::Vector3D globalChannelPosition(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the global pad/strip/wireGroup position.
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
localCornerArray localPadCorners(const Identifier &measId) const
const WireGroupDesign & wireDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
double stripLength(const Identifier &measId) const
Length of each strip.
const PadDesign & padDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
globalCornerArray globalPadCorners(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
double gasGapThickness() const
Returns the thickness of the gas gap.
unsigned int padPhi(const Identifier &measId) const
Returns the Phi index of the pad for the given pad identifier.
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
const StripDesign & stripDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
unsigned int numPadPhi(const Identifier &measId) const
Returns the number of pads in the Phi direction in the given gasGap layer.
unsigned int numPadEta(const Identifier &measId) const
Returns the number of pads in the eta direction in the given layer.
double sChamberLength() const
Length of the chamber on the short side.
unsigned int numLayers() const
Returns the number of gas gap layers.
double padPhiShift(const Identifier &measId) const
Returns the staggering shift of inner pad edges in the phi direction.
int padNumber(const Amg::Vector2D &hitPos, const Identifier &measId) const
Returns the pad Number given local position of hit and Identifier/Hash.
IdentifierHash layerHash(const Identifier &measId) const override final
Transforms the Identifier into a layer hash.
unsigned int padEta(const Identifier &measId) const
Returns the Eta index of the pad for the given pad identifier.
double chamberHeight() const
Height of the chamber.
double padHeight(const Identifier &measId) const
Returns the height of all the pads that are not adjacent to the bottom edge of the trapezoid active a...
double lChamberLength() const
Length of the chamber on the long side.
double anglePadPhi(const Identifier &measId) const
Returns the angular pitch of the pads in the phi direction.
unsigned int numChannels(const Identifier &measId) const
Returns the number of strips / wires / pads in a given gasGap.
double beamlineRadius(const Identifier &measId) const
Returns the distance between the gasGap center and the beamline.
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Identifier padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
Identifier multilayerID(const Identifier &channeldID) const
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.