CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
mkfit::LayerInfo Class Reference

#include <TrackerInfo.h>

Public Types

enum  LayerType_e { Undef = -1, Barrel = 0, EndCapPos = 1, EndCapNeg = 2 }
 

Public Member Functions

void extend_limits (float r, float z)
 
bool has_charge () const
 
bool is_barrel () const
 
bool is_in_r_hole (float r) const
 
bool is_pixel () const
 
bool is_stereo () const
 
bool is_within_q_limits (float q) const
 
bool is_within_r_limits (float r) const
 
WSR_Result is_within_r_sensitive_region (float r, float dr) const
 
bool is_within_z_limits (float z) const
 
WSR_Result is_within_z_sensitive_region (float z, float dz) const
 
int layer_id () const
 
LayerType_e layer_type () const
 
 LayerInfo ()=default
 
 LayerInfo (int lid, LayerType_e type)
 
const ModuleInfomodule_info (unsigned int sid) const
 
int n_modules () const
 
void print_layer () const
 
float propagate_to () const
 
float q_bin () const
 
float r_mean () const
 
unsigned int register_module (ModuleInfo &&mi)
 
void reserve_modules (int nm)
 
float rin () const
 
float rout () const
 
void set_has_charge (bool c)
 
void set_is_pixel (bool p)
 
void set_is_stereo (bool s)
 
void set_layer_type (LayerType_e t)
 
void set_limits (float r1, float r2, float z1, float z2)
 
void set_propagate_to (float pto)
 
void set_q_bin (float qb)
 
void set_r_hole_range (float rh1, float rh2)
 
void set_r_in_out (float r1, float r2)
 
void set_subdet (int sd)
 
unsigned int short_id (unsigned int detid) const
 
unsigned int shrink_modules ()
 
int subdet () const
 
float z_mean () const
 
float zmax () const
 
float zmin () const
 

Private Member Functions

bool is_in_r_hole_no_check (float r) const
 

Private Attributes

std::unordered_map< unsigned int, unsigned int > m_detid2sid
 
bool m_has_charge = true
 
bool m_has_r_range_hole = false
 
float m_hole_r_max = 0
 
float m_hole_r_min = 0
 
bool m_is_pixel = false
 
bool m_is_stereo = false
 
int m_layer_id = -1
 
LayerType_e m_layer_type = Undef
 
std::vector< ModuleInfom_modules
 
float m_propagate_to = 0
 
float m_q_bin = 0
 
float m_rin = 0
 
float m_rout = 0
 
int m_subdet = -1
 
float m_zmax = 0
 
float m_zmin = 0
 

Friends

class TrackerInfo
 

Detailed Description

Definition at line 45 of file TrackerInfo.h.

Member Enumeration Documentation

◆ LayerType_e

Enumerator
Undef 
Barrel 
EndCapPos 
EndCapNeg 

Definition at line 49 of file TrackerInfo.h.

Constructor & Destructor Documentation

◆ LayerInfo() [1/2]

mkfit::LayerInfo::LayerInfo ( )
default

◆ LayerInfo() [2/2]

mkfit::LayerInfo::LayerInfo ( int  lid,
LayerType_e  type 
)
inline

Definition at line 52 of file TrackerInfo.h.

Member Function Documentation

◆ extend_limits()

void mkfit::LayerInfo::extend_limits ( float  r,
float  z 
)

Definition at line 33 of file TrackerInfo.cc.

References m_rin, m_rout, m_zmax, and m_zmin.

Referenced by MkFitGeometryESProducer::considerPoint().

33  {
34  if (z > m_zmax)
35  m_zmax = z;
36  if (z < m_zmin)
37  m_zmin = z;
38  if (r > m_rout)
39  m_rout = r;
40  if (r < m_rin)
41  m_rin = r;
42  }
float float float z

◆ has_charge()

bool mkfit::LayerInfo::has_charge ( ) const
inline

Definition at line 81 of file TrackerInfo.h.

References m_has_charge.

Referenced by mkfit::MkFinder::findCandidates(), and mkfit::MkFinder::findCandidatesCloneEngine().

81 { return m_has_charge; }

◆ is_barrel()

bool mkfit::LayerInfo::is_barrel ( ) const
inline

◆ is_in_r_hole()

bool mkfit::LayerInfo::is_in_r_hole ( float  r) const
inline

Definition at line 87 of file TrackerInfo.h.

References is_in_r_hole_no_check(), m_has_r_range_hole, and alignCSCRings::r.

bool is_in_r_hole_no_check(float r) const
Definition: TrackerInfo.h:132

◆ is_in_r_hole_no_check()

