ATLAS Offline Software
MuonTrackSegmentMatchResult.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  * Author : Martin Woudstra
7  ***************************************************************************/
8 
9 #ifndef MUONTRACKSEGMENTMATCHRESULT_H
10 #define MUONTRACKSEGMENTMATCHRESULT_H
11 
12 // std
13 #include <string>
14 // other packages
16 #include "Identifier/Identifier.h"
17 
18 namespace Trk {
19  class Track;
20 }
21 
22 // this package
23 
24 namespace Muon {
25 
26  class MuonSegment;
27 
30  //
31  // nested types
32  //
33  enum CutType {
44  };
45 
47  static std::string cutString(CutType cut);
48 
49  enum Reason {
73  };
74 
76  static std::string reasonString(Reason r);
77 
78  //
79  // public data members
80  //
81  double localPosXDiff{};
82  double localPosYDiff{};
83  double localAngleXDiff{};
84  double localAngleYDiff{};
85  double posXMeasErr2{};
86  double posYMeasErr2{};
87  double posXPredErr2{};
88  double posYPredErr2{};
89  double posXAlignErr2{};
90  double posYAlignErr2{};
91  double posXTotalErr2{}; // measured + predicted + alignment
92  double posYTotalErr2{}; // measured + predicted + alignment
93  double angleXMeasErr2{};
94  double angleYMeasErr2{};
95  double angleXPredErr2{};
96  double angleYPredErr2{};
97  double angleXAlignErr2{};
98  double angleYAlignErr2{};
99  double angleXTotalErr2{}; // measured + predicted + alignment
100  double angleYTotalErr2{}; // measured + predicted + alignment
101  double matchChiSquared{};
104  Amg::MatrixX totalCovariance; // measured + predicted + alignment
106  Identifier trackChamberId; // ID of the MDT/CSC chamber on the track closest to segment
107  Identifier segmentChamberId; // ID of the MDT/CSC chamber of the segment
108  const Trk::Track* track{};
110  Reason reason; // reason for acceptance or failure
111  bool havePosX{}; // have X position difference available
112  bool havePosY{}; // have Y position difference available
113  bool havePosXError{}; // have total error on X position difference available
114  bool havePosYError{}; // have total error on Y position difference available
115  bool haveAngleX{}; // have X angle difference available
116  bool haveAngleY{}; // have Y angle difference available
117  bool haveAngleXError{}; // have total error on X angle difference available
118  bool haveAngleYError{}; // have total error on X angle difference available
119  bool haveMatchChiSquared{}; // have total match chi-squared available
120  bool matchOK{}; // Final result: was the match OK or not
121 
122  //
123  // public functions
124  //
126  virtual ~TrackSegmentMatchResult();
127 
128  virtual void clear();
129 
131  void resetCuts() {
132  m_failedCuts = 0;
133  m_passedCuts = 0;
134  }
135 
137  void setCutPassed(CutType cut) { m_passedCuts |= (1 << cut); }
138 
140  void setCutFailed(CutType cut) { m_failedCuts |= (1 << cut); }
141 
143  bool passedCut(CutType cut) const { return !(m_failedCuts & (1 << cut)); }
144 
146  bool failedCut(CutType cut) const { return (m_failedCuts & (1 << cut)); }
147 
149  bool appliedCut(CutType cut) const { return (m_passedCuts & (1 << cut)) || (m_failedCuts & (1 << cut)); }
150 
152  bool appliedAnyCut() const { return m_passedCuts || m_failedCuts; }
153 
155  bool passedAllCuts() const { return !m_failedCuts; }
156 
158  std::string failedCutsString() const;
159 
161  std::string passedCutsString() const;
162 
163  std::string reasonString() const;
164 
165  private:
166  //
167  // private data members
168  //
169  int m_failedCuts{}; // bitpattern with failed cuts (bits given by enum CutType)
170  int m_passedCuts{}; // bitpattern with passed cuts (bits given by enum CutType)
171 
172  }; // end of class TrackSegmentMatchResult
173 
175  double posXCut{};
176  double posYCut{};
177  double posXPullCut{};
178  double posYPullCut{};
179  double angleXCut{};
180  double angleYCut{};
181  double angleXPullCut{};
182  double angleYPullCut{};
184  bool useTightCuts{};
185  bool cutOnPosX{};
186  bool cutOnPosY{};
189  bool cutOnAngleX{};
190  bool cutOnAngleY{};
194 
195  virtual void clear();
196 
199  };
200 
201 } // namespace Muon
202 
203 #endif // MUONCOMBITRACKMAKER_MUONTRACKSEGMENTMATCHRESULT_H
Muon::TrackSegmentMatchResult::posYMeasErr2
double posYMeasErr2
Definition: MuonTrackSegmentMatchResult.h:86
Muon::TrackSegmentMatchResult::LocalDirFailed
@ LocalDirFailed
Definition: MuonTrackSegmentMatchResult.h:71
Muon::TrackSegmentMatchResult::PassedPosAngleCuts
@ PassedPosAngleCuts
Definition: MuonTrackSegmentMatchResult.h:54
beamspotman.r
def r
Definition: beamspotman.py:676
Muon::TrackSegmentMatchResult::posXPredErr2
double posXPredErr2
Definition: MuonTrackSegmentMatchResult.h:87
Muon::TrackSegmentMatchResult::angleXMeasErr2
double angleXMeasErr2
Definition: MuonTrackSegmentMatchResult.h:93
Muon::TrackSegmentMatchResult::NumberOfReasons
@ NumberOfReasons
Definition: MuonTrackSegmentMatchResult.h:72
Muon::TrackSegmentMatchResult::m_passedCuts
int m_passedCuts
Definition: MuonTrackSegmentMatchResult.h:170
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:30
Muon::TrackSegmentMatchResult::SegmentMatching
@ SegmentMatching
Definition: MuonTrackSegmentMatchResult.h:56
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Muon::TrackSegmentMatchCuts::cutOnPosXPull
bool cutOnPosXPull
Definition: MuonTrackSegmentMatchResult.h:187
Muon::TrackSegmentMatchResult::PassedAllCuts
@ PassedAllCuts
Definition: MuonTrackSegmentMatchResult.h:52
Muon::TrackSegmentMatchResult::NoClosestPars
@ NoClosestPars
Definition: MuonTrackSegmentMatchResult.h:59
Muon::TrackSegmentMatchResult::ExtrapolNoErrors
@ ExtrapolNoErrors
Definition: MuonTrackSegmentMatchResult.h:65
Muon::TrackSegmentMatchResult::angleYAlignErr2
double angleYAlignErr2
Definition: MuonTrackSegmentMatchResult.h:98
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Muon::TrackSegmentMatchCuts::angleYPullCut
double angleYPullCut
Definition: MuonTrackSegmentMatchResult.h:182
Muon::TrackSegmentMatchResult::PredLocalAnglesFailed
@ PredLocalAnglesFailed
Definition: MuonTrackSegmentMatchResult.h:67
Muon::TrackSegmentMatchCuts::posXCut
double posXCut
Definition: MuonTrackSegmentMatchResult.h:175
Muon::TrackSegmentMatchResult::localAngleXDiff
double localAngleXDiff
Definition: MuonTrackSegmentMatchResult.h:83
Muon::TrackSegmentMatchResult::passedAllCuts
bool passedAllCuts() const
Did all of the cuts that were applied pass?
Definition: MuonTrackSegmentMatchResult.h:155
Muon::TrackSegmentMatchResult::haveAngleX
bool haveAngleX
Definition: MuonTrackSegmentMatchResult.h:115
Muon::TrackSegmentMatchResult::havePosX
bool havePosX
Definition: MuonTrackSegmentMatchResult.h:111
Muon::TrackSegmentMatchResult::passedCut
bool passedCut(CutType cut) const
Did it pass the cut? Returns true if cut was not applied or passed.
Definition: MuonTrackSegmentMatchResult.h:143
Muon::TrackSegmentMatchResult::haveMatchChiSquared
bool haveMatchChiSquared
Definition: MuonTrackSegmentMatchResult.h:119
Muon::TrackSegmentMatchResult::AngXPullCut
@ AngXPullCut
Definition: MuonTrackSegmentMatchResult.h:40
Muon::TrackSegmentMatchResult::PosYCut
@ PosYCut
Definition: MuonTrackSegmentMatchResult.h:35
Muon::TrackSegmentMatchResult::track
const Trk::Track * track
Definition: MuonTrackSegmentMatchResult.h:108
Muon::TrackSegmentMatchResult::FailedCuts
@ FailedCuts
Definition: MuonTrackSegmentMatchResult.h:55
Muon::TrackSegmentMatchResult::angleXAlignErr2
double angleXAlignErr2
Definition: MuonTrackSegmentMatchResult.h:97
Muon::TrackSegmentMatchResult::NoCutsApplied
@ NoCutsApplied
Definition: MuonTrackSegmentMatchResult.h:51
Muon::TrackSegmentMatchCuts::cutOnAngleY
bool cutOnAngleY
Definition: MuonTrackSegmentMatchResult.h:190
Muon::TrackSegmentMatchResult::PassedMatchChiSquaredCut
@ PassedMatchChiSquaredCut
Definition: MuonTrackSegmentMatchResult.h:53
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::TrackSegmentMatchResult::AngleMeasErrFailed
@ AngleMeasErrFailed
Definition: MuonTrackSegmentMatchResult.h:68
Muon::TrackSegmentMatchResult::NoSegmentPointer
@ NoSegmentPointer
Definition: MuonTrackSegmentMatchResult.h:57
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
Muon::TrackSegmentMatchResult::angleYPredErr2
double angleYPredErr2
Definition: MuonTrackSegmentMatchResult.h:96
Muon::TrackSegmentMatchCuts::cutOnAngleYPull
bool cutOnAngleYPull
Definition: MuonTrackSegmentMatchResult.h:192
Muon::TrackSegmentMatchCuts
Definition: MuonTrackSegmentMatchResult.h:174
Muon::TrackSegmentMatchResult::appliedAnyCut
bool appliedAnyCut() const
Was any cut applied ?
Definition: MuonTrackSegmentMatchResult.h:152
Muon::TrackSegmentMatchResult::posXAlignErr2
double posXAlignErr2
Definition: MuonTrackSegmentMatchResult.h:89
Muon::TrackSegmentMatchResult::angleYMeasErr2
double angleYMeasErr2
Definition: MuonTrackSegmentMatchResult.h:94
Muon::TrackSegmentMatchResult::posXMeasErr2
double posXMeasErr2
Definition: MuonTrackSegmentMatchResult.h:85
Muon::TrackSegmentMatchCuts::angleYCut
double angleYCut
Definition: MuonTrackSegmentMatchResult.h:180
Muon::TrackSegmentMatchCuts::cutOnMatchChiSquared
bool cutOnMatchChiSquared
Definition: MuonTrackSegmentMatchResult.h:193
Muon::TrackSegmentMatchResult::NoClosestSegment
@ NoClosestSegment
Definition: MuonTrackSegmentMatchResult.h:61
Muon::TrackSegmentMatchResult::resetCuts
void resetCuts()
Reset all cuts (applied & passed)
Definition: MuonTrackSegmentMatchResult.h:131
Muon::TrackSegmentMatchResult::m_failedCuts
int m_failedCuts
Definition: MuonTrackSegmentMatchResult.h:169
Muon::TrackSegmentMatchResult::localAngleYDiff
double localAngleYDiff
Definition: MuonTrackSegmentMatchResult.h:84
Muon::TrackSegmentMatchCuts::cutOnPosX
bool cutOnPosX
Definition: MuonTrackSegmentMatchResult.h:185
Muon::TrackSegmentMatchCuts::cutOnPosYPull
bool cutOnPosYPull
Definition: MuonTrackSegmentMatchResult.h:188
Muon::TrackSegmentMatchResult::setCutPassed
void setCutPassed(CutType cut)
Set cut applied and cut passed.
Definition: MuonTrackSegmentMatchResult.h:137
Muon::TrackSegmentMatchResult::AngYCut
@ AngYCut
Definition: MuonTrackSegmentMatchResult.h:39
Muon::TrackSegmentMatchResult::localPosXDiff
double localPosXDiff
Definition: MuonTrackSegmentMatchResult.h:81
Muon::TrackSegmentMatchResult::Unknown
@ Unknown
Definition: MuonTrackSegmentMatchResult.h:50
Muon::TrackSegmentMatchResult::haveAngleYError
bool haveAngleYError
Definition: MuonTrackSegmentMatchResult.h:118
Muon::TrackSegmentMatchResult::havePosXError
bool havePosXError
Definition: MuonTrackSegmentMatchResult.h:113
Muon::TrackSegmentMatchResult::posYPredErr2
double posYPredErr2
Definition: MuonTrackSegmentMatchResult.h:88
Muon::TrackSegmentMatchCuts::useTightCuts
bool useTightCuts
Definition: MuonTrackSegmentMatchResult.h:184
Muon::TrackSegmentMatchResult::AngYPullCut
@ AngYPullCut
Definition: MuonTrackSegmentMatchResult.h:41
Muon::TrackSegmentMatchResult::havePosY
bool havePosY
Definition: MuonTrackSegmentMatchResult.h:112
Muon::TrackSegmentMatchResult::reason
Reason reason
Definition: MuonTrackSegmentMatchResult.h:110
Muon::TrackSegmentMatchResult::posXTotalErr2
double posXTotalErr2
Definition: MuonTrackSegmentMatchResult.h:91
Muon::TrackSegmentMatchResult::TrackSegmentMatchResult
TrackSegmentMatchResult()
Definition: MuonTrackSegmentMatchResult.cxx:27
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
Muon::TrackSegmentMatchCuts::posYPullCut
double posYPullCut
Definition: MuonTrackSegmentMatchResult.h:178
Muon::TrackSegmentMatchResult::CutType
CutType
Definition: MuonTrackSegmentMatchResult.h:33
Muon::TrackSegmentMatchCuts::angleXCut
double angleXCut
Definition: MuonTrackSegmentMatchResult.h:179
Muon::TrackSegmentMatchCuts::cutOnAngleX
bool cutOnAngleX
Definition: MuonTrackSegmentMatchResult.h:189
Muon::TrackSegmentMatchResult::cutString
static std::string cutString(CutType cut)
turn enum CutType into a string
Definition: MuonTrackSegmentMatchResult.cxx:77
Muon::TrackSegmentMatchResult::totalCovariance
Amg::MatrixX totalCovariance
Definition: MuonTrackSegmentMatchResult.h:104
Muon::TrackSegmentMatchCuts::cutOnPosY
bool cutOnPosY
Definition: MuonTrackSegmentMatchResult.h:186
Muon::TrackSegmentMatchResult::MatchChiSquaredCut
@ MatchChiSquaredCut
Definition: MuonTrackSegmentMatchResult.h:42
Muon::TrackSegmentMatchResult::measuredCovariance
Amg::MatrixX measuredCovariance
Definition: MuonTrackSegmentMatchResult.h:103
Muon::TrackSegmentMatchResult::failedCut
bool failedCut(CutType cut) const
Did it fail the cut? Returns true if cut was applied and failed.
Definition: MuonTrackSegmentMatchResult.h:146
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Muon::TrackSegmentMatchResult::matchOK
bool matchOK
Definition: MuonTrackSegmentMatchResult.h:120
Muon::TrackSegmentMatchResult::haveAngleY
bool haveAngleY
Definition: MuonTrackSegmentMatchResult.h:116
Muon::TrackSegmentMatchResult::angleXTotalErr2
double angleXTotalErr2
Definition: MuonTrackSegmentMatchResult.h:99
Muon::TrackSegmentMatchResult::FieldNotOk
@ FieldNotOk
Definition: MuonTrackSegmentMatchResult.h:60
Muon::TrackSegmentMatchResult::PosXPullCut
@ PosXPullCut
Definition: MuonTrackSegmentMatchResult.h:36
Muon::TrackSegmentMatchResult::matchChiSquared
double matchChiSquared
Definition: MuonTrackSegmentMatchResult.h:101
Muon::TrackSegmentMatchResult::StereoAngleWithoutPhi
@ StereoAngleWithoutPhi
Definition: MuonTrackSegmentMatchResult.h:58
Muon::TrackSegmentMatchResult::SegmentMatch
@ SegmentMatch
Definition: MuonTrackSegmentMatchResult.h:62
Muon::TrackSegmentMatchResult::passedCutsString
std::string passedCutsString() const
String with all cuts that were applied and passed.
Definition: MuonTrackSegmentMatchResult.cxx:138
Muon::TrackSegmentMatchResult::NoMeasErrors
@ NoMeasErrors
Definition: MuonTrackSegmentMatchResult.h:66
Muon::TrackSegmentMatchResult::posYTotalErr2
double posYTotalErr2
Definition: MuonTrackSegmentMatchResult.h:92
Muon::TrackSegmentMatchResult::ExtrapolFailed
@ ExtrapolFailed
Definition: MuonTrackSegmentMatchResult.h:64
Muon::TrackSegmentMatchResult::appliedCut
bool appliedCut(CutType cut) const
Was the cut applied ?
Definition: MuonTrackSegmentMatchResult.h:149
Muon::TrackSegmentMatchCuts::angleXPullCut
double angleXPullCut
Definition: MuonTrackSegmentMatchResult.h:181
Muon::TrackSegmentMatchResult::~TrackSegmentMatchResult
virtual ~TrackSegmentMatchResult()
Definition: MuonTrackSegmentMatchResult.cxx:32
Muon::TrackSegmentMatchResult::CovarInverseFailed
@ CovarInverseFailed
Definition: MuonTrackSegmentMatchResult.h:70
Muon::TrackSegmentMatchCuts::matchChiSquaredCut
double matchChiSquaredCut
Definition: MuonTrackSegmentMatchResult.h:183
Muon::TrackSegmentMatchCuts::posXPullCut
double posXPullCut
Definition: MuonTrackSegmentMatchResult.h:177
Muon::TrackSegmentMatchCuts::TrackSegmentMatchCuts
TrackSegmentMatchCuts()
Definition: MuonTrackSegmentMatchResult.cxx:152
Muon::TrackSegmentMatchResult::angleYTotalErr2
double angleYTotalErr2
Definition: MuonTrackSegmentMatchResult.h:100
Muon::TrackSegmentMatchResult::predictionCovariance
Amg::MatrixX predictionCovariance
Definition: MuonTrackSegmentMatchResult.h:102
Muon::TrackSegmentMatchResult::posYAlignErr2
double posYAlignErr2
Definition: MuonTrackSegmentMatchResult.h:90
Muon::TrackSegmentMatchResult::segmentChamberId
Identifier segmentChamberId
Definition: MuonTrackSegmentMatchResult.h:107
Muon::TrackSegmentMatchResult::PosXCut
@ PosXCut
Definition: MuonTrackSegmentMatchResult.h:34
Muon::TrackSegmentMatchResult::NoMomentumWithMagField
@ NoMomentumWithMagField
Definition: MuonTrackSegmentMatchResult.h:63
Muon::TrackSegmentMatchResult::trackChamberId
Identifier trackChamberId
Definition: MuonTrackSegmentMatchResult.h:106
Muon::TrackSegmentMatchResult::PosYPullCut
@ PosYPullCut
Definition: MuonTrackSegmentMatchResult.h:37
Muon::TrackSegmentMatchResult::localPosYDiff
double localPosYDiff
Definition: MuonTrackSegmentMatchResult.h:82
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
Muon::TrackSegmentMatchCuts::~TrackSegmentMatchCuts
virtual ~TrackSegmentMatchCuts()
Muon::TrackSegmentMatchResult::AnglePredErrFailed
@ AnglePredErrFailed
Definition: MuonTrackSegmentMatchResult.h:69
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
Muon::TrackSegmentMatchResult::NumberOfCutTypes
@ NumberOfCutTypes
Definition: MuonTrackSegmentMatchResult.h:43
Muon::TrackSegmentMatchResult::Reason
Reason
Definition: MuonTrackSegmentMatchResult.h:49
Muon::TrackSegmentMatchResult::failedCutsString
std::string failedCutsString() const
String with all cuts that were applied and failed.
Definition: MuonTrackSegmentMatchResult.cxx:125
Muon::TrackSegmentMatchCuts::clear
virtual void clear()
Definition: MuonTrackSegmentMatchResult.cxx:156
Muon::TrackSegmentMatchResult::setCutFailed
void setCutFailed(CutType cut)
Set cut applied, but not cut passed.
Definition: MuonTrackSegmentMatchResult.h:140
Muon::TrackSegmentMatchResult::segment
const MuonSegment * segment
Definition: MuonTrackSegmentMatchResult.h:109
Muon::TrackSegmentMatchResult::AngXCut
@ AngXCut
Definition: MuonTrackSegmentMatchResult.h:38
Muon::TrackSegmentMatchCuts::posYCut
double posYCut
Definition: MuonTrackSegmentMatchResult.h:176
Muon::TrackSegmentMatchResult::havePosYError
bool havePosYError
Definition: MuonTrackSegmentMatchResult.h:114
Muon::TrackSegmentMatchCuts::cutOnAngleXPull
bool cutOnAngleXPull
Definition: MuonTrackSegmentMatchResult.h:191
Muon::TrackSegmentMatchResult::reasonString
std::string reasonString() const
Definition: MuonTrackSegmentMatchResult.cxx:150
Muon::TrackSegmentMatchResult::clear
virtual void clear()
Definition: MuonTrackSegmentMatchResult.cxx:34
Muon::TrackSegmentMatchResult
Class with matching return information.
Definition: MuonTrackSegmentMatchResult.h:29
Muon::TrackSegmentMatchResult::haveAngleXError
bool haveAngleXError
Definition: MuonTrackSegmentMatchResult.h:117
Muon::TrackSegmentMatchResult::angleXPredErr2
double angleXPredErr2
Definition: MuonTrackSegmentMatchResult.h:95
Muon::TrackSegmentMatchResult::diffVector
Amg::VectorX diffVector
Definition: MuonTrackSegmentMatchResult.h:105
Identifier
Definition: IdentifierFieldParser.cxx:14