 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include <GaudiKernel/SystemOfUnits.h>
10 #ifndef SIMULATIONBASE
11 # include "Acts/Surfaces/TrapezoidBounds.hpp"
12 # include "Acts/Surfaces/Surface.hpp"
20 if (
pars.stripDesign) ostr<<
"Strips: "<<(*
pars.stripDesign)<<std::endl;
21 if (
pars.wireGroupDesign) ostr<<
"Wire Groups: "<<(*
pars.wireGroupDesign)<<std::endl;
22 if (
pars.padDesign) ostr<<
"Pads: "<<(*
pars.padDesign)<<std::endl;
25 sTgcReadoutElement::~sTgcReadoutElement() =
default;
28 m_pars{std::move(
args)} {
37 #ifndef SIMULATIONBASE
46 return StatusCode::FAILURE;
49 IdentifierHash layHash{
layer};
52 return StatusCode::FAILURE;
56 #ifndef SIMULATIONBASE
60 design.longHalfHeight(),
67 IdentifierHash layHash{
layer};
70 return StatusCode::FAILURE;
73 #ifndef SIMULATIONBASE
77 design.longHalfHeight(),
78 design.halfWidth())));
82 IdentifierHash layHash{
layer};
85 return StatusCode::FAILURE;
88 #ifndef SIMULATIONBASE
92 design.longHalfHeight(),
93 design.halfWidth())));
100 return StatusCode::SUCCESS;
108 if (
chType(measHash) == ReadoutChannelType::Strip) {
113 std::optional<Amg::Vector2D> stripCenterOpt = design.center(
ch);
114 if (!stripCenterOpt) {
115 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" The strip " <<
ch <<
" doesn't intersect with the edges of the trapezoid.");
120 stripCenter = std::move(*stripCenterOpt);
122 stripCenter.x() += 0.25 * design.stripWidth();
124 if (
ch == design.numStrips() &&
firstStripPitch(measHash) > 0.75 * design.stripPitch()) {
125 stripCenter.x() -= 0.25 * design.stripWidth();
128 }
else if (
chType(measHash) == ReadoutChannelType::Wire) {
132 std::optional<Amg::Vector2D> wireGroupCenterOpt = design.center(
ch);
133 if (!wireGroupCenterOpt) {
134 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" The wireGroup" <<
ch <<
"doesn't intersect with the edges of the trapezoid.");
135 return wireGroupCenter;
137 wireGroupCenter = std::move(*wireGroupCenterOpt);
141 ATH_MSG_DEBUG(
"The first wiregroup width is " <<design.numWiresInGroup(
ch) <<
" firstWirePos: " << design.firstStripPos());
142 ATH_MSG_DEBUG(
"The last wire pos is: " << wireGroupCenter.x() + (0.5 * (design.numWiresInGroup(
ch) + 1) - 1) * design.stripPitch() );
144 wireGroupCenter.x() = wireGroupCenter.x() + (0.5 * (design.numWiresInGroup(
ch) + 1) - 1) * design.stripPitch();
147 wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() - design.longHalfHeight());
148 }
else if (
ch == design.numStrips()) {
149 ATH_MSG_VERBOSE(
"The actual center of the last wire group is: " << wireGroupCenter.x());
151 wireGroupCenter.x() = wireGroupCenter.x() - 0.5 * (design.numWiresInGroup(
ch) + 1) * design.stripPitch();
152 ATH_MSG_VERBOSE(
"The last wire of the last second group is at: " << wireGroupCenter.x());
155 wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() + design.longHalfHeight());
159 return wireGroupCenter;
161 else if (
chType(measHash) == ReadoutChannelType::Pad) {
168 padCenter = std::move(*padCenterOpt);
178 const IdentifierHash lHash =
layerHash(measHash);
179 unsigned int layIdx =
static_cast<unsigned int>(lHash);
183 <<
"with the layer hash "<<layIdx<<
" is invalid. Maximum range "<<
m_pars.
stripLayers.size());
188 channelPos.block<2,1>(0,0) = std::move(localChannel);
195 const IdentifierHash lHash =
layerHash(measHash);
196 unsigned int layIdx =
static_cast<unsigned int>(lHash);
201 for (
unsigned int corner = 0; corner < lPadCorners.size(); ++corner) {
202 gPadCorners[corner].block<2,1>(0,0) = std::move(lPadCorners[corner]);
213 const IdentifierHash lHash =
layerHash(measHash);
214 unsigned int layIdx =
static_cast<unsigned int>(lHash);
233 const IdentifierHash lHash =
layerHash(measHash);
235 unsigned int layIdx =
static_cast<unsigned int>(lHash);
237 if(
chType(measHash) == ReadoutChannelType::Strip){
246 localstripleftEdge = std::move(*stripleftEdgeOpt);
247 stripleftEdge.block<2,1>(0,0) = std::move(localstripleftEdge);
251 }
else if(
chType(measHash) == ReadoutChannelType::Wire){
262 localwireleftEdge = std::move(*wireleftedgeOpt);
263 wireleftEdge.block<2,1>(0,0) = std::move(localwireleftEdge);
269 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" The layer hash "<<layIdx
270 <<
" is not valid Type "<<
chType(measHash));
277 const IdentifierHash lHash =
layerHash(measHash);
279 unsigned int layIdx =
static_cast<unsigned int>(lHash);
281 if(
chType(measHash) == ReadoutChannelType::Strip){
290 localstriprightEdge = std::move(*striprightEdgeOpt);
291 striprightEdge.block<2,1>(0,0) = std::move(localstriprightEdge);
295 }
else if(
chType(measHash) == ReadoutChannelType::Wire){
306 localwirerightEdge = std::move(*wirerightedgeOpt);
307 wirerightEdge.block<2,1>(0,0) = std::move(localwirerightEdge);
313 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" The layer hash "<<layIdx
314 <<
" is not valid Type "<<
chType(measHash));
324 double lpos = (
chType(
measurementHash) == ReadoutChannelType::Strip ? localPosition.x() : localPosition.y() );
Amg::Vector2D localChannelPosition(const Identifier &measId) const
Returns the local pad/strip/wireGroup position.
Amg::Transform3D fromGapToChamOrigin(const IdentifierHash &layerHash) const
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
MmReadoutElement::parameterBook parameterBook
double firstStripPitch(const Identifier &measId) const
Gas Gaps.
double wireCutout() const
Extract the wireCutout for a wireGroup layer.
std::array< Amg::Vector2D, 4 > localCornerArray
Returns an array of four 2D vectors representing corner positions of the pads.
unsigned int padEta(const Identifier &measId) const
Returns the Eta index of the pad for the given pad identifier.
CheckVector2D leftEdge(int stripNumb) const
Returns the left edge of the strip (Global numbering scheme)
Eigen::Matrix< double, 2, 1 > Vector2D
std::array< Amg::Vector3D, 4 > globalCornerArray
Returns an array of four 3D vectors representing corner positions of the pads.
const StripDesign & stripDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
const Amg::Transform3D & toOrigin() const
Returns the transformation to go from the strip layer center to the origin of the Strip chamber.
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
double lHalfChamberLength
Length of the chamber on the long side.
StatusCode createGeoTransform()
#define ATH_MSG_VERBOSE(x)
StatusCode initElement() override final
Element initialization.
unsigned int padNumber(const Identifier &measId) const
Returns the pad number in the conventional pad numbering scheme from the sequential channel number.
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
std::pair< int, int > channelNumber(const Amg::Vector2D &hitPos) const
Function to retrieve the pad eta and phi given a local position coordinate.
std::array< Amg::Vector3D, 4 > globalCornerArray
std::array< Amg::Vector2D, 4 > localCornerArray
const WireGroupDesign & wireDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
static IdentifierHash createHash(const unsigned int gasGap, const unsigned int channelType, const unsigned int channel, const unsigned int wireInGrp=0)
Create a measurement hash from the Identifier fields.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
int channel(const Identifier &id) const override
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< StripLayer > wireGroupLayers
Amg::Vector3D chamberStripPos(const IdentifierHash &measHash) const
const parameterBook & getParameters() const
Eigen::Affine3d Transform3D
Amg::Vector3D leftStripEdge(const ActsGeometryContext &ctx, const IdentifierHash &measHash) const
static unsigned int chType(const IdentifierHash &measHash)
Returns the channel type for a given identifierHash.
Amg::Vector3D center(const ActsGeometryContext &ctx) const
Returns the detector center (Which is the same as the detector center of the first measurement layer)
MsgStream & operator<<(MsgStream &out, const ActsUtils::Stat &stat)
bool isEtaZero(const IdentifierHash &measurementHash, const Amg::Vector2D &localPosition) const
double halfChamberHeight
sTGC Chamber Details
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
Include the GeoPrimitives which need to be put first.
std::vector< StripLayer > padLayers
ActsTrk::SurfaceBoundSetPtr< Acts::TrapezoidBounds > layerBounds
Amg::Vector3D globalChannelPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global pad/strip/wireGroup position.
static IdentifierHash geoTransformHash()
Returns the hash that is associated with the surface cache holding the transformation that is placing...
Identifier padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi) const
static unsigned int gasGapNumber(const IdentifierHash &measHash)
Returns the gasGap (0 to 3) for a given identifierHash.
const sTgcIdHelper & m_idHelper
Amg::Vector3D rightStripEdge(const ActsGeometryContext &ctx, const IdentifierHash &measHash) const
int stationEta(const Identifier &id) const
Identifier identify() const override final
Return the athena identifier.
Eigen::Matrix< double, 3, 1 > Vector3D
unsigned int padPhi(const Identifier &measId) const
Returns the Phi index of the pad for the given pad identifier.
const PadDesign & padDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
double halfWidth() const
Returns the half height of the strip panel.
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::PlanarBounds > pBounds)
#define ATH_MSG_WARNING(x)
globalCornerArray globalPadCorners(const ActsGeometryContext &ctx, const Identifier &measId) const
localCornerArray localPadCorners(const Identifier &measId) const
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Set of parameters to describe an sTGC chamber.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
const StripLayer & stripLayer(const Identifier &measId) const
CheckVector2D rightEdge(int stripNumb) const
Returns the right edge of the strip (Global numbering scheme)
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...
IdentifierHash layerHash(const Identifier &measId) const override final
Transforms the Identifier into a layer hash.
static unsigned int channelNumber(const IdentifierHash &measHash)
Returns channel position for a given identifierHash.
Scalar mag() const
mag method
std::vector< StripLayer > stripLayers
double sHalfChamberLength
Length of the chamber on the short side.