ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCombinedR4::InDetTrackSelectionAlg Class Reference

Algorithm to select ID / ITk track candidates which may be suitable for the combined muon reconstruction chain. More...

#include <InDetTrackSelectionAlg.h>

Inheritance diagram for MuonCombinedR4::InDetTrackSelectionAlg:
Collaboration diagram for MuonCombinedR4::InDetTrackSelectionAlg:

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 unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
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
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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

std::optional< Acts::BoundTrackParameters > extrapolateToMsEntrance (const EventContext &ctx, const xAOD::TrackParticle &idTrack) const
 Extrapolate the ID track to the MS entrance in order to match it later with spectrometer activity.
bool compatibleWithMsTrk (const Acts::BoundTrackParameters &caloExitPars, const MuonR4::MuonTagContainer &msTracks) const
 Returns whether the ID track expressed on the calorimeter exit volume can be loosely matched with a reconsturcted MS track.
bool compatibleWithSegment (const EventContext &ctx, const Acts::BoundTrackParameters &caloExitPars, const std::span< const xAOD::MuonSegment * > candidateSegs) const
 Checks whether the ID track is compatible with a reconstructed segment which is not part of a reconstructed MS track.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::TrackParticleContainerm_idTrkKey {this, "IdTrackKey", "InDetTrackParticles"}
 The input key for the ID / ITk track particles.
SG::ReadHandleKey< MuonR4::MuonTagContainerm_msTrkKey {this, "MsTrackKey", "MuonTagsSA"}
 Input key for the MS track particles.
SG::ReadHandleKey< xAOD::MuonSegmentContainerm_segmentKey {this, "SegmentKey", "MuonSegmentsFromR4"}
 To pass the selection criteria, ITk tracks can alternatively be matched to.
SG::WriteHandleKey< MuonR4::MuonTagContainerm_writeKey {this, "writeKey", "MuonInDetCandidates"}
 The output key for the selected track candidates.
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
 Detector manager to retrieve the sector envelope surfaces.
ToolHandle< InDet::IInDetTrackSelectionToolm_selectionTool {this, "TackSelectionTool" , ""}
 Track quality selection tool (optional).
PublicToolHandle< ActsTrk::ITrackingGeometryToolm_trackingGeometryTool {this, "TrackingGeometryTool", ""}
 Tracking geometry tool.
ToolHandle< ActsTrk::IExtrapolationToolm_extrapolationTool {this, "ExtrapolationTool" ,"" }
 Track extrapolation tool.
Gaudi::Property< float > m_trackPt {this, "minPt", 2.5*Gaudi::Units::GeV}
 The minimum momentum cut applied on the ID tracks to be considered.
Gaudi::Property< float > m_trackEta {this, "maxEta", 2.8}
 Apply a maximum eta cut to stay within the MS acceptance.
Gaudi::Property< float > m_dEtaCutMsTrk {this, "dEtaMaxMsTrk", 0.2}
 Selection cuts for the MS tracks.
Gaudi::Property< float > m_dPhiCutMsTrk {this, "dPhiMsTrk", 5*Gaudi::Units::deg}
Gaudi::Property< float > m_dEtaCutMsSeg {this, "dEtaMaxMsSegment", 0.3}
 Selection cuts for the Muon segments.
Gaudi::Property< float > m_dY0CutMsSeg {this, "dY0MaxMsSegment", 40 * Gaudi::Units::cm}
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

Algorithm to select ID / ITk track candidates which may be suitable for the combined muon reconstruction chain.

Apart from basic kinematic requirements, the tracks need to be dR cones around MS tracks or can be loosely matched to a standalone segment which has not been yet associated with a muon track. Successfully matched candidates need

Definition at line 34 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

62{
63 return 0;
64}

◆ compatibleWithMsTrk()

bool MuonCombinedR4::InDetTrackSelectionAlg::compatibleWithMsTrk ( const Acts::BoundTrackParameters & caloExitPars,
const MuonR4::MuonTagContainer & msTracks ) const
private

