ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::xAODSegmentCnvAlg Class Reference

The xAODSegmentCnvAlg takes MuonR4::Segments and converts them into a single xAOD::MuonSegmentContainer. More...

#include <xAODSegmentCnvAlg.h>

Inheritance diagram for MuonR4::xAODSegmentCnvAlg:

Classes

struct  PrepDataCollectorShip
 Auxiliary struct to ship the WriteDecorHandle and writeHandles needed to link the uncalibrated meausrements to the segment. More...
struct  Counter
 Helper struct to keep track of the number of precision, trigger phi and trigger eta hits. More...

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

using PrdCont_t = xAOD::UncalibratedMeasurementContainer
 Abrivation to call an uncalibrated measurement container.
using PrdLink_t = ElementLink<PrdCont_t>
 Abrivation to call the link to an element inside an uncalibrated measurement container.
using PrdLinkVec_t = std::vector<PrdLink_t>
 Abrivation of a collection of Prd links.
using DecorKey_t = SG::WriteDecorHandleKey<xAOD::MuonSegmentContainer>
 Abrivation of the extra declared auxVariables.
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode linkMeasurements (const ActsTrk::GeometryContext &gctx, const Segment &inSegment, xAOD::MuonSegment &targetSegment, PrepDataCollectorShip &ship) const
 Decorate the prd links onto the output muon segment.
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 passed segment.
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.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc
 IdHelperSvc for Identifier printing & manipulation.
SG::ReadHandleKeyArray< SegmentContainerm_readKeys {this, "InSegmentKeys", {"R4MuonSegments"}}
 Input segment container key.
SG::WriteHandleKey< xAOD::MuonSegmentContainerm_writeKey {this, "OutSegmentKey", "MuonSegmentsFromR4"}
 Output segment container key.
ActsTrk::GeoContextReadKey_t m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
 Alignment container key.
ServiceHandle< ActsTrk::ITrackingGeometrySvcm_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
 Tracking geometry tool to search for holes.
ToolHandle< ActsTrk::IExtrapolationToolm_extrapolationTool {this, "ExtrapolationTool", ""}
 Acts extrapolation tool to search for holes.
DecorKey_t m_prdLinkKey {this, "PrdLinkKey", m_writeKey, "prdLinks" }
 Decoration to the links to the associated Uncalibrated measurements.
