31 return StatusCode::SUCCESS;
35 const std::vector<IdentifierHash>& idVect)
const {
44 const std::unordered_set<IdentifierHash> hashToSelect(idVect.begin(), idVect.end());
45 using RdoPairs = std::array<const xAOD::NRPCRDO*, 2>;
50 cabling.subDetector = rdo->subdetector();
51 cabling.boardSector = rdo->boardsector();
52 cabling.board = rdo->board();
53 cabling.channelId = rdo->channel();
56 if (!cablingMap->getOfflineId(cabling, msgStream())){
57 return StatusCode::FAILURE;
60 if (!cablingMap->convert(cabling, offId)){
62 return StatusCode::FAILURE;
64 if (hashToSelect.size() && !hashToSelect.count(
m_idHelperSvc->moduleHash(offId))) {
69 const bool stripSide = cabling.stripSide();
70 sortedRdos[offId][stripSide] = rdo;
83 outputMeas->setIdentifierHash(
m_idHelperSvc->detElementHash(offId));
84 outputMeas->setReadoutElement(reElement);
85 outputMeas->setIdentifier(offId.get_compact());
86 outputMeas->setDoubletPhi(idHelper.
doubletPhi(offId));
87 outputMeas->setGasGap(idHelper.
gasGap(offId));
88 outputMeas->setChannelNumber(idHelper.
channel(offId));
89 outputMeas->setTimeOverThreshold(rdo->timeoverthr());
91 outputMeas->setTime(rdo->time());
97 for (
const auto& [offId, rdoPairs] : sortedRdos) {
103 CheckVector2D stripPos = design.
center(idHelper.
channel(offId));
108 const double stripLocX = (*stripPos).x();
109 const double stripCovX = std::pow(design.
stripPitch(), 2) / std::sqrt(12.);
112 xAOD::RpcStrip2D* measurement = strip2DHandle->push_back(std::make_unique<xAOD::RpcStrip2D>());
119 lCov(0,0) = stripCovX;
124 setMeasValues(measurement, rdoPairs[0], offId);
133 lCov(0,0) = stripCovX;
137 strip->setMeasurement<1>(0, lPos, lCov);
138 setMeasValues(
strip, rdoPairs[0] ? rdoPairs[0] : rdoPairs[1], offId);
143 return StatusCode::SUCCESS;
147 const std::vector<uint32_t>& robIds)
const {
150 return decode(ctx, cablingMap->getChamberHashVec(robIds, msgStream()));
154 ATH_CHECK(stripHandle.
record(std::make_unique<xAOD::RpcStripContainer>(),
155 std::make_unique<xAOD::RpcStripAuxContainer>()));
159 ATH_CHECK(strip2DHandle.
record(std::make_unique<xAOD::RpcStrip2DContainer>(),
160 std::make_unique<xAOD::RpcStrip2DAuxContainer>()));
163 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Handle class for recording to StoreGate.
This is a "hash" representation of an Identifier.
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.
StatusCode record(const SG::WriteHandleKey< Cont_t > &key, const EventContext &ctx)
Record the container to store gate using the passed write handle key.
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
This header ties the generic definitions in this package.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
RpcStripContainer_v1 RpcStripContainer
RpcStripAuxContainer_v1 RpcStripAuxContainer
Eigen::Matrix< float, N, N > MeasMatrix
NRPCRDO_v1 NRPCRDO
Define the version of the NRPC RDO class.
RpcStrip2DAuxContainer_v1 RpcStrip2DAuxContainer
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
RpcStrip2DContainer_v1 RpcStrip2DContainer
Helper struct that is parsed to the cabling map to translate between the offline & online Identifiers...