ATLAS Offline Software
Loading...
Searching...
No Matches
Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9#include "TrkTrack/Track.h"
10
11namespace MuonCombined {
12
16 const ElementLink<TrackCollection>& saTrackLink, size_t container_idx) :
18 m_extrapolatedTrackLink(saTrackLink),
20 m_extContIdx(container_idx) {}
21
30
32
33 std::string MuonCandidate::toString() const {
34 const Trk::Track* track = primaryTrack();
35 const Trk::Perigee* perigee = track->perigeeParameters();
36 std::ostringstream sout;
37 if (!perigee)
38 sout << " Track has no perigee parameters!";
39 else
40 sout << " pt " << perigee->momentum().perp() << " eta " << perigee->momentum().eta() << " phi " << perigee->momentum().phi();
41 sout << " hasExtrapolatedTrack " << (extrapolatedTrack() ? "yes" : "no") << std::endl;
42 return sout.str();
43 }
44
46
51 return m_extrapolatedTrackLink.isValid() ? *m_extrapolatedTrackLink : nullptr;
52 }
54 const Trk::Track* ext_trk = extrapolatedTrack();
55 return ext_trk ? ext_trk : &muonSpectrometerTrack();
56 }
57
62
63 void MuonCandidate::setSegments(std::vector<const Muon::MuonSegment*>&& segments) { m_assoc_segments = std::move(segments); }
64 const std::vector<const Muon::MuonSegment*>& MuonCandidate::getSegments() const { return m_assoc_segments; }
66
67} // namespace MuonCombined
void setSegments(std::vector< const Muon::MuonSegment * > &&segments)
set the vector of associated segments to the candidate
const ElementLink< TrackCollection > m_extrapolatedTrackLink
element link to extrapolated track
const ElementLink< xAOD::TrackParticleContainer > m_extrapolatedParticleLink
element link to the extrapolated muon track particle
std::vector< const Muon::MuonSegment * > m_assoc_segments
Segments associated with the candidate.
const ElementLink< xAOD::TrackParticleContainer > m_muonSpectrometerTrackLink
element link to spectrometer track
const Trk::Track & muonSpectrometerTrack() const
access spectrometer track, always there
const Trk::Track * primaryTrack() const
Returns the extrapolated track otherwise the muonSpectrometer.
MuonCandidate(const ElementLink< xAOD::TrackParticleContainer > &msTrackLink)
constructor taking an ElementLink to a xAOD::TrackParicle& Users should ensure that the element link ...
const ElementLink< TrackCollection > & extrapolatedTrackLink() const
access extrapolated track element link
const std::vector< const Muon::MuonSegment * > & getSegments() const
returns the vector of associated muon segments
const ElementLink< xAOD::TrackParticleContainer > & muonSpectrometerTrackLink() const
access spectrometer track, always there
const ElementLink< xAOD::TrackParticleContainer > & extrapolatedParticleLink() const
access extrapolated track particle element link
const Trk::Track * extrapolatedTrack() const
access extrapolated track, can be zero if back extrapolation failed
bool m_isCommissioning
flag whether the track belongs to the comissioning stream
size_t extrapolatedElementID() const
returns the index of the container where the extrapolated track is located
bool isCommissioning() const
Returns whether the muon belongs to the comissioning chain.
const Amg::Vector3D & momentum() const
Access method for the momentum.
The MuonTagToSegMap is an auxillary construct that links the MuonSegments associated with a combined ...
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee