ATLAS Offline Software
Loading...
Searching...
No Matches
CombinedFitAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONCOMBINEDALGSR4_COMBINEDFITALG_H
5#define MUONCOMBINEDALGSR4_COMBINEDFITALG_H
6
8
9
10
14
17
21
22
25
28
29namespace MuonCombinedR4 {
30
32 public:
33 using AthReentrantAlgorithm::AthReentrantAlgorithm;
34
35 virtual StatusCode initialize() override final;
36 virtual StatusCode execute(const EventContext& ctx) const override final;
37
38 private:
41 struct DataShip{
43 std::map<const xAOD::TrackParticle*,
44 std::vector<const MuonR4::MuonTag*>,
55 Acts::GeometryContext tgContext{Acts::GeometryContext::dangerouslyDefaultConstruct()};
57 Acts::MagneticFieldContext mfContext{};
59 Acts::CalibrationContext calContext{};
61 ActsTrk::MutableTrackContainer actsCmbTracks{Acts::VectorTrackContainer{},
62 Acts::VectorMultiTrajectory{}};
63
64 ActsTrk::MutableTrackContainer actsMeTracks{Acts::VectorTrackContainer{},
65 Acts::VectorMultiTrajectory{}};
66 };
67
71 StatusCode prepareDataShip(const EventContext& ctx, DataShip& ship) const;
76 DataShip& ship) const;
77
78 void buildMETrack(MuonR4::MuonTag& combinedTag,
79 DataShip& ship) const;
90 StatusCode writeTracksToStoreGate(const EventContext& ctx,
93 xAOD::TrackParticleContainer& particleContainer,
94 ActsTrk::MutableTrackContainer&& fittedTracks) const;
95
98 std::vector<Acts::SourceLink> extractMeasurements(const MuonR4::MuonTag& muonTag) const;
101 std::vector<Acts::SourceLink> extractMeasurements(const xAOD::TrackParticle& trackPart) const;
103 ToolHandle<ActsTrk::ITrackToTrackParticleCnvTool> m_cnvTool{this, "TrackToTrackParticleCnvTool", ""};
105 ToolHandle<ActsTrk::IFitterTool> m_trackFitTool{this, "FittingTool", ""};
107 ToolHandle<ActsTrk::IExtrapolationTool> m_extrapolationTool{this, "ExtrapolationTool" ,"" };
111 SG::ReadHandleKey<MuonR4::MuonTagContainer> m_stacoKey{this, "StacoKey", "MuonTagsSTACO"};
113 SG::WriteHandleKey<MuonR4::MuonTagContainer> m_outTagKey{this, "MuonTagKey" , "MuonTagsMuidCo"};
118 "MuonCmbTrackParticles"};
119
121 "MuonMeTrackParticles"};
122
123 SG::WriteHandleKey<ActsTrk::TrackContainer> m_cmbTrackKey{this, "CombinedTrackKey", "MuonCmbTracks"};
126
130
133
134 Gaudi::Property<bool> m_fitMEtrack{this, "fitMETracks" , false};
135 };
136}
137
138
139#endif
Handle class for reading from StoreGate.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for recording to StoreGate.
Utility class to handle the three contexts neeeded in an ACTS reconstruction job 1) GeometryContext -...
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< MuonR4::MuonTagContainer > m_outTagKey
Write key of the created combined tags.
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_MeParticleKey
Write key of the created ME track particles.
SG::WriteHandleKey< ActsTrk::TrackContainer > m_cmbTrackKey
Write key to store the fitted Acts combined tracks.
SG::ReadHandleKey< MuonR4::MuonTagContainer > m_stacoKey
Use STACO as input to the MuidCo chain as the track pair is already done upstream.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_cmbTrackLinkKey
Element link to the produced extrapolated Acts track.
SG::WriteHandleKey< ActsTrk::TrackContainer > m_meTrackKey
Write key to store the fitted Acts ME tracks.
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_CmbParticleKey
Write key of the created combined track particles.
void buildMETrack(MuonR4::MuonTag &combinedTag, DataShip &ship) const
ToolHandle< ActsTrk::IFitterTool > m_trackFitTool
Track fitting tool.
Gaudi::Property< bool > m_fitMEtrack
Toggle whether the ME track is formed after the combined fit.
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Track extrapolation tool.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_meTrackLinkKey
StatusCode prepareDataShip(const EventContext &ctx, DataShip &ship) const
Load the input containers from store gate and setup the write Handles for the output.
StatusCode writeTracksToStoreGate(const EventContext &ctx, const SG::WriteHandleKey< ActsTrk::TrackContainer > &key, const SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > &decorKey, xAOD::TrackParticleContainer &particleContainer, ActsTrk::MutableTrackContainer &&fittedTracks) const
Convert the ActsTracks to track particles and write the Acts track container to store gate.
ActsTrk::ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
virtual StatusCode initialize() override final
ToolHandle< ActsTrk::ITrackToTrackParticleCnvTool > m_cnvTool
Conversion tool from Acts -> xAOD:TrackParticle.
std::vector< Acts::SourceLink > extractMeasurements(const MuonR4::MuonTag &muonTag) const
Retrieve the ID & Muon measurements from the associated ID & MS track particles.
SG::ReadHandleKey< xAOD::UncalibratedMeasurementContainer > m_beamSpotKey
Data dependency on the beam spot.
virtual StatusCode execute(const EventContext &ctx) const override final
MuonR4::MuonTag * fitMuonTag(const MuonR4::MuonTag &tag, DataShip &ship) const
Attempt to fit the muon tag to a combined track particle.
Baseline EDM object to gather all relevant information about a reconstructed muon candidate which can...
Definition MuonTag.h:25
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Acts::TrackContainer< MutableTrackBackend, MutableTrackStateBackend, Acts::detail::ValueHolder > MutableTrackContainer
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
TrackParticleAuxContainer_v5 TrackParticleAuxContainer
Definition of the current TrackParticle auxiliary container.
Helper struct to ship the input output data during the combined track fit.
xAOD::FillContainer< MuonR4::MuonTagContainer, void * > outputTags
The output combined tag collection.
Acts::MagneticFieldContext mfContext
The magnetic field context.
ActsTrk::MutableTrackContainer actsMeTracks
The ME track container.
std::map< const xAOD::TrackParticle *, std::vector< const MuonR4::MuonTag * >, MuonR4::ParticleSorter > preMatchedTags
The prematched combined muon tags.
xAOD::FillContainer< xAOD::TrackParticleContainer, xAOD::TrackParticleAuxContainer > cmbParticles
The output combined particle container.
Acts::GeometryContext tgContext
The geometry context to align the surfaces during the fit.
Acts::CalibrationContext calContext
The calibration context.
ActsTrk::MutableTrackContainer actsCmbTracks
The combined acts track container.
xAOD::FillContainer< xAOD::TrackParticleContainer, xAOD::TrackParticleAuxContainer > meParticles
The output ME particle container.
Auxiliary class to sort the particles by momentum First sorting is by pt, then eta and finally by phi...