CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
SiPixelCPEGenericDBErrorParametrization Class Reference

#include <SiPixelCPEGenericDBErrorParametrization.h>

Public Member Functions

std::pair< float, float > getError (const SiPixelCPEGenericErrorParm *parmErrors, GeomDetType::SubDetector pixelPart, int sizex, int sizey, float alpha, float beta, bool bigInX=false, bool bigInY=false)
 
std::pair< float, float > getError (GeomDetType::SubDetector pixelPart, int sizex, int sizey, float alpha, float beta, bool bigInX=false, bool bigInY=false)
 
float index (int ind_subpart, int size, float alpha, float beta, bool big)
 
void setDBAccess (const edm::EventSetup &es)
 
 SiPixelCPEGenericDBErrorParametrization ()
 
 ~SiPixelCPEGenericDBErrorParametrization ()
 

Private Attributes

edm::ESHandle
< SiPixelCPEGenericErrorParm
errorsH
 

Static Private Attributes

static const float * a_max [4] = {by_a_max, bx_a_max, fy_a_max, fx_a_max}
 
static const float * a_min [4] = {by_a_min, bx_a_min, fy_a_min, fx_a_min}
 
static const int alpha_bin_size [4] = {10, 1, 10, 1}
 
static const float * b_max [4] = {by_b_max, garbage, fy_b_max, fx_b_max}
 
static const float * b_min [4] = {by_b_min, garbage, fy_b_min, fx_b_min}
 
static const int beta_bin_size [4] = { 1, 10, 1, 10}
 
static const float bx_a_max [3] = {1.725, 1.675, 1.625}
 
static const float bx_a_min [3] = {1.525, 1.475, 1.425}
 
static const float by_a_max [6] = {1.67078, 1.67078, 1.67078, 1.67078, 1.67078, 1.67078}
 
static const float by_a_min [6] = {1.47078, 1.47078, 1.47078, 1.47078, 1.47078, 1.47078}
 
static const float by_b_max [6] = {0.50, 0.90, 1.05, 1.15, 1.20, 1.40}
 
static const float by_b_min [6] = {0.05, 0.15, 0.70, 0.95, 1.15, 1.20}
 
static const float errors_big_pix [4] = {0.0070, 0.0030, 0.0068, 0.0040}
 
static const float fx_a_max [2] = {0.285, 0.465}
 
static const float fx_a_min [2] = {0.165, 0.185}
 
static const float fx_b_max [2] = {999, 999}
 
static const float fx_b_min [2] = {998, 998}
 
static const float fy_a_max [2] = {999, 999}
 
static const float fy_a_min [2] = {998, 998}
 
static const float fy_b_max [2] = {0.39, 0.39}
 
static const float fy_b_min [2] = {0.31, 0.31}
 
static const int part_bin_size [4] = { 0, 240, 360, 380}
 
static const int size_bin_size [4] = {40, 40, 40, 40}
 
static const int size_max [4] = {5, 2, 0, 0}
 

Detailed Description

Definition at line 11 of file SiPixelCPEGenericDBErrorParametrization.h.

Constructor & Destructor Documentation

SiPixelCPEGenericDBErrorParametrization::SiPixelCPEGenericDBErrorParametrization ( )

Definition at line 46 of file SiPixelCPEGenericDBErrorParametrization.cc.

46 {}
SiPixelCPEGenericDBErrorParametrization::~SiPixelCPEGenericDBErrorParametrization ( )

Definition at line 48 of file SiPixelCPEGenericDBErrorParametrization.cc.

48 {}

Member Function Documentation

std::pair< float, float > SiPixelCPEGenericDBErrorParametrization::getError ( const SiPixelCPEGenericErrorParm parmErrors,
GeomDetType::SubDetector  pixelPart,
int  sizex,
int  sizey,
float  alpha,
float  beta,
bool  bigInX = false,
bool  bigInY = false 
)

Definition at line 56 of file SiPixelCPEGenericDBErrorParametrization.cc.

References SiPixelCPEGenericErrorParm::errors(), benchmark_cfg::errors, Exception, reco::if(), index(), GeomDetEnumerators::isBarrel(), and GeomDetEnumerators::isTrackerPixel().

61 {
62  std::pair<float,float> element;
63  std::pair<float,float> errors;
64 
66  throw cms::Exception("PixelCPEGenericDBErrorParametrization::getError")
67  << "Non-pixel detector type !!!" ;
68  if(GeomDetEnumerators::isBarrel(pixelPart)) {
69  element = std::pair<float,float>(index(1, sizex, alpha, beta, bigInX), //1 -- Bx
70  index(0, sizey, alpha, beta, bigInY)); //0 -- By
71  }
72  else {
73  element = std::pair<float,float>(index(3, sizex, alpha, beta, bigInX), //3 -- Fx
74  index(2, sizey, alpha, beta, bigInY)); //2 -- Fy
75  }
76 
77  if (bigInX && sizex == 1) errors.first = element.first;
78  else errors.first = parmErrors->errors()[(int)element.first].sigma;
79  if (bigInY && sizey == 1) errors.second = element.second;
80  else errors.second = parmErrors->errors()[(int)element.second].sigma;
81 
82  return errors;
83 }
const double beta
float alpha
Definition: AMPTWrapper.h:95
bool isBarrel(GeomDetEnumerators::SubDetector m)
float index(int ind_subpart, int size, float alpha, float beta, bool big)
DbVector & errors()
Accessors for the vectors – non-const version.
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
if(dp >Float(M_PI)) dp-
std::pair< float, float > SiPixelCPEGenericDBErrorParametrization::getError ( GeomDetType::SubDetector  pixelPart,
int  sizex,
int  sizey,
float  alpha,
float  beta,
bool  bigInX = false,
bool  bigInY = false 
)

Definition at line 86 of file SiPixelCPEGenericDBErrorParametrization.cc.

References benchmark_cfg::errors, errorsH, Exception, reco::if(), index(), GeomDetEnumerators::isBarrel(), and GeomDetEnumerators::isTrackerPixel().

90 {
91  std::pair<float,float> element;
92  std::pair<float,float> errors;
93 
95  throw cms::Exception("PixelCPEGenericDBErrorParametrization::getError")
96  << "Non-pixel detector type !!!" ;
97  if(GeomDetEnumerators::isBarrel(pixelPart)) {
98  element = std::pair<float,float>(index(1, sizex, alpha, beta, bigInX), //1 -- Bx
99  index(0, sizey, alpha, beta, bigInY)); //0 -- By
100  }
101  else {
102  element = std::pair<float,float>(index(3, sizex, alpha, beta, bigInX), //3 -- Fx
103  index(2, sizey, alpha, beta, bigInY)); //2 -- Fy
104  }
105 
106  if (bigInX && sizex == 1) errors.first = element.first;
107  else errors.first = errorsH->errors()[(int)element.first].sigma;
108  if (bigInY && sizey == 1) errors.second = element.second;
109  else errors.second = errorsH->errors()[(int)element.second].sigma;
110 
111  return errors;
112 }
const double beta
float alpha
Definition: AMPTWrapper.h:95
bool isBarrel(GeomDetEnumerators::SubDetector m)
float index(int ind_subpart, int size, float alpha, float beta, bool big)
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
if(dp >Float(M_PI)) dp-
edm::ESHandle< SiPixelCPEGenericErrorParm > errorsH
float SiPixelCPEGenericDBErrorParametrization::index ( int  ind_subpart,
int  size,
float  alpha,
float  beta,
bool  big 
)

Definition at line 116 of file SiPixelCPEGenericDBErrorParametrization.cc.

References a_max, a_min, alpha_bin_size, b_max, b_min, beta_bin_size, errors_big_pix, math_pi, min(), part_bin_size, size_bin_size, and size_max.

Referenced by BeautifulSoup.PageElement::_invert(), and getError().

117 {
118  //This is a check for big pixels. If it passes, the code returns a given error and the function ends.
119  if ( big && size == 1) return errors_big_pix[ind_subpart];
120 
121  int ind_size = std::min(size - 1, size_max[ind_subpart]);
122 
123  float alpha_rad = -999.9;
124  float betap_rad = -999.9;
125 
126  int ind_alpha = -99;
127  int ind_beta = -99;
128 
129  float binw_a = -999.9;
130  float binw_b = -999.9;
131  int maxbin_a = -99;
132  int maxbin_b = -99;
133 
134  betap_rad = fabs(math_pi/2.0 - beta);
135  //We must take into account that Fx(subpart=3) has different alpha parametrization
136  if(ind_subpart == 3) alpha_rad = fabs(math_pi/2.0 - alpha);
137  else alpha_rad = fabs(alpha);
138 
139  //Sets the correct binning for alpha and beta based on whether in x or y
140  if(ind_subpart == 0||ind_subpart == 2)
141  {
142  binw_a = (a_max[ind_subpart][ind_size] - a_min[ind_subpart][ind_size])/2.0;
143  binw_b = (b_max[ind_subpart][ind_size] - b_min[ind_subpart][ind_size])/8.0;
144  maxbin_a = 3;
145  maxbin_b = 9;
146  }
147  else
148  {
149  binw_a = (a_max[ind_subpart][ind_size] - a_min[ind_subpart][ind_size])/8.0;
150  binw_b = (b_max[ind_subpart][ind_size] - b_min[ind_subpart][ind_size])/2.0;
151  maxbin_a = 3;
152  maxbin_b = 9;
153  }
154 
155  //Binning for alpha
156  if ( alpha_rad < a_min[ind_subpart][ind_size]) ind_alpha = 0;
157  else if ( alpha_rad >= a_max[ind_subpart][ind_size]) ind_alpha = maxbin_a;
158  else ind_alpha = 1 + (int)((alpha_rad - a_min[ind_subpart][ind_size])/binw_a);
159 
160  //Binning for beta -- we need to account for Bx(subpart=1) having uneven binning
161  if(ind_subpart == 1)
162  {
163  if ( betap_rad <= 0.7 ) ind_beta = 0;
164  else if ( 0.7 < betap_rad && betap_rad <= 1.0 ) ind_beta = 1;
165  else if ( 1.0 < betap_rad && betap_rad <= 1.2 ) ind_beta = 2;
166  else if ( 1.2 <= betap_rad ) ind_beta = 3;
167  }
168  else if ( betap_rad < b_min[ind_subpart][ind_size]) ind_beta = 0;
169  else if ( betap_rad >= b_max[ind_subpart][ind_size]) ind_beta = maxbin_b;
170  else ind_beta = 1 + (int)((betap_rad - b_min[ind_subpart][ind_size])/binw_b);
171 
172  //Index to be used to find error in database
173  int index = part_bin_size[ind_subpart] + size_bin_size[ind_subpart] * ind_size + alpha_bin_size[ind_subpart] * ind_alpha + beta_bin_size[ind_subpart] * ind_beta;
174 
175  return index;
176 }
const double beta
float alpha
Definition: AMPTWrapper.h:95
T min(T a, T b)
Definition: MathUtil.h:58
float index(int ind_subpart, int size, float alpha, float beta, bool big)
Definition: big.h:8
tuple size
Write out results.
void SiPixelCPEGenericDBErrorParametrization::setDBAccess ( const edm::EventSetup es)

