ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TrkDriftCircleMath::SharedHitsSegments Struct Reference

counts the number of hits shared by the two segments More...

#include <SharedHitsSegments.h>

Collaboration diagram for TrkDriftCircleMath::SharedHitsSegments:

Public Member Functions

 SharedHitsSegments (bool onlyOnTrack=false)
 
unsigned int operator() (const Segment &seg1, const Segment &seg2)
 
unsigned int sharedHits () const
 
unsigned int onlyInSeg1 () const
 
unsigned int onlyInSeg2 () const
 

Private Attributes

bool m_mode
 
unsigned int m_shared
 
unsigned int m_onlySeg1
 
unsigned int m_onlySeg2
 

Detailed Description

counts the number of hits shared by the two segments

Definition at line 14 of file SharedHitsSegments.h.

Constructor & Destructor Documentation

◆ SharedHitsSegments()

TrkDriftCircleMath::SharedHitsSegments::SharedHitsSegments ( bool  onlyOnTrack = false)
inline

Definition at line 15 of file SharedHitsSegments.h.

15  : m_mode(onlyOnTrack), m_shared{}, m_onlySeg1{}, m_onlySeg2{} { /*nop **/
16  }

Member Function Documentation

◆ onlyInSeg1()

unsigned int TrkDriftCircleMath::SharedHitsSegments::onlyInSeg1 ( ) const
inline

Definition at line 91 of file SharedHitsSegments.h.

91 { return m_onlySeg1; }

◆ onlyInSeg2()

unsigned int TrkDriftCircleMath::SharedHitsSegments::onlyInSeg2 ( ) const
inline

Definition at line 92 of file SharedHitsSegments.h.

92 { return m_onlySeg2; }

◆ operator()()

unsigned int TrkDriftCircleMath::SharedHitsSegments::operator() ( const Segment seg1,
const Segment seg2 
)
inline

Definition at line 18 of file SharedHitsSegments.h.

18  {
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  }

◆ sharedHits()

unsigned int TrkDriftCircleMath::SharedHitsSegments::sharedHits ( ) const
inline

Definition at line 90 of file SharedHitsSegments.h.

90 { return m_shared; }

Member Data Documentation

◆ m_mode

bool TrkDriftCircleMath::SharedHitsSegments::m_mode
private

Definition at line 95 of file SharedHitsSegments.h.

◆ m_onlySeg1

unsigned int TrkDriftCircleMath::SharedHitsSegments::m_onlySeg1
private

Definition at line 97 of file SharedHitsSegments.h.

◆ m_onlySeg2

unsigned int TrkDriftCircleMath::SharedHitsSegments::m_onlySeg2
private

Definition at line 98 of file SharedHitsSegments.h.

◆ m_shared

unsigned int TrkDriftCircleMath::SharedHitsSegments::m_shared
private

Definition at line 96 of file SharedHitsSegments.h.


The documentation for this struct was generated from the following file:
TrkDriftCircleMath::SharedHitsSegments::m_onlySeg2
unsigned int m_onlySeg2
Definition: SharedHitsSegments.h:98
TrkDriftCircleMath::SharedHitsSegments::m_mode
bool m_mode
Definition: SharedHitsSegments.h:95
TrkDriftCircleMath::DCOnTrackCit
DCOnTrackVec::const_iterator DCOnTrackCit
Definition: DCOnTrack.h:61
TrkDriftCircleMath::DCOnTrack::OnTrack
@ OnTrack
Definition: DCOnTrack.h:20
TrkDriftCircleMath::SharedHitsSegments::m_onlySeg1
unsigned int m_onlySeg1
Definition: SharedHitsSegments.h:97
TrkDriftCircleMath::SharedHitsSegments::m_shared
unsigned int m_shared
Definition: SharedHitsSegments.h:96
TrkDriftCircleMath::DCOnTrack::CloseDC
@ CloseDC
too large drift time
Definition: DCOnTrack.h:23