ATLAS Offline Software
MatchDCWithLine.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DCMATH_MATCHDCWITHLINE_H
6 #define DCMATH_MATCHDCWITHLINE_H
7 
13 
14 namespace TrkDriftCircleMath {
15 
17  public:
18  enum MatchStrategy { Road, Pull };
19 
20  public:
21  MatchDCWithLine() = default;
22  MatchDCWithLine(const Line& l, double deltaCut, MatchStrategy strategy, double tubeRadius) :
24  m_dcOnTrackVec.reserve(50);
25  setTubeRadius(tubeRadius);
26  }
27 
28  void set(const Line& l, double deltaCut, MatchStrategy strategy, double tubeRadius) {
30  m_deltaCut = deltaCut;
32  setTubeRadius(tubeRadius);
33  }
34 
35  void setTubeRadius(double radius) {
37  m_closeByCut = 2 * radius;
38  m_showerCut = 4 * radius;
39  }
40 
41  const DCOnTrackVec& match(const DCVec& dcs);
42  const DCOnTrackVec& match(const DCOnTrackVec& dcs, const HitSelection* selection = nullptr, bool recoverMdtHits = true,
43  bool usePreciseErrors = false);
44 
45  unsigned int deltas() const { return m_deltas; }
46  unsigned int hitsOutOfTime() const { return m_outOfTimes; }
47  unsigned int hitsOnTrack() const { return m_onTracks; }
48  unsigned int closeHits() const { return m_closeHits; }
49  unsigned int showerHits() const { return m_showerHits; }
50  unsigned int passedTubes() const { return m_passedTubes; }
51  unsigned int hitsMl1() const { return m_ml1; }
52  unsigned int hitsMl2() const { return m_ml2; }
53 
55  unsigned int matchDifference() const { return m_matchDifference; }
56 
57  private:
58  void reset();
59  void matchDC(DCOnTrack& dc, double& res, double& dline, bool forceOnTrack = false, bool forceOffTrack = false,
60  bool usePreciseErrors = false);
61  bool select(double residual, double error) const;
62 
64  double m_tubeRadius{0.};
65  double m_closeByCut{0.};
66  double m_showerCut{0.};
67  double m_deltaCut{0.};
69  unsigned int m_deltas{0};
70  unsigned int m_outOfTimes{0};
71  unsigned int m_onTracks{0};
72  unsigned int m_passedTubes{0};
73  unsigned int m_ml1{0};
74  unsigned int m_ml2{0};
75  unsigned int m_closeHits{0};
76  unsigned int m_showerHits{0};
77  unsigned int m_matchDifference{0};
78 
79  // cache results to reduce CPU usage
81  };
82 
83 } // namespace TrkDriftCircleMath
84 
85 #endif
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
TrkDriftCircleMath::MatchDCWithLine::match
const DCOnTrackVec & match(const DCVec &dcs)
Definition: MatchDCWithLine.cxx:9
TrkDriftCircleMath::MatchDCWithLine::m_dcOnTrackVec
DCOnTrackVec m_dcOnTrackVec
Definition: MatchDCWithLine.h:80
TrkDriftCircleMath::MatchDCWithLine::m_ml1
unsigned int m_ml1
Definition: MatchDCWithLine.h:73
TrkDriftCircleMath::MatchDCWithLine::set
void set(const Line &l, double deltaCut, MatchStrategy strategy, double tubeRadius)
Definition: MatchDCWithLine.h:28
ResidualWithLine.h
TrkDriftCircleMath::MatchDCWithLine::matchDC
void matchDC(DCOnTrack &dc, double &res, double &dline, bool forceOnTrack=false, bool forceOffTrack=false, bool usePreciseErrors=false)
Definition: MatchDCWithLine.cxx:84
TrkDriftCircleMath::ResidualWithLine
Definition: ResidualWithLine.h:16
TrkDriftCircleMath::DCOnTrackVec
std::vector< DCOnTrack > DCOnTrackVec
Definition: DCOnTrack.h:59
TrkDriftCircleMath::MatchDCWithLine::m_ml2
unsigned int m_ml2
Definition: MatchDCWithLine.h:74
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
TrkDriftCircleMath::MatchDCWithLine::m_tubeRadius
double m_tubeRadius
Definition: MatchDCWithLine.h:64
TrkDriftCircleMath::HitSelection
std::vector< bool > HitSelection
Definition: HitSelection.h:9
TrkDriftCircleMath::MatchDCWithLine::Pull
@ Pull
Definition: MatchDCWithLine.h:18
TrkDriftCircleMath::MatchDCWithLine::m_deltaCut
double m_deltaCut
Definition: MatchDCWithLine.h:67
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition: IMdtSegmentFinder.h:13
TrkDriftCircleMath::MatchDCWithLine::m_passedTubes
unsigned int m_passedTubes
Definition: MatchDCWithLine.h:72
TrkDriftCircleMath::MatchDCWithLine::showerHits
unsigned int showerHits() const
Definition: MatchDCWithLine.h:49
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
DriftCircle.h
TrkDriftCircleMath::MatchDCWithLine::matchDifference
unsigned int matchDifference() const
returns the number of DCOnTrack that have a different status after the match, returns 0 if used with ...
Definition: MatchDCWithLine.h:55
TrkDriftCircleMath::MatchDCWithLine::m_deltas
unsigned int m_deltas
Definition: MatchDCWithLine.h:69
TrkDriftCircleMath::MatchDCWithLine::hitsOnTrack
unsigned int hitsOnTrack() const
Definition: MatchDCWithLine.h:47
TrkDriftCircleMath::MatchDCWithLine::reset
void reset()
Definition: MatchDCWithLine.cxx:127
TrkDriftCircleMath::MatchDCWithLine::m_matchDifference
unsigned int m_matchDifference
Definition: MatchDCWithLine.h:77
TrkDriftCircleMath::DCVec
std::vector< DriftCircle > DCVec
Definition: DriftCircle.h:117
TrkDriftCircleMath::Line
Definition: Line.h:17
TrkDriftCircleMath::MatchDCWithLine::m_strategy
MatchStrategy m_strategy
Definition: MatchDCWithLine.h:68
Line.h
TrkDriftCircleMath::MatchDCWithLine::passedTubes
unsigned int passedTubes() const
Definition: MatchDCWithLine.h:50
TrkDriftCircleMath::MatchDCWithLine::m_showerHits
unsigned int m_showerHits
Definition: MatchDCWithLine.h:76
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
TrkDriftCircleMath::MatchDCWithLine::deltas
unsigned int deltas() const
Definition: MatchDCWithLine.h:45
TrkDriftCircleMath::MatchDCWithLine
Definition: MatchDCWithLine.h:16
TrkDriftCircleMath::MatchDCWithLine::m_outOfTimes
unsigned int m_outOfTimes
Definition: MatchDCWithLine.h:70
TrkDriftCircleMath::MatchDCWithLine::closeHits
unsigned int closeHits() const
Definition: MatchDCWithLine.h:48
DCOnTrack.h
TrkDriftCircleMath::MatchDCWithLine::m_closeHits
unsigned int m_closeHits
Definition: MatchDCWithLine.h:75
selection
const std::string selection
Definition: fbtTestBasics.cxx:74
TrkDriftCircleMath::MatchDCWithLine::hitsMl2
unsigned int hitsMl2() const
Definition: MatchDCWithLine.h:52
TrkDriftCircleMath::MatchDCWithLine::select
bool select(double residual, double error) const
Definition: MatchDCWithLine.cxx:118
HitSelection.h
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
TrkDriftCircleMath::MatchDCWithLine::Road
@ Road
Definition: MatchDCWithLine.h:18
TrkDriftCircleMath::MatchDCWithLine::m_showerCut
double m_showerCut
Definition: MatchDCWithLine.h:66
TrkDriftCircleMath::MatchDCWithLine::MatchStrategy
MatchStrategy
Definition: MatchDCWithLine.h:18
TrkDriftCircleMath::DCOnTrack
class representing a drift circle meaurement on segment
Definition: DCOnTrack.h:16
TrkDriftCircleMath::MatchDCWithLine::m_resWithLine
ResidualWithLine m_resWithLine
Definition: MatchDCWithLine.h:63
TrkDriftCircleMath::MatchDCWithLine::hitsOutOfTime
unsigned int hitsOutOfTime() const
Definition: MatchDCWithLine.h:46
TrkDriftCircleMath::MatchDCWithLine::m_closeByCut
double m_closeByCut
Definition: MatchDCWithLine.h:65
TrkDriftCircleMath::MatchDCWithLine::MatchDCWithLine
MatchDCWithLine(const Line &l, double deltaCut, MatchStrategy strategy, double tubeRadius)
Definition: MatchDCWithLine.h:22
TrkDriftCircleMath::MatchDCWithLine::MatchDCWithLine
MatchDCWithLine()=default
error
Definition: IImpactPoint3dEstimator.h:70
TrkDriftCircleMath::ResidualWithLine::set
void set(const Line &line)
Definition: ResidualWithLine.h:34
TrkDriftCircleMath::MatchDCWithLine::hitsMl1
unsigned int hitsMl1() const
Definition: MatchDCWithLine.h:51
TrkDriftCircleMath::MatchDCWithLine::setTubeRadius
void setTubeRadius(double radius)
Definition: MatchDCWithLine.h:35
TrkDriftCircleMath::MatchDCWithLine::m_onTracks
unsigned int m_onTracks
Definition: MatchDCWithLine.h:71