7#include <GaudiKernel/SystemOfUnits.h>
10# include "Acts/Surfaces/TrapezoidBounds.hpp"
11# include "Acts/Surfaces/Surface.hpp"
19 ostr<<
"sTGC parameter halfX (S/L):"<<
pars.sHalfChamberLength<<
"/"<<
pars.lHalfChamberLength
20 <<
", halfY: "<<
pars.halfChamberHeight<<
", thickness: "<<
pars.halfChamberTck;
37 m_pars.layerBounds->makeBounds<Acts::TrapezoidBounds>(
m_pars.sHalfChamberLength,
39 m_pars.halfChamberHeight)));
42 if (
m_pars.stripLayers.empty()) {
44 return StatusCode::FAILURE;
46 for (
unsigned layer = 0; layer <
m_pars.stripLayers.size(); ++layer) {
49 ATH_MSG_FATAL(
"Layer "<<
m_pars.stripLayers[layer]<<
" has a very strange hash. Expect "<<layer);
50 return StatusCode::FAILURE;
60 90.*Gaudi::Units::deg)));
66 return StatusCode::SUCCESS;
74 switch (
chType(measHash)) {
80 std::optional<Amg::Vector2D> stripCenterOpt = design.
center(ch);
81 if (!stripCenterOpt) {
82 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" The strip " << ch <<
" doesn't intersect with the edges of the trapezoid.");
87 stripCenter = std::move(*stripCenterOpt);
99 std::optional<Amg::Vector2D> wireGroupCenterOpt = design.
center(ch);
100 if (!wireGroupCenterOpt) {
102 <<
"doesn't intersect with the edges of the trapezoid.");
103 return wireGroupCenter;
105 wireGroupCenter = std::move(*wireGroupCenterOpt);
115 wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() - design.
longHalfHeight());
117 ATH_MSG_VERBOSE(
"The actual center of the last wire group is: " << wireGroupCenter.x());
120 ATH_MSG_VERBOSE(
"The last wire of the last second group is at: " << wireGroupCenter.x());
123 wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() + design.
longHalfHeight());
127 return wireGroupCenter;
132 <<
"doesn't is not a valid pad number.");
133 return Amg::Vector2D::Zero();
135 return padCenterOpt.value();
138 return Amg::Vector2D::Zero();
161 for (
unsigned corner = 0; corner < lPadCorners.size(); ++corner) {
162 gPadCorners[corner] =
localToGlobalTransform(ctx, lHash)* layer.to3D(std::move(lPadCorners[corner]),
true);
167 <<
" is out of range. Maximum range "<<
m_pars.padLayers.size());
173 int padEta = design.channelNumber(hitPos).first;
174 int padPhi = design.channelNumber(hitPos).second;
182 switch (
chType(measHash)) {
192 <<
" is not valid Type "<<
chType(measHash));
193 return Amg::Vector3D::Zero();
200 switch (
chType(measHash)) {
210 <<
" is not valid Type "<<
chType(measHash));
211 return Amg::Vector3D::Zero();
Scalar mag() const
mag method
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)
sTgcIdHelper::sTgcChannelTypes chType
This is a "hash" representation of an Identifier.
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)
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< const Acts::PlanarBounds > pBounds)
Invokes the factory to create plane surfaces && to associate them with the particular transform cache...
Identifier identify() const override final
Return the ATLAS identifier.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
StatusCode createGeoTransform()
Creates the TransformCacheDetEle corresponding the generic local -> global transformation of the read...
StatusCode insertTransform(const IdentifierHash &hash)
Constructs the TransformDetEleCache associated with the hash of the given Mdt tube or strip layer.
MuonReadoutElement(const defineArgs &args)
Constructor taking the basic define arguments.
static IdentifierHash geoTransformHash()
Returns the hash that is associated with the surface cache holding the transformation that is placing...
Amg::Vector2D stripPosition(int stripNum) const override final
Override from stripDesign. This function will give the center of the pad by taking the sequential cha...
double halfWidth() const
Returns the half height of the strip panel.
CheckVector2D center(int stripNumb) const
Returns the bisector of the strip (Global numbering scheme)
const Amg::Vector2D & firstStripPos() const
Vector indicating the first strip position.
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.
Amg::Vector3D localStripRightEdge(unsigned int stripNum, bool phiView=false) const
Returns the position of the right strip edge at (negative y in the strip design description) in the l...
Amg::Vector3D to3D(CheckVector2D &&vec, const bool phiView) const
Transforms the 2D vector from the strip design into a 3D vector If phi view is switched on,...
const Amg::Transform3D & toOrigin() const
Returns the transformation to go from the strip layer center to the origin of the Strip chamber.
Amg::Vector3D localStripLeftEdge(unsigned int stripNum, bool phiView=false) const
Returns the position of the strip edge at (positive y in the strip design description) in the local c...
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.
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.
Amg::Vector3D leftStripEdge(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
static unsigned gasGapNumber(const IdentifierHash &measHash)
Returns the gasGap (0 to 3) for a given identifierHash.
unsigned padEta(const IdentifierHash &measHash) const
Returns the Eta index of the pad for the given pad identifier.
double firstStripPitch(const IdentifierHash &measHash) const
Gas Gaps.
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
StatusCode initElement() override final
Initialization of the readout elements.
virtual ~sTgcReadoutElement()
localCornerArray localPadCorners(const IdentifierHash &measHash) const
std::array< Amg::Vector3D, 4 > globalCornerArray
Returns an array of four 3D vectors representing corner positions of the pads.
sTgcReadoutElement(defineArgs &&args)
std::array< Amg::Vector2D, 4 > localCornerArray
Returns an array of four 2D vectors representing corner positions of the pads.
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
int padNumber(const Amg::Vector2D &hitPos, const IdentifierHash &measHash) const
Returns the pad Number given local position of hit and Identifier/Hash.
const sTgcIdHelper & m_idHelper
Amg::Vector3D rightStripEdge(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
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
bool isEtaZero(const IdentifierHash &measurementHash, const Amg::Vector2D &localPosition) const
IdentifierHash layerHash(const Identifier &measId) const override final
Transforms the Identifier into a layer hash.
unsigned padPhi(const IdentifierHash &measHash) const
Returns the Phi index of the pad for the given pad identifier.
const parameterBook & getParameters() const
Amg::Vector3D localPosition(const IdentifierHash &measHash) const
Returns the local position in the local gasGap frame.
static unsigned channelNumber(const IdentifierHash &measHash)
Returns channel position for a given identifierHash.
Amg::Transform3D fromGapToChamOrigin(const IdentifierHash &layerHash) const
Returns the transform to go from the gasGap -> chamber origin.
Amg::Vector3D globalChannelPosition(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
Returns the global pad/strip/wireGroup position.
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.
static IdentifierHash createHash(const unsigned gasGap, const unsigned channelType, const unsigned channel, const unsigned wireInGrp=0)
Create a measurement hash from the Identifier fields.
const StripLayer & stripLayer(const IdentifierHash &measId) 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...
std::ostream & operator<<(std::ostream &ostr, const Chamber::defineArgs &args)
std::string toString(const MuonGMR4::MuonReadoutElement *re)
std::array< Amg::Vector2D, 4 > localCornerArray
std::array< Amg::Vector3D, 4 > globalCornerArray
MmReadoutElement::parameterBook parameterBook
Set of parameters to describe an sTGC chamber.