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

#include <MsTrackFindingAlg.h>

Inheritance diagram for MuonR4::MsTrackFindingAlg:
Collaboration diagram for MuonR4::MsTrackFindingAlg:

Public Types

using OptBoundPars_t = Acts::Result<Acts::BoundTrackParameters>
using MeasVec_t = std::vector<const xAOD::UncalibratedMeasurement*>

Public Member Functions

virtual ~MsTrackFindingAlg ()
virtual StatusCode initialize () override final
 Standard algorithm hook to setup the extrapolator, retrieve the tools and declare algorithm's data dependencies.
virtual StatusCode execute (const EventContext &ctx) const override final
 Standard algorithm execution hook.
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

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

bool fitSeedCandidate (const Acts::GeometryContext &tgContext, const Acts::MagneticFieldContext &mfContext, const Acts::CalibrationContext &calContext, const MsTrackSeed &seed, ActsTrk::MutableTrackContainer &outContainer) const
 Attempts to fit the track seed candidate to a full track and returns whether the fit succeeded.
std::pair< OptBoundPars_t, MeasVec_tprepareFit (const Acts::GeometryContext &tgContext, const Acts::CalibrationContext &calContext, const MsTrackSeed &seed) const
 Prepares the input to the fit by collecting the measurements on the segment &.
