ATLAS Offline Software
Loading...
Searching...
No Matches
xAODSegmentCnvTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
11
12#include "Acts/Surfaces/StrawSurface.hpp"
14#include "Acts/Geometry/TrackingGeometry.hpp"
15#include "Acts/Surfaces/PlaneSurface.hpp"
16
17namespace MuonR4{
18
20 ATH_CHECK(m_idHelperSvc.retrieve());
21 ATH_CHECK(m_ctxProvider.initialize());
22 if (m_estimateHoles) {
24 }
25 ATH_CHECK(m_extrapolationTool.retrieve(EnableTool{m_estimateHoles}));
26 return StatusCode::SUCCESS;
27 }
28
30 const MuonR4::Segment& inSegment,
31 DataShip& ship) const {
32
33 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
34 const MuonGMR4::SpectrometerSector* sector = inSegment.msSector();
35
36 xAOD::MuonSegment* convertedSeg = ship.segmentContainer->push_back(std::make_unique<xAOD::MuonSegment>());
37
38 const Amg::Vector3D& pos{inSegment.position()};
39 const Amg::Vector3D& dir{inSegment.direction()};
40 convertedSeg->setPosition(pos.x(), pos.y(), pos.z());
41 convertedSeg->setDirection(dir.x(), dir.y(), dir.z());
42
43 convertedSeg->setIdentifier(sector->sector(), sector->chamberIndex(),
44 sector->side(), inSegment.technology());
45 convertedSeg->setFitQuality(inSegment.chi2(), inSegment.nDoF());
46
47 using enum SegmentFit::ParamDefs;
48 convertedSeg->setT0Error(inSegment.segementT0(),
49 Amg::error(inSegment.covariance(), Acts::toUnderlying(t0)));
50
51 if (ship.dec_localSegPars) {
52 using SegPars_t = xAOD::PosAccessor<Acts::toUnderlying(SegmentFit::ParamDefs::nPars)>::element_type;
53 SegPars_t& localPars{ship.dec_localSegPars(*convertedSeg)};
54
55 const Amg::Transform3D globToLoc{sector->globalToLocalTransform(tgContext)};
56 const Amg::Vector3D locPos{globToLoc * pos};
57 const Amg::Vector3D locDir{globToLoc.linear() * dir};
58
59 localPars[Acts::toUnderlying(x0)] = locPos.x();
60 localPars[Acts::toUnderlying(y0)] = locPos.y();
61 localPars[Acts::toUnderlying(theta)] = locDir.theta();
62 localPars[Acts::toUnderlying(phi)] = locDir.phi();
63 localPars[Acts::toUnderlying(t0)] = inSegment.segementT0();
64 }
65
66 if (ship.dec_localSegCov) {
67 using SegCov_t = xAOD::PosAccessor<Acts::sumUpToN(Acts::toUnderlying(SegmentFit::ParamDefs::nPars))>::element_type;
68 SegCov_t& localCov{ship.dec_localSegCov(*convertedSeg)};
69 constexpr std::size_t n = Acts::toUnderlying(SegmentFit::ParamDefs::nPars);
70 for (std::size_t p = 1; p < n; ++p) {
71 for (std::size_t p1 = 0 ; p1 <=p;++p1) {
72 localCov[Acts::vecIdxFromSymMat<n>(p,p1)] = inSegment.covariance()(p, p1);
73 }
74 }
75 }
76
77 if (linkMeasurements(tgContext, inSegment, *convertedSeg, ship) != StatusCode::SUCCESS) {
78 ATH_MSG_ERROR("Failed to link measurements");
79 ship.segmentContainer->pop_back();
80 return nullptr;
81 }
82 evaluateSummary(ctx, *convertedSeg);
83 return convertedSeg;
84 }
85
86 StatusCode xAODSegmentCnvTool::linkMeasurements(const Acts::GeometryContext& tgContext,
87 const Segment& inSegment,
88 xAOD::MuonSegment& targetSegment,
89 DataShip& ship) const {
90 if (!ship.dec_prdLinks || !ship.dec_prdStates || !ship.prdCombContainer.hasHandle()) {
91 ATH_MSG_DEBUG("Decorators for the prd links and states are not initialized");
92 return StatusCode::SUCCESS;
93 }
94
96 // Cache all measurements that can be combined to two measurements in a single gas gap
97 std::vector< std::tuple<const xAOD::MuonMeasurement*, State, std::size_t>> combineMap{};
98 std::vector< std::tuple<const xAOD::UncalibratedMeasurement*, State, std::size_t>> linkMap{};
99
100 using PrdLinkVec_t = std::vector<ElementLink<xAOD::UncalibratedMeasurementContainer>>;
101 PrdLinkVec_t& links = ship.dec_prdLinks(targetSegment);
102 std::vector<char>& linkStates = ship.dec_prdStates(targetSegment);
103 links.reserve(2*inSegment.measurements().size());
104 linkStates.reserve(2*inSegment.measurements().size());
105
108 auto combine = [&](const xAOD::MuonMeasurement* m1,
109 const xAOD::MuonMeasurement* m2) {
110 auto cmbMeas = ship.prdCombContainer->push_back(std::make_unique<xAOD::CombinedMuonStrip>());
111
112 cmbMeas->setPrimaryStrip(m1);
113 cmbMeas->setSecondaryStrip(m2);
114 const auto [locPos, locCov] = xAOD::positionAndCovariance(m1, m2);
115 cmbMeas->localCovariance<2>() = xAOD::toStorage(locCov);
116 cmbMeas->localPosition<2>() = xAOD::toStorage(locPos);
117 const Identifier id1{m1->identify()}, id2{m2->identify()};
118 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Combine "<<m_idHelperSvc->toString(id1)
119 <<" & "<<m_idHelperSvc->toString(id2));
120 if ((m1->type() != xAOD::UncalibMeasType::sTgcStripType ||
121 m_idHelperSvc->stgcIdHelper().channelType(id1) ==
122 m_idHelperSvc->stgcIdHelper().channelType(id2))&&
123 m_idHelperSvc->measuresPhi(id1) == m_idHelperSvc->measuresPhi(id2)) {
124 THROW_EXCEPTION("Cannot combine "<<m_idHelperSvc->toString(id1)
125 <<" & "<<m_idHelperSvc->toString(id2));
126 }
127 return cmbMeas;
128 };
129 // Loop over the measurements
130 for (const auto [segIdx, meas] : Acts::enumerate(inSegment.measurements())) {
131 const SpacePoint* sp = meas->spacePoint();
132 if (!sp) {
133 if (!ship.beamSpotMeasCreator.ok()) {
134 continue;
135 }
136 // Up to now, there's no variety on the beamspot across the segments
137 if (!ship.beamSpot) {
138 if (!ship.beamSpotMeasCreator.ok()) {
139 ATH_MSG_ERROR("Cannot create a beamspot measurement");
140 return StatusCode::FAILURE;
141 }
142
143 const Amg::Vector3D beamSpot = inSegment.msSector()->localToGlobalTransform(tgContext) *
144 meas->localPosition();
145 AmgSymMatrix(2) covariance{AmgSymMatrix(2)::Identity()};
146 using CovIdx = SpacePoint::CovIdx;
147 using ProjectorType = xAOD::AuxiliaryMeasurement::ProjectorType;
148 covariance(0,0) = meas->covariance()[Acts::toUnderlying(CovIdx::etaCov)];
149 covariance(1,1) = meas->covariance()[Acts::toUnderlying(CovIdx::phiCov)];
151 auto surf = Acts::Surface::makeShared<Acts::StrawSurface>(Amg::getTranslate3D(beamSpot),
152 std::make_shared<Acts::LineBounds>(std::sqrt(covariance(0,0)), 20._m));
153
154 ship.beamSpot = ship.beamSpotMeasCreator->newMeasurement<2>(surf, ProjectorType::e2DimNoTime, covariance);
155 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Created beamspot measurement "<<(*meas)<<", "
156 <<surf->toString(tgContext));
157 }
158 linkMap.emplace_back(ship.beamSpot, meas->fitState(), segIdx);
159 continue;
160 }
161 switch (sp->type()) {
162 using enum xAOD::UncalibMeasType;
163 // Mdt & micromegas are never combined
164 case MdtDriftCircleType:
165 case MMClusterType: {
166 linkMap.emplace_back(sp->primaryMeasurement(), meas->fitState(), segIdx);
167 break;
168 } case RpcStripType:
169 case TgcStripType:
170 case sTgcStripType: {
171 if (sp->primaryMeasurement() && sp->secondaryMeasurement()) {
172 if (sp->primaryMeasurement() != sp->secondaryMeasurement()) {
173 linkMap.emplace_back(combine(sp->primaryMeasurement(),
174 sp->secondaryMeasurement()),
175 meas->fitState(), segIdx);
176 } else { // BI - RPC measurements
177 linkMap.emplace_back(sp->primaryMeasurement(), meas->fitState(), segIdx);
178 }
179 } else {
182 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Append for later combination "<<(*meas));
183 combineMap.emplace_back(sp->primaryMeasurement(), meas->fitState(), segIdx);
184 }
185 break;
186 } default:
187 break;
188 }
189 }
190
191 // Finally we need to check whether there're measurements left to combine
192 for (std::size_t cmbIdx = 0; cmbIdx < combineMap.size(); ++cmbIdx){
193 const xAOD::MuonMeasurement* m1{std::get<0>(combineMap[cmbIdx])};
194 const State s1{std::get<1>(combineMap[cmbIdx])};
195 const std::size_t segIdx1{std::get<2>(combineMap[cmbIdx])};
196 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Find another measurement to combine with "
197 <<m_idHelperSvc->toString(m1->identify()));
198 if (cmbIdx +1 < combineMap.size()) {
199 const xAOD::MuonMeasurement* m2{std::get<0>(combineMap[cmbIdx +1])};
200 const State s2{std::get<1>(combineMap[cmbIdx+1])};
201 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Check whether "<<m_idHelperSvc->toString(m2->identify())
202 <<" is a good candidate");
203 // Ensure that they point to the same detector element, are within the same
204 // layer and have also the same state
205 if (m1->type() == m2->type() && m1->identifierHash() == m2->identifierHash() &&
206 m1->layerHash() == m2->layerHash() && s1 == s2) {
208 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - They match");
209 if (m1->measuresPhi()) {
210 linkMap.emplace_back(combine(m2, m1), s2, segIdx1);
211 } else {
212 linkMap.emplace_back(combine(m1, m2), s1, segIdx1);
213 }
214 ++cmbIdx; // skip the next measurement as it's absorbed here
215 continue;
216 }
217 }
218 ATH_MSG_VERBOSE("No match found");
219 linkMap.emplace_back(m1, s1, segIdx1);
220 }
221
222 std::ranges::sort(linkMap, [](const auto& a, const auto& b){
223 return std::get<2>(a) < std::get<2>(b);
224 });
225
226 for (const auto& [prd, state, segIdx]: linkMap) {
227 links.emplace_back(*static_cast<const xAOD::UncalibratedMeasurementContainer*>(prd->container()),
228 prd->index());
229 linkStates.emplace_back(Acts::toUnderlying(state));
230 }
231 return StatusCode::SUCCESS;
232 }
233
234 void xAODSegmentCnvTool::evaluateSummary(const EventContext& ctx,
235 xAOD::MuonSegment& segment) const {
236
238 Counter hits{}, outliers{}, holes{};
240 std::unordered_set<Identifier> crossedSurfaces{};
241 const std::size_t nMeas = nMeasurements(segment);
242
243 const Acts::Surface* startSurface{}, *lastSurface{};
244 const Acts::TrackingGeometry* trackingGeo = m_estimateHoles ? m_trackingGeometrySvc->trackingGeometry().get() : nullptr;
245
246 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Loop over "<<nMeas<<" measurements.");
247 for (std::size_t m = 0 ; m < nMeas; ++m) {
248 const xAOD::UncalibratedMeasurement* meas = getMeasurement(segment, m);
249 // Skip auxiliary constraints from summary, such as the beam spot (technically this should not happen because the beam spot is not considered as measurement here, but just in case )
250 if (meas->type() == xAOD::UncalibMeasType::Other) {
251 ATH_MSG_VERBOSE(__func__ << "() " << __LINE__
252 << " - Skip auxiliary measurement in segment summary");
253 continue;
254 }
255
256 const bool isOutlier = isOutlierMeasurement(segment, m);
257 Counter& increment = {isOutlier ? outliers: hits};
258
259 increment.precision += xAOD::isPrecisionHit(meas);
260 const auto* muonMeas = static_cast<const xAOD::MuonMeasurement*>(meas);
261
262 increment.triggerPhi += (muonMeas->measuresPhi() ||
263 //RPC BI / MDT twin or sTGC strip + pad hits
264 muonMeas->numDimensions() == 2);
265 increment.triggerEta += !xAOD::isPrecisionHit(muonMeas) && (
266 // 0D for combined strip + X measurements
267 (muonMeas->numDimensions() == 0 ) ||
268 // 1D strip/wire/pad (RPC,TGC, sTGC) cases
269 (muonMeas->numDimensions() == 1 && !muonMeas->measuresPhi() ) ||
270 //RPC BI for which measuresPhi = 0 as the phi is extracted from time information
271 (muonMeas->numDimensions() == 2));
272 // Count measurement holes of the trigger hits
273 if (!isOutlier && meas->numDimensions() == 1) {
275 //coverity[FORWARD_NULL]
276 const auto* re = static_cast<const MuonGMR4::RpcReadoutElement*>(muonMeas->readoutElement());
277 if (!muonMeas->measuresPhi() && re->nPhiStrips()) {
278 ++holes.triggerPhi;
279 } else if (muonMeas->measuresPhi()) {
280 ++holes.triggerEta;
281 }
282 } else if (meas->type() == xAOD::UncalibMeasType::TgcStripType) {
283 //coverity[FORWARD_NULL]
284 const auto* re = static_cast<const MuonGMR4::TgcReadoutElement*>(muonMeas->readoutElement());
285 if (!muonMeas->measuresPhi() && re->numStrips(muonMeas->layerHash())) {
286 ++holes.triggerPhi;
287 } else if (muonMeas->measuresPhi() && re->numWireGangs(muonMeas->layerHash())) {
288 ++holes.triggerEta;
289 }
290 } else if (meas->type() == xAOD::UncalibMeasType::sTgcStripType) {
291 if (!xAOD::isPrecisionHit(meas)) {
292 ++holes.precision;
293 } else {
294 ++holes.triggerPhi;
295 }
296 }
297 }
298
299 if (!m_estimateHoles) {
300 continue;
301 }
302 const Acts::Surface& surface = xAOD::muonSurface(meas);
303 if (!muonMeas){
304 continue;
305 }
306 crossedSurfaces.insert( muonMeas->type() != xAOD::UncalibMeasType::MdtDriftCircleType ?
307 m_idHelperSvc->gasGapId(muonMeas->identify()) :
308 muonMeas->identify());
309 const auto* volume = MuonGMR4::highestAlignable(trackingGeo->findVolume(volumeId(surface)));
310 assert(volume != nullptr);
311 if (!startSurface) {
312 startSurface = MuonGMR4::bottomBoundary(*volume);
313 } else if (m +1 == nMeas) {
314 lastSurface = MuonGMR4::topBoundary(*volume);
315 }
316 }
318 if (m_estimateHoles) {
319 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
320 std::shared_ptr<const Acts::Surface> startSurfPtr = startSurface->getSharedPtr();
321 auto atSurface = startSurface->intersect(tgContext, segment.position(), segment.direction(),
322 Acts::BoundaryTolerance::Infinite()).closest();
323
324 const auto locPos = startSurface->globalToLocal(tgContext, atSurface.position(), segment.direction());
325 if (!locPos.ok()) {
326 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Intersection "<<Amg::toString(atSurface.position())
327 <<" is not on surface "<<startSurface->geometryId());
328 return;
329 }
330 if (!startSurface->insideBounds(*locPos)) {
331 const auto* volume = MuonGMR4::highestAlignable(trackingGeo->highestTrackingVolume()->
332 lowestTrackingVolume(tgContext, atSurface.position()));
333 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Intersection "<<Amg::toString(atSurface.position())
334 <<" is outside surface: "<<startSurface->geometryId()<<", "<<startSurface->bounds()<<". "
335 <<" Switch to volume "<<volume->geometryId()<<", bounds: "<<volume->volumeBounds());
336
337 if (volume->isAlignable()) {
338 startSurfPtr = MuonGMR4::bottomBoundary(*volume)->getSharedPtr();
339 atSurface = startSurfPtr->intersect(tgContext, segment.position(), segment.direction(),
340 Acts::BoundaryTolerance::Infinite()).closest();
341 } else {
342 startSurfPtr = Acts::Surface::makeShared<Acts::PlaneSurface>(startSurfPtr->localToGlobalTransform(tgContext));
343 }
344 }
345 auto startPars = Acts::BoundTrackParameters::create(tgContext, startSurfPtr,
346 ActsTrk::convertPosToActs(atSurface.position()),
347 segment.direction(), 1./ 5._TeV, std::nullopt,
348 Acts::ParticleHypothesis::muon());
349 if (startPars.ok()) {
350 findHoles(ctx, *startPars, lastSurface, crossedSurfaces, holes);
351 } else {
352 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Start parameters not defined.");
353 }
354 }
355 segment.setNHits(hits.precision, hits.triggerPhi, hits.triggerEta);
356 segment.setNOutliers(outliers.precision, outliers.triggerPhi, outliers.triggerEta);
357 segment.setNHoles(holes.precision, holes.triggerPhi, holes.triggerEta);
358 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" Updated summary: "<<hits);
359 }
360 void xAODSegmentCnvTool::findHoles(const EventContext& ctx,
361 const Acts::BoundTrackParameters& startPars,
362 const Acts::Surface* target,
363 const std::unordered_set<Identifier>& layersWithHits,
364 Counter& holeCounter) const {
365
366
367 using SurfaceRecordOptions = ActsTrk::IExtrapolationTool::SurfaceRecordOptions;
368 SurfaceRecordOptions propOpts{target, m_extraHolePath};
369 propOpts.recordMaterial = false;
370 propOpts.recordPassive = false;
371 propOpts.recordSensitive = true;
372
373
374 auto propResult = m_extrapolationTool->propagateAndRecord(ctx, startPars, propOpts);
375 if (!propResult.ok()) {
376 return;
377 }
378
379 /* Loop over the track record to filter out the holes*/
380 for (Acts::BoundTrackParameters& record : (*propResult)) {
381 const auto* placement = dynamic_cast<const ActsTrk::SurfacePlacement*>(record.referenceSurface().surfacePlacement());
382 assert(placement != nullptr);
383 const auto* detEl = static_cast<const MuonGMR4::MuonReadoutElement*>(placement->detectorElement());
384 using enum ActsTrk::DetectorType;
386 if (layersWithHits.count(placement->identify())) {
387 continue;
388 }
393 if(std::ranges::none_of(layersWithHits,[&](const Identifier& recorded){
394 return m_idHelperSvc->chamberIndex(recorded) == detEl->chamberIndex() &&
395 m_idHelperSvc->stationPhi(recorded) == detEl->stationPhi();
396 })) {
397 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Surface "
398 <<m_idHelperSvc->toStringGasGap(placement->identify())<<" is not in the same sector");
399 continue;
400 }
401 switch (placement->detectorType()) {
402 case Mm:
403 case Mdt: {
404 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Precision hole detected "
405 <<m_idHelperSvc->toString(placement->identify()));
406 ++holeCounter.precision;
407 break;
408 } case Rpc: {
409 const auto* re = static_cast<const MuonGMR4::RpcReadoutElement*>(placement->detectorElement());
410 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Rpc hole detected "
411 <<m_idHelperSvc->toStringGasGap(placement->identify())<<".");
412 ++holeCounter.triggerEta;
413 holeCounter.triggerPhi += (re->nPhiStrips() > 0);
414 break;
415 } case Tgc: {
416 const auto* re = static_cast<const MuonGMR4::TgcReadoutElement*>(placement->detectorElement());
417 holeCounter.triggerEta += (re->numWireGangs(placement->hash())>0);
418 holeCounter.triggerPhi += (re->numStrips(placement->hash())>0);
419 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Tgc hole detected "
420 <<m_idHelperSvc->toStringGasGap(placement->identify())<<".");
421 break;
422 } case sTgc: {
423 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Precision hole detected "
424 <<m_idHelperSvc->toString(placement->identify()));
425 ++holeCounter.precision;
426 ++holeCounter.triggerPhi;
427 break;
428 } default:
429 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Unknown detector type "
430 <<placement->detectorType());
431 break;
432 }
433 }
434 }
435}
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
: Helper class to assign a @ActsSurfacePlacementBase to the Acts::Surfaces in order to make them alig...
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.
double segementT0() const
Returns the fitted segment time, if there's any.
unsigned int nDoF() const
Returns the number of degrees of freedom.
const SegmentFit::Covariance & covariance() const
Returns the uncertainties of the defining parameters.
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
Muon::MuonStationIndex::TechnologyIndex technology() const
Returns the technology index of the first precision hit.
const MeasVec & measurements() const
Returns the associated measurements.
const Amg::Vector3D & position() const
Returns the global segment position.
const Amg::Vector3D & direction() const
Returns the global segment direction.
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...
xAOD::MuonSegment * convertSegment(const EventContext &ctx, const MuonR4::Segment &inSegment, DataShip &ship) const override
Convert a MuonR4::Segment to an xAOD::MuonSegment and decorate it with the necessary information.
StatusCode initialize() override
ActsTrk::ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
Gaudi::Property< double > m_extraHolePath
Extra path length for the propagation after the last surface was crossed.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc for Identifier printing & manipulation.
StatusCode linkMeasurements(const Acts::GeometryContext &tgContext, const Segment &inSegment, xAOD::MuonSegment &targetSegment, DataShip &ship) const
Decorate the prd links onto the output muon segment.
Gaudi::Property< bool > m_estimateHoles
Flag to tell whether the hole summary shall be written.
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Tracking geometry tool to search for holes.
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Acts extrapolation tool to search for holes.
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.
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
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
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::TrackingVolume * highestAlignable(const Acts::TrackingVolume *volume)
Returns the highest parent volume that is alignable.
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.
std::vector< PrdLink_t > PrdLinkVec_t
xAOD::PosAccessor< Acts::toUnderlying(ParamDefs::nPars)>::element_type SegPars_t
SG::AuxElement::Accessor< std::array< float, N > > PosAccessor
xAOD Accessor to the position
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
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.
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...
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.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10