ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrkDriftCircleMath::MatchDCWithLine Class Reference

#include <MatchDCWithLine.h>

Collaboration diagram for TrkDriftCircleMath::MatchDCWithLine:

Public Types

enum  MatchStrategy { Road, Pull }
 

Public Member Functions

 MatchDCWithLine ()=default
 
 MatchDCWithLine (const Line &l, double deltaCut, MatchStrategy strategy, double tubeRadius)
 
void set (const Line &l, double deltaCut, MatchStrategy strategy, double tubeRadius)
 
void setTubeRadius (double radius)
 
const DCOnTrackVecmatch (const DCVec &dcs)
 
const DCOnTrackVecmatch (const DCOnTrackVec &dcs, const HitSelection *selection=nullptr, bool recoverMdtHits=true, bool usePreciseErrors=false)
 
unsigned int deltas () const
 
unsigned int hitsOutOfTime () const
 
unsigned int hitsOnTrack () const
 
unsigned int closeHits () const
 
unsigned int showerHits () const
 
unsigned int passedTubes () const
 
unsigned int hitsMl1 () const
 
unsigned int hitsMl2 () const
 
unsigned int matchDifference () const
 returns the number of DCOnTrack that have a different status after the match, returns 0 if used with DCVec More...
 

Private Member Functions

void reset ()
 
void matchDC (DCOnTrack &dc, double &res, double &dline, bool forceOnTrack=false, bool forceOffTrack=false, bool usePreciseErrors=false)
 
bool select (double residual, double error) const
 

Private Attributes

ResidualWithLine m_resWithLine {}
 
double m_tubeRadius {0.}
 
double m_closeByCut {0.}
 
double m_showerCut {0.}
 
double m_deltaCut {0.}
 
MatchStrategy m_strategy {}
 
unsigned int m_deltas {0}
 
unsigned int m_outOfTimes {0}
 
unsigned int m_onTracks {0}
 
unsigned int m_passedTubes {0}
 
unsigned int m_ml1 {0}
 
unsigned int m_ml2 {0}
 
unsigned int m_closeHits {0}
 
unsigned int m_showerHits {0}
 
unsigned int m_matchDifference {0}
 
DCOnTrackVec m_dcOnTrackVec
 

Detailed Description

Definition at line 16 of file MatchDCWithLine.h.

Member Enumeration Documentation

◆ MatchStrategy

Enumerator
Road 
Pull 

Definition at line 18 of file MatchDCWithLine.h.

18 { Road, Pull };

Constructor & Destructor Documentation

◆ MatchDCWithLine() [1/2]

TrkDriftCircleMath::MatchDCWithLine::MatchDCWithLine ( )
default

◆ MatchDCWithLine() [2/2]

TrkDriftCircleMath::MatchDCWithLine::MatchDCWithLine ( const Line l,
double  deltaCut,
MatchStrategy  strategy,
double  tubeRadius 
)
inline

Definition at line 22 of file MatchDCWithLine.h.

22  :
24  m_dcOnTrackVec.reserve(50);
25  setTubeRadius(tubeRadius);
26  }

Member Function Documentation

◆ closeHits()

unsigned int TrkDriftCircleMath::MatchDCWithLine::closeHits ( ) const
inline

Definition at line 48 of file MatchDCWithLine.h.

48 { return m_closeHits; }

◆ deltas()

unsigned int TrkDriftCircleMath::MatchDCWithLine::deltas ( ) const
inline

Definition at line 45 of file MatchDCWithLine.h.

45 { return m_deltas; }

◆ hitsMl1()

unsigned int TrkDriftCircleMath::MatchDCWithLine::hitsMl1 ( ) const
inline

Definition at line 51 of file MatchDCWithLine.h.

51 { return m_ml1; }

◆ hitsMl2()

unsigned int TrkDriftCircleMath::MatchDCWithLine::hitsMl2 ( ) const
inline

Definition at line 52 of file MatchDCWithLine.h.

52 { return m_ml2; }

◆ hitsOnTrack()

unsigned int TrkDriftCircleMath::MatchDCWithLine::hitsOnTrack ( ) const
inline

Definition at line 47 of file MatchDCWithLine.h.

47 { return m_onTracks; }

◆ hitsOutOfTime()

unsigned int TrkDriftCircleMath::MatchDCWithLine::hitsOutOfTime ( ) const
inline

Definition at line 46 of file MatchDCWithLine.h.

46 { return m_outOfTimes; }

◆ match() [1/2]

const DCOnTrackVec & TrkDriftCircleMath::MatchDCWithLine::match ( const DCOnTrackVec dcs,
const HitSelection selection = nullptr,
bool  recoverMdtHits = true,
bool  usePreciseErrors = false 
)