bool expressAtCaloExit (const EventContext &ctx, ActsTrk::MutableTrackContainer::TrackProxy track) const
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 {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 IdHelperSvc to decode the Identifiers.
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
 Pointer to the MuonDetectorManager.
SG::WriteHandleKey< MsTrackSeedContainerm_msTrkSeedKey {this, "MsTrkSeedKey", "MsTrackSeeds"}
 Temporary container write handle to push the seeds to store gate for later efficiency analysis.
ToolHandle< ITrackSeedingToolm_seedingTool {this, "SeedingTool", ""}
 The track seeding tool to construct the seed candidates and to estimate the initial parameters.
ToolHandle< ActsTrk::IFitterToolm_trackFitTool {this, "FittingTool", ""}
 Track fitting tool.
ToolHandle< ISpacePointCalibratorm_calibTool {this, "Calibrator", ""}
 Calibration tool to fill the track states.
ToolHandle< ActsTrk::IExtrapolationToolm_extrapolationTool {this, "ExtrapolationTool" ,"" }
 Track extrapolation tool.
ServiceHandle< ActsTrk::ITrackingGeometrySvcm_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
 Service handle to the tracking geometry service.
Gaudi::Property< bool > m_expressAtMsEntrance {this, "expressAtMsEntrance", true}
 Propagate the track at the MS entry and express its parameters.
Gaudi::Property< bool > m_ignoreFailedMsEntrance {this, "ignoreFailedExtpMsEntrance", true}
 Ignore failed track extrapolations to the entrance.
ActsTrk::ContextUtility m_ctxProvider {this}
 Utility to fetch the geometry, magnetic field and calibration context in the event.
ToolHandle< MuonValR4::ITrackVisualizationToolm_visualizationTool {this, "VisualizationTool", ""}
 Visualization tool to debug the track finding.
ToolHandle< MuonR4::ITrackSummaryToolm_summaryTool {this, "SummaryTool" , ""}
 Handle to the muon summary tool.
SG::WriteHandleKey< ActsTrk::TrackContainerm_writeKey {this, "TrackWriteKey", "MsTracks"}
 Key to the output track container.
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

Definition at line 39 of file MsTrackFindingAlg.h.

Member Typedef Documentation

◆ MeasVec_t

◆ OptBoundPars_t

using MuonR4::MsTrackFindingAlg::OptBoundPars_t = Acts::Result<Acts::BoundTrackParameters>

Definition at line 50 of file MsTrackFindingAlg.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~MsTrackFindingAlg()

MuonR4::MsTrackFindingAlg::~MsTrackFindingAlg ( )
virtualdefault

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.

◆ 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::MsTrackFindingAlg::execute ( const EventContext & ctx) const
finaloverridevirtual

Standard algorithm execution hook.

Attach the number of the parent seed to the output container

Definition at line 54 of file MsTrackFindingAlg.cxx.

54 {
55 ATH_MSG_VERBOSE("Run track finding in event "<<ctx.eventID().event_number());
56
57
58 auto seedContainer = std::make_unique<MsTrackSeedContainer>();
59
60 ATH_CHECK(m_seedingTool->findTrackSeeds(ctx, *seedContainer));
61
62 if (!m_visualizationTool.empty()) {
63 m_visualizationTool->displaySeeds(ctx, *seedContainer);
64 }
65 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
66 const Acts::MagneticFieldContext mfContext = m_ctxProvider.getMagneticFieldContext(ctx);
67 const Acts::CalibrationContext calContext{m_ctxProvider.getCalibrationContext(ctx)};
68
69
70 Acts::VectorTrackContainer trackBackend{};
71 Acts::VectorMultiTrajectory trackStateBackend{};
72 ActsTrk::MutableTrackContainer cacheTrkContainer{std::move(trackBackend),
73 std::move(trackStateBackend)};
75 cacheTrkContainer.addColumn<std::size_t>("parentSeed");
76 unsigned seedIdx{0};
77 for (const MsTrackSeed& seed : *seedContainer) {
78 if (!fitSeedCandidate(tgContext, mfContext, calContext, seed,
79 cacheTrkContainer)) {
80 ++seedIdx;
81 continue;
82 }
83 auto lastTrack = cacheTrkContainer.getTrack(cacheTrkContainer.size() -1);
84 lastTrack.component<std::size_t, Acts::hashString("parentSeed")>() = seedIdx;
85 ++seedIdx;
86 }
87 if (!m_msTrkSeedKey.empty()) {
88 SG::WriteHandle writeHandleSeed{m_msTrkSeedKey, ctx};
89 ATH_CHECK(writeHandleSeed.record(std::move(seedContainer)));
90 }
91
92 // Constant declination
93 Acts::ConstVectorTrackContainer ctrackBackend{std::move(cacheTrkContainer.container())};
94 Acts::ConstVectorMultiTrajectory ctrackStateBackend{std::move(cacheTrkContainer.trackStateContainer())};
95 auto ctc = std::make_unique<ActsTrk::TrackContainer>(std::move(ctrackBackend),
96 std::move(ctrackStateBackend));
97
98 SG::WriteHandle writeHandle{m_writeKey, ctx};
99 ATH_CHECK(writeHandle.record(std::move(ctc)));
100 return StatusCode::SUCCESS;
101 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
bool fitSeedCandidate(const Acts::GeometryContext &tgContext, const Acts::MagneticFieldContext &mfContext, const Acts::CalibrationContext &calContext, const MsTrackSeed &seed, ActsTrk::MutableTrackContainer &outContainer) const
Attempts to fit the track seed candidate to a full track and returns whether the fit succeeded.
ToolHandle< ITrackSeedingTool > m_seedingTool
The track seeding tool to construct the seed candidates and to estimate the initial parameters.
SG::WriteHandleKey< ActsTrk::TrackContainer > m_writeKey
Key to the output track container.
SG::WriteHandleKey< MsTrackSeedContainer > m_msTrkSeedKey
Temporary container write handle to push the seeds to store gate for later efficiency analysis.
ToolHandle< MuonValR4::ITrackVisualizationTool > m_visualizationTool
Visualization tool to debug the track finding.
ActsTrk::ContextUtility m_ctxProvider
Utility to fetch the geometry, magnetic field and calibration context in the event.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Acts::TrackContainer< MutableTrackBackend, MutableTrackStateBackend, Acts::detail::ValueHolder > MutableTrackContainer

◆ expressAtCaloExit()

bool MuonR4::MsTrackFindingAlg::expressAtCaloExit ( const EventContext & ctx,
ActsTrk::MutableTrackContainer::TrackProxy track ) const
private

Definition at line 211 of file MsTrackFindingAlg.cxx.

212 {
214 return true;
215 }
216 const Acts::BoundTrackParameters startPars = track.createParametersAtReference();
217 const Acts::TrackingVolume* msEntrance = m_trackingGeometrySvc->getEnvelope(ActsTrk::SystemEnvelope::CaloExit);
218 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
219 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Extrapolate "<<startPars<<", "
220 <<startPars.referenceSurface().toString(tgContext)<<" to MS entrance: "<<msEntrance->volumeBounds());
221
222 auto parsAtEntrance = m_extrapolationTool->propagate(ctx, startPars, *msEntrance,
224 Acts::Direction::Backward());
225
226 if (!parsAtEntrance.ok()) {
227 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Failed to extrapolate "<<startPars<<" to MS entrance");
229 }
230 if (parsAtEntrance->referenceSurface().geometryId().withBoundary(0) != msEntrance->geometryId()) {
231 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Parameter extrapolation to "<<(*parsAtEntrance)<<", @"
232 << Amg::toString(parsAtEntrance->referenceSurface().localToGlobalTransform(tgContext))
233 <<" did not end up at "<<msEntrance->geometryId()<<".");
235 }
236 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Extrapolated start parameters to "<<(*parsAtEntrance)
237 <<", "<<parsAtEntrance->referenceSurface().toString(tgContext));
238 track.setReferenceSurface(parsAtEntrance->referenceSurface().getSharedPtr());
239 track.parameters() = parsAtEntrance->parameters();
240 track.covariance() = (*parsAtEntrance->covariance());
241 return true;
242 }
#define ATH_MSG_WARNING(x)
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Service handle to the tracking geometry service.
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Track extrapolation tool.
Gaudi::Property< bool > m_expressAtMsEntrance
Propagate the track at the MS entry and express its parameters.
Gaudi::Property< bool > m_ignoreFailedMsEntrance
Ignore failed track extrapolations to the entrance.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.

