ATLAS Offline Software
Tracking
TrkUtilityPackages
TrkDriftCircleMath
TrkDriftCircleMath
SharedHitsSegments.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_SHAREDHITSSEGMENTS_H
6
#define DCMATH_SHAREDHITSSEGMENTS_H
7
8
#include "
TrkDriftCircleMath/Segment.h
"
9
#include "
TrkDriftCircleMath/SortDcsByY.h
"
10
11
namespace
TrkDriftCircleMath
{
14
struct
SharedHitsSegments
{
15
SharedHitsSegments
(
bool
onlyOnTrack =
false
) :
m_mode
(onlyOnTrack),
m_shared
{},
m_onlySeg1
{},
m_onlySeg2
{} {
/*nop **/
16
}
17
18
unsigned
int
operator()
(
const
Segment
& seg1,
const
Segment
& seg2) {
19
DCOnTrackCit
sit1 = seg1.
dcs
().begin();
20
DCOnTrackCit
sit1_end = seg1.
dcs
().end();
21
DCOnTrackCit
sit2 = seg2.
dcs
().begin();
22
DCOnTrackCit
sit2_end = seg2.
dcs
().end();
23
24
SortDcsByY
compDC;
25
26
m_shared
= 0;
27
m_onlySeg1
= 0;
28
m_onlySeg2
= 0;
29
30
while
(sit1 != sit1_end && sit2 != sit2_end) {
31
// skip all close hits
32
if
(sit1->state() ==
DCOnTrack::CloseDC
) {
33
++sit1;
34
continue
;
35
}
36
if
(sit2->state() ==
DCOnTrack::CloseDC
) {
37
++sit2;
38
continue
;
39
}
40
41
if
(
m_mode
) {
42
// only use hits on track
43
if
(sit1->state() !=
DCOnTrack::OnTrack
) {
44
++sit1;
45
continue
;
46
}
47
if
(sit2->state() !=
DCOnTrack::OnTrack
) {
48
++sit2;
49
continue
;
50
}
51
}
52
53
// dc1 < dc2
54
if
(compDC(*sit1, *sit2)) {
55
++sit1;
56
++
m_onlySeg1
;
57
// dc1 >= dc2
58
}
else
{
59
// dc2 < dc1
60
if
(compDC(*sit2, *sit1)) {
61
++sit2;
62
++
m_onlySeg2
;
63
// dc1 == dc2
64
}
else
{
65
++
m_shared
;
66
++sit1;
67
++sit2;
68
}
69
}
70
}
71
72
// add remaining hits to counters
73
for
(; sit1 != sit1_end; ++sit1) {
74
if
(
m_mode
&& sit1->state() !=
DCOnTrack::OnTrack
)
continue
;
75
76
if
(sit1->state() ==
DCOnTrack::CloseDC
)
continue
;
77
78
++
m_onlySeg1
;
79
}
80
for
(; sit2 != sit2_end; ++sit2) {
81
if
(
m_mode
&& sit2->state() !=
DCOnTrack::OnTrack
)
continue
;
82
83
if
(sit2->state() ==
DCOnTrack::CloseDC
)
continue
;
84
++
m_onlySeg2
;
85
}
86
87
return
m_shared
;
88
}
89
90
unsigned
int
sharedHits
()
const
{
return
m_shared
; }
91
unsigned
int
onlyInSeg1
()
const
{
return
m_onlySeg1
; }
92
unsigned
int
onlyInSeg2
()
const
{
return
m_onlySeg2
; }
93
94
private
:
95
bool
m_mode
;
96
unsigned
int
m_shared
;
97
unsigned
int
m_onlySeg1
;
98
unsigned
int
m_onlySeg2
;
99
};
100
101
}
// namespace TrkDriftCircleMath
102
103
#endif
TrkDriftCircleMath::SharedHitsSegments::m_onlySeg2
unsigned int m_onlySeg2
Definition:
SharedHitsSegments.h:98
SortDcsByY.h
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition:
IMdtSegmentFinder.h:13
Segment.h
TrkDriftCircleMath::SharedHitsSegments::onlyInSeg1
unsigned int onlyInSeg1() const
Definition:
SharedHitsSegments.h:91
TrkDriftCircleMath::SharedHitsSegments::onlyInSeg2
unsigned int onlyInSeg2() const
Definition:
SharedHitsSegments.h:92
TrkDriftCircleMath::Segment
Definition:
Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/Segment.h:18
TrkDriftCircleMath::SortDcsByY
Definition:
SortDcsByY.h:17
TrkDriftCircleMath::SharedHitsSegments::m_mode
bool m_mode
Definition:
SharedHitsSegments.h:95
TrkDriftCircleMath::DCOnTrackCit
DCOnTrackVec::const_iterator DCOnTrackCit
Definition:
DCOnTrack.h:61
TrkDriftCircleMath::Segment::dcs
const DCOnTrackVec & dcs() const
Definition:
Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/Segment.h:28
TrkDriftCircleMath::DCOnTrack::OnTrack
@ OnTrack
Definition:
DCOnTrack.h:20
TrkDriftCircleMath::SharedHitsSegments::SharedHitsSegments
SharedHitsSegments(bool onlyOnTrack=false)
Definition:
SharedHitsSegments.h:15
TrkDriftCircleMath::SharedHitsSegments::m_onlySeg1
unsigned int m_onlySeg1
Definition:
SharedHitsSegments.h:97
TrkDriftCircleMath::SharedHitsSegments
counts the number of hits shared by the two segments
Definition:
SharedHitsSegments.h:14
TrkDriftCircleMath::SharedHitsSegments::m_shared
unsigned int m_shared
Definition:
SharedHitsSegments.h:96
TrkDriftCircleMath::SharedHitsSegments::sharedHits
unsigned int sharedHits() const
Definition:
SharedHitsSegments.h:90
TrkDriftCircleMath::SharedHitsSegments::operator()
unsigned int operator()(const Segment &seg1, const Segment &seg2)
Definition:
SharedHitsSegments.h:18
TrkDriftCircleMath::DCOnTrack::CloseDC
@ CloseDC
too large drift time
Definition:
DCOnTrack.h:23
Generated on Thu Nov 7 2024 21:25:59 for ATLAS Offline Software by
1.8.18