27 {
28
29
32
33 const Muon::RpcCablingMap*
cablingMap{
nullptr};
35
36 const std::unordered_set<IdentifierHash> hashToSelect(idVect.begin(), idVect.end());
37 using RdoPairs = std::array<const xAOD::NRPCRDO*, 2>;
38 std::map<Identifier, RdoPairs, Muon::IdentifierByDetElSorter> sortedRdos{Muon::IdentifierByDetElSorter{
m_idHelperSvc.get()}};
40
42 cabling.subDetector = rdo->subdetector();
43 cabling.boardSector = rdo->boardsector();
45 cabling.channelId = rdo->channel();
46
47
48 if (!
cablingMap->getOfflineId(cabling, msgStream())){
49 return StatusCode::FAILURE;
50 }
51 Identifier offId{};
54 return StatusCode::FAILURE;
55 }
56 if (hashToSelect.size() && !hashToSelect.count(
m_idHelperSvc->moduleHash(offId))) {
58 continue;
59 }
61 const bool stripSide =
cabling.stripSide();
62 sortedRdos[offId][stripSide] = rdo;
63 }
64
66 ATH_CHECK(stripHandle.
record(std::make_unique<xAOD::RpcStripContainer>(),
67 std::make_unique<xAOD::RpcStripAuxContainer>()));
68
69 SG::WriteHandle<xAOD::RpcStrip2DContainer> strip2DHandle{};
72 ATH_CHECK(strip2DHandle.
record(std::make_unique<xAOD::RpcStrip2DContainer>(),
73 std::make_unique<xAOD::RpcStrip2DAuxContainer>()));
74
75 }
76
78
81 const Identifier& offId){
82
83 const MuonGMR4::RpcReadoutElement* reElement =
m_detMgr->getRpcReadoutElement(offId);
84 outputMeas->setIdentifierHash(
m_idHelperSvc->detElementHash(offId));
85 outputMeas->setReadoutElement(reElement);
87 outputMeas->setDoubletPhi(idHelper.
doubletPhi(offId));
88 outputMeas->setGasGap(idHelper.
gasGap(offId));
89 outputMeas->setStripNumber(idHelper.
channel(offId));
90 outputMeas->setTimeOverThreshold(rdo->timeoverthr());
92 outputMeas->setTime(rdo->time());
94 };
95
98 for (const auto& [offId, rdoPairs] : sortedRdos) {
99 const MuonGMR4::RpcReadoutElement* reElement =
m_detMgr->getRpcReadoutElement(offId);
101
103
104 CheckVector2D stripPos = design.
center(idHelper.
channel(offId));
105 if (!stripPos) {
107 continue;
108 }
109 const double stripLocX = (*stripPos).x();
110 const double stripCovX = std::pow(design.
stripPitch(), 2) / std::sqrt(12.);
111
113 xAOD::RpcStrip2D* measurement = strip2DHandle->push_back(std::make_unique<xAOD::RpcStrip2D>());
114
117
118 lPos[0] = stripLocX;
120 lCov(0,0) = stripCovX;
124
125 setMeasValues(measurement, rdoPairs[0], offId);
127 continue;
128 }
129
133 lPos[0] = stripLocX;
134 lCov(0,0) = stripCovX;
135
138 strip->setMeasurement<1>(0, lPos, lCov);
139 setMeasValues(
strip, rdoPairs[0] ? rdoPairs[0] : rdoPairs[1], offId);
140 }
141 return StatusCode::SUCCESS;
142
143 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
value_type get_compact() const
Get the compact id.
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
const StripLayerPtr & sensorLayout(const IdentifierHash &measHash) const
Access to the StripLayer associated to a given measurement Hash.
CheckVector2D center(int stripNumb) const
Returns the bisector of the strip (Global numbering scheme)
std::optional< Amg::Vector2D > CheckVector2D
double stripPitch() const
Distance between two adjacent strips.
int gasGap(const Identifier &id) const override
get the hashes
int channel(const Identifier &id) const override
int doubletPhi(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
time(flags, cells_name, *args, **kw)
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Eigen::Matrix< float, N, N > MeasMatrix
NRPCRDO_v1 NRPCRDO
Define the version of the NRPC RDO class.
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
NRPCRDOContainer_v1 NRPCRDOContainer
Define the version of the NRPC RDO container.
RpcMeasurement_v1 RpcMeasurement