Returns whether the ID track expressed on the calorimeter exit volume can be loosely matched with a reconsturcted MS track.

The matching is based on the angular cone between the MS & the ID track + separations on the local parameters on the cylinder

Parameters
caloExitParsThe ID track expressed at the calo exit
msTrackList of reconstructed MS track particles

Definition at line 171 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.cxx.

172 {
173
174 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Check whether the "<<itkParameters
175 <<" are compatible with one of the "<<msTrks.size()<<" MS tracks.");
176 if (std::any_of(msTrks.begin(), msTrks.end(),
177 [&](const MuonR4::MuonTag* saTag) {
178 const xAOD::TrackParticle* msTrack = saTag->msTrack();
179 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Check MS "<<print(*msTrack));
180 return std::abs(msTrack->eta() - eta(itkParameters)) < m_dEtaCutMsTrk &&
181 std::abs(xAOD::P4Helpers::deltaPhi(msTrack->phi(),
182 itkParameters.phi())) < m_dPhiCutMsTrk;
183 })) {
184 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" Found a matching track.");
185 return true;
186 }
187 return false;
188 }
#define ATH_MSG_DEBUG(x)

◆ compatibleWithSegment()

bool MuonCombinedR4::InDetTrackSelectionAlg::compatibleWithSegment ( const EventContext & ctx,
const Acts::BoundTrackParameters & caloExitPars,
const std::span< const xAOD::MuonSegment * > candidateSegs ) const
private

Checks whether the ID track is compatible with a reconstructed segment which is not part of a reconstructed MS track.

Matching is based on straight line extrapolations and sector correspondence

Straight line extrapolation onto the surface

Segment parameters expressed on the envelope surface

Definition at line 189 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.cxx.

191 {
192
193 const ActsTrk::GeometryContext& gctx{m_trackingGeometryTool->getGeometryContext(ctx)};
194 const Amg::Vector3D exitPos = caloExitPars.position(gctx.context());
195 const Amg::Vector3D exitDir = caloExitPars.direction();
196 MuonR4::ExpandedSector exitSector{exitPos.phi()};
197 const double caloEta = eta(caloExitPars);
198
199 const MuonGMR4::SpectrometerSector* lastSector{nullptr};
200 Amg::Vector3D extPosOnSector{Amg::Vector3D::Zero()};
201
202 for (const xAOD::MuonSegment* segment : candidateSegs) {
203
204 MuonR4::ExpandedSector segSector{segment->position().phi()};
205 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Check compatibility with "<<MuonR4::printID(*segment)
206 <<", sector: "<<segSector);
207 if (!segSector.isNeighbour(exitSector)) {
208 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Sector requirement failed");
209 continue;
210 }
211 // Reject segments on oposite sides
212 if (std::abs(segment->direction().eta() - caloEta) > m_dEtaCutMsSeg) {
213 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Too large separation in dEta: "
214 <<std::abs(segment->direction().eta() - caloEta)<<" cut: "<<m_dEtaCutMsSeg);
215 continue;
216 }
218 const MuonGMR4::SpectrometerSector* msSector = m_detMgr->getSectorEnvelope(segment->chamberIndex(),
219 segment->sector(),
220 segment->etaIndex());
222 Parameters segPars = localSegmentPars(*segment);
223
224 if (lastSector == msSector) {
225 if (std::abs(segPars[Acts::toUnderlying(ParamDefs::y0)] - extPosOnSector.y()) < m_dY0CutMsSeg) {
226 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" Segment is close enough: "
227 <<std::abs(segPars[Acts::toUnderlying(ParamDefs::y0)] - extPosOnSector.y()));
228 return true;
229 }
230 continue;
231 }
232 lastSector = msSector;
233
234 const Amg::Transform3D toLocal = msSector->globalToLocalTransform(gctx);
235
236 const Amg::Vector3D locExitPos = toLocal * exitPos;
237 const Amg::Vector3D locExitDir = toLocal.linear()* exitDir;
238
239 using namespace Acts::PlanarHelper;
240 auto iSect = intersectPlane(locExitPos, locExitDir, Amg::Vector3D::Zero(), 0.);
241 extPosOnSector = iSect.position();
242 if (std::abs(segPars[Acts::toUnderlying(ParamDefs::y0)] - extPosOnSector.y()) < m_dY0CutMsSeg) {
243 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" Segment is close enough: "
244 <<std::abs(segPars[Acts::toUnderlying(ParamDefs::y0)] - extPosOnSector.y()));
245 return true;
246 }
247 }
248 return false;
249 }
Scalar eta() const
pseudorapidity method
#define ATH_MSG_VERBOSE(x)
Acts::GeometryContext context() const
const MuonGMR4::MuonDetectorManager * m_detMgr
Detector manager to retrieve the sector envelope surfaces.
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
Tracking geometry tool.
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
bool isNeighbour(const ExpandedSector &other) const
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t Parameters
std::string printID(const xAOD::MuonSegment &seg)
Print the chamber ID of a segment, e.g.
Amg::Vector3D toLocal(const Amg::Transform3D &toLocalTrans, const Amg::Vector3D &dir)
Rotates a direction vector into a local frame: x-axis : Parallell to the radial direction of the dete...
MuonSegment_v1 MuonSegment
Reference the current persistent version:

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

