![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include <GaudiKernel/SystemOfUnits.h>
15 if (
pars.stripDesign) ostr<<
"Strips: "<<(*
pars.stripDesign)<<std::endl;
16 if (
pars.wireGroupDesign) ostr<<
"Wire Groups: "<<(*
pars.wireGroupDesign)<<std::endl;
17 if (
pars.padDesign) ostr<<
"Pads: "<<(*
pars.padDesign)<<std::endl;
23 m_pars{std::move(
args)} {
32 #ifndef SIMULATIONBASE
41 return StatusCode::FAILURE;
44 IdentifierHash layHash{
layer};
47 return StatusCode::FAILURE;
51 #ifndef SIMULATIONBASE
55 design.longHalfHeight(),
62 IdentifierHash layHash{
layer};
65 return StatusCode::FAILURE;
68 #ifndef SIMULATIONBASE
72 design.longHalfHeight(),
73 design.halfWidth())));
77 IdentifierHash layHash{
layer};
80 return StatusCode::FAILURE;
83 #ifndef SIMULATIONBASE
87 design.longHalfHeight(),
88 design.halfWidth())));
95 return StatusCode::SUCCESS;
99 unsigned int layIdx =
static_cast<unsigned int>(measHash);
113 <<
" is out of range. Maximum range "<< maxReadoutLayers);
114 return Amg::Transform3D::Identity();
119 if (
chType(measHash) == ReadoutChannelType::Strip) {
122 if (!stripCenterOpt) {
123 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" The strip " <<
channelNumber(measHash) <<
" doesn't intersect with the edges of the trapezoid.");
126 stripCenter = std::move(*stripCenterOpt);
128 stripCenter.x() += 0.25 *
stripWidth(measHash);
131 stripCenter.x() -= 0.25 *
stripWidth(measHash);
135 else if (
chType(measHash) == ReadoutChannelType::Wire) {
138 if (!wireGroupCenterOpt) {
139 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" The wireGroup" <<
channelNumber(measHash) <<
"doesn't intersect with the edges of the trapezoid.");
140 return wireGroupCenter;
142 wireGroupCenter = std::move(*wireGroupCenterOpt);
151 wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() - 0.5 *
lPadLength(measHash));
154 ATH_MSG_DEBUG(
"The last wire center before modification is: " << wireGroupCenter.x());
156 ATH_MSG_DEBUG(
"The last wire group width is: " << lastWireGroupWidth <<
" and half of that is: "<< lastWireGroupWidth / 2);
158 wireGroupCenter.x() = wireGroupCenter.x() - (lastWireGroupWidth / 2 + 1) *
wirePitch(measHash);
159 ATH_MSG_DEBUG(
"The last wire of the last second group is at: " << wireGroupCenter.x());
162 wireGroupCenter.x() = 0.5 * (wireGroupCenter.x() + 0.5 *
lPadLength(measHash));
167 wireGroupCenter.x() = wireGroupCenter.x() -
wirePitch(measHash);
169 return wireGroupCenter;
171 else if (
chType(measHash) == ReadoutChannelType::Pad) {
178 padCenter = std::move(*padCenterOpt);
188 const IdentifierHash lHash =
layerHash(measHash);
189 unsigned int layIdx =
static_cast<unsigned int>(lHash);
193 <<
"with the layer hash "<<layIdx<<
" is invalid. Maximum range "<<
m_pars.
stripLayers.size());
198 channelPos.block<2,1>(0,0) = std::move(localChannel);
205 const IdentifierHash lHash =
layerHash(measHash);
206 unsigned int layIdx =
static_cast<unsigned int>(lHash);
211 for (
unsigned int corner = 0; corner < lPadCorners.size(); ++corner) {
212 gPadCorners[corner].block<2,1>(0,0) = std::move(lPadCorners[corner]);
223 const IdentifierHash lHash =
layerHash(measHash);
224 unsigned int layIdx =
static_cast<unsigned int>(lHash);
242 #ifndef SIMULATIONBASE
244 std::map<Identifier, std::shared_ptr<Acts::Surface>> surfaces{};
246 for (
unsigned int ch : {ReadoutChannelType::Strip, ReadoutChannelType::Wire,
247 ReadoutChannelType::Pad}) {
258 const IdentifierHash lHash =
layerHash(measHash);
260 unsigned int layIdx =
static_cast<unsigned int>(lHash);
262 if(
chType(measHash) == ReadoutChannelType::Strip){
271 localstripleftEdge = std::move(*stripleftEdgeOpt);
272 stripleftEdge.block<2,1>(0,0) = std::move(localstripleftEdge);
276 }
else if(
chType(measHash) == ReadoutChannelType::Wire){
287 localwireleftEdge = std::move(*wireleftedgeOpt);
288 wireleftEdge.block<2,1>(0,0) = std::move(localwireleftEdge);
294 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" The layer hash "<<layIdx
295 <<
" is not valid Type "<<
chType(measHash));
302 const IdentifierHash lHash =
layerHash(measHash);
304 unsigned int layIdx =
static_cast<unsigned int>(lHash);
306 if(
chType(measHash) == ReadoutChannelType::Strip){
315 localstriprightEdge = std::move(*striprightEdgeOpt);
316 striprightEdge.block<2,1>(0,0) = std::move(localstriprightEdge);
320 }
else if(
chType(measHash) == ReadoutChannelType::Wire){
331 localwirerightEdge = std::move(*wirerightedgeOpt);
332 wirerightEdge.block<2,1>(0,0) = std::move(localwirerightEdge);
338 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" The layer hash "<<layIdx
339 <<
" is not valid Type "<<
chType(measHash));
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.
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.
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.
A muon chamber is a collection of readout elements belonging to the same station.
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.
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)
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
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
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 numLayers() const
Returns the number of gas gap layers.
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)
std::shared_ptr< Acts::Surface > surfacePtr(const IdentifierHash &hash) const
Returns the pointer associated to a certain wire / plane.
#define ATH_MSG_WARNING(x)
std::map< Identifier, std::shared_ptr< Acts::Surface > > getSurfaces() const override final
Returns all surfaces that are associated with the active readout planes.
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.