◆ 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:

◆ fitSeedCandidate()

bool MuonR4::MsTrackFindingAlg::fitSeedCandidate ( const Acts::GeometryContext & tgContext,
const Acts::MagneticFieldContext & mfContext,
const Acts::CalibrationContext & calContext,
const MsTrackSeed & seed,
ActsTrk::MutableTrackContainer & outContainer ) const
private

Attempts to fit the track seed candidate to a full track and returns whether the fit succeeded.

Parameters
tgContextGeometry context to access the alignment of the surfaces
mfContextcMagnetic field context to access the field map during the fit
calContextCalibration context to access the calibration constants from Store gate during the track state filling
seedThe seed of interest to fit
outContainerMutable track container to which the output track is written

Add the links to the segments making up this track as an extra column. Use the indices of the segment objects which can later be transformed into a full ElementLink as there is only one SegmentContainer from which the seeds are built

Definition at line 149 of file MsTrackFindingAlg.cxx.

153 {
154
155 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Attempt to fit a new track seed \n"<<seed);
156 const EventContext& ctx{*calContext.get<const EventContext*>()};
157 const auto [initialPars, measurements] = prepareFit(tgContext, calContext, seed);
158
159 if (!initialPars.ok()) {
160 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Failed to construct valid parameters for seed \n"<<seed);
161 if (m_visualizationTool.isEnabled()) {
162 m_visualizationTool->displayTrackSeedObj(ctx, seed, initialPars, "FailedStartPars");
163 }
164 return false;
165 }
166 auto fitTraject = m_trackFitTool->fit(measurements, *initialPars,
167 tgContext, mfContext, calContext,
168 &(*initialPars).referenceSurface());
169 if (!fitTraject || fitTraject->size() == 0) {
170 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Fit failed. Seed was \n"<<seed);
171 if (m_visualizationTool.isEnabled()) {
172 m_visualizationTool->displayTrackSeedObj(ctx, seed, initialPars, "FailedFit");
173 }
174 return false;
175 }
176
177 ActsTrk::MutableTrackContainer::TrackProxy track = fitTraject->getTrack(0);
178 // Check the hit counts on track post fit and if we only have one station on track discard track
179 // Eventually we should implement some recovery mechanism for track where we loose too many stations
180 MuonR4::HitSummary summary = m_summaryTool->makeSummary(ctx, track);
181 ATH_MSG_DEBUG("Track has " << static_cast<std::uint32_t>(summary.nPrecisionStations()) << " precision layers with summary "<< summary);
182 if(summary.nPrecisionStations()<2) {
183 ATH_MSG_DEBUG("rejecting single station track");
184 return false;
185 }
186 if (!expressAtCaloExit(ctx, track)) {
187
188 return false;
189 }
190
195 {
196 fitTraject->addColumn<std::vector<const xAOD::MuonSegment*>>("muonSegLinks");
197 auto appendMe = seed.segments();
198 auto& toAppend = track.component<std::vector<const xAOD::MuonSegment*>>("muonSegLinks");
199 toAppend.insert(toAppend.end(), appendMe.begin(), appendMe.end());
200 }
201 outContainer.ensureDynamicColumns(*fitTraject);
202 auto destProxy = outContainer.getTrack(outContainer.addTrack());
203 destProxy.copyFrom(track);
204 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Good track fit...");
205 if (m_visualizationTool.isEnabled()) {
206 m_visualizationTool->displayTrackSeedObj(ctx, seed,
207 destProxy.createParametersAtReference(), "GoodFit");
208 }
209 return true;
210 }
#define ATH_MSG_DEBUG(x)
bool expressAtCaloExit(const EventContext &ctx, ActsTrk::MutableTrackContainer::TrackProxy track) const
std::pair< OptBoundPars_t, MeasVec_t > prepareFit(const Acts::GeometryContext &tgContext, const Acts::CalibrationContext &calContext, const MsTrackSeed &seed) const
Prepares the input to the fit by collecting the measurements on the segment &.
ToolHandle< ActsTrk::IFitterTool > m_trackFitTool
Track fitting tool.
ToolHandle< MuonR4::ITrackSummaryTool > m_summaryTool
Handle to the muon summary tool.

