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 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_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_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 41 of file TrackerInfo.h.

Member Enumeration Documentation

◆ LayerType_e

Enumerator
Undef 
Barrel 
EndCapPos 
EndCapNeg 

Definition at line 45 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 48 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

◆ 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 81 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:126

◆ is_in_r_hole_no_check()

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

Definition at line 126 of file TrackerInfo.h.

References m_hole_r_max, m_hole_r_min, and alignCSCRings::r.

Referenced by is_in_r_hole().

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

◆ is_pixel()

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

Definition at line 74 of file TrackerInfo.h.

References m_is_pixel.

Referenced by mkfit::IterationMaskIfcCmssw::get_mask_for_layer(), and mkfit::LayerOfHits::is_pixel().

74 { return m_is_pixel; }

◆ is_stereo()

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

Definition at line 75 of file TrackerInfo.h.

References m_is_stereo.

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

75 { return m_is_stereo; }

◆ is_within_q_limits()

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

Definition at line 79 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:77
bool is_within_r_limits(float r) const
Definition: TrackerInfo.h:78
bool is_barrel() const
Definition: TrackerInfo.h:73

◆ is_within_r_limits()

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

Definition at line 78 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().

78 { 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 91 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().

91  {
92  if (r > m_rout + dr || r < m_rin - dr)
93  return WSR_Result(WSR_Outside, false);
94  if (r < m_rout - dr && r > m_rin + dr) {
95  if (m_has_r_range_hole) {
96  if (r < m_hole_r_max - dr && r > m_hole_r_min + dr)
97  return WSR_Result(WSR_Outside, true);
98  if (r < m_hole_r_max + dr && r > m_hole_r_min - dr)
99  return WSR_Result(WSR_Edge, true);
100  }
101  return WSR_Result(WSR_Inside, false);
102  }
103  return WSR_Result(WSR_Edge, false);
104  }

◆ is_within_z_limits()

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

Definition at line 77 of file TrackerInfo.h.

References m_zmax, m_zmin, and z.

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

77 { 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 83 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().

83  {
84  if (z > m_zmax + dz || z < m_zmin - dz)
85  return WSR_Result(WSR_Outside, false);
86  if (z < m_zmax - dz && z > m_zmin + dz)
87  return WSR_Result(WSR_Inside, false);
88  return WSR_Result(WSR_Edge, false);
89  }

◆ layer_id()

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

◆ layer_type()

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

Definition at line 62 of file TrackerInfo.h.

References m_layer_type.

62 { return m_layer_type; }
LayerType_e m_layer_type
Definition: TrackerInfo.h:129

◆ module_info()

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

Definition at line 123 of file TrackerInfo.h.

References m_modules.

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

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

◆ n_modules()

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

Definition at line 122 of file TrackerInfo.h.

References m_modules.

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

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

◆ 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:73

◆ propagate_to()

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

◆ q_bin()

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

Definition at line 70 of file TrackerInfo.h.

References m_q_bin.

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

70 { return m_q_bin; }

◆ r_mean()

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

Definition at line 65 of file TrackerInfo.h.

References m_rin, and m_rout.

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

◆ register_module()

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

Definition at line 110 of file TrackerInfo.h.

References m_detid2sid, and m_modules.

110  {
111  unsigned int pos = m_modules.size();
112  m_modules.emplace_back(mi);
113  m_detid2sid[mi.detid] = pos;
114  return pos;
115  }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:142
std::unordered_map< unsigned int, unsigned int > m_detid2sid
Definition: TrackerInfo.h:141

◆ reserve_modules()

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

Definition at line 109 of file TrackerInfo.h.

References m_modules.

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

◆ rin()

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

◆ rout()

float mkfit::LayerInfo::rout ( ) const
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 59 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 50 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 54 of file TrackerInfo.h.

References m_propagate_to.

54 { m_propagate_to = pto; }

◆ set_q_bin()

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

Definition at line 56 of file TrackerInfo.h.

References m_q_bin.

56 { 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 57 of file TrackerInfo.h.

References m_subdet.

57 { m_subdet = sd; }

◆ short_id()

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

Definition at line 121 of file TrackerInfo.h.

References m_detid2sid.

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

◆ shrink_modules()

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

Definition at line 116 of file TrackerInfo.h.

References m_modules.

116  {
117  m_modules.shrink_to_fit();
118  return m_modules.size() - 1;
119  }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:142

◆ subdet()

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

Definition at line 72 of file TrackerInfo.h.

References m_subdet.

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

72 { return m_subdet; }

◆ z_mean()

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

Definition at line 68 of file TrackerInfo.h.

References m_zmax, and m_zmin.

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

◆ zmax()

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

Definition at line 67 of file TrackerInfo.h.

References m_zmax.

Referenced by MkFitGeometryESProducer::fillLayers(), and mkfit::LayerOfHits::Initializator::Initializator().

67 { return m_zmax; }

◆ zmin()

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

Definition at line 66 of file TrackerInfo.h.

References m_zmin.

Referenced by MkFitGeometryESProducer::fillLayers(), and mkfit::LayerOfHits::Initializator::Initializator().

66 { return m_zmin; }

Friends And Related Function Documentation

◆ TrackerInfo

friend class TrackerInfo
friend

Definition at line 42 of file TrackerInfo.h.

Member Data Documentation

◆ m_detid2sid

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

Definition at line 141 of file TrackerInfo.h.

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

◆ 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 136 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 139 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 138 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 128 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 129 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 133 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 135 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 130 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