![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include <GaudiKernel/SystemOfUnits.h>
17 ostr <<
" // Chamber half- length (min/max): "<<
pars.shortHalfX<<
"/"<<
pars.longHalfX
18 <<
", half-width "<<
pars.halfY<<
", height: "<<
pars.halfHeight;
19 ostr <<
" // Number of tube layers " <<
pars.tubeLayers.size()<< std::endl;
20 ostr <<
" // Tube pitch: " <<
pars.tubePitch
21 <<
" wall thickness: " <<
pars.tubeWall
22 <<
" inner radius: " <<
pars.tubeInnerRad
23 <<
" endplug: "<<
pars.endPlugLength
24 <<
" deadlength: "<<
pars.deadLength<< std::endl;
26 ostr <<
" // **** "<<
Amg::toString(
layer->tubeTransform(0).translation(), 2)<<std::endl;
32 m_pars{std::move(
args)} {
45 return StatusCode::FAILURE;
49 return StatusCode::FAILURE;
51 #ifndef SIMULATIONBASE
60 std::optional<Amg::Vector3D> prevLayPos{std::nullopt};
62 for (
unsigned int lay =1 ; lay <=
numLayers() ; ++lay) {
65 ATH_CHECK(insertTransform<MdtReadoutElement>(layHash));
66 #ifndef SIMULATIONBASE
71 std::optional<Amg::Vector3D> prevTubePos{std::nullopt};
74 GeoVolumeCursor tubeCursor =
layer.tubeCursor();
77 assert (!tubeCursor.atEnd());
80 prevTubePos = std::nullopt;
83 ATH_CHECK(insertTransform<MdtReadoutElement>(idHash));
84 #ifndef SIMULATIONBASE
90 if (std::abs(tubeRot.determinant()- 1.) > std::numeric_limits<float>::epsilon()){
91 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" Transformation matrix is not a pure rotation for "<<
94 return StatusCode::FAILURE;
101 const double dR = std::abs((tubePos - (*prevTubePos)).
z());
102 if (std::abs(dR -
tubePitch()) > pitchTolerance) {
103 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" Detected irregular tube in "<<
105 <<
". Expected tube pitch: "<<
tubePitch()<<
" measured tube pitch: "
108 return StatusCode::FAILURE;
111 if (prevLayPos &&
tube == 1) {
112 const double dR = (tubePos - (*prevLayPos)).
mag();
113 if (std::abs(dR -
tubePitch()) > pitchTolerance) {
114 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" Detected irregular layer pitch in "<<
116 <<
". Expected tube pitch: "<<
tubePitch()<<
" measured tube pitch: "
122 prevLayPos = std::make_optional<Amg::Vector3D>(tubePos);
124 prevTubePos = std::make_optional<Amg::Vector3D>(tubePos);
127 #ifndef SIMULATIONBASE
131 return StatusCode::SUCCESS;
135 const IdentifierHash&
hash)
const {
143 const IdentifierHash&
hash)
const {
151 const IdentifierHash&
hash)
const {
161 return zeroT.layerTransform();
167 return zeroT.tubeTransform(
tube);
173 return 2. * zeroT.tubeHalfLength(
tube);
182 const IdentifierHash& measHash,
190 zeroT.tubeHalfLength(
tube) *
191 Amg::Vector3D::UnitZ();
194 #ifndef SIMULATIONBASE
196 std::map<Identifier, std::shared_ptr<Acts::Surface>> surfaces{};
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
ActsTrk::SurfaceBoundSetPtr< Acts::LineBounds > tubeBounds
Sets of surface bounds which is shared amongst all readout elements used to assign the same bound obj...
Amg::Vector3D localTubePos(const IdentifierHash &hash) const
Returns the tube position in the chamber coordinate frame.
std::set< IdentifierHash > removedTubes
List of tube places without tubes.
unsigned int numTubesInLay() const
Returns the number of tubes per layer.
ActsTrk::SurfaceBoundSetPtr< Acts::TrapezoidBounds > layerBounds
std::vector< MdtTubeLayerPtr > tubeLayers
Vector defining the position of all tubes in each tube layer.
double tubeLength(const IdentifierHash &hash) const
static IdentifierHash measurementHash(unsigned int layerNumber, unsigned int tubeNumber)
Transform the layer and tube number to the measurementHash.
Amg::Transform3D toChamberLayer(const IdentifierHash &hash) const
Returns the transformation into the rest frame of the tube x-axis: Pointing towards the next layer y-...
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
double activeTubeLength(const IdentifierHash &hash) const
Amg::Vector3D readOutPos(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the readout card.
StatusCode createGeoTransform()
Helper struct to retrieve the tube lengths and the tube centers directly from the GeoModel tree.
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
StatusCode initElement() override final
Element initialization.
#define AmgSymMatrix(dim)
double tubeRadius() const
Adds the thickness of the tube wall onto the radius.
double readoutSide
Is the readout chip at positive or negative Z?
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
unsigned int multilayer() const
Returns the multi layer of the MdtReadoutElement.
double wireLength(const IdentifierHash &hash) const
static unsigned int layerNumber(const IdentifierHash &hash)
Transforms the identifier hash into a layer number ranging from (0-numLayers()-1)
double halfY
Length ~ number of tubes.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
A muon chamber is a collection of readout elements belonging to the same station.
std::map< Identifier, std::shared_ptr< Acts::Surface > > getSurfaces() const override final
Returns all surfaces that are associated with the active readout planes.
Set of parameters to describe a MDT chamber.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
unsigned int numLayers() const
Returns the number of tube layer.
Eigen::Affine3d Transform3D
MsgStream & operator<<(MsgStream &out, const ActsUtils::Stat &stat)
Include the GeoPrimitives which need to be put first.
double innerTubeRadius() const
Returns the inner tube radius.
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
double distanceToReadout(const ActsGeometryContext &ctx, const Identifier &measId, const Amg::Vector3D &globPoint) const
Returns the distance along the wire from the readout card The distance is given as the delta z of the...
static IdentifierHash geoTransformHash()
Returns the hash that is associated with the surface cache holding the transformation that is placing...
StatusCode strawSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::LineBounds > lBounds)
Identifier identify() const override final
Return the athena identifier.
double tubePitch() const
Returns the pitch between 2 tubes in a layer.
Eigen::Matrix< double, 3, 1 > Vector3D
double tubePitch
Distance between 2 tubes in the layer.
static unsigned int tubeNumber(const IdentifierHash &hash)
Transforms the idenfier hash into a tube number ranging from (0- numTubesInLay()-1)
double endPlugLength
Depth of the endplug into the active tube volume.
const MdtIdHelper & m_idHelper
double shortHalfX
The chambers have either a rectangular or a trapezoidal shape to first approximation.
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.
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Amg::Vector3D globalTubePos(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the tube center.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
const parameterBook & getParameters() const
Amg::Transform3D toTubeFrame(const IdentifierHash &hash) const
Returns the transformation into the rest frame of the tube x-axis: Pointing towards the next layer y-...
Amg::Vector3D highVoltPos(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the High Voltage connectors.
bool isValid(const IdentifierHash &measHash) const
Scalar mag() const
mag method