Definition at line 45 of file MatchDCWithLine.cxx.

46  {
47  // clear cached information
48  reset();
49 
50  DCOnTrackCit it = dcs.begin();
51  DCOnTrackCit it_end = dcs.end();
52  unsigned int index = 0;
53  for (; it != it_end; ++it, ++index) {
54  double dline = m_resWithLine.residual(it->position());
55  double rhit = it->r() < 0. ? -it->r() : it->r();
56  if (dline < 0.) dline *= -1.;
57 
58  double res = dline - rhit;
59 
60  DCOnTrack dcOnTrack(*it, res);
61  dcOnTrack.errorTrack(it->errorTrack());
62 
63  // check whether any DCOnTracks change state from or to OnTrack with respect to the old selection
64  if ((dcOnTrack.state() == DCOnTrack::OnTrack || it->state() == DCOnTrack::OnTrack) && dcOnTrack.state() != it->state())
66 
67  if (selection) {
68  if ((*selection)[index] == 0) {
69  matchDC(dcOnTrack, res, dline, true, false, usePrecise);
70  } else if (recoverMdtHits) {
71  matchDC(dcOnTrack, res, dline, false, false, usePrecise);
72  } else {
73  matchDC(dcOnTrack, res, dline, false, true, usePrecise);
74  }
75  } else {
76  matchDC(dcOnTrack, res, dline, false, false, usePrecise);
77  }
78 
79  if (dcOnTrack.state() != DCOnTrack::OutsideRoad) m_dcOnTrackVec.push_back(dcOnTrack);
80  }
81  return m_dcOnTrackVec;
82  }

◆ match() [2/2]

const DCOnTrackVec & TrkDriftCircleMath::MatchDCWithLine::match ( const DCVec dcs)

add check to remove hits in the same tube check whether

  • this is not the first tube
  • the tubes have the same id

Definition at line 9 of file MatchDCWithLine.cxx.

9  {
10  // clear cached information
11  reset();
12  DCCit it = dcs.begin();
13  DCCit it_end = dcs.end();
14  for (; it != it_end; ++it) {
15  double dline = m_resWithLine.residual(it->position());
16  double rhit = it->r() < 0. ? -it->r() : it->r();
17  if (dline < 0.) dline *= -1.;
18 
19  double res = dline - rhit;
20 
21  DCOnTrack dcOnTrack(*it, res);
22 
23  matchDC(dcOnTrack, res, dline);
24 
25  if (dcOnTrack.state() != DCOnTrack::OutsideRoad) {
30  if (!m_dcOnTrackVec.empty() && m_dcOnTrackVec.back().id() == it->id()) {
31  // take the hit with the smallest residual
32  if (fabs(m_dcOnTrackVec.back().residual()) > fabs(res)) {
33  // exchange the two hits
34  m_dcOnTrackVec.pop_back();
35  m_dcOnTrackVec.push_back(dcOnTrack);
36  }
37  } else {
38  m_dcOnTrackVec.push_back(dcOnTrack);
39  }
40  }
41  }
42  return m_dcOnTrackVec;
43  }

◆ matchDC()

void TrkDriftCircleMath::MatchDCWithLine::matchDC ( DCOnTrack dc,
double &  res,
double &  dline,
bool  forceOnTrack = false,
bool  forceOffTrack = false,
bool  usePreciseErrors = false 
)
private

Definition at line 84 of file MatchDCWithLine.cxx.

85  {
86  // check whether hit within range
87  double error = usePrecise ? dcOnTrack.drPrecise() : dcOnTrack.dr();
88  if (forceOnTrack || (!forceOffTrack && (dcOnTrack.driftState() == DriftCircle::InTime && select(res, error)))) {
89  ++m_onTracks;
90  ++m_passedTubes;
91  if (dcOnTrack.id().ml() == 0)
92  ++m_ml1;
93  else
94  ++m_ml2;
95  dcOnTrack.state(DCOnTrack::OnTrack);
96  } else {
97  if (dline < m_tubeRadius) {
98  if (res < 0. || dcOnTrack.driftState() == DriftCircle::LateHit) {
99  dcOnTrack.state(DCOnTrack::OutOfTime);
100  ++m_outOfTimes;
101  } else {
102  dcOnTrack.state(DCOnTrack::Delta);
103  ++m_deltas;
104  }
105  ++m_passedTubes;
106  } else {
107  if (dline < m_closeByCut) {
108  dcOnTrack.state(DCOnTrack::CloseDC);
109  ++m_closeHits;
110  } else {
111  dcOnTrack.state(DCOnTrack::OutsideRoad);
112  }
113  if (dline < m_showerCut) { ++m_showerHits; }
114  }
115  }
116  }

