ATLAS Offline Software
MuonMatchQuality.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // get quality of combined track match
8 
9 #ifndef MUIDTRACKBUILDER_MUONMATCHQUALITY_H
10 #define MUIDTRACKBUILDER_MUONMATCHQUALITY_H
11 
13 #include "AthenaKernel/Units.h"
14 #include "GaudiKernel/ToolHandle.h"
18 
19 namespace Units = Athena::Units;
20 
21 namespace Rec {
22 
23  class MuonMatchQuality : public AthAlgTool, virtual public IMuonMatchQuality {
24  public:
25  MuonMatchQuality(const std::string& type, const std::string& name, const IInterface* parent);
26  virtual ~MuonMatchQuality() = default; // destructor
27 
28  StatusCode initialize() override;
29 
34  double innerMatchChi2(const Trk::Track& track1, const Trk::Track& track2, const EventContext& ctx) const override;
35 
38  int innerMatchDOF(const Trk::Track& track1, const Trk::Track& track2) const override;
39 
42  double innerMatchProbability(const Trk::Track& track1, const Trk::Track& track2, const EventContext& ctx) const override;
43 
46  std::pair<int, std::pair<double, double> > innerMatchAll(const Trk::Track& track1, const Trk::Track& track2,
47  const EventContext& ctx) const override;
48 
52  double outerMatchChi2(const Trk::Track& track1, const Trk::Track& track2, const EventContext& ctx) const override;
53 
56  virtual int outerMatchDOF(const Trk::Track& track1, const Trk::Track& track2) const override;
57 
60  double outerMatchProbability(const Trk::Track& track1, const Trk::Track& track2, const EventContext& ctx) const override;
61 
64  virtual bool shareOrigin(const Trk::Track& track1, const Trk::Track& track2) const override;
65 
68  double simpleChi2(const Trk::Track& track1, const Trk::Track& track2, const EventContext& ctx) const override;
69 
70  private:
71  // cache
72  struct CacheAll {
73  double innerMatchChi2{FLT_MAX};
74  int innerMatchDOF{0};
76  double simpleChi2{FLT_MAX};
77  };
78 
79  CacheAll setCache(const Trk::Track& track1, const Trk::Track& track2, const EventContext& ctx) const;
80 
81  // helpers, managers, tools
82  ToolHandle<MuonCombined::IMuonTrackTagTool> m_tagTool{
83  this,
84  "TagTool",
85  "",
86  "Track tag tool",
87  };
88 
89  ToolHandle<IMuonTrackQuery> m_trackQuery{
90  this,
91  "TrackQuery",
92  "Rec::MuonTrackQuery/MuonTrackQuery",
93  "Track query tool",
94  };
95 
96  // estimate of ID/MS alignment uncertainties
97  std::unique_ptr<AmgSymMatrix(5)> m_alignmentUncertainty;
98  Gaudi::Property<double> m_directionUncertainty{
99  this,
100  "ID_MS_DirectionUncertainty",
101  0.000001,
102  }; // not used anymore angle ID and MS: done by m_addIDMSerrors
103 
104  Gaudi::Property<double> m_positionUncertainty{
105  this,
106  "ID_MS_PositionUncertainty",
107  0.01 * Units::mm,
108  }; // not used anymore shift ID and MS: done by m_addIDMSerrors
109 
110  }; // end of class MuonMatchQuality
111 
112 } // end of namespace Rec
113 
114 #endif // MUIDTRACKBUILDER_MUONMATCHQUALITY_H
Rec::MuonMatchQuality::innerMatchDOF
int innerMatchDOF(const Trk::Track &track1, const Trk::Track &track2) const override
IMuonMatchQuality interface: degrees of freedom for chi2 match at IP.
Definition: MuonMatchQuality.cxx:51
Rec::MuonMatchQuality::initialize
StatusCode initialize() override
Definition: MuonMatchQuality.cxx:25
Rec::MuonMatchQuality::MuonMatchQuality
MuonMatchQuality(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MuonMatchQuality.cxx:20
IMuonTrackQuery.h
Rec::MuonMatchQuality
Definition: MuonMatchQuality.h:23
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Rec::MuonMatchQuality::CacheAll::innerMatchDOF
int innerMatchDOF
Definition: MuonMatchQuality.h:74
Rec::MuonMatchQuality::~MuonMatchQuality
virtual ~MuonMatchQuality()=default
Rec::MuonMatchQuality::m_positionUncertainty
Gaudi::Property< double > m_positionUncertainty
Definition: MuonMatchQuality.h:104
Rec::MuonMatchQuality::innerMatchProbability
double innerMatchProbability(const Trk::Track &track1, const Trk::Track &track2, const EventContext &ctx) const override
IMuonMatchQuality interface: match probability for chi2 match at IP.
Definition: MuonMatchQuality.cxx:67
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
Rec::MuonMatchQuality::setCache
CacheAll setCache(const Trk::Track &track1, const Trk::Track &track2, const EventContext &ctx) const
Definition: MuonMatchQuality.cxx:119
Rec::MuonMatchQuality::outerMatchChi2
double outerMatchChi2(const Trk::Track &track1, const Trk::Track &track2, const EventContext &ctx) const override
IMuonMatchQuality interface: match chiSquared between two tracks expressed at first muon spectrometer...
Definition: MuonMatchQuality.cxx:81
Rec::MuonMatchQuality::m_tagTool
ToolHandle< MuonCombined::IMuonTrackTagTool > m_tagTool
Definition: MuonMatchQuality.h:82
Rec::MuonMatchQuality::CacheAll::simpleChi2
double simpleChi2
Definition: MuonMatchQuality.h:76
Rec
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Definition: FakeTrackBuilder.h:10
Rec::MuonMatchQuality::outerMatchDOF
virtual int outerMatchDOF(const Trk::Track &track1, const Trk::Track &track2) const override
IMuonMatchQuality interface: degrees of freedom for chi2 match at first MS hit.
Definition: MuonMatchQuality.cxx:91
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Rec::MuonMatchQuality::shareOrigin
virtual bool shareOrigin(const Trk::Track &track1, const Trk::Track &track2) const override
IMuonMatchQuality interface: check the track perigee parameters are expressed at the same surface.
Definition: MuonMatchQuality.cxx:107
Rec::MuonMatchQuality::m_alignmentUncertainty
std::unique_ptr< AmgSymMatrix(5)> m_alignmentUncertainty
Definition: MuonMatchQuality.h:97
Rec::MuonMatchQuality::CacheAll::innerMatchChi2
double innerMatchChi2
Definition: MuonMatchQuality.h:73
Athena::Units
Definition: Units.h:45
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Rec::MuonMatchQuality::m_trackQuery
ToolHandle< IMuonTrackQuery > m_trackQuery
Definition: MuonMatchQuality.h:89
IMuonTrackTagTool.h
Units.h
Wrapper to avoid constant divisions when using units.
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
Rec::MuonMatchQuality::CacheAll
Definition: MuonMatchQuality.h:72
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Rec::MuonMatchQuality::outerMatchProbability
double outerMatchProbability(const Trk::Track &track1, const Trk::Track &track2, const EventContext &ctx) const override
IMuonMatchQuality interface: match probability for chi2 match at first MS hit.
Definition: MuonMatchQuality.cxx:92
Rec::MuonMatchQuality::innerMatchChi2
double innerMatchChi2(const Trk::Track &track1, const Trk::Track &track2, const EventContext &ctx) const override
IMuonMatchQuality interface: match chiSquared between two tracks expressed at same inner (IP) surface...
Definition: MuonMatchQuality.cxx:45
AthAlgTool
Definition: AthAlgTool.h:26
IMuonMatchQuality.h
Rec::IMuonMatchQuality
Definition: IMuonMatchQuality.h:23
Rec::MuonMatchQuality::simpleChi2
double simpleChi2(const Trk::Track &track1, const Trk::Track &track2, const EventContext &ctx) const override
IMuonMatchQuality interface: as inner match chiSquared but simplified to just use diagonal errors.
Definition: MuonMatchQuality.cxx:113
Rec::MuonMatchQuality::m_directionUncertainty
Gaudi::Property< double > m_directionUncertainty
Definition: MuonMatchQuality.h:98
Rec::MuonMatchQuality::CacheAll::innerMatchProbability
double innerMatchProbability
Definition: MuonMatchQuality.h:75
Rec::MuonMatchQuality::innerMatchAll
std::pair< int, std::pair< double, double > > innerMatchAll(const Trk::Track &track1, const Trk::Track &track2, const EventContext &ctx) const override
IMuonMatchQuality interface: degrees of freedom, chi2, probability for chi2 match at IP.
Definition: MuonMatchQuality.cxx:72