ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkUtilityPackages
TrkDriftCircleMath
TrkDriftCircleMath
MatchCrossedTubes.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_MATCHCROSSEDTUBES_H
6
#define DCMATH_MATCHCROSSEDTUBES_H
7
8
#include "
TrkDriftCircleMath/DCOnTrack.h
"
9
#include "
TrkDriftCircleMath/DriftCircle.h
"
10
#include "
TrkDriftCircleMath/SortDcsByY.h
"
11
12
namespace
TrkDriftCircleMath
{
14
15
typedef
std::pair<DCOnTrackVec, DCVec>
MatchResult
;
16
17
struct
MatchCrossedTubes
{
18
MatchCrossedTubes
(
bool
onlyOnTrack =
false
) :
m_mode
(onlyOnTrack) {}
19
20
const
MatchResult
operator()
(
const
DCOnTrackVec
& hits,
const
DCVec
& crossedTubes)
const
{
21
MatchResult
result;
22
result.first.reserve(50);
23
result.second.reserve(50);
24
25
DCOnTrackCit
sit1 = hits.begin();
26
DCOnTrackCit
sit1_end = hits.end();
27
DCCit
sit2 = crossedTubes.begin();
28
DCCit
sit2_end = crossedTubes.end();
29
30
SortDcsByY
compDC;
31
SameTube
sameTube;
32
33
result.first.clear();
34
result.second.clear();
35
36
while
(sit1 != sit1_end && sit2 != sit2_end) {
37
if
(sit1->state() ==
DCOnTrack::CloseDC
) {
38
++sit1;
39
continue
;
40
}
41
42
if
(
m_mode
) {
43
// only use hits on track
44
if
(sit1->state() !=
DCOnTrack::OnTrack
) {
45
++sit1;
46
continue
;
47
}
48
}
49
50
if
(sameTube(*sit1, *sit2)) {
51
++sit1;
52
++sit2;
53
continue
;
54
}
55
56
// dc1 < dc2
57
if
(compDC(*sit1, *sit2)) {
58
result.first.push_back(*sit1);
59
++sit1;
60
// dc1 >= dc2
61
}
else
{
62
// dc2 < dc1
63
if
(compDC(*sit2, *sit1)) {
64
result.second.push_back(*sit2);
65
++sit2;
66
// dc1 == dc2
67
}
else
{
68
++sit1;
69
++sit2;
70
}
71
}
72
}
73
74
// add remaining hits to counters
75
for
(; sit1 != sit1_end; ++sit1) {
76
if
(sit1->state() ==
DCOnTrack::CloseDC
) {
continue
; }
77
if
(
m_mode
&& sit1->state() !=
DCOnTrack::OnTrack
)
continue
;
78
result.first.push_back(*sit1);
79
}
80
for
(; sit2 != sit2_end; ++sit2) { result.second.push_back(*sit2); }
81
82
return
result;
83
}
84
85
private
:
86
bool
m_mode
;
87
};
88
89
}
// namespace TrkDriftCircleMath
90
91
#endif
DCOnTrack.h
DriftCircle.h
SortDcsByY.h
TrkDriftCircleMath::DCOnTrack::OnTrack
@ OnTrack
Definition
DCOnTrack.h:20
TrkDriftCircleMath::DCOnTrack::CloseDC
@ CloseDC
too large drift time
Definition
DCOnTrack.h:23
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition
IMdtSegmentFinder.h:13
TrkDriftCircleMath::DCOnTrackCit
DCOnTrackVec::const_iterator DCOnTrackCit
Definition
DCOnTrack.h:61
TrkDriftCircleMath::MatchResult
std::pair< DCOnTrackVec, DCVec > MatchResult
counts the number of hits shared by the two segments
Definition
MatchCrossedTubes.h:15
TrkDriftCircleMath::DCCit
DCVec::const_iterator DCCit
Definition
DriftCircle.h:119
TrkDriftCircleMath::DCVec
std::vector< DriftCircle > DCVec
Definition
DriftCircle.h:117
TrkDriftCircleMath::DCOnTrackVec
std::vector< DCOnTrack > DCOnTrackVec
Definition
DCOnTrack.h:59
TrkDriftCircleMath::MatchCrossedTubes::m_mode
bool m_mode
Definition
MatchCrossedTubes.h:86
TrkDriftCircleMath::MatchCrossedTubes::MatchCrossedTubes
MatchCrossedTubes(bool onlyOnTrack=false)
Definition
MatchCrossedTubes.h:18
TrkDriftCircleMath::MatchCrossedTubes::operator()
const MatchResult operator()(const DCOnTrackVec &hits, const DCVec &crossedTubes) const
Definition
MatchCrossedTubes.h:20
TrkDriftCircleMath::SameTube
Definition
SortDcsByY.h:26
TrkDriftCircleMath::SortDcsByY
Definition
SortDcsByY.h:17
Generated on
for ATLAS Offline Software by
1.17.0