|
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;
104 unsigned int layIdx =
static_cast<unsigned int>(measHash);
118 <<
" is out of range. Maximum range "<< maxReadoutLayers);
119 return Amg::Transform3D::Identity();
124 if (
chType(measHash) == ReadoutChannelType::Strip) {
127 if (!stripCenterOpt) {
128 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" The strip " <<
channelNumber(measHash) <<
" doesn't intersect with the edges of the trapezoid.");
131 stripCenter = std::move(*stripCenterOpt);
133 stripCenter.x() += 0.25 *
stripWidth(measHash);
136 stripCenter.x() -= 0.25 *
stripWidth(measHash);
140 else if (
chType(measHash) == ReadoutChannelType::Wire) {
143 if (!wireGroupCenterOpt) {
144 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" The wireGroup" <<
channelNumber(measHash) <<
"doesn't intersect with the edges of the trapezoid.");
145 return wireGroupCenter;
147 wireGroupCenter = std::move(*wireGroupCenterOpt);
156 wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() - 0.5 *
lPadLength(measHash));
159 ATH_MSG_DEBUG(
"The last wire center before modification is: " << wireGroupCenter.x());
161 ATH_MSG_DEBUG(
"The last wire group width is: " << lastWireGroupWidth <<
" and half of that is: "<< lastWireGroupWidth / 2);
163 wireGroupCenter.x() = wireGroupCenter.x() - (lastWireGroupWidth / 2 + 1) *
wirePitch(measHash);
164 ATH_MSG_DEBUG(
"The last wire of the last second group is at: " << wireGroupCenter.x());
167 wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() + 0.5 *
lPadLength(measHash));
172 wireGroupCenter.x() = wireGroupCenter.x() -
wirePitch(measHash);
174 return wireGroupCenter;
176 else if (
chType(measHash) == ReadoutChannelType::Pad) {
183 padCenter = std::move(*padCenterOpt);
193 const IdentifierHash lHash =
layerHash(measHash);
194 unsigned int layIdx =
static_cast<unsigned int>(lHash);
198 <<
"with the layer hash "<<layIdx<<
" is invalid. Maximum range "<<
m_pars.
stripLayers.size());
203 channelPos.block<2,1>(0,0) = std::move(localChannel);
210 const IdentifierHash lHash =
layerHash(measHash);
211 unsigned int layIdx =
static_cast<unsigned int>(lHash);
216 for (
unsigned int corner = 0; corner < lPadCorners.size(); ++corner) {
217 gPadCorners[corner].block<2,1>(0,0) = std::move(lPadCorners[corner]);
228 const IdentifierHash lHash =
layerHash(measHash);
229 unsigned int layIdx =
static_cast<unsigned int>(lHash);
248 const IdentifierHash lHash =
layerHash(measHash);
250 unsigned int layIdx =
static_cast<unsigned int>(lHash);
252 if(
chType(measHash) == ReadoutChannelType::Strip){
261 localstripleftEdge = std::move(*stripleftEdgeOpt);
262 stripleftEdge.block<2,1>(0,0) = std::move(localstripleftEdge);
266 }
else if(
chType(measHash) == ReadoutChannelType::Wire){
277 localwireleftEdge = std::move(*wireleftedgeOpt);
278 wireleftEdge.block<2,1>(0,0) = std::move(localwireleftEdge);
284 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" The layer hash "<<layIdx
285 <<
" is not valid Type "<<
chType(measHash));
292 const IdentifierHash lHash =
layerHash(measHash);
294 unsigned int layIdx =
static_cast<unsigned int>(lHash);
296 if(
chType(measHash) == ReadoutChannelType::Strip){
305 localstriprightEdge = std::move(*striprightEdgeOpt);
306 striprightEdge.block<2,1>(0,0) = std::move(localstriprightEdge);
310 }
else if(
chType(measHash) == ReadoutChannelType::Wire){
321 localwirerightEdge = std::move(*wirerightedgeOpt);
322 wirerightEdge.block<2,1>(0,0) = std::move(localwirerightEdge);
328 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" The layer hash "<<layIdx
329 <<
" is not valid Type "<<
chType(measHash));
339 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.
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()
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.
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
int channel(const Identifier &id) const override
unsigned int numWireGroups(unsigned int gasGap) const
Number of wire groups in the gas gap.
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.
double gapHeight(const Identifier &measId) const
Height of gas Gap.
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
Include the GeoPrimitives which need to be put first.
std::vector< StripLayer > padLayers
ActsTrk::SurfaceBoundSetPtr< Acts::TrapezoidBounds > layerBounds
CheckVector2D center(int stripNumb) const
Returns the bisector of the strip (Global numbering scheme)
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
unsigned int wireGroupWidth(unsigned int gasGap) const
Number of wires in a normal wire group.
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 numWires(unsigned int gasGap) const
Number of wires in the gas gap.
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.
unsigned int firstWireGroupWidth(unsigned int gasGap) const
Number of wires in the first wire group.
double stripWidth(const Identifier &measId) const
Width of a strip.
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
unsigned int numStrips(const Identifier &measId) const
Strips Number of strips in a chamber.
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...
double wirePitch(const Identifier &measId) const
Wires Pitch of the wire.
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...
double lPadLength(const Identifier &measId) const
Length of gas Gap on long side for wireGroup/Pads.
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
double stripPitch(const Identifier &measId) const
Pitch of a strip.
std::vector< StripLayer > stripLayers
double sHalfChamberLength
Length of the chamber on the short side.