CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
mkfit::HitMatchPair Struct Reference

#include <TrackStructures.h>

Public Member Functions

void consider_hit_for_overlap (int hit_idx, int module_id, float chi2)
 
HitMatchfind_overlap (int hit_idx, int module_id)
 
void reset ()
 

Public Attributes

HitMatch M [2]
 

Detailed Description

Definition at line 38 of file TrackStructures.h.

Member Function Documentation

◆ consider_hit_for_overlap()

void mkfit::HitMatchPair::consider_hit_for_overlap ( int  hit_idx,
int  module_id,
float  chi2 
)
inline

Definition at line 46 of file TrackStructures.h.

References isoTrack_cff::chi2, M, mkfit::HitMatch::m_chi2, mkfit::HitMatch::m_hit_idx, and edm::service::monitor_file_utilities::module_id().

Referenced by mkfit::TrackCand::considerHitForOverlap().

46  {
47  if (module_id == M[0].m_module_id) {
48  if (chi2 < M[0].m_chi2) {
49  M[0].m_chi2 = chi2;
50  M[0].m_hit_idx = hit_idx;
51  }
52  } else if (module_id == M[1].m_module_id) {
53  if (chi2 < M[1].m_chi2) {
54  M[1].m_chi2 = chi2;
55  M[1].m_hit_idx = hit_idx;
56  }
57  } else {
58  if (M[0].m_chi2 > M[1].m_chi2) {
59  if (chi2 < M[0].m_chi2) {
60  M[0] = {hit_idx, module_id, chi2};
61  }
62  } else {
63  if (chi2 < M[1].m_chi2) {
64  M[1] = {hit_idx, module_id, chi2};
65  }
66  }
67  }
68  }
auto module_id(edm::ModuleCallingContext const &mcc)

◆ find_overlap()

HitMatch* mkfit::HitMatchPair::find_overlap ( int  hit_idx,
int  module_id 
)
inline

Definition at line 70 of file TrackStructures.h.

References M, and edm::service::monitor_file_utilities::module_id().

Referenced by mkfit::TrackCand::findOverlap().

70  {
71  if (module_id == M[0].m_module_id) {
72  if (M[1].m_hit_idx >= 0)
73  return &M[1];
74  } else if (module_id == M[1].m_module_id) {
75  if (M[0].m_hit_idx >= 0)
76  return &M[0];
77  } else {
78  if (M[0].m_chi2 <= M[1].m_chi2) {
79  if (M[0].m_hit_idx >= 0)
80  return &M[0];
81  } else {
82  if (M[1].m_hit_idx >= 0)
83  return &M[1];
84  }
85  }
86 
87  return nullptr;
88  }
auto module_id(edm::ModuleCallingContext const &mcc)

◆ reset()

void mkfit::HitMatchPair::reset ( void  )
inline

Definition at line 41 of file TrackStructures.h.

References M, and mkfit::HitMatch::reset().

Referenced by mkfit::TrackCand::resetOverlaps().

41  {
42  M[0].reset();
43  M[1].reset();
44  }

Member Data Documentation

◆ M

HitMatch mkfit::HitMatchPair::M[2]

Definition at line 39 of file TrackStructures.h.

Referenced by consider_hit_for_overlap(), find_overlap(), and reset().