ATLAS Offline Software
Loading...
Searching...
No Matches
xAODSegmentCnvAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#include "xAODSegmentCnvAlg.h"
5
8
11
12
15
19
20#include "Acts/Utilities/Enumerate.hpp"
21#include "Acts/Surfaces/StrawSurface.hpp"
22#include "Acts/Surfaces/LineBounds.hpp"
23#include "Acts/Geometry/TrackingGeometry.hpp"
24
26
27using namespace Acts::UnitLiterals;
28
29namespace {
31 const Acts::TrackingVolume* highestAlignable(const Acts::TrackingVolume* volume){
32 return !volume || !volume->motherVolume() || !volume->motherVolume()->isAlignable()
33 ? volume : highestAlignable(volume->motherVolume());
34 }
35}
36
37namespace MuonR4{
38 using namespace SegmentFit;
42 using SegPars_t = xAOD::PosAccessor<Acts::toUnderlying(ParamDefs::nPars)>::element_type;
44 using SegCov_t = xAOD::PosAccessor<Acts::sumUpToN(Acts::toUnderlying(ParamDefs::nPars))>::element_type;
46 ATH_CHECK(m_idHelperSvc.retrieve());
47 ATH_CHECK(m_readKeys.initialize());
48 ATH_CHECK(m_geoCtxKey.initialize());
49 ATH_CHECK(m_writeKey.initialize());
50 ATH_CHECK(m_prdLinkKey.initialize());
51 ATH_CHECK(m_localSegParKey.initialize());
52 ATH_CHECK(m_localSegCovKey.initialize());
53 ATH_CHECK(m_parentSegKey.initialize());
54 ATH_CHECK(m_combMeasKey.initialize());
55 ATH_CHECK(m_prdStateKey.initialize());
57 if (m_estimateHoles) {
59 }
60 ATH_CHECK(m_extrapolationTool.retrieve(EnableTool{m_estimateHoles}));
62 return StatusCode::SUCCESS;
63 }
64 StatusCode xAODSegmentCnvAlg::execute(const EventContext& ctx) const {
65 const ActsTrk::GeometryContext* gctx{nullptr};
66 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
67
68 PrepDataCollectorShip measDecorator{*this, ctx, gctx->context()};
69
71 xAOD::MuonSegmentAuxContainer> outContainer{};
72
73
74 ATH_CHECK(outContainer.record(m_writeKey, ctx));
75 ATH_CHECK(measDecorator.prdCombContainer.record(m_combMeasKey, ctx));
76
80
82 const SegmentContainer* segmentContainer{nullptr};
83 ATH_CHECK(SG::get(segmentContainer, key, ctx));
84
86 unsigned recoSegIdx{0};
87 outContainer->reserve(outContainer->size() + segmentContainer->size());
88 for (const Segment* inSegment : *segmentContainer) {
89 const MuonGMR4::SpectrometerSector* sector = inSegment->msSector();
90
91 xAOD::MuonSegment* convertedSeg = outContainer->push_back(std::make_unique<xAOD::MuonSegment>());
92 dec_parentLink(*convertedSeg) = SegLink_t{segmentContainer, recoSegIdx};
93 ++recoSegIdx;
94
95 const Amg::Vector3D& pos{inSegment->position()};
96 const Amg::Vector3D& dir{inSegment->direction()};
97 convertedSeg->setPosition(pos.x(), pos.y(), pos.z());
98 convertedSeg->setDirection(dir.x(), dir.y(), dir.z());
99
100 convertedSeg->setIdentifier(sector->sector(), sector->chamberIndex(),
101 sector->side(), inSegment->technology());
102 convertedSeg->setFitQuality(inSegment->chi2(), inSegment->nDoF());
103
104 using enum ParamDefs;
105 convertedSeg->setT0Error(inSegment->segementT0(),
106 Amg::error(inSegment->covariance(), Acts::toUnderlying(t0)));
107
108 SegPars_t& localPars{dec_locPars(*convertedSeg)};
109 const Amg::Transform3D globToLoc{sector->globalToLocalTransform(*gctx)};
110 const Amg::Vector3D locPos{globToLoc * pos};
111 const Amg::Vector3D locDir{globToLoc.linear() * dir};
112
113 localPars[Acts::toUnderlying(x0)] = locPos.x();
114 localPars[Acts::toUnderlying(y0)] = locPos.y();
115 localPars[Acts::toUnderlying(theta)] = locDir.theta();
116 localPars[Acts::toUnderlying(phi)] = locDir.phi();
117 localPars[Acts::toUnderlying(t0)] = inSegment->segementT0();
118
119 SegCov_t& localCov{dec_locCov(*convertedSeg)};
120 constexpr std::size_t n = Acts::toUnderlying(ParamDefs::nPars);
121 for (std::size_t p = 1; p < n; ++p) {
122 for (std::size_t p1 = 0 ; p1 <=p;++p1) {
123 localCov[Acts::vecIdxFromSymMat<n>(p,p1)] = inSegment->covariance()(p, p1);
124 }
125 }
126 ATH_CHECK(linkMeasurements(*gctx, *inSegment, *convertedSeg, measDecorator));
127 evaluateSummary(ctx, *convertedSeg);
128 }
129 }
130 return StatusCode::SUCCESS;
131 }
132
134 const Segment& inSegment,
135 xAOD::MuonSegment& copySegment,
136 PrepDataCollectorShip& ship) const {
138 // Cache all measurements that can be combined to two measurements in a single gas gap
139 std::vector< std::tuple<const xAOD::MuonMeasurement*, State, std::size_t>> combineMap{};
140 std::vector< std::tuple<const xAOD::UncalibratedMeasurement*, State, std::size_t>> linkMap{};
141
142
143 PrdLinkVec_t& links = ship.dec_prdLinks(copySegment);
144 std::vector<char>& linkStates = ship.dec_prdStates(copySegment);
145 links.reserve(2*inSegment.measurements().size());
146 linkStates.reserve(2*inSegment.measurements().size());
147
150 auto combine = [&](const xAOD::MuonMeasurement* m1,
151 const xAOD::MuonMeasurement* m2) {
152 auto cmbMeas = ship.prdCombContainer->push_back(std::make_unique<xAOD::CombinedMuonStrip>());
153
154 cmbMeas->setPrimaryStrip(m1);
155 cmbMeas->setSecondaryStrip(m2);
156 const auto [locPos, locCov] = xAOD::positionAndCovariance(m1, m2);
157 cmbMeas->localCovariance<2>() = xAOD::toStorage(locCov);
158 cmbMeas->localPosition<2>() = xAOD::toStorage(locPos);
159 const Identifier id1{m1->identify()}, id2{m2->identify()};
160 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Combine "<<m_idHelperSvc->toString(id1)
161 <<" & "<<m_idHelperSvc->toString(id2));
162 if ((m1->type() != xAOD::UncalibMeasType::sTgcStripType ||
163 m_idHelperSvc->stgcIdHelper().channelType(id1) ==
164 m_idHelperSvc->stgcIdHelper().channelType(id2))&&
165 m_idHelperSvc->measuresPhi(id1) == m_idHelperSvc->measuresPhi(id2)) {
166 THROW_EXCEPTION("Cannot combine "<<m_idHelperSvc->toString(id1)
167 <<" & "<<m_idHelperSvc->toString(id2));
168 }
169 return cmbMeas;
170 };
171 // Loop over the measurements
172 for (const auto [segIdx, meas] : Acts::enumerate(inSegment.measurements())) {
173 const SpacePoint* sp = meas->spacePoint();
174 if (!sp) {
175 if (!m_convertBeamSpot) {
176 continue;
177 }
178 // Up to now, there's no variety on the beamspot across the segments
179 if (!ship.beamSpot) {
180 if (!ship.beamSpotMeasCreator.ok()) {
181 ATH_MSG_ERROR("Cannot create a beamspot measurement");
182 return StatusCode::FAILURE;
183 }
184
185 const Amg::Vector3D beamSpot = inSegment.msSector()->localToGlobalTransform(gctx) *
186 meas->localPosition();
187 AmgSymMatrix(2) covariance{AmgSymMatrix(2)::Identity()};
188 using CovIdx = SpacePoint::CovIdx;
189 using ProjectorType = xAOD::AuxiliaryMeasurement::ProjectorType;
190 covariance(0,0) = meas->covariance()[Acts::toUnderlying(CovIdx::etaCov)];
191 covariance(1,1) = meas->covariance()[Acts::toUnderlying(CovIdx::phiCov)];
193 auto surf = Acts::Surface::makeShared<Acts::StrawSurface>(Amg::getTranslate3D(beamSpot),
194 std::make_shared<Acts::LineBounds>(std::sqrt(covariance(0,0)), 20._m));
195
196 ship.beamSpot = ship.beamSpotMeasCreator->newMeasurement<2>(surf, ProjectorType::e2DimNoTime, covariance);
197 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Created beamspot measurement "<<(*meas)<<", "
198 <<surf->toString(gctx.context()));
199 }
200 linkMap.emplace_back(ship.beamSpot, meas->fitState(), segIdx);
201 continue;
202 }
203 switch (sp->type()) {
204 using enum xAOD::UncalibMeasType;
205 // Mdt & micromegas are never combined
206 case MdtDriftCircleType:
207 case MMClusterType: {
208 linkMap.emplace_back(sp->primaryMeasurement(), meas->fitState(), segIdx);
209 break;
210 } case RpcStripType:
211 case TgcStripType:
212 case sTgcStripType: {
213 if (sp->primaryMeasurement() && sp->secondaryMeasurement()) {
214 if (sp->primaryMeasurement() != sp->secondaryMeasurement()) {
215 linkMap.emplace_back(combine(sp->primaryMeasurement(),
216 sp->secondaryMeasurement()),
217 meas->fitState(), segIdx);
218 } else { // BI - RPC measurements
219 linkMap.emplace_back(sp->primaryMeasurement(), meas->fitState(), segIdx);
220 }
221 } else {
224 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Append for later combination "<<(*meas));
225 combineMap.emplace_back(sp->primaryMeasurement(), meas->fitState(), segIdx);
226 }
227 break;
228 } default:
229 break;
230 }
231 }
232
233 // Finally we need to check whether there're measurements left to combine
234 for (std::size_t cmbIdx = 0; cmbIdx < combineMap.size(); ++cmbIdx){
235 const xAOD::MuonMeasurement* m1{std::get<0>(combineMap[cmbIdx])};
236 const State s1{std::get<1>(combineMap[cmbIdx])};
237 const std::size_t segIdx1{std::get<2>(combineMap[cmbIdx])};
238 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Find another measurement to combine with "
239 <<m_idHelperSvc->toString(m1->identify()));
240 if (cmbIdx +1 < combineMap.size()) {
241 const xAOD::MuonMeasurement* m2{std::get<0>(combineMap[cmbIdx +1])};
242 const State s2{std::get<1>(combineMap[cmbIdx+1])};
243 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Check whether "<<m_idHelperSvc->toString(m2->identify())
244 <<" is a good candidate");
245 // Ensure that they point to the same detector element, are within the same
246 // layer and have also the same state
247 if (m1->type() == m2->type() && m1->identifierHash() == m2->identifierHash() &&
248 m1->layerHash() == m2->layerHash() && s1 == s2) {
250 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - They match");
251 if (m1->measuresPhi()) {
252 linkMap.emplace_back(combine(m2, m1), s2, segIdx1);
253 } else {
254 linkMap.emplace_back(combine(m1, m2), s1, segIdx1);
255 }
256 ++cmbIdx; // skip the next measurement as it's absorbed here
257 continue;
258 }
259 }
260 ATH_MSG_VERBOSE("No match found");
261 linkMap.emplace_back(m1, s1, segIdx1);
262 }
263
264 std::ranges::sort(linkMap, [](const auto& a, const auto& b){
265 return std::get<2>(a) < std::get<2>(b);
266 });
267
268 for (const auto& [prd, state, segIdx]: linkMap) {
269 links.emplace_back(*static_cast<const xAOD::UncalibratedMeasurementContainer*>(prd->container()),
270 prd->index());
271 linkStates.emplace_back(Acts::toUnderlying(state));
272 }
273 return StatusCode::SUCCESS;
274 }
275
276 void xAODSegmentCnvAlg::evaluateSummary(const EventContext& ctx,
277 xAOD::MuonSegment& segment) const {
278
279
281 Counter hits{}, outliers{}, holes{};
283 std::unordered_set<Identifier> crossedSurfaces{};
284 const std::size_t nMeas = nMeasurements(segment);
285
286 const Acts::Surface* startSurface{}, *lastSurface{};
287 const Acts::TrackingGeometry* trackingGeo = m_estimateHoles ? m_trackingGeometrySvc->trackingGeometry().get() : nullptr;
288
289 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Loop over "<<nMeas<<" measurements.");
290 for (std::size_t m = 0 ; m < nMeas; ++m) {
291 const bool isOutlier = isOutlierMeasurement(segment, m);
292 Counter& increment = {isOutlier ? outliers: hits};
293 const xAOD::UncalibratedMeasurement* meas = getMeasurement(segment, m);
294 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Evaluate measurement "<<m_idHelperSvc->toString(xAOD::identify(meas))
295 <<", outlier: "<<isOutlier);
296 increment.precision += xAOD::isPrecisionHit(meas);
297 const auto* muonMeas = dynamic_cast<const xAOD::MuonMeasurement*>(meas);
298 increment.triggerPhi += (!muonMeas|| muonMeas->measuresPhi());
299 increment.triggerEta += (!muonMeas|| !muonMeas->measuresPhi()) && !xAOD::isPrecisionHit(meas);
300 // Count measurement holes of the trigger hits
301 if (!isOutlier && meas->numDimensions() == 1) {
303 //coverity[FORWARD_NULL]
304 const auto* re = static_cast<const MuonGMR4::RpcReadoutElement*>(muonMeas->readoutElement());
305 if (!muonMeas->measuresPhi() && re->nPhiStrips()) {
306 ++holes.triggerPhi;
307 } else if (muonMeas->measuresPhi()) {
308 ++holes.triggerEta;
309 }
310 } else if (meas->type() == xAOD::UncalibMeasType::TgcStripType) {
311 //coverity[FORWARD_NULL]
312 const auto* re = static_cast<const MuonGMR4::TgcReadoutElement*>(muonMeas->readoutElement());
313 if (!muonMeas->measuresPhi() && re->numStrips(muonMeas->layerHash())) {
314 ++holes.triggerPhi;
315 } else if (muonMeas->measuresPhi() && re->numWireGangs(muonMeas->layerHash())) {
316 ++holes.triggerEta;
317 }
318 } else if (meas->type() == xAOD::UncalibMeasType::sTgcStripType) {
319 if (!xAOD::isPrecisionHit(meas)) {
320 ++holes.precision;
321 } else {
322 ++holes.triggerPhi;
323 }
324 }
325 }
326
327
328 if (!m_estimateHoles) {
329 continue;
330 }
331 const Acts::Surface& surface = xAOD::muonSurface(meas);
332 if (!muonMeas){
333 continue;
334 }
335 crossedSurfaces.insert( muonMeas->type() != xAOD::UncalibMeasType::MdtDriftCircleType ?
336 m_idHelperSvc->gasGapId(muonMeas->identify()) :
337 muonMeas->identify());
338 const auto* volume = highestAlignable(trackingGeo->findVolume(volumeId(surface)));
339 assert(volume != nullptr);
340 if (!startSurface) {
341 startSurface = MuonGMR4::bottomBoundary(*volume);
342 } else if (m +1 == nMeas) {
343 lastSurface = MuonGMR4::topBoundary(*volume);
344 }
345 }
347 if (m_estimateHoles) {
348 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
349 auto atSurface = startSurface->intersect(tgContext, segment.position(), segment.direction(),
350 Acts::BoundaryTolerance::Infinite()).closest();
351
352 auto startPars = Acts::BoundTrackParameters::create(tgContext, startSurface->getSharedPtr(),
353 ActsTrk::convertPosToActs(atSurface.position()),
354 segment.direction(), 1./ 5._TeV, std::nullopt,
355 Acts::ParticleHypothesis::muon());
356 if (startPars.ok()) {
357 findHoles(ctx, *startPars, lastSurface, crossedSurfaces, holes);
358 } else {
359 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Start parameters not defined.");
360 }
361 }
362 segment.setNHits(hits.precision, hits.triggerPhi, hits.triggerEta);
363 segment.setNOutliers(outliers.precision, outliers.triggerPhi, outliers.triggerEta);
364 segment.setNHoles(holes.precision, holes.triggerPhi, holes.triggerEta);
365 }
366 void xAODSegmentCnvAlg::findHoles(const EventContext& ctx,
367 const Acts::BoundTrackParameters& startPars,
368 const Acts::Surface* target,
369 const std::unordered_set<Identifier>& layersWithHits,
370 Counter& holeCounter) const {
371
372
373 using SurfaceRecordOptions = ActsTrk::IExtrapolationTool::SurfaceRecordOptions;
374 SurfaceRecordOptions propOpts{target, m_extraHolePath};
375 propOpts.recordMaterial = false;
376 propOpts.recordPassive = false;
377 propOpts.recordSensitive = true;
378
379
380 auto propResult = m_extrapolationTool->propagateAndRecord(ctx, startPars, propOpts);
381 if (!propResult.ok()) {
382 return;
383 }
384
385 /* Loop over the track record to filter out the holes*/
386 for (Acts::BoundTrackParameters& record : (*propResult)) {
387 const auto* placement = dynamic_cast<const ActsTrk::SurfacePlacement*>(record.referenceSurface().surfacePlacement());
388 assert(placement != nullptr);
389 const auto* detEl = static_cast<const MuonGMR4::MuonReadoutElement*>(placement->detectorElement());
390 using enum ActsTrk::DetectorType;
392 if (layersWithHits.count(placement->identify())) {
393 continue;
394 }
399 if(std::ranges::none_of(layersWithHits,[&](const Identifier& recorded){
400 return m_idHelperSvc->chamberIndex(recorded) == detEl->chamberIndex() &&
401 m_idHelperSvc->stationPhi(recorded) == detEl->stationPhi();
402 })) {
403 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Surface "
404 <<m_idHelperSvc->toStringGasGap(placement->identify())<<" is not in the same sector");
405 continue;
406 }
407 switch (placement->detectorType()) {
408 case Mm:
409 case Mdt: {
410 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Precision hole detected "
411 <<m_idHelperSvc->toString(placement->identify()));
412 ++holeCounter.precision;
413 break;
414 } case Rpc: {
415 const auto* re = static_cast<const MuonGMR4::RpcReadoutElement*>(placement->detectorElement());
416 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Rpc hole detected "
417 <<m_idHelperSvc->toStringGasGap(placement->identify())<<".");
418 ++holeCounter.triggerEta;
419 holeCounter.triggerPhi += (re->nPhiStrips() > 0);
420 break;
421 } case Tgc: {
422 const auto* re = static_cast<const MuonGMR4::TgcReadoutElement*>(placement->detectorElement());
423 holeCounter.triggerEta += (re->numWireGangs(placement->hash())>0);
424 holeCounter.triggerPhi += (re->numStrips(placement->hash())>0);
425 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Tgc hole detected "
426 <<m_idHelperSvc->toStringGasGap(placement->identify())<<".");
427 break;
428 } case sTgc: {
429 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Precision hole detected "
430 <<m_idHelperSvc->toString(placement->identify()));
431 ++holeCounter.precision;
432 ++holeCounter.triggerPhi;
433 break;
434 } default:
435 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Unknown detector type "
436 <<placement->detectorType());
437 break;
438 }
439 }
440 }
441}
const std::regex re(r_e)
Scalar phi() const
phi method
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define AmgSymMatrix(dim)
static Double_t sp
static Double_t a
static Double_t t0
Acts::GeometryContext context() const
: Helper class to assign a @ActsSurfacePlacementBase to the Acts::Surfaces in order to make them alig...
size_type size() const noexcept
Returns the number of elements in the collection.
MuonReadoutElement is an abstract class representing the geometry of a muon detector.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
int sector() const
Returns the sector of the MS-sector.
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.
State
State flag to distinguish different space point states.
Placeholder for what will later be the muon segment EDM representation.
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
const MeasVec & measurements() const
Returns the associated measurements.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
void evaluateSummary(const EventContext &ctx, xAOD::MuonSegment &segment) const
Calculate the number of hits, outliers and holes on the segment and set the hit summary fields of the...
DecorKey_t m_prdStateKey
Decoration to the PrdLink state (I.e.
DecorKey_t m_localSegParKey
Decoration of the local segment parameters.
void findHoles(const EventContext &ctx, const Acts::BoundTrackParameters &startPars, const Acts::Surface *target, const std::unordered_set< Identifier > &geoIdsWithHits, Counter &holeCounter) const
Find potential sensitive surfaces crossed by the segment but without contributing measurements.
DecorKey_t m_localSegCovKey
Decoration of the local fit covariance parameters.
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Tracking geometry tool to search for holes.
DecorKey_t m_parentSegKey
Decoration of the original segment.
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_writeKey
Output segment container key.
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Acts extrapolation tool to search for holes.
StatusCode linkMeasurements(const ActsTrk::GeometryContext &gctx, const Segment &inSegment, xAOD::MuonSegment &targetSegment, PrepDataCollectorShip &ship) const
Decorate the prd links onto the output muon segment.
std::vector< PrdLink_t > PrdLinkVec_t
Abrivation of a collection of Prd links.
SG::WriteHandleKey< xAOD::CombinedMuonStripContainer > m_combMeasKey
Auxiliary container to model two measurements in the same gas gap as a single track state.
Gaudi::Property< double > m_extraHolePath
Extra path length for the propagation after the last surface was crossed.
DecorKey_t m_prdLinkKey
Decoration to the links to the associated Uncalibrated measurements.
virtual StatusCode execute(const EventContext &ctx) const override final
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc for Identifier printing & manipulation.
virtual StatusCode initialize() override final
Gaudi::Property< bool > m_convertBeamSpot
Flag to convert the beamspot constaint as well.
ActsTrk::AuxiliaryMeasurementHandler m_auxMeasProv
Handler to parse the auxiliary beam spot constaint.
ActsTrk::ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
SG::ReadHandleKeyArray< SegmentContainer > m_readKeys
Input segment container key.
ActsTrk::GeoContextReadKey_t m_geoCtxKey
Alignment container key.
Gaudi::Property< bool > m_estimateHoles
Flag to tell whether the hole summary shall be written.
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for adding a decoration to an object.
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType ProjectorType
Use the calibration projector.
void setDirection(float px, float py, float pz)
Sets the direction.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Amg::Vector3D direction() const
Returns the direction as Amg::Vector.
void setT0Error(float t0, float t0Error)
Sets the time error.
void setNHits(const std::uint8_t nPrecisionHits, const std::uint8_t nPhiLayers, const std::uint8_t nTrigEtaLayers)
Assign the segment hit summary.
void setNOutliers(const std::uint8_t nPrecOutliers, const std::uint8_t nTrigPhiOutliers, const std::uint8_t nTrigEtaOutliers)
Assign the number of hits with a large pull per hit category.
void setNHoles(const std::uint8_t nPrecHoles, const std::uint8_t nTrigPhiHoles, const std::uint8_t nTrigEtaHoles)
Assign the number of expected but missing hits.
void setPosition(float x, float y, float z)
Sets the global position.
void setIdentifier(const std::uint8_t sector, const ::Muon::MuonStationIndex::ChIndex chamberIndex, const std::int8_t etaIndex, const ::Muon::MuonStationIndex::TechnologyIndex technology)
Set the Identifier fields of the Segment.
Amg::Vector3D position() const
Returns the position as Amg::Vector.
virtual unsigned int numDimensions() const =0
Returns the number of dimensions of the measurement.
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Acts::Vector4 convertPosToActs(const Amg::Vector3D &athenaPos, const double athenaTime=0.)
Converts a position vector & time from Athena units into Acts units.
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
const Acts::Surface * bottomBoundary(const Acts::TrackingVolume &volume)
Returns the boundary surface parallel to the x-y plane at negative local z.
const Acts::Surface * topBoundary(const Acts::TrackingVolume &volume)
Returns the boundary surface parallel to the x-y plane at positive local z.
SeedingAux::FitParIndex ParamDefs
Use the same parameter indices as used by the CompSpacePointAuxiliaries.
This header ties the generic definitions in this package.
const xAOD::UncalibratedMeasurement * getMeasurement(const xAOD::MuonSegment &segment, const std::size_t n)
Returns the n-th uncalibrated measurement.
CalibratedSpacePoint::State State
std::size_t nMeasurements(const xAOD::MuonSegment &segment)
Returns the number of associated Uncalibrated measurements.
Acts::GeometryIdentifier volumeId(const Acts::Surface &surface)
Returns the identifier of the volume in which the surface is embedded.
bool isOutlierMeasurement(const xAOD::MuonSegment &segment, const std::size_t n)
Returns whether the n-the uncalibrated measurement is an outlier.
ElementLink< MuonR4::SegmentContainer > SegLink_t
Abrivation of the link to the reco segment container.
DataVector< Segment > SegmentContainer
xAOD::PosAccessor< Acts::sumUpToN(Acts::toUnderlying(ParamDefs::nPars))>::element_type SegCov_t
Abrivation of the decorated local segment covariance.
xAOD::PosAccessor< Acts::toUnderlying(ParamDefs::nPars)>::element_type SegPars_t
Abrivation of the decorated local segment parameters.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
SG::AuxElement::Accessor< std::array< float, N > > PosAccessor
xAOD Accessor to the position
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
MuonMeasurement_v1 MuonMeasurement
MeasVector< N > toStorage(const AmgVector(N)&amgVec)
Converts the double precision of the AmgVector into the floating point storage precision of the MeasV...
UncalibMeasType
Define the type of the uncalibrated measurement.
bool isPrecisionHit(const UncalibratedMeasurement *meas)
Returns whether the measurement is a precision hit.
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
std::pair< Amg::Vector2D, AmgSymMatrix(2)> positionAndCovariance(const MuonMeasurement *oneDimMeas)
Returns the 1D position of the uncalibrated measurement expressed in the coordinate system of the mea...
MuonSegmentAuxContainer_v1 MuonSegmentAuxContainer
Definition of the current Muon auxiliary container.
UncalibratedMeasurementContainer_v1 UncalibratedMeasurementContainer
Define the version of the uncalibrated measurement container.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
Configuration struct to steer the propagation with surface record.
bool recordMaterial
Flag to toggle whether track parameters at material surfaces shall be created if crossed.
Helper struct to keep track of the number of precision, trigger phi and trigger eta hits.
Auxiliary struct to ship the WriteDecorHandle and writeHandles needed to link the uncalibrated meausr...
SG::WriteDecorHandle< xAOD::MuonSegmentContainer, PrdLinkVec_t > dec_prdLinks
List of element links to the associated measurements.
xAOD::FillContainer< xAOD::CombinedMuonStripContainer, xAOD::CombinedMuonStripAuxContainer > prdCombContainer
Container handle to create the combined measurements of Rpc/Tgc/sTgc.
Acts::Result< ActsTrk::AuxiliaryMeasurementHandler::MeasurementProvider, ActsTrk::AuxiliaryMeasurementHandler::HandleStatus > beamSpotMeasCreator
Container handle to create the beamspot measurement, if needed.
const xAOD::UncalibratedMeasurement * beamSpot
Pointer to the commonly shared beamspot measurement.
SG::WriteDecorHandle< xAOD::MuonSegmentContainer, std::vector< char > > dec_prdStates
Flag indicating whether each measurement is valid or an outlier.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10