Tracks within the MS eta range are attempted to be extrapolated to the calo exit

Failed extrapolations to the calo exit -> track probably too low in momentum in order to be considered even for calo tagging

Store the parameters at the calorimeter exit if the association to a MS track or a segment is successful -> The tag is then available for the combined fit, STACO, MuTagIMO && inside-> out chain

Definition at line 65 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.cxx.

65 {
66 const xAOD::TrackParticleContainer* idTracks{nullptr};
67 const MuonR4::MuonTagContainer* msTags{nullptr};
68 const xAOD::MuonSegmentContainer* msSegments{nullptr};
69 ATH_CHECK(SG::get(idTracks, m_idTrkKey, ctx));
70 ATH_CHECK(SG::get(msSegments, m_segmentKey, ctx));
71 ATH_CHECK(SG::get(msTags, m_msTrkKey, ctx));
72
73 std::vector<const xAOD::MuonSegment*> uncombinedSegments{};
74 uncombinedSegments.reserve(msSegments->size());
75 std::copy_if(msSegments->begin(), msSegments->end(), std::back_inserter(uncombinedSegments),
76 [msTags](const xAOD::MuonSegment* segment){
77 return std::none_of(msTags->begin(), msTags->end(),
78 [&segment](const MuonR4::MuonTag* tag){
79 return !Acts::rangeContainsValue(tag->segments(), segment);
80 });
81 });
82
83 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__
84 <<" - Select track candidates suitable for combined reconstruction amongst "
85 <<idTracks->size()<<" ID tracks.");
86 IdCandidateCont_t idCandidates{};
87
88 for (const xAOD::TrackParticle* idTrk : *idTracks) {
89 /* Track does not satisfy the kinematic requirements
90 * Or the optional track quality */
91 if (idTrk->pt () < m_trackPt ||
92 (m_selectionTool.isEnabled() && !m_selectionTool->accept(*idTrk))) {
93 continue;
94 }
97 auto idTag = std::make_unique<MuonR4::MuonTag>();
98 idTag->setIdTrack(idTrk);
99 if (std::abs(idTrk->eta()) < m_trackEta) {
102 auto parsAtEntrance = extrapolateToMsEntrance(ctx, *idTrk);
103 if (!parsAtEntrance) {
104 continue;
105 }
109 if (compatibleWithMsTrk(*parsAtEntrance, *msTags) ||
110 compatibleWithSegment(ctx, *parsAtEntrance, uncombinedSegments)) {
111 idTag->setExtrapolatedParsID(Acts::hashString("@CaloExit"),
112 std::move(*parsAtEntrance));
113 }
114 }
115 idCandidates->push_back(std::move(idTag));
116 }
117 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Selected "<<idCandidates->size()
118 <<" candidates for combined reconstruction downstream");
119 ATH_CHECK(idCandidates.record(m_writeKey, ctx));
120 return StatusCode::SUCCESS;
121 }
#define ATH_CHECK
Evaluate an expression and check for errors.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< float > m_trackPt
The minimum momentum cut applied on the ID tracks to be considered.
bool compatibleWithSegment(const EventContext &ctx, const Acts::BoundTrackParameters &caloExitPars, const std::span< const xAOD::MuonSegment * > candidateSegs) const
Checks whether the ID track is compatible with a reconstructed segment which is not part of a reconst...
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_idTrkKey
The input key for the ID / ITk track particles.
ToolHandle< InDet::IInDetTrackSelectionTool > m_selectionTool
Track quality selection tool (optional).
bool compatibleWithMsTrk(const Acts::BoundTrackParameters &caloExitPars, const MuonR4::MuonTagContainer &msTracks) const
Returns whether the ID track expressed on the calorimeter exit volume can be loosely matched with a r...
SG::ReadHandleKey< MuonR4::MuonTagContainer > m_msTrkKey
Input key for the MS track particles.
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
To pass the selection criteria, ITk tracks can alternatively be matched to.
std::optional< Acts::BoundTrackParameters > extrapolateToMsEntrance(const EventContext &ctx, const xAOD::TrackParticle &idTrack) const
Extrapolate the ID track to the MS entrance in order to match it later with spectrometer activity.
Gaudi::Property< float > m_trackEta
Apply a maximum eta cut to stay within the MS acceptance.
SG::WriteHandleKey< MuonR4::MuonTagContainer > m_writeKey
The output key for the selected track candidates.
DataVector< MuonTag > MuonTagContainer
Definition MuonTag.h:118
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".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".

