ATLAS Offline Software
Loading...
Searching...
No Matches
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

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

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 }
l
Printing final latex table to .tex output file.

Member Function Documentation

◆ closeHits()

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

Definition at line 48 of file MatchDCWithLine.h.

◆ 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.

◆ hitsOutOfTime()

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

Definition at line 46 of file MatchDCWithLine.h.

◆ 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 }
std::pair< std::vector< unsigned int >, bool > res
@ OutsideRoad
inside road but too far to be on track
Definition DCOnTrack.h:24
void matchDC(DCOnTrack &dc, double &res, double &dline, bool forceOnTrack=false, bool forceOffTrack=false, bool usePreciseErrors=false)
const std::string selection
str index
Definition DeMoScan.py:362
DCOnTrackVec::const_iterator DCOnTrackCit
Definition DCOnTrack.h:61

◆ 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 }
DCVec::const_iterator DCCit

◆ 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;
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 }
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 }
@ OutOfTime
delta electron
Definition DCOnTrack.h:22
@ CloseDC
too large drift time
Definition DCOnTrack.h:23
@ LateHit
drift time compatible with drift spectrum
Definition DriftCircle.h:28
@ InTime
drift time too small to be compatible with drift spectrum
Definition DriftCircle.h:27
bool select(double residual, double error) const

◆ 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;
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 {
29 m_resWithLine.set(l);
30 m_deltaCut = deltaCut;
32 setTubeRadius(tubeRadius);
33 }

◆ setTubeRadius()

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

◆ 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.

65{0.};

◆ m_closeHits

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

Definition at line 75 of file MatchDCWithLine.h.

75{0};

◆ 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.

67{0.};

◆ m_deltas

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

Definition at line 69 of file MatchDCWithLine.h.

69{0};

◆ m_matchDifference

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

Definition at line 77 of file MatchDCWithLine.h.

77{0};

◆ m_ml1

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

Definition at line 73 of file MatchDCWithLine.h.

73{0};

◆ m_ml2

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

Definition at line 74 of file MatchDCWithLine.h.

74{0};

◆ m_onTracks

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

Definition at line 71 of file MatchDCWithLine.h.

71{0};

◆ m_outOfTimes

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

Definition at line 70 of file MatchDCWithLine.h.

70{0};

◆ m_passedTubes

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

Definition at line 72 of file MatchDCWithLine.h.

72{0};

◆ m_resWithLine

ResidualWithLine TrkDriftCircleMath::MatchDCWithLine::m_resWithLine {}
private

Definition at line 63 of file MatchDCWithLine.h.

63{};

◆ m_showerCut

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

Definition at line 66 of file MatchDCWithLine.h.

66{0.};

◆ m_showerHits

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

Definition at line 76 of file MatchDCWithLine.h.

76{0};

◆ m_strategy

MatchStrategy TrkDriftCircleMath::MatchDCWithLine::m_strategy {}
private

Definition at line 68 of file MatchDCWithLine.h.

68{};

◆ m_tubeRadius

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

Definition at line 64 of file MatchDCWithLine.h.

64{0.};

The documentation for this class was generated from the following files: