![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include <GeoModelKernel/GeoDefinitions.h>
15 #include <GeoModelKernel/GeoLogVol.h>
16 #include <GeoModelKernel/GeoVFullPhysVol.h>
17 #include <GeoModelKernel/GeoVPhysVol.h>
29 #define THROW_EXCEPTION(MSG) \
31 std::stringstream sstr{}; \
32 sstr<<"RpcReadoutElement - "<<idHelperSvc()->toStringDetEl(identify())<<" "<<__LINE__<<": "; \
34 throw std::runtime_error(sstr.str()); \
43 m_mirrored{is_mirrored} {
44 std::string gVersion =
manager()->geometryVersion();
46 m_descratzneg = (zi < 0 && !is_mirrored);
47 setStationName(stName);
64 if (strip < 1 || strip >
Nstrips(measphi)) {
78 <<
"localStripSCoord: local_s is " << local_s <<
" for doubletPhi: " <<
doubletPhi
79 <<
", measuresPhi: " << measphi <<
", strip: " << strip);
83 if (strip < 1 || strip >
Nstrips(measphi)) {
95 <<
"localStripZCoord: local_z is " << local_z <<
" measuresPhi, " << measphi <<
", strip: " << strip );
102 <<
gasGap <<
", measuresPhi: " << measphi <<
", strip:" << strip );
110 <<
"RpcReadoutElement::stripPos gl. transl. R, phi "
111 << rpcTrans.translation().perp() <<
" " << rpcTrans.translation().phi() <<
" R-Rsize/2 "
112 << rpcTrans.translation().perp() -
m_Rsize * 0.5 );
114 return rpcTrans * localP;
121 <<
", gasGap: " <<
gasGap <<
", mesuresPhi: " << measphi
122 <<
", strip: " << strip );
141 if (measphi) lstrip =
NphiStrips() - lstrip + 1;
144 if (ldoubletPhi > 2) ldoubletPhi = 1;
148 << lstrip <<
" " << ldoubletPhi );
156 if (!measphi) lstrip =
NetaStrips() - lstrip + 1;
157 ATH_MSG_VERBOSE(
"localstrippos special not mirrored at eta<0 = lstrip, ldoublerZ " << lstrip);
161 if (
m_nlayers == 3 && ldoubletPhi != 1) {
163 <<
" for BI RPC which cannot be true, setting to 1");
197 double local_s{0.}, local_z{0.};
228 unsigned int ndbz{0};
235 double zPoint = P.z();
242 if (zPoint < zLow || zPoint > zUp) {
244 <<
" ::distanceToPhiReadout --- z of the Point " << P.z() <<
" is out of the rpc-module range (" << zLow <<
","
247 zPoint = std::clamp(zPoint,zLow, zUp);
252 dist = zPoint - zLow;
255 if (zPoint < zLow || zPoint > zUp) {
257 <<
" ::distanceToPhiReadout --- z of the Point " << P.z() <<
" is out of the rpc-module range (" << zLow <<
","
260 zPoint = std::clamp(zPoint, zLow, zUp);
266 dist = zPoint - zLow;
268 }
else if (
m_dbZ == 2) {
270 dist = zPoint - zLow;
280 double dist = -999999.;
283 double sdistToCenter = pAmdbL - myCenterAmdbL;
284 if (std::abs(sdistToCenter) >
getSsize() * 0.5) {
286 <<
" ::distanceToEtaReadout --- in amdb local frame x of the point " << pAmdbL
287 <<
" is out of the rpc-module range ("<< myCenterAmdbL -
getSsize() * 0.5 <<
","
288 << myCenterAmdbL +
getSsize() * 0.5 <<
")");
290 if (sdistToCenter > 0) {
293 }
else if (sdistToCenter < 0) {
299 dist =
getSsize() * 0.5 - std::abs(sdistToCenter);
302 dist =
getSsize() * 0.5 + (sdistToCenter);
327 if (locStripPos2.x() - locStripPos1.x() < 0.) {
337 if (std::abs(pos1.x() - locStripPos1.x()) > 1
e-6) {
339 std::endl<<
" phi local strip positions " <<
Amg::toString(locStripPos1) <<
" "
341 <<
" pitch " << phiDesign.
stripPitch <<
" from calc " << locStripPos2.x() - locStripPos1.x() <<
354 if (locStripPosEta2.x() - locStripPosEta1.x() < 0.) {
362 if (std::abs(pos1.x() - locStripPosEta1.x()) > 1
e-6) {
364 <<
" eta local strip positions " <<
Amg::toString(locStripPosEta1)
367 << locStripPosEta2.x() - locStripPosEta1.x() <<std::endl
368 <<
" checking strip position: eta design " <<
Amg::toString(pos1)
392 surfaceTRotation.col(0) = muonTRotation.col(1);
393 surfaceTRotation.col(1) = muonTRotation.col(2);
394 surfaceTRotation.col(2) = muonTRotation.col(0);
396 for (
bool measphi : {
true,
false}) {
401 trans.pretranslate(trans3D.translation());
404 m_surfaceData->m_layerSurfaces.emplace_back(std::make_unique<Trk::PlaneSurface>(*
this,
id));
411 Amg::Vector3D::UnitZ());
427 if (gasgap < 1 || gasgap >
m_nlayers)
return false;
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
double m_first_etastrip_z
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
const Amg::Vector3D REcenter() const
center of an RPC RE is not trivially the center of the first surface, overloading MuonClusterReadoutE...
const RpcIdHelper & m_idHelper
Ensure that the Athena extensions are properly loaded.
Amg::Vector3D gasGapPos(int doubletPhi, int gasGap) const
Returns the centre of the gasGap.
point_t recenter(const point_t &p, const point_t ¢er)
int NphiStripPanels() const
returns the number of phi strip panels (1 or 2)
const Amg::Transform3D & absTransform() const
double StripLength(bool measphi) const
returns the strip length for the phi or eta plane
std::array< double, s_maxphipanels > m_first_phistrip_s
Eigen::Matrix< double, 2, 1 > Vector2D
RpcReadoutElement(GeoVFullPhysVol *pv, const std::string &stName, int zi, int fi, bool is_mirrored, MuonDetectorManager *mgr)
constructor
void setDoubletR(int doubletR)
Amg::Transform3D globalToLocalTransf(const Identifier &id) const
~RpcReadoutElement()
destructor
bool measuresPhi(const Identifier &id) const override
double localStripZCoord(bool measphi, int strip) const
IdentifierHash detectorElementHash() const
Returns the IdentifierHash of the detector element.
const std::string & getTechnologyName() const
double localStripSCoord(int doubletPhi, bool measphi, int strip) const
#define ATH_MSG_VERBOSE(x)
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
void initDesign()
initialize the design classes for this readout element
Amg::Vector3D globalToLocalCoords(const Amg::Vector3D &x, const Identifier &id) const
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
int gasGap(const Identifier &id) const override
get the hashes
const Muon::IMuonIdHelperSvc * idHelperSvc() const
std::array< double, s_maxphipanels > m_etastrip_s
std::vector< MuonStripDesign > m_etaDesigns
Visitor to process all volumes under a GeoModel node.
std::unique_ptr< SurfaceData > m_surfaceData
Amg::Vector3D localToGlobalCoords(const Amg::Vector3D &x, const Identifier &id) const
Attention: these transformations do not represent the tracking transformations as obtained by the tra...
Amg::Transform3D localToGlobalTransf(const Identifier &id) const
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
virtual Amg::Vector3D GlobalToAmdbLRSCoords(const Amg::Vector3D &x) const
const std::string & getStationName() const
Amg::Vector2D firstStripPos
double distanceToPhiReadout(const Amg::Vector3D &P) const
bool inTheRibs() const
returns whether the RE is in the ribs of the muon spectrometer
int NphiStrips() const
returns the number of phi strips
Eigen::Affine3d Transform3D
int strip(const Identifier &id) const
void setNumberOfLayers(const int=2)
int getDoubletPhi() const
return DoubletPhi value for the given readout element, be aware that one RE can contain two DoubletPh...
const MuonStripDesign * getDesign(const Identifier &id) const
returns the MuonStripDesign class for the given identifier
const MuonDetectorManager * manager() const
void setDoubletPhi(int doubletPhi)
int NetaStrips() const
returns the number of eta strips
void setZTranslation(const double z)
bool stripPosition(int strip, Amg::Vector2D &pos) const
calculate local strip position for a given strip number
void setYTranslation(const double y)
void setDoubletZ(int dobuletZ)
int channel(const Identifier &id) const override
Amg::Vector3D localStripPos(int doubletPhi, int gasGap, bool measphi, int strip) const
Returns the local strip position in the AMDB frame.
Ensure that the ATLAS eigen extensions are properly loaded.
virtual bool containsId(const Identifier &id) const override
function to be used to check whether a given Identifier is contained in the readout element
#define THROW_EXCEPTION(MSG)
bool rotatedRpcModule() const
std::vector< MuonStripDesign > m_phiDesigns
virtual int surfaceHash(const Identifier &id) const override final
returns the hash to be used to look up the surface and transform in the MuonClusterReadoutElement tra...
Amg::Vector3D stripPos(const Identifier &id) const
Amg::Vector3D localGasGapPos(const Identifier &id) const
Returns the position of the gasGap w.r.t. rest frame of the chamber.
virtual int layerHash(const Identifier &id) const override final
returns the hash to be used to look up the normal and center in the MuonClusterReadoutElement trackin...
double StripPitch(bool measphi) const
returns the strip pitch for the phi or eta plane
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Eigen::Matrix< double, 3, 1 > Vector3D
virtual int numberOfLayers(bool measphi=true) const override final
number of layers in phi/eta projection, same for eta/phi planes
double StripWidth(bool measphi) const
returns the strip width for the phi or eta plane
virtual void fillCache() override final
function to fill tracking cache
std::array< double, s_nLayers > m_gasGap_xPos
Array caching the distance of the gasGap center to the origin plane in global radial direction.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Translation< double, 3 > Translation3D
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
int Nstrips(bool measphi) const
returns the number of strips for the phi or eta plane
Eigen::AngleAxisd AngleAxis3D
double distanceToEtaReadout(const Amg::Vector3D &P) const
int getDoubletZ() const
return DoubletZ value for the given readout element
int doubletPhi(const Identifier &id) const