◆ 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 & AthCommonReentrantAlgorithm< 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 94 of file AthCommonReentrantAlgorithm.cxx.

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
An algorithm that can be simultaneously executed in multiple threads.

◆ extrapolateToMsEntrance()

std::optional< Acts::BoundTrackParameters > MuonCombinedR4::InDetTrackSelectionAlg::extrapolateToMsEntrance ( const EventContext & ctx,
const xAOD::TrackParticle & idTrack ) const
private

Extrapolate the ID track to the MS entrance in order to match it later with spectrometer activity.

Parameters
ctxEventContext to retrieve the alignment and magnetic field or the calo extensions
idTrackThe track to be extrapolated

Retrieve the last state of the track to extrapolate into the MS

Construct the track parameter from it

Todo
We need to check whether we can retrieve the track parameters from the calo extension provided by the Egamma / Jet ETmiss group.

Definition at line 123 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.cxx.

124 {
125
126 const auto trackingGeometry = m_trackingGeometryTool->trackingGeometry();
127
128 const Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
129 const Acts::TrackingVolume* msEntrance = m_trackingGeometryTool->getEnvelope(ActsTrk::SystemEnvelope::CaloExit);
130 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Extrapolate ID "<<print(idTrack)<<"\n to the calorimeter exit.\n"
131 <<msEntrance->volumeBounds()<<", id: "<<msEntrance->geometryId());
133 auto lastState = lastMeasurementState(idTrack);
134 if (!lastState) {
135 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - The ID track has no valid last state");
136 return std::nullopt;
137 }
139 const Acts::BoundTrackParameters idExitPars = getActsTrack(idTrack)->createParametersFromState(*lastState);
142 const Acts::GeometryIdentifier barrelId = msEntrance->geometryId().withBoundary(1 + cylinderFace);
143 const Acts::GeometryIdentifier endcapId = msEntrance->geometryId().withBoundary(1 + (idTrack.eta() > 0 ? faceSideA : faceSideC));
144 const Acts::Surface* barrelEntance = trackingGeometry->findSurface(barrelId);
145 const Acts::Surface* endcapDisc = trackingGeometry->findSurface(endcapId);
146
147 const Acts::Surface* target = std::abs(idTrack.eta()) < 1.1 ? barrelEntance : endcapDisc;
148
149 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Target: "<<target->toString(tgContext)
150 <<", "<<target->geometryId()<<", alignable: "<<target->isAlignable()<<".");
151 auto caloPars = m_extrapolationTool->propagate(ctx, idExitPars, *target);
152 if (caloPars.ok()) {
153 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Extrapolation successful "<<(*caloPars));
154 return *caloPars;
155 }
156 if (std::abs(idTrack.eta()) > 0.9 && (target == barrelEntance)){
157 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Track is in the transition region. Try the endcap as target.");
158 caloPars = m_extrapolationTool->propagate(ctx, idExitPars, *endcapDisc);
159 } else if (std::abs(idTrack.eta()) < 1.2 && (target == endcapDisc)) {
160 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Track is in the transition region. Try the barrel as target.");
161 caloPars = m_extrapolationTool->propagate(ctx, idExitPars, *barrelEntance);
162 }
163 if (caloPars.ok()) {
164 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Transition recovery succeeded.");
165 return *caloPars;
166 }
167 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Failed to extrapolate ID "<<print(idTrack)<<".");
168 return std::nullopt;
169 }
#define ATH_MSG_WARNING(x)
void print(char *figname, TCanvas *c1)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
std::optional< ActsTrk::TrackContainer::ConstTrackStateProxy > lastMeasurementState(const xAOD::TrackParticle &trkPart, const bool skipOutlier=true)
Returns the track state proxy corresponding to the last measurement on track.
std::optional< ActsTrk::TrackContainer::ConstTrackProxy > getActsTrack(const xAOD::TrackParticle &trkPart)
Return the proxy to the Acts track from which the track particle was made frome.
Definition Decoration.cxx:9

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode MuonCombinedR4::InDetTrackSelectionAlg::initialize ( )
finaloverridevirtual