◆ initialize()

StatusCode MuonR4::MsTrackFindingAlg::initialize ( )
finaloverridevirtual

Standard algorithm hook to setup the extrapolator, retrieve the tools and declare algorithm's data dependencies.

Definition at line 34 of file MsTrackFindingAlg.cxx.

34 {
35 ATH_CHECK(m_idHelperSvc.retrieve());
36 ATH_CHECK(detStore()->retrieve(m_detMgr));
38
39 ATH_CHECK(m_visualizationTool.retrieve(EnableTool{!m_visualizationTool.empty()}));
40 ATH_CHECK(m_trackFitTool.retrieve());
41 ATH_CHECK(m_calibTool.retrieve());
42 ATH_CHECK(m_writeKey.initialize());
43 ATH_CHECK(m_summaryTool.retrieve());
44 ATH_CHECK(m_seedingTool.retrieve());
45 ATH_CHECK(m_extrapolationTool.retrieve(EnableTool{m_expressAtMsEntrance}));
47
48 ATH_CHECK(m_ctxProvider.initialize());
49 return StatusCode::SUCCESS;
50 }
const ServiceHandle< StoreGateSvc > & detStore() const
ToolHandle< ISpacePointCalibrator > m_calibTool
Calibration tool to fill the track states.
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the MuonDetectorManager.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.

◆ 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 }

◆ 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.

◆ prepareFit()

std::pair< MsTrackFindingAlg::OptBoundPars_t, MsTrackFindingAlg::MeasVec_t > MuonR4::MsTrackFindingAlg::prepareFit ( const Acts::GeometryContext & tgContext,
const Acts::CalibrationContext & calContext,
const MsTrackSeed & seed ) const
private

Prepares the input to the fit by collecting the measurements on the segment &.

Parameters
tgContextGeometry context to access the alignment of the surfaces
calContextCalibration context to access the calibration constants from Store gate during the track state filling
seedThe seed of interest to fit

Ensure that the drift signs from the fit are stamped onto the Uncalibrated measurements

Definition at line 105 of file MsTrackFindingAlg.cxx.

107 {
108 const EventContext& ctx{*calContext.get<const EventContext*>()};
109
110 auto initialPars = m_seedingTool->estimateStartParameters(ctx, seed);
111 if (!initialPars.ok()) {
112 ATH_MSG_WARNING(__func__<<"() "<<__LINE__
113 <<" - Start parameter creation failed. ");
114 return std::make_pair(OptBoundPars_t::failure(std::make_error_code(std::errc::invalid_argument)),
115 std::vector<const xAOD::UncalibratedMeasurement_v1*>{});
116 }
117
118 MeasVec_t measurements{};
119 measurements.reserve(100);
120 for (const xAOD::MuonSegment* segment : seed.segments()) {
122 m_calibTool->stampSignsOnMeasurements(*segment);
123 MeasVec_t segMeasurements = collectMeasurements(*segment, /*skipOutlier:*/ true);
124 if (msgLvl(MSG::VERBOSE)) {
125 std::stringstream sstr{};
126 for (const xAOD::UncalibratedMeasurement* m : segMeasurements) {
127 const Acts::Surface& surf{xAOD::muonSurface(m)};
128 sstr<<" *** "<<m_idHelperSvc->toString(xAOD::identify(m))
129 <<", "<<m->numDimensions()<<", "
130 <<", "<<surf.geometryId()<<" @ "<<Amg::toString(surf.localToGlobalTransform(tgContext))<<std::endl;
131 }
132 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Fetch measurements from segment: "<<Amg::toString(segment->position())
133 <<", direction: "<<Amg::toString(segment->direction()) << " eta " << segment->direction().eta() << " phi " << segment->direction().phi() <<"\n"<<sstr.str());
134 }
135 measurements.insert(measurements.end(),
136 std::make_move_iterator(segMeasurements.begin()),
137 std::make_move_iterator(segMeasurements.end()));
138 }
139
140 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - "<<measurements.size()<<" measurements");
141 if (measurements.empty()) {
142 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - No measurements were associated with seed "<<seed);
143 return std::make_pair(OptBoundPars_t::failure(std::make_error_code(std::errc::invalid_argument)),
144 std::vector<const xAOD::UncalibratedMeasurement_v1*>{});
145 }
146 return std::make_pair(std::move(initialPars), std::move(measurements));
147
148 }
bool msgLvl(const MSG::Level lvl) const
std::vector< const xAOD::UncalibratedMeasurement * > MeasVec_t
std::vector< const xAOD::UncalibratedMeasurement * > collectMeasurements(const xAOD::MuonSegment &segment, bool skipOutlier=true)
Helper function to extract the measurements from the segment.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.

