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

#include <MatchCrossedTubes.h>

Collaboration diagram for TrkDriftCircleMath::MatchCrossedTubes:

Public Member Functions

 MatchCrossedTubes (bool onlyOnTrack=false)
 
const MatchResult operator() (const DCOnTrackVec &hits, const DCVec &crossedTubes) const
 

Private Attributes

bool m_mode
 

Detailed Description

Definition at line 17 of file MatchCrossedTubes.h.

Constructor & Destructor Documentation

◆ MatchCrossedTubes()

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

Definition at line 18 of file MatchCrossedTubes.h.

18 : m_mode(onlyOnTrack) {}

Member Function Documentation

◆ operator()()

const MatchResult TrkDriftCircleMath::MatchCrossedTubes::operator() ( const DCOnTrackVec hits,
const DCVec crossedTubes 
) const
inline

Definition at line 20 of file MatchCrossedTubes.h.

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

Member Data Documentation

◆ m_mode

bool TrkDriftCircleMath::MatchCrossedTubes::m_mode
private

Definition at line 86 of file MatchCrossedTubes.h.


The documentation for this struct was generated from the following file:
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
get_generator_info.result
result
Definition: get_generator_info.py:21
TrkDriftCircleMath::MatchResult
std::pair< DCOnTrackVec, DCVec > MatchResult
counts the number of hits shared by the two segments
Definition: MatchCrossedTubes.h:15
TrkDriftCircleMath::DCOnTrackCit
DCOnTrackVec::const_iterator DCOnTrackCit
Definition: DCOnTrack.h:61
TrkDriftCircleMath::DCOnTrack::OnTrack
@ OnTrack
Definition: DCOnTrack.h:20
TrkDriftCircleMath::DCCit
DCVec::const_iterator DCCit
Definition: DriftCircle.h:119
TrkDriftCircleMath::MatchCrossedTubes::m_mode
bool m_mode
Definition: MatchCrossedTubes.h:86
TrkDriftCircleMath::DCOnTrack::CloseDC
@ CloseDC
too large drift time
Definition: DCOnTrack.h:23