◆ matchDifference()

unsigned int TrkDriftCircleMath::MatchDCWithLine::matchDifference ( ) const
inline

returns the number of DCOnTrack that have a different status after the match, returns 0 if used with DCVec

Definition at line 55 of file MatchDCWithLine.h.

55 { return m_matchDifference; }

◆ passedTubes()

unsigned int TrkDriftCircleMath::MatchDCWithLine::passedTubes ( ) const
inline

Definition at line 50 of file MatchDCWithLine.h.

50 { return m_passedTubes; }

◆ reset()

void TrkDriftCircleMath::MatchDCWithLine::reset ( )
private

Definition at line 127 of file MatchDCWithLine.cxx.

127  {
128  // clear cache
129  m_dcOnTrackVec.clear();
130 
131  m_outOfTimes = 0;
132  m_deltas = 0;
133  m_onTracks = 0;
134  m_passedTubes = 0;
135  m_ml1 = 0;
136  m_ml2 = 0;
137  m_closeHits = 0;
138  m_showerHits = 0;
139  m_matchDifference = 0;
140  }

◆ select()

bool TrkDriftCircleMath::MatchDCWithLine::select ( double  residual,
double  error 
) const
private

Definition at line 118 of file MatchDCWithLine.cxx.

118  {
119  if (residual < 0.) residual *= -1.;
120  switch (m_strategy) {
121  case Road: return residual < m_deltaCut;
122  case Pull: return residual < m_deltaCut * error;
123  default: return false;
124  }
125  }

◆ set()

void TrkDriftCircleMath::MatchDCWithLine::set ( const Line l,
double  deltaCut,
MatchStrategy  strategy,
double  tubeRadius 
)
inline

Definition at line 28 of file MatchDCWithLine.h.

28  {
30  m_deltaCut = deltaCut;
32  setTubeRadius(tubeRadius);
33  }

◆ setTubeRadius()

void TrkDriftCircleMath::MatchDCWithLine::setTubeRadius ( double  radius)
inline

Definition at line 35 of file MatchDCWithLine.h.

35  {
37  m_closeByCut = 2 * radius;
38  m_showerCut = 4 * radius;
39  }

◆ showerHits()

unsigned int TrkDriftCircleMath::MatchDCWithLine::showerHits ( ) const
inline

Definition at line 49 of file MatchDCWithLine.h.

49 { return m_showerHits; }

Member Data Documentation

◆ m_closeByCut

double TrkDriftCircleMath::MatchDCWithLine::m_closeByCut {0.}
private

Definition at line 65 of file MatchDCWithLine.h.

◆ m_closeHits

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_closeHits {0}
private

Definition at line 75 of file MatchDCWithLine.h.

◆ m_dcOnTrackVec

DCOnTrackVec TrkDriftCircleMath::MatchDCWithLine::m_dcOnTrackVec
private

Definition at line 80 of file MatchDCWithLine.h.

◆ m_deltaCut

double TrkDriftCircleMath::MatchDCWithLine::m_deltaCut {0.}
private

Definition at line 67 of file MatchDCWithLine.h.

◆ m_deltas

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_deltas {0}
private

Definition at line 69 of file MatchDCWithLine.h.

◆ m_matchDifference

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_matchDifference {0}
private

Definition at line 77 of file MatchDCWithLine.h.

◆ m_ml1

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_ml1 {0}
private

Definition at line 73 of file MatchDCWithLine.h.

◆ m_ml2

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_ml2 {0}
private

Definition at line 74 of file MatchDCWithLine.h.

◆ m_onTracks

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_onTracks {0}
private

Definition at line 71 of file MatchDCWithLine.h.

◆ m_outOfTimes

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_outOfTimes {0}
private

Definition at line 70 of file MatchDCWithLine.h.

◆ m_passedTubes

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_passedTubes {0}
private

Definition at line 72 of file MatchDCWithLine.h.

◆ m_resWithLine

ResidualWithLine TrkDriftCircleMath::MatchDCWithLine::m_resWithLine {}
private

Definition at line 63 of file MatchDCWithLine.h.

◆ m_showerCut

double TrkDriftCircleMath::MatchDCWithLine::m_showerCut {0.}
private

Definition at line 66 of file MatchDCWithLine.h.

◆ m_showerHits

unsigned int TrkDriftCircleMath::MatchDCWithLine::m_showerHits {0}
private

Definition at line 76 of file MatchDCWithLine.h.

◆ m_strategy

MatchStrategy TrkDriftCircleMath::MatchDCWithLine::m_strategy {}
private

Definition at line 68 of file MatchDCWithLine.h.

◆ m_tubeRadius

double TrkDriftCircleMath::MatchDCWithLine::m_tubeRadius {0.}
private

