ATLAS Offline Software
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 
11 namespace MuonCombined {
12 
14  m_muonSpectrometerTrackLink(trackLink), m_muonSpectrometerTrack((*m_muonSpectrometerTrackLink)->track()) {}
16  const ElementLink<TrackCollection>& saTrackLink, size_t container_idx) :
17  m_muonSpectrometerTrackLink(trackLink),
18  m_extrapolatedTrackLink(saTrackLink),
19  m_muonSpectrometerTrack((*m_muonSpectrometerTrackLink)->track()),
20  m_extContIdx(container_idx) {}
21 
23  m_muonSpectrometerTrackLink{oldCandidate.m_muonSpectrometerTrackLink},
24  m_extrapolatedParticleLink{msoeTrackLink},
25  m_extrapolatedTrackLink{(*msoeTrackLink)->trackLink()},
26  m_muonSpectrometerTrack{oldCandidate.m_muonSpectrometerTrack},
27  m_isCommissioning{oldCandidate.m_isCommissioning},
28  m_assoc_segments{oldCandidate.m_assoc_segments},
29  m_extContIdx{oldCandidate.m_extContIdx} {}
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 
49  }
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
MuonCombined::MuonCandidate::m_extrapolatedParticleLink
const ElementLink< xAOD::TrackParticleContainer > m_extrapolatedParticleLink
element link to the extrapolated muon track particle
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:79
TrackParameters.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
MuonCombined::MuonCandidate::primaryTrack
const Trk::Track * primaryTrack() const
Returns the extrapolated track otherwise the muonSpectrometer.
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:53
MuonCombined::MuonCandidate::m_muonSpectrometerTrack
const Trk::Track * m_muonSpectrometerTrack
pointer to spectrometer track, not owned
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:84
MuonCombined::MuonCandidate::m_muonSpectrometerTrackLink
const ElementLink< xAOD::TrackParticleContainer > m_muonSpectrometerTrackLink
element link to spectrometer track
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:77
MuonCombined::MuonCandidate::m_assoc_segments
std::vector< const Muon::MuonSegment * > m_assoc_segments
Segments associated with the candidate.
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:90
MuonCombined::MuonCandidate::m_extrapolatedTrackLink
const ElementLink< TrackCollection > m_extrapolatedTrackLink
element link to extrapolated track
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:81
Track.h
MuonCombined::MuonCandidate::muonSpectrometerTrackLink
const ElementLink< xAOD::TrackParticleContainer > & muonSpectrometerTrackLink() const
access spectrometer track, always there
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:47
MuonCombined::MuonCandidate::extrapolatedElementID
size_t extrapolatedElementID() const
returns the index of the container where the extrapolated track is located
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:59
MuonCombined::MuonCandidate
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:25
MuonCombined::MuonCandidate::MuonCandidate
MuonCandidate(const ElementLink< xAOD::TrackParticleContainer > &msTrackLink)
constructor taking an ElementLink to a xAOD::TrackParicle& Users should ensure that the element link ...
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:13
MuonCombined::MuonCandidate::toString
std::string toString() const
print candidate to string
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:33
MuonCombined::MuonCandidate::getSegments
const std::vector< const Muon::MuonSegment * > & getSegments() const
returns the vector of associated muon segments
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:64
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
MuonCandidate.h
MuonCombined::MuonCandidate::extrapolatedTrackLink
const ElementLink< TrackCollection > & extrapolatedTrackLink() const
access extrapolated track element link
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:58
MuonCombined::MuonCandidate::extrapolatedTrack
const Trk::Track * extrapolatedTrack() const
access extrapolated track, can be zero if back extrapolation failed
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:50
MuonCombined::MuonCandidate::setSegments
void setSegments(std::vector< const Muon::MuonSegment * > &&segments)
set the vector of associated segments to the candidate
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:63
MuonCombined
The MuonTagToSegMap is an auxillary construct that links the MuonSegments associated with a combined ...
Definition: IMuonSystemExtensionTool.h:23
MuonCombined::MuonCandidate::~MuonCandidate
~MuonCandidate()
destructor
MuonCombined::MuonCandidate::extrapolatedParticleLink
const ElementLink< xAOD::TrackParticleContainer > & extrapolatedParticleLink() const
access extrapolated track particle element link
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:65
MuonSegment.h
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
MuonCombined::MuonCandidate::muonSpectrometerTrack
const Trk::Track & muonSpectrometerTrack() const
access spectrometer track, always there
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:45
MuonCombined::MuonCandidate::isCommissioning
bool isCommissioning() const
Returns whether the muon belongs to the comissioning chain.
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:61
MuonCombined::MuonCandidate::m_isCommissioning
bool m_isCommissioning
flag whether the track belongs to the comissioning stream
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:87
MuonCombined::MuonCandidate::m_extContIdx
size_t m_extContIdx
Index of the MSOE track in the output container.
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:93
MuonCombined::MuonCandidate::setCommissioning
void setCommissioning(bool b)
Sets ths comissioning flag.
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/src/MuonCandidate.cxx:60