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) {
125 bool isValidLay{
false};
128 layer,
chType, 1, isValidLay);
134 for (
unsigned int channel = 1; channel < numChannel ; ++channel) {
135 bool isValidCh{
false};
138 layer,
chType, channel, isValidCh);
146 <<
" --> layerHash: "<<
static_cast<unsigned>(layHash));
148 if (backCnv != chID) {
151 return StatusCode::FAILURE;
153 if (layHash != reElement->
layerHash(measHash)) {
154 ATH_MSG_FATAL(
"Constructing the layer hash from the identifier "<<
155 m_idHelperSvc->toString(chID)<<
" leads to different layer hashes "<<
156 layHash<<
" vs. "<< reElement->
layerHash(measHash));
157 return StatusCode::FAILURE;
165 return StatusCode::SUCCESS;
191 for (
unsigned int layer = 1; layer <= reElement->
numLayers(); ++layer) {
195 unsigned int numWireGroup = 0;
197 bool isValidLay{
false};
200 layer,
chType, 1, isValidLay);
223 for (
unsigned int phiIndex = 1; phiIndex <= reElement->
numPadPhi(layHash); ++phiIndex) {
224 for(
unsigned int etaIndex = 1; etaIndex <= reElement->
numPadEta(layHash); ++etaIndex) {
225 bool isValidPad{
false};
228 layer,
chType, etaIndex, phiIndex, isValidPad);
232 <<
" layer: "<<layer<<
" pad: ("<<etaIndex <<
", " << phiIndex<<
") channelType: "<<
chType);
236 if (etaIndex == 1 && phiIndex == 1) {
238 }
else if (etaIndex == 2 && phiIndex == 1) {
277 if (!(etaIndex == 1 && phiIndex == 1))
continue;
292 bool isValidStrip{
false};
299 <<
" layer: "<<layer<<
" strip: "<<
strip<<
" channelType: "<<
chType);
309 if (
strip != 1)
continue;
328 for (
unsigned int wireGroup = 1; wireGroup <= numWireGroup; ++wireGroup) {
329 bool isValidWire{
false};
332 layer,
chType, wireGroup, isValidWire);
336 <<
" layer: "<<layer<<
" wireGroup: "<<wireGroup<<
" channelType: "<<
chType);
345 if (wireGroup != 1)
continue;
357 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.
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the local coordinate system of the readout element into the global AT...
int stationEta() const
Returns the stationEta (positive A site, negative C site)
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...
const std::string & chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
Identifier identify() const override final
Return the ATLAS 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
Return the alignable transform node of the readout element.
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.
unsigned numChannels(const IdentifierHash &measHash) const
Returns the number of strips / wires / pads in a given gasGap.
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
const PadDesign & padDesign(const IdentifierHash &measHash) const
Retrieves the readoutElement Layer given the Identifier/Hash.
double padHeight(const IdentifierHash &measHash) const
Returns the height of all the pads that are not adjacent to the bottom edge of the trapezoid active a...
unsigned padEta(const IdentifierHash &measHash) const
Returns the Eta index of the pad for the given pad identifier.
double gasGapThickness() const
Returns the thickness of the gas gap.
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
localCornerArray localPadCorners(const IdentifierHash &measHash) const
double stripLength(const IdentifierHash &measHash) const
Length of each strip.
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
double padPhiShift(const IdentifierHash &measHash) const
Returns the staggering shift of inner pad edges in the phi direction.
int padNumber(const Amg::Vector2D &hitPos, const IdentifierHash &measHash) const
Returns the pad Number given local position of hit and Identifier/Hash.
double sChamberLength() const
Length of the chamber on the short side.
const StripDesign & stripDesign(const IdentifierHash &measHash) const
Retrieves the readoutElement Layer given the Identifier/Hash.
globalCornerArray globalPadCorners(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
unsigned numLayers() const
Returns the number of gas gap layers.
double anglePadPhi(const IdentifierHash &measHash) const
Returns the angular pitch of the pads in the phi direction.
IdentifierHash layerHash(const Identifier &measId) const override final
Transforms the Identifier into a layer hash.
unsigned numPadEta(const IdentifierHash &measHash) const
Returns the number of pads in the eta direction in the given layer.
unsigned padPhi(const IdentifierHash &measHash) const
Returns the Phi index of the pad for the given pad identifier.
double beamlineRadius(const IdentifierHash &measHash) const
Returns the distance between the gasGap center and the beamline.
double chamberHeight() const
Height of the chamber.
double lChamberLength() const
Length of the chamber on the long side.
Amg::Vector3D globalChannelPosition(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
Returns the global pad/strip/wireGroup position.
unsigned numPadPhi(const IdentifierHash &measHash) const
Returns the number of pads in the Phi direction in the given gasGap layer.
Amg::Vector2D localChannelPosition(const IdentifierHash &measHash) const
Returns the local position of the measurement in the repsective frame.
const WireGroupDesign & wireDesign(const IdentifierHash &measHash) const
Retrieves the readoutElement Layer given the Identifier/Hash.
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.