bool mkfit::LayerInfo::is_in_r_hole_no_check ( float  r) const
inlineprivate

Definition at line 132 of file TrackerInfo.h.

References m_hole_r_max, m_hole_r_min, and alignCSCRings::r.

Referenced by is_in_r_hole().

132 { return r > m_hole_r_min && r < m_hole_r_max; }

◆ is_pixel()

bool mkfit::LayerInfo::is_pixel ( ) const
inline

◆ is_stereo()

bool mkfit::LayerInfo::is_stereo ( ) const
inline

Definition at line 80 of file TrackerInfo.h.

References m_is_stereo.

Referenced by mkfit::LayerOfHits::is_stereo().

80 { return m_is_stereo; }

◆ is_within_q_limits()

bool mkfit::LayerInfo::is_within_q_limits ( float  q) const
inline

Definition at line 85 of file TrackerInfo.h.

References is_barrel(), is_within_r_limits(), is_within_z_limits(), and submitPVResolutionJobs::q.

bool is_within_z_limits(float z) const
Definition: TrackerInfo.h:83
bool is_within_r_limits(float r) const
Definition: TrackerInfo.h:84
bool is_barrel() const
Definition: TrackerInfo.h:78

◆ is_within_r_limits()

bool mkfit::LayerInfo::is_within_r_limits ( float  r) const
inline

Definition at line 84 of file TrackerInfo.h.

References m_rin, m_rout, and alignCSCRings::r.

Referenced by is_within_q_limits(), and mkfit::LayerOfHits::is_within_r_limits().

84 { return r > m_rin && r < m_rout; }

◆ is_within_r_sensitive_region()

WSR_Result mkfit::LayerInfo::is_within_r_sensitive_region ( float  r,
float  dr 
) const
inline

Definition at line 97 of file TrackerInfo.h.

References l1ctLayer1_cff::dr, m_has_r_range_hole, m_hole_r_min, m_rin, m_rout, alignCSCRings::r, mkfit::WSR_Edge, mkfit::WSR_Inside, and mkfit::WSR_Outside.

Referenced by mkfit::LayerOfHits::is_within_r_sensitive_region().

97  {
98  if (r > m_rout + dr || r < m_rin - dr)
99  return WSR_Result(WSR_Outside, false);
100  if (r < m_rout - dr && r > m_rin + dr) {
101  if (m_has_r_range_hole) {
102  if (r < m_hole_r_max - dr && r > m_hole_r_min + dr)
103  return WSR_Result(WSR_Outside, true);
104  if (r < m_hole_r_max + dr && r > m_hole_r_min - dr)
105  return WSR_Result(WSR_Edge, true);
106  }
107  return WSR_Result(WSR_Inside, false);
108  }
109  return WSR_Result(WSR_Edge, false);
110  }

◆ is_within_z_limits()

bool mkfit::LayerInfo::is_within_z_limits ( float  z) const
inline

Definition at line 83 of file TrackerInfo.h.

References m_zmax, m_zmin, and z.

Referenced by is_within_q_limits(), and mkfit::LayerOfHits::is_within_z_limits().

83 { return z > m_zmin && z < m_zmax; }
float float float z

◆ is_within_z_sensitive_region()

WSR_Result mkfit::LayerInfo::is_within_z_sensitive_region ( float  z,
float  dz 
) const
inline

Definition at line 89 of file TrackerInfo.h.

References PVValHelper::dz, m_zmax, m_zmin, mkfit::WSR_Edge, mkfit::WSR_Inside, mkfit::WSR_Outside, and z.

Referenced by mkfit::LayerOfHits::is_within_z_sensitive_region().

89  {
90  if (z > m_zmax + dz || z < m_zmin - dz)
91  return WSR_Result(WSR_Outside, false);
92  if (z < m_zmax - dz && z > m_zmin + dz)
93  return WSR_Result(WSR_Inside, false);
94  return WSR_Result(WSR_Edge, false);
95  }

◆ layer_id()

int mkfit::LayerInfo::layer_id ( ) const
inline

◆ layer_type()

LayerType_e mkfit::LayerInfo::layer_type ( ) const
inline

Definition at line 67 of file TrackerInfo.h.

References m_layer_type.

67 { return m_layer_type; }
LayerType_e m_layer_type
Definition: TrackerInfo.h:135

◆ module_info()

const ModuleInfo& mkfit::LayerInfo::module_info ( unsigned int  sid) const
inline

Definition at line 129 of file TrackerInfo.h.

References m_modules.

Referenced by mkfit::MkFinder::packModuleNormDir(), mkfit::TrackerInfo::print_tracker(), and mkfit::Event::read_in().

129 { return m_modules[sid]; }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:149

◆ n_modules()

int mkfit::LayerInfo::n_modules ( ) const
inline

Definition at line 128 of file TrackerInfo.h.

References m_modules.

Referenced by mkfit::TrackerInfo::print_tracker().

128 { return m_modules.size(); }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:149

◆ print_layer()

void mkfit::LayerInfo::print_layer ( ) const

Definition at line 55 of file TrackerInfo.cc.

References is_barrel(), m_has_r_range_hole, m_hole_r_max, m_hole_r_min, m_is_pixel, m_is_stereo, m_layer_id, m_q_bin, m_rin, m_rout, m_zmax, and m_zmin.

Referenced by mkfit::TrackerInfo::print_tracker().

55  {
56  // clang-format off
57  printf("Layer %2d r(%7.4f, %7.4f) z(% 9.4f, % 9.4f) is_brl=%d, is_pix=%d, is_stereo=%d, q_bin=%.2f\n",
58  m_layer_id,
62  printf(" has_r_range_hole: %.2f -> %.2f, dr: %f\n", m_hole_r_min, m_hole_r_max, m_hole_r_max - m_hole_r_min);
63  // clang-format on
64  }
bool is_barrel() const
Definition: TrackerInfo.h:78

◆ propagate_to()

float mkfit::LayerInfo::propagate_to ( ) const
inline

◆ q_bin()

float mkfit::LayerInfo::q_bin ( ) const
inline

Definition at line 75 of file TrackerInfo.h.

References m_q_bin.

Referenced by mkfit::LayerOfHits::Initializator::Initializator(), and mkfit::MkFinder::selectHitIndicesV2().

75 { return m_q_bin; }

◆ r_mean()

float mkfit::LayerInfo::r_mean ( ) const
inline

Definition at line 70 of file TrackerInfo.h.

References m_rin, and m_rout.

70 { return 0.5f * (m_rin + m_rout); }

◆ register_module()

unsigned int mkfit::LayerInfo::register_module ( ModuleInfo &&  mi)
inline

Definition at line 116 of file TrackerInfo.h.

References m_detid2sid, and m_modules.

116  {
117  unsigned int pos = m_modules.size();
118  m_modules.emplace_back(mi);
119  m_detid2sid[mi.detid] = pos;
120  return pos;
121  }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:149
std::unordered_map< unsigned int, unsigned int > m_detid2sid
Definition: TrackerInfo.h:148

◆ reserve_modules()

void mkfit::LayerInfo::reserve_modules ( int  nm)
inline

Definition at line 115 of file TrackerInfo.h.

References m_modules.

115 { m_modules.reserve(nm); }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:149

◆ rin()

float mkfit::LayerInfo::rin ( ) const
inline

◆ rout()

float mkfit::LayerInfo::rout ( ) const
inline

◆ set_has_charge()

void mkfit::LayerInfo::set_has_charge ( bool  c)
inline

◆ set_is_pixel()

void mkfit::LayerInfo::set_is_pixel ( bool  p)
inline

◆ set_is_stereo()

void mkfit::LayerInfo::set_is_stereo ( bool  s)
inline

Definition at line 63 of file TrackerInfo.h.

References m_is_stereo, and alignCSCRings::s.

◆ set_layer_type()

void mkfit::LayerInfo::set_layer_type ( LayerType_e  t)
inline

Definition at line 54 of file TrackerInfo.h.

References m_layer_type, and submitPVValidationJobs::t.

◆ set_limits()

void mkfit::LayerInfo::set_limits ( float  r1,
float  r2,
float  z1,
float  z2 
)

◆ set_propagate_to()

void mkfit::LayerInfo::set_propagate_to ( float  pto)
inline

Definition at line 58 of file TrackerInfo.h.

References m_propagate_to.

58 { m_propagate_to = pto; }

◆ set_q_bin()

void mkfit::LayerInfo::set_q_bin ( float  qb)
inline

Definition at line 60 of file TrackerInfo.h.

References m_q_bin.

60 { m_q_bin = qb; }

◆ set_r_hole_range()

void mkfit::LayerInfo::set_r_hole_range ( float  rh1,
float  rh2 
)

Definition at line 49 of file TrackerInfo.cc.

References m_has_r_range_hole, m_hole_r_max, and m_hole_r_min.

Referenced by MkFitGeometryESProducer::addTECGeometry().

49  {
50  m_has_r_range_hole = true;
51  m_hole_r_min = rh1;
52  m_hole_r_max = rh2;
53  }

◆ set_r_in_out()

void mkfit::LayerInfo::set_r_in_out ( float  r1,
float  r2 
)

Definition at line 44 of file TrackerInfo.cc.

References m_rin, m_rout, and diffTwoXMLs::r2.

44  {
45  m_rin = r1;
46  m_rout = r2;
47  }

◆ set_subdet()

void mkfit::LayerInfo::set_subdet ( int  sd)
inline

Definition at line 61 of file TrackerInfo.h.

References m_subdet.

61 { m_subdet = sd; }

◆ short_id()

unsigned int mkfit::LayerInfo::short_id ( unsigned int  detid) const
inline

Definition at line 127 of file TrackerInfo.h.

References m_detid2sid.

127 { return m_detid2sid.at(detid); }
std::unordered_map< unsigned int, unsigned int > m_detid2sid
Definition: TrackerInfo.h:148

◆ shrink_modules()

unsigned int mkfit::LayerInfo::shrink_modules ( )
inline

Definition at line 122 of file TrackerInfo.h.

References m_modules.

122  {
123  m_modules.shrink_to_fit();
124  return m_modules.size() - 1;
125  }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:149

◆ subdet()

int mkfit::LayerInfo::subdet ( ) const
inline

Definition at line 77 of file TrackerInfo.h.

References m_subdet.

Referenced by mkfit::LayerOfHits::subdet().

77 { return m_subdet; }

◆ z_mean()

float mkfit::LayerInfo::z_mean ( ) const
inline

Definition at line 73 of file TrackerInfo.h.

References m_zmax, and m_zmin.

73 { return 0.5f * (m_zmin + m_zmax); }

◆ zmax()

float mkfit::LayerInfo::zmax ( ) const
inline

◆ zmin()

float mkfit::LayerInfo::zmin ( ) const
inline

Friends And Related Function Documentation

◆ TrackerInfo

friend class TrackerInfo
friend

Definition at line 46 of file TrackerInfo.h.

Member Data Documentation

◆ m_detid2sid

std::unordered_map<unsigned int, unsigned int> mkfit::LayerInfo::m_detid2sid
private

Definition at line 148 of file TrackerInfo.h.

Referenced by mkfit::TrackerInfo::read_bin_file(), register_module(), and short_id().

◆ m_has_charge

bool mkfit::LayerInfo::m_has_charge = true
private

Definition at line 146 of file TrackerInfo.h.

Referenced by has_charge(), and set_has_charge().

◆ m_has_r_range_hole

bool mkfit::LayerInfo::m_has_r_range_hole = false
private

◆ m_hole_r_max

float mkfit::LayerInfo::m_hole_r_max = 0
private

Definition at line 142 of file TrackerInfo.h.

Referenced by is_in_r_hole_no_check(), print_layer(), and set_r_hole_range().

◆ m_hole_r_min

float mkfit::LayerInfo::m_hole_r_min = 0
private

◆ m_is_pixel

bool mkfit::LayerInfo::m_is_pixel = false
private

Definition at line 145 of file TrackerInfo.h.

Referenced by is_pixel(), print_layer(), and set_is_pixel().

◆ m_is_stereo

bool mkfit::LayerInfo::m_is_stereo = false
private

Definition at line 144 of file TrackerInfo.h.

Referenced by is_stereo(), print_layer(), and set_is_stereo().

◆ m_layer_id

int mkfit::LayerInfo::m_layer_id = -1
private

Definition at line 134 of file TrackerInfo.h.

Referenced by layer_id(), and print_layer().

◆ m_layer_type

LayerType_e mkfit::LayerInfo::m_layer_type = Undef
private

Definition at line 135 of file TrackerInfo.h.

Referenced by is_barrel(), layer_type(), and set_layer_type().

◆ m_modules

std::vector<ModuleInfo> mkfit::LayerInfo::m_modules
private

◆ m_propagate_to

float mkfit::LayerInfo::m_propagate_to = 0
private

Definition at line 139 of file TrackerInfo.h.

Referenced by propagate_to(), and set_propagate_to().

◆ m_q_bin

float mkfit::LayerInfo::m_q_bin = 0
private

Definition at line 141 of file TrackerInfo.h.

Referenced by print_layer(), q_bin(), and set_q_bin().

◆ m_rin

float mkfit::LayerInfo::m_rin = 0
private

◆ m_rout

float mkfit::LayerInfo::m_rout = 0
private

◆ m_subdet

int mkfit::LayerInfo::m_subdet = -1
private

Definition at line 136 of file TrackerInfo.h.

Referenced by set_subdet(), and subdet().

◆ m_zmax

float mkfit::LayerInfo::m_zmax = 0
private

◆ m_zmin

float mkfit::LayerInfo::m_zmin = 0
private