Definition at line 64 of file MatchDCWithLine.h.


The documentation for this class was generated from the following files:
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
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::matchDC
void matchDC(DCOnTrack &dc, double &res, double &dline, bool forceOnTrack=false, bool forceOffTrack=false, bool usePreciseErrors=false)
Definition: MatchDCWithLine.cxx:84
TrkDriftCircleMath::DriftCircle::LateHit
@ LateHit
drift time compatible with drift spectrum
Definition: DriftCircle.h:28
TrkDriftCircleMath::MatchDCWithLine::m_ml2
unsigned int m_ml2
Definition: MatchDCWithLine.h:74
TrkDriftCircleMath::DCOnTrack::Delta
@ Delta
used in fit
Definition: DCOnTrack.h:21
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
index
Definition: index.py:1
TrkDriftCircleMath::MatchDCWithLine::m_tubeRadius
double m_tubeRadius
Definition: MatchDCWithLine.h:64
TrkDriftCircleMath::MatchDCWithLine::Pull
@ Pull
Definition: MatchDCWithLine.h:18
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrkDriftCircleMath::MatchDCWithLine::m_deltaCut
double m_deltaCut
Definition: MatchDCWithLine.h:67
TrkDriftCircleMath::ResidualWithLine::residual
double residual(const LocVec2D &pos) const
Definition: ResidualWithLine.h:21
TrkDriftCircleMath::MatchDCWithLine::m_passedTubes
unsigned int m_passedTubes
Definition: MatchDCWithLine.h:72
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
TrkDriftCircleMath::DCOnTrack::OutOfTime
@ OutOfTime
delta electron
Definition: DCOnTrack.h:22
TrkDriftCircleMath::MatchDCWithLine::m_deltas
unsigned int m_deltas
Definition: MatchDCWithLine.h:69
TrkDriftCircleMath::MatchDCWithLine::reset
void reset()
Definition: MatchDCWithLine.cxx:127
TrkDriftCircleMath::MatchDCWithLine::m_matchDifference
unsigned int m_matchDifference
Definition: MatchDCWithLine.h:77
TrkDriftCircleMath::MatchDCWithLine::m_strategy
MatchStrategy m_strategy
Definition: MatchDCWithLine.h:68
TrkDriftCircleMath::MatchDCWithLine::m_showerHits
unsigned int m_showerHits
Definition: MatchDCWithLine.h:76
TrkDriftCircleMath::DCOnTrack::OutsideRoad
@ OutsideRoad
inside road but too far to be on track
Definition: DCOnTrack.h:24
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
TrkDriftCircleMath::DCOnTrackCit
DCOnTrackVec::const_iterator DCOnTrackCit
Definition: DCOnTrack.h:61
TrkDriftCircleMath::MatchDCWithLine::m_outOfTimes
unsigned int m_outOfTimes
Definition: MatchDCWithLine.h:70
TrkDriftCircleMath::DCOnTrack::OnTrack
@ OnTrack
Definition: DCOnTrack.h:20
TrkDriftCircleMath::MatchDCWithLine::m_closeHits
unsigned int m_closeHits
Definition: MatchDCWithLine.h:75
selection
const std::string selection
Definition: fbtTestBasics.cxx:74
TrkDriftCircleMath::DCCit
DCVec::const_iterator DCCit
Definition: DriftCircle.h:119
TrkDriftCircleMath::MatchDCWithLine::select
bool select(double residual, double error) const
Definition: MatchDCWithLine.cxx:118
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
DeMoScan.index
string index
Definition: DeMoScan.py:364
TrkDriftCircleMath::MatchDCWithLine::m_resWithLine
ResidualWithLine m_resWithLine
Definition: MatchDCWithLine.h:63
TrkDriftCircleMath::MatchDCWithLine::m_closeByCut
double m_closeByCut
Definition: MatchDCWithLine.h:65
get_generator_info.error
error
Definition: get_generator_info.py:40
error
Definition: IImpactPoint3dEstimator.h:70
TrkDriftCircleMath::ResidualWithLine::set
void set(const Line &line)
Definition: ResidualWithLine.h:34
TrkDriftCircleMath::MatchDCWithLine::setTubeRadius
void setTubeRadius(double radius)
Definition: MatchDCWithLine.h:35
TrkDriftCircleMath::DCOnTrack::CloseDC
@ CloseDC
too large drift time
Definition: DCOnTrack.h:23
TrkDriftCircleMath::DriftCircle::InTime
@ InTime
drift time too small to be compatible with drift spectrum
Definition: DriftCircle.h:27
TrkDriftCircleMath::MatchDCWithLine::m_onTracks
unsigned int m_onTracks
Definition: MatchDCWithLine.h:71