Definition at line 49 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.cxx.

49 {
50 ATH_CHECK(m_idTrkKey.initialize());
51 ATH_CHECK(m_msTrkKey.initialize());
52 ATH_CHECK(m_selectionTool.retrieve(EnableTool{!m_selectionTool.empty()}));
55 ATH_CHECK(m_writeKey.initialize());
56 ATH_CHECK(m_segmentKey.initialize());
57 ATH_CHECK(detStore()->retrieve(m_detMgr));
58 if (m_trackingGeometryTool->trackingGeometry()->geometryVersion() !=
59 Acts::TrackingGeometry::GeometryVersion::Gen3){
60 ATH_MSG_ERROR("The ID track selection alg requires the Gen 3 geometry format");
61 return StatusCode::FAILURE;
62 }
63 return StatusCode::SUCCESS;
64 }
#define ATH_MSG_ERROR(x)
const ServiceHandle< StoreGateSvc > & detStore() const

◆ 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()

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< 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.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< 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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

105 {
107
108 if (sc.isFailure()) {
109 return sc;
110 }
111
112 ServiceHandle<ICondSvc> cs("CondSvc",name());
113 for (auto h : outputHandles()) {
114 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
115 // do this inside the loop so we don't create the CondSvc until needed
116 if ( cs.retrieve().isFailure() ) {
117 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
118 return StatusCode::SUCCESS;
119 }
120 if (cs->regHandle(this,*h).isFailure()) {
122 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
123 << " with CondSvc");
124 }
125 }
126 }
127 return sc;
128}
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_dEtaCutMsSeg

Gaudi::Property<float> MuonCombinedR4::InDetTrackSelectionAlg::m_dEtaCutMsSeg {this, "dEtaMaxMsSegment", 0.3}
private

Selection cuts for the Muon segments.

Definition at line 87 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

87{this, "dEtaMaxMsSegment", 0.3};

◆ m_dEtaCutMsTrk

Gaudi::Property<float> MuonCombinedR4::InDetTrackSelectionAlg::m_dEtaCutMsTrk {this, "dEtaMaxMsTrk", 0.2}
private

Selection cuts for the MS tracks.

Definition at line 84 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

84{this, "dEtaMaxMsTrk", 0.2};

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonCombinedR4::InDetTrackSelectionAlg::m_detMgr {nullptr}
private