DecorKey_t m_prdStateKey {this, "PrdStateKey", m_writeKey, "prdState"}
 Decoration to the PrdLink state (I.e.
DecorKey_t m_localSegParKey {this, "LocalSegParKey", m_writeKey, "localSegPars"}
 Decoration of the local segment parameters.
DecorKey_t m_localSegCovKey {this, "LocalCovParKey", m_writeKey, "localSegCov"}
 Decoration of the local fit covariance parameters.
DecorKey_t m_parentSegKey {this, "ParentSegmentKey", m_writeKey, "parentSegment"}
 Decoration of the original segment.
SG::WriteHandleKey< xAOD::CombinedMuonStripContainerm_combMeasKey {this, "combinedPrdKey", "CombinedMuonPrds"}
 Auxiliary container to model two measurements in the same gas gap as a single track state.
ActsTrk::AuxiliaryMeasurementHandler m_auxMeasProv {this}
 Handler to parse the auxiliary beam spot constaint.
ActsTrk::ContextUtility m_ctxProvider {this}
 Context provider for geometry, magnetic field and calibration contexts.
Gaudi::Property< bool > m_convertBeamSpot {this, "convertBeamSpot", false}
 Flag to convert the beamspot constaint as well.
Gaudi::Property< bool > m_estimateHoles {this, "estimateHoles", true}
 Flag to tell whether the hole summary shall be written.
Gaudi::Property< double > m_extraHolePath {this, "extraHolePath", 20.*Gaudi::Units::cm}
 Extra path length for the propagation after the last surface was crossed.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

The xAODSegmentCnvAlg takes MuonR4::Segments and converts them into a single xAOD::MuonSegmentContainer.

The segments carry the global segment position and direction, the fit quality in terms of chi2 & nDoF, and the hit, outlier and hole hit count summary. For the latter, the algortihm optionally launches a hole search using the Acts::TrackingGeometry. Further, the local parameters and covariance from the fit are decorated onto the segment. Finally, the ElementLinks to the contributing measurements are attached. Prds from the uncombined space points (mainly Mdt, Mm, BI-RPC, sTGC pad) are directly appended to the list. The eta & phi measurements of Rpc/Tgc/sTgc which are within the same gasgap are combined in a CombindMuonStrip object which itself is then appended to the list. Optionally, the conversion alg can also convert the beamspot measurement into a xAOD::UncalibratedMeasurement. For each measurement, the flag whether it was an outlier or not is also stored.

Definition at line 45 of file xAODSegmentCnvAlg.h.

Member Typedef Documentation

◆ DecorKey_t

Abrivation of the extra declared auxVariables.

Definition at line 152 of file xAODSegmentCnvAlg.h.

◆ PrdCont_t

Abrivation to call an uncalibrated measurement container.

Definition at line 54 of file xAODSegmentCnvAlg.h.

◆ PrdLink_t

Abrivation to call the link to an element inside an uncalibrated measurement container.

Definition at line 57 of file xAODSegmentCnvAlg.h.

◆ PrdLinkVec_t

using MuonR4::xAODSegmentCnvAlg::PrdLinkVec_t = std::vector<PrdLink_t>
private

Abrivation of a collection of Prd links.

Definition at line 59 of file xAODSegmentCnvAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evaluateSummary()

void MuonR4::xAODSegmentCnvAlg::evaluateSummary ( const EventContext & ctx,
xAOD::MuonSegment & segment ) const
private

Calculate the number of hits, outliers and holes on the segment and set the hit summary fields of the passed segment.

Parameters
ctxEventContext to access conditions data and to propagate
segmentThe segment for which the hit summary shall be evaluated

Instantiate one counter for hits, outliers, holes

Also write down the geometryIdentifiers of the segment measurements

Calculate the segment start parameters

Definition at line 276 of file xAODSegmentCnvAlg.cxx.

277 {
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 }
const std::regex re(r_e)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
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.
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Tracking geometry tool to search for holes.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc for Identifier printing & manipulation.
ActsTrk::ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
Gaudi::Property< bool > m_estimateHoles
Flag to tell whether the hole summary shall be written.
Amg::Vector3D direction() const
Returns the direction as Amg::Vector.
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.
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.
Acts::Vector4 convertPosToActs(const Amg::Vector3D &athenaPos, const double athenaTime=0.)
Converts a position vector & time from Athena units into Acts units.
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.
const xAOD::UncalibratedMeasurement * getMeasurement(const xAOD::MuonSegment &segment, const std::size_t n)
Returns the n-th uncalibrated measurement.
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.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
MuonMeasurement_v1 MuonMeasurement
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.
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
Helper struct to keep track of the number of precision, trigger phi and trigger eta hits.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode MuonR4::xAODSegmentCnvAlg::execute ( const EventContext & ctx) const
finaloverridevirtual

Counter for the reco segment link

Definition at line 64 of file xAODSegmentCnvAlg.cxx.

64 {
65 const ActsTrk::GeometryContext* gctx{nullptr};
66 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
67
68 PrepDataCollectorShip measDecorator{*this, ctx, gctx->context()};
69
70 xAOD::FillContainer<xAOD::MuonSegmentContainer,
71 xAOD::MuonSegmentAuxContainer> outContainer{};
72
73
74 ATH_CHECK(outContainer.record(m_writeKey, ctx));
75 ATH_CHECK(measDecorator.prdCombContainer.record(m_combMeasKey, ctx));
76
77 SG::WriteDecorHandle<xAOD::MuonSegmentContainer, SegLink_t> dec_parentLink{m_parentSegKey, ctx};
78 SG::WriteDecorHandle<xAOD::MuonSegmentContainer, SegPars_t> dec_locPars{m_localSegParKey, ctx};
79 SG::WriteDecorHandle<xAOD::MuonSegmentContainer, SegCov_t> dec_locCov{m_localSegCovKey, ctx};
80
81 for (const SG::ReadHandleKey<SegmentContainer>& key : m_readKeys) {
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 }
Scalar phi() const
phi method
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t t0
Acts::GeometryContext context() const
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
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.
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_localSegParKey
Decoration of the local segment parameters.
DecorKey_t m_localSegCovKey
Decoration of the local fit covariance parameters.
DecorKey_t m_parentSegKey
Decoration of the original segment.
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_writeKey
Output segment container key.
StatusCode linkMeasurements(const ActsTrk::GeometryContext &gctx, const Segment &inSegment, xAOD::MuonSegment &targetSegment, PrepDataCollectorShip &ship) const
Decorate the prd links onto the output muon segment.
SG::WriteHandleKey< xAOD::CombinedMuonStripContainer > m_combMeasKey
Auxiliary container to model two measurements in the same gas gap as a single track state.
SG::ReadHandleKeyArray< SegmentContainer > m_readKeys
Input segment container key.
ActsTrk::GeoContextReadKey_t m_geoCtxKey
Alignment container key.
void setDirection(float px, float py, float pz)
Sets the direction.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
void setT0Error(float t0, float t0Error)
Sets the time error.
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.
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
SeedingAux::FitParIndex ParamDefs
Use the same parameter indices as used by the CompSpacePointAuxiliaries.
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.
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
MuonSegmentAuxContainer_v1 MuonSegmentAuxContainer
Definition of the current Muon auxiliary container.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Auxiliary struct to ship the WriteDecorHandle and writeHandles needed to link the uncalibrated meausr...

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ findHoles()

void MuonR4::xAODSegmentCnvAlg::findHoles ( const EventContext & ctx,
const Acts::BoundTrackParameters & startPars,
const Acts::Surface * target,
const std::unordered_set< Identifier > & geoIdsWithHits,
Counter & holeCounter ) const
private

Find potential sensitive surfaces crossed by the segment but without contributing measurements.

The segment line is propagated from the startPars to the target surface + some margin using the Acts::Propagator. The propaator records every surface crossing. The associated SurfacePlacements are then used to determine the ATLAS identifier and then to assign whether there's a hole or not.

Parameters
ctxEventContext to be passed to the extrapolation tool
startParsThe start parameters from which the propagation starts. The surface is the bottom boundary surface of the volume where's the first segment measurement.
targetThe top boundary surface of the volume with the last segment measurement.
geoIdsWithHitsThe list of ATLAS identifiers with segmen measurements (outlier + hit)
holeCounterMutable reference to the segment hole counter.

Surface is already part of the measurement pool

We expect at least one hit in the same sector to avoid that hits in the sector-overlap from the adjacent chamber are marked as holes. While they are not part of the segment by construction

Definition at line 366 of file xAODSegmentCnvAlg.cxx.

370 {
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 }
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Acts extrapolation tool to search for holes.
Gaudi::Property< double > m_extraHolePath
Extra path length for the propagation after the last surface was crossed.
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ sTgc
Micromegas (NSW).
@ Rpc
Monitored Drift Tubes.
@ Mdt
MuonSpectrometer.

◆ initialize()

StatusCode MuonR4::xAODSegmentCnvAlg::initialize ( )
finaloverridevirtual

Definition at line 45 of file xAODSegmentCnvAlg.cxx.

45 {
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 }
DecorKey_t m_prdStateKey
Decoration to the PrdLink state (I.e.
DecorKey_t m_prdLinkKey
Decoration to the links to the associated Uncalibrated measurements.
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.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ linkMeasurements()

StatusCode MuonR4::xAODSegmentCnvAlg::linkMeasurements ( const ActsTrk::GeometryContext & gctx,
const Segment & inSegment,
xAOD::MuonSegment & targetSegment,
PrepDataCollectorShip & ship ) const
private

Decorate the prd links onto the output muon segment.

Eta & phi measurements are absorbed converted into a CombinedMuonStrip which is a source link linke object carrying a link to both prds. In this way, only one track state is generated later in the track fit from the two measurements. Two assumptions are made for the linking

  • There's exclusivley one eta & one phi measurement @maximum on the segment
  • The measurements are sorted along the segment trajectory.
    Parameters
    gctxThe geometry context to construct the local segment parameters
    inSegmentThe segment from which the space points are collected
    targetSegmentThe xAOD segment onto which all the links are decorated
    shipReference to the auxiliary ship carrying all the write decor handles needed for the linking

Combine the two prds from the space point to a combined muonstrip and link the latter to the segment.

Size of the bounds purely for visualization purposes

It might be that the segment has anoher 1D-measurement in the same gas gap

The first measurement should always be the eta measurement

Definition at line 133 of file xAODSegmentCnvAlg.cxx.

136 {
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
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 }
#define ATH_MSG_ERROR(x)
#define AmgSymMatrix(dim)
static Double_t sp
static Double_t a
State
State flag to distinguish different space point states.
std::vector< PrdLink_t > PrdLinkVec_t
Abrivation of a collection of Prd links.
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType ProjectorType
Use the calibration projector.
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
size_t combine(size_t lhs, size_t rhs)
Definition hash.h:22
CalibratedSpacePoint::State State
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
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.
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.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_auxMeasProv

ActsTrk::AuxiliaryMeasurementHandler MuonR4::xAODSegmentCnvAlg::m_auxMeasProv {this}
private

Handler to parse the auxiliary beam spot constaint.

Definition at line 166 of file xAODSegmentCnvAlg.h.

166{this};

◆ m_combMeasKey

SG::WriteHandleKey<xAOD::CombinedMuonStripContainer> MuonR4::xAODSegmentCnvAlg::m_combMeasKey {this, "combinedPrdKey", "CombinedMuonPrds"}
private

Auxiliary container to model two measurements in the same gas gap as a single track state.

Definition at line 164 of file xAODSegmentCnvAlg.h.

164{this, "combinedPrdKey", "CombinedMuonPrds"};

◆ m_convertBeamSpot

Gaudi::Property<bool> MuonR4::xAODSegmentCnvAlg::m_convertBeamSpot {this, "convertBeamSpot", false}
private

Flag to convert the beamspot constaint as well.

Definition at line 170 of file xAODSegmentCnvAlg.h.

170{this, "convertBeamSpot", false};

◆ m_ctxProvider

ActsTrk::ContextUtility MuonR4::xAODSegmentCnvAlg::m_ctxProvider {this}
private

Context provider for geometry, magnetic field and calibration contexts.

Definition at line 168 of file xAODSegmentCnvAlg.h.

168{this};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_estimateHoles

Gaudi::Property<bool> MuonR4::xAODSegmentCnvAlg::m_estimateHoles {this, "estimateHoles", true}
private

Flag to tell whether the hole summary shall be written.

Definition at line 172 of file xAODSegmentCnvAlg.h.

172{this, "estimateHoles", true};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_extraHolePath

Gaudi::Property<double> MuonR4::xAODSegmentCnvAlg::m_extraHolePath {this, "extraHolePath", 20.*Gaudi::Units::cm}
private

Extra path length for the propagation after the last surface was crossed.

Definition at line 174 of file xAODSegmentCnvAlg.h.

174{this, "extraHolePath", 20.*Gaudi::Units::cm};

◆ m_extrapolationTool

ToolHandle<ActsTrk::IExtrapolationTool> MuonR4::xAODSegmentCnvAlg::m_extrapolationTool {this, "ExtrapolationTool", ""}
private

Acts extrapolation tool to search for holes.

Definition at line 149 of file xAODSegmentCnvAlg.h.

149{this, "ExtrapolationTool", ""};

◆ m_geoCtxKey

ActsTrk::GeoContextReadKey_t MuonR4::xAODSegmentCnvAlg::m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
private

Alignment container key.

Definition at line 145 of file xAODSegmentCnvAlg.h.

145{this, "AlignmentKey", "ActsAlignment", "cond handle key"};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonR4::xAODSegmentCnvAlg::m_idHelperSvc
private
Initial value:
{this, "MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"}

IdHelperSvc for Identifier printing & manipulation.

Definition at line 138 of file xAODSegmentCnvAlg.h.

138 {this, "MuonIdHelperSvc",
139 "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_localSegCovKey

DecorKey_t MuonR4::xAODSegmentCnvAlg::m_localSegCovKey {this, "LocalCovParKey", m_writeKey, "localSegCov"}
private

Decoration of the local fit covariance parameters.

Definition at line 160 of file xAODSegmentCnvAlg.h.

160{this, "LocalCovParKey", m_writeKey, "localSegCov"};

◆ m_localSegParKey

DecorKey_t MuonR4::xAODSegmentCnvAlg::m_localSegParKey {this, "LocalSegParKey", m_writeKey, "localSegPars"}
private

Decoration of the local segment parameters.

Definition at line 158 of file xAODSegmentCnvAlg.h.

158{this, "LocalSegParKey", m_writeKey, "localSegPars"};

◆ m_parentSegKey

DecorKey_t MuonR4::xAODSegmentCnvAlg::m_parentSegKey {this, "ParentSegmentKey", m_writeKey, "parentSegment"}
private

Decoration of the original segment.

Definition at line 162 of file xAODSegmentCnvAlg.h.

162{this, "ParentSegmentKey", m_writeKey, "parentSegment"};

◆ m_prdLinkKey

DecorKey_t MuonR4::xAODSegmentCnvAlg::m_prdLinkKey {this, "PrdLinkKey", m_writeKey, "prdLinks" }
private

Decoration to the links to the associated Uncalibrated measurements.

Definition at line 154 of file xAODSegmentCnvAlg.h.

154{this, "PrdLinkKey", m_writeKey, "prdLinks" };

◆ m_prdStateKey

DecorKey_t MuonR4::xAODSegmentCnvAlg::m_prdStateKey {this, "PrdStateKey", m_writeKey, "prdState"}
private

Decoration to the PrdLink state (I.e.

outlier or valid)

Definition at line 156 of file xAODSegmentCnvAlg.h.

156{this, "PrdStateKey", m_writeKey, "prdState"};

◆ m_readKeys

SG::ReadHandleKeyArray<SegmentContainer> MuonR4::xAODSegmentCnvAlg::m_readKeys {this, "InSegmentKeys", {"R4MuonSegments"}}
private

Input segment container key.

Definition at line 141 of file xAODSegmentCnvAlg.h.

141{this, "InSegmentKeys", {"R4MuonSegments"}};

◆ m_trackingGeometrySvc

ServiceHandle<ActsTrk::ITrackingGeometrySvc> MuonR4::xAODSegmentCnvAlg::m_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
private

Tracking geometry tool to search for holes.

Definition at line 147 of file xAODSegmentCnvAlg.h.

147{this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeKey

SG::WriteHandleKey<xAOD::MuonSegmentContainer> MuonR4::xAODSegmentCnvAlg::m_writeKey {this, "OutSegmentKey", "MuonSegmentsFromR4"}
private

Output segment container key.

Definition at line 143 of file xAODSegmentCnvAlg.h.

143{this, "OutSegmentKey", "MuonSegmentsFromR4"};

The documentation for this class was generated from the following files: