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

Member Enumeration Documentation

◆ LayerType_e

Enumerator
Undef 
Barrel 
EndCapPos 
EndCapNeg 

Definition at line 40 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 43 of file TrackerInfo.h.

Member Function Documentation

◆ extend_limits()

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

Definition at line 15 of file TrackerInfo.cc.

References m_rin, m_rout, m_zmax, and m_zmin.

Referenced by MkFitGeometryESProducer::considerPoint().

15  {
16  if (z > m_zmax)
17  m_zmax = z;
18  if (z < m_zmin)
19  m_zmin = z;
20  if (r > m_rout)
21  m_rout = r;
22  if (r < m_rin)
23  m_rin = r;
24  }
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 76 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:121

◆ is_in_r_hole_no_check()

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

Definition at line 121 of file TrackerInfo.h.

References m_hole_r_max, m_hole_r_min, and alignCSCRings::r.

Referenced by is_in_r_hole().

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

◆ is_pixel()

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

Definition at line 69 of file TrackerInfo.h.

References m_is_pixel.

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

69 { return m_is_pixel; }

◆ is_stereo()

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

Definition at line 70 of file TrackerInfo.h.

References m_is_stereo.

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

70 { return m_is_stereo; }

◆ is_within_q_limits()

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

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

◆ is_within_r_limits()

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

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

73 { 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 86 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().

86  {
87  if (r > m_rout + dr || r < m_rin - dr)
88  return WSR_Result(WSR_Outside, false);
89  if (r < m_rout - dr && r > m_rin + dr) {
90  if (m_has_r_range_hole) {
91  if (r < m_hole_r_max - dr && r > m_hole_r_min + dr)
92  return WSR_Result(WSR_Outside, true);
93  if (r < m_hole_r_max + dr && r > m_hole_r_min - dr)
94  return WSR_Result(WSR_Edge, true);
95  }
96  return WSR_Result(WSR_Inside, false);
97  }
98  return WSR_Result(WSR_Edge, false);
99  }

◆ is_within_z_limits()

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

Definition at line 72 of file TrackerInfo.h.

References m_zmax, m_zmin, and z.

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

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

78  {
79  if (z > m_zmax + dz || z < m_zmin - dz)
80  return WSR_Result(WSR_Outside, false);
81  if (z < m_zmax - dz && z > m_zmin + dz)
82  return WSR_Result(WSR_Inside, false);
83  return WSR_Result(WSR_Edge, false);
84  }

◆ layer_id()

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

◆ layer_type()

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

Definition at line 57 of file TrackerInfo.h.

References m_layer_type.

57 { return m_layer_type; }
LayerType_e m_layer_type
Definition: TrackerInfo.h:124

◆ module_info()

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

Definition at line 118 of file TrackerInfo.h.

References m_modules.

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

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

◆ n_modules()

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

Definition at line 117 of file TrackerInfo.h.

References m_modules.

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

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

◆ print_layer()

void mkfit::LayerInfo::print_layer ( ) const

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

37  {
38  // clang-format off
39  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",
40  m_layer_id,
44  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);
45  // clang-format on
46  }
bool is_barrel() const
Definition: TrackerInfo.h:68

◆ propagate_to()

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

◆ q_bin()

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

Definition at line 65 of file TrackerInfo.h.

References m_q_bin.

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

65 { return m_q_bin; }

◆ r_mean()

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

Definition at line 60 of file TrackerInfo.h.

References m_rin, and m_rout.

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

◆ register_module()

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

Definition at line 105 of file TrackerInfo.h.

References m_detid2sid, and m_modules.

105  {
106  unsigned int pos = m_modules.size();
107  m_modules.emplace_back(mi);
108  m_detid2sid[mi.detid] = pos;
109  return pos;
110  }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:137
std::unordered_map< unsigned int, unsigned int > m_detid2sid
Definition: TrackerInfo.h:136

◆ reserve_modules()

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

Definition at line 104 of file TrackerInfo.h.

References m_modules.

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

◆ 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 54 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 45 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 49 of file TrackerInfo.h.

References m_propagate_to.

49 { m_propagate_to = pto; }

◆ set_q_bin()

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

Definition at line 51 of file TrackerInfo.h.

References m_q_bin.

51 { m_q_bin = qb; }

◆ set_r_hole_range()

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

Definition at line 31 of file TrackerInfo.cc.

References m_has_r_range_hole, m_hole_r_max, and m_hole_r_min.

Referenced by MkFitGeometryESProducer::addTECGeometry().

31  {
32  m_has_r_range_hole = true;
33  m_hole_r_min = rh1;
34  m_hole_r_max = rh2;
35  }

◆ set_r_in_out()

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

Definition at line 26 of file TrackerInfo.cc.

References m_rin, m_rout, and diffTwoXMLs::r2.

26  {
27  m_rin = r1;
28  m_rout = r2;
29  }

◆ set_subdet()

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

Definition at line 52 of file TrackerInfo.h.

References m_subdet.

52 { m_subdet = sd; }

◆ short_id()

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

Definition at line 116 of file TrackerInfo.h.

References m_detid2sid.

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

◆ shrink_modules()

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

Definition at line 111 of file TrackerInfo.h.

References m_modules.

111  {
112  m_modules.shrink_to_fit();
113  return m_modules.size() - 1;
114  }
std::vector< ModuleInfo > m_modules
Definition: TrackerInfo.h:137

◆ subdet()

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

Definition at line 67 of file TrackerInfo.h.

References m_subdet.

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

67 { return m_subdet; }

◆ z_mean()

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

Definition at line 63 of file TrackerInfo.h.

References m_zmax, and m_zmin.

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

◆ zmax()

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

Definition at line 62 of file TrackerInfo.h.

References m_zmax.

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

62 { return m_zmax; }

◆ zmin()

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

Definition at line 61 of file TrackerInfo.h.

References m_zmin.

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

61 { return m_zmin; }

Friends And Related Function Documentation

◆ TrackerInfo

friend class TrackerInfo
friend

Definition at line 37 of file TrackerInfo.h.

Member Data Documentation

◆ m_detid2sid

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

Definition at line 136 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 131 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 134 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 133 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 123 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 124 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 128 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 130 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 125 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