Detector manager to retrieve the sector envelope surfaces.

Definition at line 72 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

72{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_dPhiCutMsTrk

Gaudi::Property<float> MuonCombinedR4::InDetTrackSelectionAlg::m_dPhiCutMsTrk {this, "dPhiMsTrk", 5*Gaudi::Units::deg}
private

Definition at line 85 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

85{this, "dPhiMsTrk", 5*Gaudi::Units::deg};

◆ m_dY0CutMsSeg

Gaudi::Property<float> MuonCombinedR4::InDetTrackSelectionAlg::m_dY0CutMsSeg {this, "dY0MaxMsSegment", 40 * Gaudi::Units::cm}
private

Definition at line 88 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

88{this, "dY0MaxMsSegment", 40 * Gaudi::Units::cm};

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_extrapolationTool

ToolHandle<ActsTrk::IExtrapolationTool> MuonCombinedR4::InDetTrackSelectionAlg::m_extrapolationTool {this, "ExtrapolationTool" ,"" }
private

Track extrapolation tool.

Definition at line 78 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

78{this, "ExtrapolationTool" ,"" };

◆ m_idTrkKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> MuonCombinedR4::InDetTrackSelectionAlg::m_idTrkKey {this, "IdTrackKey", "InDetTrackParticles"}
private

The input key for the ID / ITk track particles.

Definition at line 63 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

63{this, "IdTrackKey", "InDetTrackParticles"};

◆ m_msTrkKey

SG::ReadHandleKey<MuonR4::MuonTagContainer> MuonCombinedR4::InDetTrackSelectionAlg::m_msTrkKey {this, "MsTrackKey", "MuonTagsSA"}
private

Input key for the MS track particles.

ID tracks are only considered if they can be roughly matched to a MS track

Definition at line 66 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

66{this, "MsTrackKey", "MuonTagsSA"};

◆ m_segmentKey

SG::ReadHandleKey<xAOD::MuonSegmentContainer> MuonCombinedR4::InDetTrackSelectionAlg::m_segmentKey {this, "SegmentKey", "MuonSegmentsFromR4"}
private

To pass the selection criteria, ITk tracks can alternatively be matched to.

Definition at line 68 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

68{this, "SegmentKey", "MuonSegmentsFromR4"};

◆ m_selectionTool

ToolHandle<InDet::IInDetTrackSelectionTool> MuonCombinedR4::InDetTrackSelectionAlg::m_selectionTool {this, "TackSelectionTool" , ""}
private

Track quality selection tool (optional).

Definition at line 74 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

74{this, "TackSelectionTool" , ""};

◆ m_trackEta

Gaudi::Property<float> MuonCombinedR4::InDetTrackSelectionAlg::m_trackEta {this, "maxEta", 2.8}
private

Apply a maximum eta cut to stay within the MS acceptance.

Definition at line 82 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

82{this, "maxEta", 2.8};

◆ m_trackingGeometryTool

PublicToolHandle<ActsTrk::ITrackingGeometryTool> MuonCombinedR4::InDetTrackSelectionAlg::m_trackingGeometryTool {this, "TrackingGeometryTool", ""}
private

Tracking geometry tool.

Definition at line 76 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

76{this, "TrackingGeometryTool", ""};

◆ m_trackPt

Gaudi::Property<float> MuonCombinedR4::InDetTrackSelectionAlg::m_trackPt {this, "minPt", 2.5*Gaudi::Units::GeV}
private

The minimum momentum cut applied on the ID tracks to be considered.

Definition at line 80 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

80{this, "minPt", 2.5*Gaudi::Units::GeV};

◆ 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<MuonR4::MuonTagContainer> MuonCombinedR4::InDetTrackSelectionAlg::m_writeKey {this, "writeKey", "MuonInDetCandidates"}
private

The output key for the selected track candidates.

Definition at line 70 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/InDetTrackSelectionAlg.h.

70{this, "writeKey", "MuonInDetCandidates"};

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