diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/RpcPrepDataContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/RpcPrepDataContainerCnv_p1.cxx index 478bc0fc5deb6977dc07ae368c6c7c0603073224..9bc2604b7e4304ed252ceac91bf689e2efa2eba6 100755 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/RpcPrepDataContainerCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonPrepRawData/RpcPrepDataContainerCnv_p1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonPrepRawData/RpcPrepData.h" @@ -171,7 +171,7 @@ void Muon::RpcPrepDataContainerCnv_p1::persToTrans(const Muon::MuonPRD_Containe (*coll)[ichan] = chan; // check to handle cases explained in bug#56227 - if (de->Nphigasgaps() == 1 && de->NphiStripPanels() == 2){ + if (de->NgasGaps(true) == 1 && de->NphiStripPanels() == 2){ // okay, so this was originally on a large surface and needs correcting. const Amg::Vector3D& globalposHIT = de->stripPos( chan->identify() ); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRIO_OnTrack/RpcClusterOnTrackCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRIO_OnTrack/RpcClusterOnTrackCnv_p1.cxx index b198c0048cfab682c974126eb88364bb1bc12d54..f2b844a90dabb329777e8e49fb1f994e9184f809 100755 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRIO_OnTrack/RpcClusterOnTrackCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRIO_OnTrack/RpcClusterOnTrackCnv_p1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ //----------------------------------------------------------------------------- @@ -24,7 +24,7 @@ persToTrans( const Muon::RpcClusterOnTrack_p1 *persObj, // check to handle cases explained in bug#56227 const MuonGM::RpcReadoutElement * de = transObj->detectorElement(); - if (de->Nphigasgaps() == 1 && de->NphiStripPanels() == 2){ + if (de->NgasGaps(true) == 1 && de->NphiStripPanels() == 2){ // okay, so this was originally on a large surface and needs correcting. const Amg::Vector3D& globalposHIT = de->stripPos( transObj->identify() ); Amg::Vector2D tmpLocal; diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h index c58790fe9fdd43eecd49772e28bd9850e6b72022..11f46f33fff1ec37919c7f66756bf8d86e84ae9c 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -73,8 +73,7 @@ namespace MuonGM { int getDoubletR() const; //!< return DoubletR value for the given readout element int getDoubletZ() const; //!< return DoubletZ value for the given readout element - int getDoubletPhi() - const; //!< return DoubletPhi value for the given readout element, be aware that one RE can contain two DoubletPhis!!!! + int getDoubletPhi() const; //!< return DoubletPhi value for the given readout element, be aware that one RE can contain two DoubletPhis!!!! bool hasDEDontop() const; //!< return whether the RPC is 'up-side-down' /** function to be used to check whether a given Identifier is contained in the readout element */ @@ -83,18 +82,18 @@ namespace MuonGM { /** returns whether the RE is in the ribs of the muon spectrometer */ bool inTheRibs() const; - int Nphigasgaps() const; //!< returns the number of phi gas gaps + int NgasGaps(bool measphi ) const; //!< returns the number of gasgaps int NphiStripPanels() const; //!< returns the number of phi strip panels (1 or 2) int NetaStripPanels() const; //!< returns the number of eta strip panels (should always be 1) int NphiStrips() const; //!< returns the number of phi strips int NetaStrips() const; //!< returns the number of eta strips - int Nstrips(int measphi) const; //!< returns the number of strips for the phi or eta plane - double StripWidth(int measphi) const; //!< returns the strip width for the phi or eta plane - double StripLength(int measphi) const; //!< returns the strip length for the phi or eta plane - double StripPitch(int measphi) const; //!< returns the strip pitch for the phi or eta plane - double StripPanelDead(int measphi) const; //!< returns strip panel dead area for the phi or eta plane - double stripPanelSsize(int measphi) const; //!< returns strip panel S size for the phi or eta plane - double stripPanelZsize(int measphi) const; //!< returns strip panel Z size for the phi or eta plane + int Nstrips(bool measphi ) const; //!< returns the number of strips for the phi or eta plane + double StripWidth(bool measphi ) const; //!< returns the strip width for the phi or eta plane + double StripLength(bool measphi ) const; //!< returns the strip length for the phi or eta plane + double StripPitch(bool measphi ) const; //!< returns the strip pitch for the phi or eta plane + double StripPanelDead(bool measphi ) const; //!< returns strip panel dead area for the phi or eta plane + double stripPanelSsize(bool measphi ) const; //!< returns strip panel S size for the phi or eta plane + double stripPanelZsize(bool measphi ) const; //!< returns strip panel Z size for the phi or eta plane double gasGapSsize() const; //!< returns the gas gap S size double gasGapZsize() const; //!< returns the gas gap Z size @@ -111,7 +110,7 @@ namespace MuonGM { virtual bool stripPosition(const Identifier& id, Amg::Vector2D& pos) const override final; /** number of layers in phi/eta projection, same for eta/phi planes */ - virtual int numberOfLayers(bool measPhi = true) const override final; + virtual int numberOfLayers(bool measphi = true) const override final; void setNumberOfLayers(const int = 2); /** number of strips per layer */ @@ -150,7 +149,7 @@ namespace MuonGM { virtual int surfaceHash(const Identifier& id) const override final; /** @brief returns the hash to be used to look up the surface and transform in the MuonClusterReadoutElement tracking cache */ - int surfaceHash(int dbPhi, int gasGap, int measPhi) const; + int surfaceHash(int dbPhi, int gasGap, bool measphi ) const; /** @brief returns the hash to be used to look up the normal and center in the MuonClusterReadoutElement tracking cache */ virtual int layerHash(const Identifier& id) const override final; @@ -186,10 +185,10 @@ namespace MuonGM { /** local MuonGeoModel to global transforms and positions, only to be used by digitization */ Amg::Vector3D stripPanelPos(const Identifier& id) const; Amg::Vector3D stripPanelPos(const IdentifierHash& id) const; - Amg::Vector3D stripPanelPos(int doubletR, int doubletZ, int DoubletPhi, int gasGap, int measPhi) const; + Amg::Vector3D stripPanelPos(int doubletR, int doubletZ, int DoubletPhi, int gasGap, bool measphi ) const; Amg::Vector3D localStripPanelPos(const Identifier& id) const; Amg::Vector3D localStripPanelPos(const IdentifierHash& id) const; - Amg::Vector3D localStripPanelPos(int doubletR, int doubletZ, int DoubletPhi, int gasGap, int measPhi) const; + Amg::Vector3D localStripPanelPos(int doubletR, int doubletZ, int DoubletPhi, int gasGap, bool measphi ) const; // local to global Amg::Vector3D SDtoModuleCoords(const Amg::Vector3D& x, const Identifier& id) const; Amg::Vector3D localToGlobalCoords(const Amg::Vector3D& x, const Identifier& id) const; @@ -201,12 +200,12 @@ namespace MuonGM { Amg::Vector3D stripPos(const Identifier& id) const; Amg::Vector3D stripPos(const IdentifierHash& id) const; - Amg::Vector3D stripPos(int doubletR, int doubletZ, int DoubletPhi, int gasGap, int measPhi, int strip) const; + Amg::Vector3D stripPos(int doubletR, int doubletZ, int DoubletPhi, int gasGap, bool measphi , int strip) const; Amg::Vector3D localStripPos(const Identifier& id) const; Amg::Vector3D localStripPos(const IdentifierHash& id) const; - Amg::Vector3D localStripPos(int doubletR, int doubletZ, int DoubletPhi, int gasGap, int measPhi, int strip) const; - double localStripSCoord(int doubletZ, int doubletPhi, int measphi, int strip) const; - double localStripZCoord(int doubletZ, int doubletPhi, int measphi, int strip) const; + Amg::Vector3D localStripPos(int doubletR, int doubletZ, int DoubletPhi, int gasGap, bool measphi , int strip) const; + double localStripSCoord(int doubletZ, int doubletPhi, bool measphi , int strip) const; + double localStripZCoord(int doubletZ, int doubletPhi, bool measphi , int strip) const; double localGasGapDepth(int gasGap) const; Amg::Vector3D localGasGapPos(const Identifier& id) const; Amg::Vector3D localGasGapPos(int dbZ, int dbP, int gg) const; @@ -289,29 +288,29 @@ namespace MuonGM { inline void RpcReadoutElement::setDoubletPhi(int dbp) { m_dbPhi = dbp; } inline bool RpcReadoutElement::hasDEDontop() const { return m_hasDEDontop; } - inline int RpcReadoutElement::Nphigasgaps() const { return m_nphigasgaps; } + inline int RpcReadoutElement::NgasGaps(bool measphi ) const { return measphi ? m_nphigasgaps: m_netagasgaps; } inline int RpcReadoutElement::NphiStripPanels() const { return m_nphistrippanels; } inline int RpcReadoutElement::NetaStripPanels() const { return m_netastrippanels; } inline int RpcReadoutElement::NphiStrips() const { return m_nphistripsperpanel; } inline int RpcReadoutElement::NetaStrips() const { return m_netastripsperpanel; } - inline int RpcReadoutElement::Nstrips(int measphi) const { return measphi == 0 ? m_netastripsperpanel : m_nphistripsperpanel; } - inline double RpcReadoutElement::StripWidth(int measphi) const { return measphi == 1 ? m_phistripwidth : m_etastripwidth; } - inline double RpcReadoutElement::StripLength(int measphi) const { return measphi == 1 ? m_phistriplength : m_etastriplength; } - inline double RpcReadoutElement::StripPitch(int measphi) const { return measphi == 1 ? m_phistrippitch : m_etastrippitch; } - inline double RpcReadoutElement::StripPanelDead(int measphi) const { return measphi == 1 ? m_phipaneldead : m_etapaneldead; } - inline double RpcReadoutElement::stripPanelSsize(int measphi) const { - if (measphi == 1) - return Nstrips(measphi) * StripPitch(measphi) - (StripPitch(measphi) - StripWidth(measphi)); + inline int RpcReadoutElement::Nstrips(bool measphi ) const { return measphi ? m_nphistripsperpanel : m_netastripsperpanel; } + inline double RpcReadoutElement::StripWidth(bool measphi ) const { return measphi ? m_phistripwidth : m_etastripwidth; } + inline double RpcReadoutElement::StripLength(bool measphi ) const { return measphi ? m_phistriplength : m_etastriplength; } + inline double RpcReadoutElement::StripPitch(bool measphi ) const { return measphi ? m_phistrippitch : m_etastrippitch; } + inline double RpcReadoutElement::StripPanelDead(bool measphi ) const { return measphi ? m_phipaneldead : m_etapaneldead; } + inline double RpcReadoutElement::stripPanelSsize(bool measphi ) const { + if (measphi ) + return Nstrips(measphi ) * StripPitch(measphi ) - (StripPitch(measphi ) - StripWidth(measphi )); else - return StripLength(measphi); + return StripLength(measphi ); } - inline double RpcReadoutElement::stripPanelZsize(int measphi) const { - if (measphi == 0) - return Nstrips(measphi) * StripPitch(measphi) - (StripPitch(measphi) - StripWidth(measphi)); + inline double RpcReadoutElement::stripPanelZsize(bool measphi ) const { + if (!measphi ) + return Nstrips(measphi ) * StripPitch(measphi ) - (StripPitch(measphi ) - StripWidth(measphi )); else - return StripLength(measphi); + return StripLength(measphi ); } inline double RpcReadoutElement::gasGapSsize() const { return m_gasgapssize; } diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx index 6df175b9d3090c215ee713a791a12f58fe10224b..3b0981d6a8ef7f9aa0a7523886115dd1e6a51d31 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx @@ -83,7 +83,7 @@ namespace MuonGM { RpcReadoutElement::~RpcReadoutElement() { clearCache(); } - double RpcReadoutElement::localStripSCoord(int doubletZ, int doubletPhi, int measphi, int strip) const { + double RpcReadoutElement::localStripSCoord(int doubletZ, int doubletPhi, bool measphi , int strip) const { if ((doubletZ != m_dbZ && m_netastrippanels == 1) || (m_netastrippanels != 1 && (doubletZ < 1 || doubletZ > m_netastrippanels))) { throw std::runtime_error( Form("File: %s, Line: %d\nRpcReadoutElement::localStripSCoord() - doubletZ %d outside range 1-%d created with m_dbZ=%d for " @@ -100,23 +100,23 @@ namespace MuonGM { __FILE__, __LINE__, doubletPhi, m_nphistrippanels, m_dbPhi, getStationName().c_str(), getTechnologyName().c_str())); } int maxstrip = 0; - if (measphi == 1) + if (measphi) maxstrip = NphiStrips(); else maxstrip = NetaStrips(); if (strip < 1 || strip > maxstrip) { throw std::runtime_error( - Form("File: %s, Line: %d\nRpcReadoutElement::localStripSCoord() - strip %d outside range 1-%d for measphi=%d for " + Form("File: %s, Line: %d\nRpcReadoutElement::localStripSCoord() - strip %d outside range 1-%d for measphi =%d for " "stName/Eta/Phi/dbR/dbZ/dbPhi=%s/%d/%d/%d/%d/%d", - __FILE__, __LINE__, strip, maxstrip, measphi, getStationName().c_str(), getStationEta(), getStationPhi(), + __FILE__, __LINE__, strip, maxstrip, measphi , getStationName().c_str(), getStationEta(), getStationPhi(), getDoubletR(), getDoubletZ(), getDoubletPhi())); } double local_s = 0.; int dbphi = doubletPhi - 1; if (m_nphistrippanels == 1) dbphi = 0; - if (measphi == 1) - local_s = m_first_phistrip_s[dbphi] + (strip - 1) * StripPitch(measphi); + if (measphi) + local_s = m_first_phistrip_s[dbphi] + (strip - 1) * StripPitch(measphi ); else local_s = m_etastrip_s[dbphi]; @@ -126,12 +126,12 @@ namespace MuonGM { log << MSG::VERBOSE << "Ssize, ndvs, nstr/pan, spitch, 1st-strp " << m_Ssize << " " << m_nphistrippanels << " " << m_nphistripsperpanel << " " << m_phistrippitch << " " << m_first_phistrip_s[doubletPhi - 1] << endmsg; log << MSG::VERBOSE << "localStripSCoord: local_s is " << local_s << " for dbZ/dbP/mphi/strip " << doubletZ << " " << doubletPhi - << " " << measphi << "/" << strip << endmsg; + << " " << measphi << "/" << strip << endmsg; } #endif return local_s; } - double RpcReadoutElement::localStripZCoord(int doubletZ, int doubletPhi, int measphi, int strip) const { + double RpcReadoutElement::localStripZCoord(int doubletZ, int doubletPhi, bool measphi , int strip) const { if ((doubletZ != m_dbZ && m_netastrippanels == 1) || (m_netastrippanels != 1 && (doubletZ < 1 || doubletZ > m_netastrippanels))) { throw std::runtime_error( Form("File: %s, Line: %d\nRpcReadoutElement::localStripZCoord() - doubletZ %d outside range 1-%d created with m_dbZ=%d for " @@ -148,23 +148,23 @@ namespace MuonGM { __FILE__, __LINE__, doubletPhi, m_nphistrippanels, m_dbPhi, getStationName().c_str(), getTechnologyName().c_str())); } int maxstrip = 0; - if (measphi == 1) + if (measphi) maxstrip = NphiStrips(); else maxstrip = NetaStrips(); - if (strip < 1 || (measphi == 1 && strip > maxstrip)) { + if (strip < 1 || (measphi && strip > maxstrip)) { throw std::runtime_error( - Form("File: %s, Line: %d\nRpcReadoutElement::localStripZCoord() - strip %d outside range 1-%d for measphi=%d for " + Form("File: %s, Line: %d\nRpcReadoutElement::localStripZCoord() - strip %d outside range 1-%d for measphi =%d for " "stName/Eta/Phi/dbR/dbZ/dbPhi=%s/%d/%d/%d/%d/%d", - __FILE__, __LINE__, strip, maxstrip, measphi, getStationName().c_str(), getStationEta(), getStationPhi(), + __FILE__, __LINE__, strip, maxstrip, measphi , getStationName().c_str(), getStationEta(), getStationPhi(), getDoubletR(), getDoubletZ(), getDoubletPhi())); } double local_z = 0.; - if (measphi == 0) { + if (measphi == 0) { double xx = m_first_etastrip_z[0]; if (m_netastrippanels > 1 && doubletZ > 1) xx = m_first_etastrip_z[doubletZ - 1]; - local_z = xx + (strip - 1) * StripPitch(measphi); + local_z = xx + (strip - 1) * StripPitch(measphi ); } else { double xx = m_phistrip_z[0]; if (m_netastrippanels > 1 && doubletZ > 1) xx = m_phistrip_z[doubletZ - 1]; @@ -177,23 +177,23 @@ namespace MuonGM { log << MSG::VERBOSE << "Zsize, ndvz, nstr/pan, zpitch, 1st-strp " << m_Zsize << " " << m_netastrippanels << " " << m_netastripsperpanel << " " << m_etastrippitch << " " << m_first_etastrip_z[doubletZ - 1] << endmsg; log << MSG::VERBOSE << "localStripZCoord: local_z is " << local_z << " for dbZ/dbP/mphi/strip " << doubletZ << " " << doubletPhi - << " " << measphi << "/" << strip << endmsg; + << " " << measphi << "/" << strip << endmsg; } #endif return local_z; } - Amg::Vector3D RpcReadoutElement::stripPos(int doubletR, int doubletZ, int doubletPhi, int gasGap, int measPhi, int strip) const { + Amg::Vector3D RpcReadoutElement::stripPos(int doubletR, int doubletZ, int doubletPhi, int gasGap, bool measphi , int strip) const { #ifndef NDEBUG MsgStream log(Athena::getMessageSvc(), "RpcReadoutElement"); if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "stripPos for dbr/dbz/dbp/gg/mp/strip " << doubletR << " " << doubletZ << " " << doubletPhi << " " - << gasGap << " " << measPhi << " " << strip << endmsg; + << gasGap << " " << measphi << " " << strip << endmsg; #endif // global position of a generic strip !!!!! - const Amg::Vector3D localP = localStripPos(doubletR, doubletZ, doubletPhi, gasGap, measPhi, strip); + const Amg::Vector3D localP = localStripPos(doubletR, doubletZ, doubletPhi, gasGap, measphi , strip); const Amg::Transform3D rpcTrans = absTransform(); #ifndef NDEBUG @@ -208,13 +208,13 @@ namespace MuonGM { return rpcTrans * localP; } - Amg::Vector3D RpcReadoutElement::localStripPos(int /*doubletR*/, int doubletZ, int doubletPhi, int gasGap, int measPhi, + Amg::Vector3D RpcReadoutElement::localStripPos(int /*doubletR*/, int doubletZ, int doubletPhi, int gasGap, bool measphi , int strip) const { #ifndef NDEBUG MsgStream log(Athena::getMessageSvc(), "RpcReadoutElement"); if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "localstripPos for dbr/dbz/dbp/gg/mp/strip " << doubletZ << " " << doubletPhi << " " << gasGap << " " - << measPhi << " " << strip << endmsg; + << measphi << " " << strip << endmsg; #endif // global position of a generic strip !!!!! @@ -231,7 +231,7 @@ namespace MuonGM { int lstrip = strip; int lgg = gasGap; if (!m_hasDEDontop) { - if (measPhi == 0) lstrip = NetaStrips() - strip + 1; + if (measphi == 0) lstrip = NetaStrips() - strip + 1; lgg++; if (lgg > m_nlayers) lgg = 1; #ifndef NDEBUG @@ -249,7 +249,7 @@ namespace MuonGM { // numbering of doubletPhi must be reversed if m_nphistrippanels>1 // numbering of doubletZ is unchanged; if (isMirrored()) { - if (measPhi == 1) lstrip = NphiStrips() - lstrip + 1; + if (measphi) lstrip = NphiStrips() - lstrip + 1; if (m_nphistrippanels != 1) { ldoubletPhi = doubletPhi + 1; if (ldoubletPhi > 2) ldoubletPhi = 1; @@ -271,7 +271,7 @@ namespace MuonGM { ldoubletZ++; if (ldoubletZ > 2) ldoubletZ = 1; } - if (measPhi == 0) lstrip = NetaStrips() - lstrip + 1; + if (measphi == 0) lstrip = NetaStrips() - lstrip + 1; #ifndef NDEBUG if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "localstrippos special not mirrored at eta<0 =" @@ -290,8 +290,8 @@ namespace MuonGM { ldoubletPhi = 1; } - Amg::Vector3D localP(localGasGapDepth(lgg), localStripSCoord(ldoubletZ, ldoubletPhi, measPhi, lstrip), - localStripZCoord(ldoubletZ, ldoubletPhi, measPhi, lstrip)); + Amg::Vector3D localP(localGasGapDepth(lgg), localStripSCoord(ldoubletZ, ldoubletPhi, measphi , lstrip), + localStripZCoord(ldoubletZ, ldoubletPhi, measphi , lstrip)); #ifndef NDEBUG if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "localstrippos = " << localP << endmsg; @@ -323,10 +323,10 @@ namespace MuonGM { int doubletZ = idh->doubletZ(id); int doubletPhi = idh->doubletPhi(id); int gasgap = idh->gasGap(id); - int measPhi = idh->measuresPhi(id); + bool measphi = idh->measuresPhi(id); int strip = idh->strip(id); - return localStripPos(doubletR, doubletZ, doubletPhi, gasgap, measPhi, strip); + return localStripPos(doubletR, doubletZ, doubletPhi, gasgap, measphi , strip); } Amg::Vector3D RpcReadoutElement::stripPos(const Identifier& id) const { @@ -335,9 +335,9 @@ namespace MuonGM { int doubletZ = idh->doubletZ(id); int doubletPhi = idh->doubletPhi(id); int gasgap = idh->gasGap(id); - int measPhi = idh->measuresPhi(id); + bool measphi = idh->measuresPhi(id); int strip = idh->strip(id); - return stripPos(doubletR, doubletZ, doubletPhi, gasgap, measPhi, strip); + return stripPos(doubletR, doubletZ, doubletPhi, gasgap, measphi , strip); } bool RpcReadoutElement::rotatedRpcModule() const { return (!m_hasDEDontop); } @@ -902,17 +902,17 @@ namespace MuonGM { surfaceTRotation.col(1) = muonTRotation.col(2); surfaceTRotation.col(2) = muonTRotation.col(0); - for (int measPhi = 1; measPhi >= 0; --measPhi) { - Identifier id = idh->channelID(parentID, getDoubletZ(), dbPhi, gasGap, measPhi, 1); + for (bool measphi : { true, false}) { + Identifier id = idh->channelID(parentID, getDoubletZ(), dbPhi, gasGap, measphi , 1); Amg::Transform3D trans(surfaceTRotation); - if (measPhi == 0) trans *= Amg::AngleAxis3D(M_PI / 2., Amg::Vector3D(0., 0., 1.)); + if (measphi == 0) trans *= Amg::AngleAxis3D(M_PI / 2., Amg::Vector3D(0., 0., 1.)); trans.pretranslate(trans3D.translation()); m_surfaceData->m_layerTransforms.push_back(trans); m_surfaceData->m_layerSurfaces.emplace_back(std::make_unique<Trk::PlaneSurface>(*this, id)); - if (measPhi == 1) { + if (measphi) { m_surfaceData->m_layerCenters.push_back(m_surfaceData->m_layerTransforms.back() * Amg::Vector3D(0., 0., 0.)); m_surfaceData->m_layerNormals.push_back(m_surfaceData->m_layerTransforms.back().linear() * Amg::Vector3D(0., 0., 1.)); @@ -945,14 +945,12 @@ namespace MuonGM { int gasgap = idh->gasGap(id); if (gasgap < 1 || gasgap > m_nlayers) return false; - int measPhi = idh->measuresPhi(id); + bool measphi = idh->measuresPhi(id); int strip = idh->strip(id); - if (measPhi == 0) { + if (!measphi) { if (strip < 1 || strip > NetaStrips()) return false; - } else if (measPhi == 1) { - if (strip < 1 || strip > NphiStrips()) return false; - } else - return false; + /// Measures phi is true so we can directly check the strip range + } else if (strip < 1 || strip > NphiStrips()) return false; return true; } @@ -961,7 +959,7 @@ namespace MuonGM { return ((getStationName().substr(0, 3) == "BMS") && (getTechnologyName() == "RPC07" || getTechnologyName() == "RPC08")); } - int RpcReadoutElement::surfaceHash(int dbPhi, int gasGap, int measPhi) const { + int RpcReadoutElement::surfaceHash(int dbPhi, int gasGap, bool measphi ) const { // if there is only one doublet phi we should always use one in the hash calculation if (m_nphistrippanels == 1) dbPhi = 1; if (dbPhi > NphiStripPanels() || gasGap > numberOfLayers(true)) { @@ -970,7 +968,7 @@ namespace MuonGM { << getDoubletPhi() << " gp " << gasGap << " max " << numberOfLayers() << endmsg; return -1; } - return (dbPhi - 1) * (2 * NphiStripPanels()) + 2 * (gasGap - 1) + (measPhi ? 0 : 1); + return (dbPhi - 1) * (2 * NphiStripPanels()) + 2 * (gasGap - 1) + (measphi ? 0 : 1); } int RpcReadoutElement::layerHash(int dbPhi, int gasGap) const { diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx index 7dab51761c4a6d7036cf59ffad44a34c9c1e152c..2e3570637a55c9ac2b326dcc2c76932f2bb9a6cb 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx @@ -1271,7 +1271,7 @@ Amg::Vector3D RpcDigitizationTool::posInPanel( float panelXlength = ele->stripPanelSsize(measuresPhi); Amg::Vector3D result = posInGap; - if (ele->Nphigasgaps() != 1) + if (ele->NgasGaps(true) != 1) return result; // all but BMS/F and ribs chambers else if (ele->NphiStripPanels() == 1) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/src/MuonEDMPrinterTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/src/MuonEDMPrinterTool.cxx index d91a669185c019187cba1b3ac836e047dfe40bc0..3b8daa7c7eb376c80cd29e6c1ee3ca197a36ff16 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/src/MuonEDMPrinterTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/src/MuonEDMPrinterTool.cxx @@ -763,8 +763,8 @@ MuonEDMPrinterTool::print(const MuonPatternChamberIntersect& intersect) const const MuonGM::RpcReadoutElement* detEl = dynamic_cast<const MuonGM::RpcReadoutElement*>(prd->detectorElement()); if (detEl) { - nchannelsPhi += detEl->Nphigasgaps() * detEl->NphiStripPanels() * detEl->NphiStrips(); - nchannelsEta += detEl->Nphigasgaps() * detEl->NetaStripPanels() * detEl->NetaStrips(); + nchannelsPhi += detEl->NgasGaps(true) * detEl->NphiStripPanels() * detEl->NphiStrips(); + nchannelsEta += detEl->NgasGaps(false) * detEl->NetaStripPanels() * detEl->NetaStrips(); } } } diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx index 8f7eac8b1e56e71049ee8e83ac66e4d057f2be41..ba07f2cd97fa7fbaa750c7931c86a5aea4ffb80b 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonChamberHoleRecoveryTool.cxx @@ -625,7 +625,7 @@ namespace Muon { int dbZ = detEl->getDoubletZ(); int dbPhi = detEl->getDoubletPhi(); - ATH_MSG_DEBUG("Looking up RPC structure: dbZ " << dbZ << " dbPhi " << dbPhi << " nphi gp " << detEl->Nphigasgaps()); + ATH_MSG_DEBUG("Looking up RPC structure: dbZ " << dbZ << " dbPhi " << dbPhi << " nphi gp " << detEl->NgasGaps(true)); // create identifiers from LayerHoleVec std::set<Identifier> chHoles;