◆ 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}
#define ATH_MSG_ERROR(x)
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_calibTool

ToolHandle<ISpacePointCalibrator> MuonR4::MsTrackFindingAlg::m_calibTool {this, "Calibrator", ""}
private

Calibration tool to fill the track states.

Definition at line 89 of file MsTrackFindingAlg.h.

89{this, "Calibrator", ""};

◆ m_ctxProvider

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

Utility to fetch the geometry, magnetic field and calibration context in the event.

Definition at line 99 of file MsTrackFindingAlg.h.

99{this};

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonR4::MsTrackFindingAlg::m_detMgr {nullptr}
private

Pointer to the MuonDetectorManager.

Definition at line 81 of file MsTrackFindingAlg.h.

81{nullptr};

◆ 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_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_expressAtMsEntrance

Gaudi::Property<bool> MuonR4::MsTrackFindingAlg::m_expressAtMsEntrance {this, "expressAtMsEntrance", true}
private

Propagate the track at the MS entry and express its parameters.

Definition at line 95 of file MsTrackFindingAlg.h.

95{this, "expressAtMsEntrance", true};

◆ 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_extrapolationTool

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

Track extrapolation tool.

Definition at line 91 of file MsTrackFindingAlg.h.

91{this, "ExtrapolationTool" ,"" };

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonR4::MsTrackFindingAlg::m_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

IdHelperSvc to decode the Identifiers.

Definition at line 79 of file MsTrackFindingAlg.h.

79{this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_ignoreFailedMsEntrance

Gaudi::Property<bool> MuonR4::MsTrackFindingAlg::m_ignoreFailedMsEntrance {this, "ignoreFailedExtpMsEntrance", true}
private

Ignore failed track extrapolations to the entrance.

Definition at line 97 of file MsTrackFindingAlg.h.

97{this, "ignoreFailedExtpMsEntrance", true};

◆ m_msTrkSeedKey

SG::WriteHandleKey<MsTrackSeedContainer> MuonR4::MsTrackFindingAlg::m_msTrkSeedKey {this, "MsTrkSeedKey", "MsTrackSeeds"}
private

Temporary container write handle to push the seeds to store gate for later efficiency analysis.

Definition at line 83 of file MsTrackFindingAlg.h.

83{this, "MsTrkSeedKey", "MsTrackSeeds"};

◆ m_seedingTool

ToolHandle<ITrackSeedingTool> MuonR4::MsTrackFindingAlg::m_seedingTool {this, "SeedingTool", ""}
private

The track seeding tool to construct the seed candidates and to estimate the initial parameters.

Definition at line 85 of file MsTrackFindingAlg.h.

85{this, "SeedingTool", ""};

◆ m_summaryTool

ToolHandle<MuonR4::ITrackSummaryTool> MuonR4::MsTrackFindingAlg::m_summaryTool {this, "SummaryTool" , ""}
private

Handle to the muon summary tool.

Definition at line 103 of file MsTrackFindingAlg.h.

103{this, "SummaryTool" , ""};

◆ m_trackFitTool

ToolHandle<ActsTrk::IFitterTool> MuonR4::MsTrackFindingAlg::m_trackFitTool {this, "FittingTool", ""}
private

Track fitting tool.

Definition at line 87 of file MsTrackFindingAlg.h.

87{this, "FittingTool", ""};

◆ m_trackingGeometrySvc

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

Service handle to the tracking geometry service.

Definition at line 93 of file MsTrackFindingAlg.h.

93{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_visualizationTool

ToolHandle<MuonValR4::ITrackVisualizationTool> MuonR4::MsTrackFindingAlg::m_visualizationTool {this, "VisualizationTool", ""}
private

Visualization tool to debug the track finding.

Definition at line 101 of file MsTrackFindingAlg.h.

101{this, "VisualizationTool", ""};

◆ m_writeKey

SG::WriteHandleKey<ActsTrk::TrackContainer> MuonR4::MsTrackFindingAlg::m_writeKey {this, "TrackWriteKey", "MsTracks"}
private

Key to the output track container.

Definition at line 105 of file MsTrackFindingAlg.h.

105{this, "TrackWriteKey", "MsTracks"};

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