ATLAS Offline Software
MuonMatch.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
13 
15 #include "MuidEvent/MuonMatch.h"
16 #include "Particle/TrackParticle.h"
17 #include "TrkTrack/Track.h"
18 #include "VxVertex/RecVertex.h"
19 
20 namespace Rec
21 {
22 
23 // combined track constructor (inDet track matched to extrapolated track)
25  const Trk::Track* extrapolatedTrack,
26  const Trk::Track* indetTrack,
27  const Trk::Track* spectrometerTrack,
28  const FieldIntegral& fieldIntegral,
29  double innerMatchChi2,
30  int innerMatchDoF,
31  double innerMatchProb,
33  double outerMatchChi2,
34  int outerMatchDoF,
35  double outerMatchProb,
36  const ScatteringAngleSignificance& scatteringAngleSignificance)
37  : m_combinedTrack (combinedTrack),
38  m_extrapolatedRefit (nullptr),
39  m_extrapolatedTrack (extrapolatedTrack),
40  m_indetParticle (nullptr),
41  m_indetTrack (indetTrack),
42  m_spectrometerParticle (nullptr),
43  m_spectrometerTrack (spectrometerTrack),
44  m_vertex (nullptr),
45  m_bestMatch (false),
46  m_fieldIntegral (fieldIntegral),
47  m_innerMatchChi2 (innerMatchChi2),
48  m_innerMatchDoF (innerMatchDoF),
49  m_innerMatchProb (innerMatchProb),
50  m_matchType (Unmatched),
51  m_momentumBalanceSignificance (momentumBalanceSignificance),
52  m_outerMatchChi2 (outerMatchChi2),
53  m_outerMatchDoF (outerMatchDoF),
54  m_outerMatchProb (outerMatchProb),
55  m_scatteringAngleSignificance (scatteringAngleSignificance),
56  m_looseMatch (false),
57  m_simpleMatch (false)
58 {}
59 
60 // combined track constructor (vertexAssociated track)
62  const TrackParticle* indetParticle,
63  const TrackParticle* spectrometerParticle,
64  const Trk::RecVertex* vertex,
65  const FieldIntegral& fieldIntegral,
66  const ScatteringAngleSignificance& scatteringAngleSignificance)
67  : m_combinedTrack (combinedTrack),
68  m_extrapolatedRefit (nullptr),
69  m_extrapolatedTrack (nullptr),
70  m_indetParticle (indetParticle),
71  m_indetTrack (nullptr),
72  m_spectrometerParticle (spectrometerParticle),
73  m_spectrometerTrack (nullptr),
74  m_vertex (vertex),
75  m_bestMatch (false),
76  m_fieldIntegral (fieldIntegral),
77  m_innerMatchChi2 (0.),
78  m_innerMatchDoF (0),
79  m_innerMatchProb (0.),
80  m_matchType (Vertex),
81  m_momentumBalanceSignificance (0.),
82  m_outerMatchChi2 (0.),
83  m_outerMatchDoF (0),
84  m_outerMatchProb (0.),
85  m_scatteringAngleSignificance (scatteringAngleSignificance),
86  m_looseMatch (false),
87  m_simpleMatch (false)
88 {
91 }
92 
93 // copy and steal constructor
95  : m_combinedTrack (match.m_combinedTrack),
96  m_extrapolatedRefit (match.m_extrapolatedRefit),
97  m_extrapolatedTrack (match.m_extrapolatedTrack),
98  m_indetParticle (match.m_indetParticle),
99  m_indetTrack (match.m_indetTrack),
100  m_spectrometerParticle (match.m_spectrometerParticle),
101  m_spectrometerTrack (match.m_spectrometerTrack),
102  m_vertex (match.m_vertex),
103  m_bestMatch (match.m_bestMatch),
104  m_fieldIntegral (match.m_fieldIntegral),
105  m_innerMatchChi2 (match.m_innerMatchChi2),
106  m_innerMatchDoF (match.m_innerMatchDoF),
107  m_innerMatchProb (match.m_innerMatchProb),
108  m_matchType (match.m_matchType),
109  m_momentumBalanceSignificance (match.m_momentumBalanceSignificance),
110  m_outerMatchChi2 (match.m_outerMatchChi2),
111  m_outerMatchDoF (match.m_outerMatchDoF),
112  m_outerMatchProb (match.m_outerMatchProb),
113  m_scatteringAngleSignificance (match.m_scatteringAngleSignificance),
114  m_looseMatch (match.m_looseMatch),
115  m_simpleMatch (match.m_simpleMatch)
116 {
117  // steal combined track
118  if (match.m_combinedTrack) match.m_combinedTrack = nullptr;
119  if (match.m_extrapolatedRefit) match.m_extrapolatedRefit = nullptr;
120 }
121 
122 // assign and steal operator
124 {
125  if (this!=&match){
126  m_extrapolatedTrack =match.m_extrapolatedTrack;
127  m_indetParticle =match.m_indetParticle;
128  m_indetTrack =match.m_indetTrack;
129  m_spectrometerParticle =match.m_spectrometerParticle;
130  m_spectrometerTrack =match.m_spectrometerTrack;
131  m_vertex =match.m_vertex;
132 
133  m_bestMatch =match.m_bestMatch;
134  m_fieldIntegral =match.m_fieldIntegral;
135  m_innerMatchChi2 =match.m_innerMatchChi2;
136  m_innerMatchDoF =match.m_innerMatchDoF;
137  m_innerMatchProb =match.m_innerMatchProb;
138  m_matchType =match.m_matchType;
139  m_momentumBalanceSignificance =match.m_momentumBalanceSignificance;
140  m_outerMatchChi2 =match.m_outerMatchChi2;
141  m_outerMatchDoF =match.m_outerMatchDoF;
142  m_outerMatchProb =match.m_outerMatchProb;
143  m_scatteringAngleSignificance =match.m_scatteringAngleSignificance;
144  m_looseMatch =match.m_looseMatch;
145  m_simpleMatch =match.m_simpleMatch;
146 
147  if(m_combinedTrack) delete m_combinedTrack;
148  m_combinedTrack =match.m_combinedTrack;
149  if (match.m_combinedTrack) match.m_combinedTrack = nullptr;
150 
152  m_extrapolatedRefit =match.m_extrapolatedRefit;
153  if (match.m_extrapolatedRefit) match.m_extrapolatedRefit = nullptr;
154  }
155  return *this;
156 }
157 
159 {
160  delete m_combinedTrack;
161  delete m_extrapolatedRefit;
162 }
163 
164 void
166 {
167  const Trk::Track* oldTrack = m_extrapolatedRefit;
168  m_extrapolatedRefit = refittedTrack;
169  delete oldTrack;
170 }
171 
172 void
173 MuonMatch::extrapolatedTrack (const Trk::Track* extrapolatedTrack)
174 {
176 }
177 
178 void
180 { m_fieldIntegral = value; }
181 
182 void
184 { m_matchType = type; }
185 
186 void
189 
190 void
193 
194 } // end of namespace
195 
RecVertex.h
Rec::MuonMatch::m_combinedTrack
const Trk::Track * m_combinedTrack
Definition: MuonMatch.h:138
Rec::MuonMatch::m_simpleMatch
bool m_simpleMatch
Definition: MuonMatch.h:160
Rec::MuonMatch::m_looseMatch
bool m_looseMatch
Definition: MuonMatch.h:159
TrackParticle.h
Rec::MuonMatch::extrapolatedTrack
const Trk::Track * extrapolatedTrack(void) const
Definition: MuonMatch.h:175
Rec::MuonMatch::operator=
MuonMatch & operator=(MuonMatch &)
Definition: MuonMatch.cxx:123
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
Rec::MuonMatch::MatchType
MatchType
enum to describe the ranked match quality
Definition: MuonMatch.h:36
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Rec::MuonMatch::m_spectrometerTrack
const Trk::Track * m_spectrometerTrack
Definition: MuonMatch.h:144
Rec::MuonMatch::m_bestMatch
bool m_bestMatch
Definition: MuonMatch.h:146
Rec::MuonMatch::m_indetTrack
const Trk::Track * m_indetTrack
Definition: MuonMatch.h:142
Rec::MuonMatch::m_extrapolatedTrack
const Trk::Track * m_extrapolatedTrack
Definition: MuonMatch.h:140
Rec::MuonMatch::matchType
MatchType matchType(void) const
Definition: MuonMatch.h:235
Rec::MuonMatch::m_innerMatchDoF
int m_innerMatchDoF
Definition: MuonMatch.h:149
athena.value
value
Definition: athena.py:124
Rec::MuonMatch
Definition: MuonMatch.h:32
Rec::MuonMatch::~MuonMatch
virtual ~MuonMatch()
Definition: MuonMatch.cxx:158
Rec::MuonMatch::indetParticle
const TrackParticle * indetParticle(void) const
Definition: MuonMatch.h:179
Trk::combinedTrack
void combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *par, double *covo)
Definition: XYZtrp.cxx:113
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition: RecVertex.h:44
MuonParameters::momentumBalanceSignificance
@ momentumBalanceSignificance
Definition: MuonParamDefs.h:136
Track.h
Rec::ScatteringAngleSignificance
Definition: ScatteringAngleSignificance.h:22
Rec
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Definition: FakeTrackBuilder.h:10
MuonMatch.h
Rec::MuonMatch::m_vertex
const Trk::RecVertex * m_vertex
Definition: MuonMatch.h:145
Rec::MuonMatch::MuonMatch
MuonMatch(const MuonMatch &)
Rec::MuonMatch::m_outerMatchDoF
int m_outerMatchDoF
Definition: MuonMatch.h:154
Rec::MuonMatch::m_spectrometerParticle
const TrackParticle * m_spectrometerParticle
Definition: MuonMatch.h:143
Rec::MuonMatch::momentumBalanceSignificance
double momentumBalanceSignificance(void) const
Definition: MuonMatch.h:239
Rec::MuonMatch::m_matchType
MatchType m_matchType
Definition: MuonMatch.h:151
Rec::MuonMatch::m_innerMatchChi2
double m_innerMatchChi2
Definition: MuonMatch.h:148
Rec::MuonMatch::m_extrapolatedRefit
const Trk::Track * m_extrapolatedRefit
Definition: MuonMatch.h:139
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
Rec::MuonMatch::m_indetParticle
const TrackParticle * m_indetParticle
Definition: MuonMatch.h:141
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
Rec::MuonMatch::fieldIntegral
const FieldIntegral & fieldIntegral(void) const
Definition: MuonMatch.h:207
Rec::FieldIntegral
Definition: FieldIntegral.h:22
Rec::MuonMatch::scatteringAngleSignificance
const ScatteringAngleSignificance & scatteringAngleSignificance(void) const
Definition: MuonMatch.h:263
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Rec::MuonMatch::m_scatteringAngleSignificance
ScatteringAngleSignificance m_scatteringAngleSignificance
Definition: MuonMatch.h:156
Rec::MuonMatch::m_innerMatchProb
double m_innerMatchProb
Definition: MuonMatch.h:150
Rec::MuonMatch::m_momentumBalanceSignificance
double m_momentumBalanceSignificance
Definition: MuonMatch.h:152
Rec::MuonMatch::extrapolatedRefit
const Trk::Track * extrapolatedRefit(void) const
Definition: MuonMatch.h:171
Rec::MuonMatch::m_fieldIntegral
FieldIntegral m_fieldIntegral
Definition: MuonMatch.h:147
Rec::MuonMatch::spectrometerParticle
const TrackParticle * spectrometerParticle(void) const
Definition: MuonMatch.h:187
Rec::MuonMatch::m_outerMatchProb
double m_outerMatchProb
Definition: MuonMatch.h:155
Rec::MuonMatch::m_outerMatchChi2
double m_outerMatchChi2
Definition: MuonMatch.h:153
Trk::TrackParticleBase::originalTrack
const Track * originalTrack() const
Return pointer to associated track.
Definition: TrackParticleBase.h:205
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356