Member Data Documentation

const float * SiPixelCPEGenericDBErrorParametrization::a_max = {by_a_max, bx_a_max, fy_a_max, fx_a_max}
staticprivate

Definition at line 68 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

const float * SiPixelCPEGenericDBErrorParametrization::a_min = {by_a_min, bx_a_min, fy_a_min, fx_a_min}
staticprivate

Definition at line 67 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

const int SiPixelCPEGenericDBErrorParametrization::alpha_bin_size = {10, 1, 10, 1}
staticprivate

Definition at line 64 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

const float * SiPixelCPEGenericDBErrorParametrization::b_max = {by_b_max, garbage, fy_b_max, fx_b_max}
staticprivate

Definition at line 70 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

const float * SiPixelCPEGenericDBErrorParametrization::b_min = {by_b_min, garbage, fy_b_min, fx_b_min}
staticprivate

Definition at line 69 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

const int SiPixelCPEGenericDBErrorParametrization::beta_bin_size = { 1, 10, 1, 10}
staticprivate

Definition at line 65 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

const float SiPixelCPEGenericDBErrorParametrization::bx_a_max = {1.725, 1.675, 1.625}
staticprivate

Definition at line 42 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::bx_a_min = {1.525, 1.475, 1.425}
staticprivate

Definition at line 41 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::by_a_max = {1.67078, 1.67078, 1.67078, 1.67078, 1.67078, 1.67078}
staticprivate

Definition at line 50 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::by_a_min = {1.47078, 1.47078, 1.47078, 1.47078, 1.47078, 1.47078}
staticprivate

Definition at line 49 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::by_b_max = {0.50, 0.90, 1.05, 1.15, 1.20, 1.40}
staticprivate

Definition at line 52 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::by_b_min = {0.05, 0.15, 0.70, 0.95, 1.15, 1.20}
staticprivate

Definition at line 51 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::errors_big_pix = {0.0070, 0.0030, 0.0068, 0.0040}
staticprivate

Definition at line 59 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

edm::ESHandle<SiPixelCPEGenericErrorParm> SiPixelCPEGenericDBErrorParametrization::errorsH
private

Definition at line 39 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by getError(), and setDBAccess().

const float SiPixelCPEGenericDBErrorParametrization::fx_a_max = {0.285, 0.465}
staticprivate

Definition at line 45 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::fx_a_min = {0.165, 0.185}
staticprivate

Definition at line 44 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::fx_b_max = {999, 999}
staticprivate

Definition at line 47 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::fx_b_min = {998, 998}
staticprivate

Definition at line 46 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::fy_a_max = {999, 999}
staticprivate

Definition at line 55 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::fy_a_min = {998, 998}
staticprivate

Definition at line 54 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::fy_b_max = {0.39, 0.39}
staticprivate

Definition at line 57 of file SiPixelCPEGenericDBErrorParametrization.h.

const float SiPixelCPEGenericDBErrorParametrization::fy_b_min = {0.31, 0.31}
staticprivate

Definition at line 56 of file SiPixelCPEGenericDBErrorParametrization.h.

const int SiPixelCPEGenericDBErrorParametrization::part_bin_size = { 0, 240, 360, 380}
staticprivate

Definition at line 62 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

const int SiPixelCPEGenericDBErrorParametrization::size_bin_size = {40, 40, 40, 40}
staticprivate

Definition at line 63 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().

const int SiPixelCPEGenericDBErrorParametrization::size_max = {5, 2, 0, 0}
staticprivate

Definition at line 60 of file SiPixelCPEGenericDBErrorParametrization.h.

Referenced by index().