diff --git a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/RpcStripAuxContainer_v1.cxx b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/RpcStripAuxContainer_v1.cxx index 34badb5867c46ef6adacf72fc6dd7637f43bbd95..6f18dc711040c4e91790c5dd7775931e53423850 100644 --- a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/RpcStripAuxContainer_v1.cxx +++ b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/RpcStripAuxContainer_v1.cxx @@ -25,6 +25,7 @@ RpcStripAuxContainer_v1::RpcStripAuxContainer_v1() PRD_AUXVARIABLE(triggerInfo); PRD_AUXVARIABLE(ambiguityFlag); PRD_AUXVARIABLE(timeOverThreshold); + PRD_AUXVARIABLE(stripPosInStation); PRD_AUXVARIABLE(stripNumber); PRD_AUXVARIABLE(gasGap); @@ -33,4 +34,4 @@ RpcStripAuxContainer_v1::RpcStripAuxContainer_v1() } } // namespace xAOD -#undef PRD_AUXVARIABLE \ No newline at end of file +#undef PRD_AUXVARIABLE diff --git a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/RpcStrip_v1.cxx b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/RpcStrip_v1.cxx index ad3deebca93e61589a67b0e6ba6ab29f9b84fbd9..3f68c2215558e31c67f440d4164814edafb18c62 100644 --- a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/RpcStrip_v1.cxx +++ b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/RpcStrip_v1.cxx @@ -14,6 +14,7 @@ namespace { static const std::string preFixStr{"Rpc_"}; + static const xAOD::PosAccessor<3> accStripPos{preFixStr + "stripPosInStation"}; } namespace xAOD { @@ -33,6 +34,13 @@ IdentifierHash RpcStrip_v1::measurementHash() const { doubletPhi(), measuresPhi()); } +void RpcStrip_v1::setStripPosInStation(const MeasVector<3>& pos){ + VectorMap<3> v{accStripPos(*this).data()}; + v = pos; +} +ConstVectorMap<3> RpcStrip_v1::stripPosInStation() const { + return ConstVectorMap<3>{accStripPos(*this).data()}; +} } // namespace xAOD #undef IMPLEMENT_SETTER_GETTER diff --git a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/versions/RpcStripAuxContainer_v1.h b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/versions/RpcStripAuxContainer_v1.h index 2dc0615ec9ee14963e21a3bc6174fa3baa8a53b4..66a16b2434090aa7465fe37602216fc5cddfc6c1 100644 --- a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/versions/RpcStripAuxContainer_v1.h +++ b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/versions/RpcStripAuxContainer_v1.h @@ -30,6 +30,7 @@ class RpcStripAuxContainer_v1 : public AuxContainerBase { std::vector<uint32_t> triggerInfo{}; // FIXME - how big do we need this to be? std::vector<uint8_t> ambiguityFlag{}; std::vector<float> timeOverThreshold{}; + std::vector<PosAccessor<3>::element_type> stripPosInStation{}; std::vector<uint16_t> stripNumber{}; std::vector<uint8_t> gasGap{}; diff --git a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/versions/RpcStrip_v1.h b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/versions/RpcStrip_v1.h index 515d1aa0031a52e7dd7bd3e0ec8f8b21f83b52f0..cd31123af4ab13c6403ce32fbe065c0a22931b8e 100644 --- a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/versions/RpcStrip_v1.h +++ b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/versions/RpcStrip_v1.h @@ -76,6 +76,14 @@ class RpcStrip_v1 : public UncalibratedMeasurement_v1 { Exceptions are thrown if that fails as well */ const MuonGMR4::RpcReadoutElement* readoutElement() const; + /** @brief Returns the local position of the strip within + * the Muon Station (I.e. the center plane between 2 multilayers) + */ + ConstVectorMap<3> stripPosInStation() const; + + /** @brief Sets the position of the strip within a muon station*/ + void setStripPosInStation(const MeasVector<3>& pos); + private: #ifdef __CLING__ /// Down cast the memory of the readoutElement cache if the object is stored to disk @@ -91,4 +99,4 @@ class RpcStrip_v1 : public UncalibratedMeasurement_v1 { #include "AthContainers/DataVector.h" DATAVECTOR_BASE(xAOD::RpcStrip_v1, xAOD::UncalibratedMeasurement_v1); -#endif \ No newline at end of file +#endif diff --git a/MuonSpectrometer/MuonPhaseII/MuonCnv/xAODMuonSimHitCnv/src/xAODSimHitToRpcMeasCnvAlg.cxx b/MuonSpectrometer/MuonPhaseII/MuonCnv/xAODMuonSimHitCnv/src/xAODSimHitToRpcMeasCnvAlg.cxx index 8d2580c7f6c1155dc8559e05c12379e5d9609fc0..782304f0fc3f793d13c4ac6181a1ccd2eddf768b 100644 --- a/MuonSpectrometer/MuonPhaseII/MuonCnv/xAODMuonSimHitCnv/src/xAODSimHitToRpcMeasCnvAlg.cxx +++ b/MuonSpectrometer/MuonPhaseII/MuonCnv/xAODMuonSimHitCnv/src/xAODSimHitToRpcMeasCnvAlg.cxx @@ -63,7 +63,7 @@ StatusCode xAODSimHitToRpcMeasCnvAlg::execute(const EventContext& ctx) const { const unsigned int etaStripNum = etaDesign.stripNumber(smearedEtaPos.block<2,1>(0,0)); - ATH_MSG_ALWAYS("Convert simulated hit "<<m_idHelperSvc->toStringGasGap(hitId)<<" located in gas gap at " + ATH_MSG_VERBOSE("Convert simulated hit "<<m_idHelperSvc->toStringGasGap(hitId)<<" located in gas gap at " <<Amg::toString(locSimHitPos, 2)<<" eta strip number: "<<etaStripNum <<" strip position "<<Amg::toString(etaDesign.center(etaStripNum).value_or(Amg::Vector2D::Zero()), 2)); @@ -93,6 +93,9 @@ StatusCode xAODSimHitToRpcMeasCnvAlg::execute(const EventContext& ctx) const { prd->setReadoutElement(readOutEle); prd->setTime(hitTime); prd->setAmbiguityFlag(0); + Amg::Vector3D strip3D {smearedEtaPos.x(), 0.,0.}; + auto globToCenter = m_surfaceProvTool->globalToChambCenter(gctx,etaHitId); + prd->setStripPosInStation(xAOD::toStorage(globToCenter * readOutEle->localToGlobalTrans(gctx,readOutEle->layerHash(prd->measurementHash())) * strip3D)); } /// Check whether the read out element contains phi strips or not. if (!readOutEle->nPhiStrips()) { @@ -129,6 +132,9 @@ StatusCode xAODSimHitToRpcMeasCnvAlg::execute(const EventContext& ctx) const { prd->setReadoutElement(readOutEle); prd->setTime(hitTime); prd->setAmbiguityFlag(0); + Amg::Vector3D strip3D {smearedPhiPos.x(), 0.,0.}; + auto globToCenter = m_surfaceProvTool->globalToChambCenter(gctx,phiHitId); + prd->setStripPosInStation(xAOD::toStorage(globToCenter * readOutEle->localToGlobalTrans(gctx,readOutEle->layerHash(prd->measurementHash())) * strip3D)); } return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonPhaseII/MuonCnv/xAODMuonSimHitCnv/src/xAODSimHitToTgcMeasCnvAlg.cxx b/MuonSpectrometer/MuonPhaseII/MuonCnv/xAODMuonSimHitCnv/src/xAODSimHitToTgcMeasCnvAlg.cxx index 71799b4a4c14a55d7249509a6545e738aac496a3..bd62d038f76db2d18251b5674c51e531ed32d137 100644 --- a/MuonSpectrometer/MuonPhaseII/MuonCnv/xAODMuonSimHitCnv/src/xAODSimHitToTgcMeasCnvAlg.cxx +++ b/MuonSpectrometer/MuonPhaseII/MuonCnv/xAODMuonSimHitCnv/src/xAODSimHitToTgcMeasCnvAlg.cxx @@ -55,7 +55,7 @@ StatusCode xAODSimHitToTgcMeasCnvAlg::execute(const EventContext& ctx) const { const Amg::Vector2D smearedEtaPos{CLHEP::RandGaussZiggurat::shoot(rndEngine, locSimHitPos.x(), etaUncert), 0.}; const unsigned int etaStripNum = etaDesign.stripNumber(smearedEtaPos.block<2,1>(0,0)); - ATH_MSG_ALWAYS("Convert simulated hit "<<m_idHelperSvc->toStringGasGap(hitId)<<" located in gas gap at " + ATH_MSG_VERBOSE("Convert simulated hit "<<m_idHelperSvc->toStringGasGap(hitId)<<" located in gas gap at " <<Amg::toString(locSimHitPos, 2)<<" eta strip number: "<<etaStripNum <<" strip position "<<Amg::toString(etaDesign.center(etaStripNum).value_or(Amg::Vector2D::Zero()), 2));