CMS 3D CMS Logo

Functions
siPixelUtils Namespace Reference

Functions

float generic_position_formula (int size, int q_f, int q_l, float upper_edge_first_pix, float lower_edge_last_pix, float lorentz_shift, float theThickness, float cot_angle, float pitch, bool first_is_big, bool last_is_big, float eff_charge_cut_low, float eff_charge_cut_high, float size_cut)
 

Function Documentation

◆ generic_position_formula()

float siPixelUtils::generic_position_formula ( int  size,
int  q_f,
int  q_l,
float  upper_edge_first_pix,
float  lower_edge_last_pix,
float  lorentz_shift,
float  theThickness,
float  cot_angle,
float  pitch,
bool  first_is_big,
bool  last_is_big,
float  eff_charge_cut_low,
float  eff_charge_cut_high,
float  size_cut 
)

A generic version of the position formula. Since it works for both X and Y, in the interest of the simplicity of the code, all parameters are passed by the caller.

Parameters
sizeSize of this projection.
q_fCharge in the first pixel.
q_lCharge in the last pixel.
upper_edge_first_pixAs the name says.
lower_edge_last_pixAs the name says.
lorentz_shiftL-shift at half thickness
cot_anglecot of alpha_ or beta_
pitchthePitchX or thePitchY
first_is_bigtrue if the first is big
last_is_bigtrue if the last is big
eff_charge_cut_lowUse edge if > w_eff &&&
eff_charge_cut_highUse edge if < w_eff &&&
size_cutUse edge when size == cuts

Definition at line 16 of file SiPixelUtils.cc.

References funct::abs(), and findQualityFiles::size.

Referenced by PixelCPEGeneric::localPosition().

30  {
31  float geom_center = 0.5f * (upper_edge_first_pix + lower_edge_last_pix);
32 
33  //--- The case of only one pixel in this projection is separate. Note that
34  //--- here first_pix == last_pix, so the average of the two is still the
35  //--- center of the pixel.
36  if (size == 1) {
37  return geom_center;
38  }
39 
40  //--- Width of the clusters minus the edge (first and last) pixels.
41  //--- In the note, they are denoted x_F and x_L (and y_F and y_L)
42  float w_inner = lower_edge_last_pix - upper_edge_first_pix; // in cm
43 
44  //--- Predicted charge width from geometry
45  float w_pred = theThickness * cot_angle // geometric correction (in cm)
46  - lorentz_shift; // (in cm) &&& check fpix!
47 
48  //--- Total length of the two edge pixels (first+last)
49  float sum_of_edge = 2.0f;
50  if (first_is_big)
51  sum_of_edge += 1.0f;
52  if (last_is_big)
53  sum_of_edge += 1.0f;
54 
55  //--- The `effective' charge width -- particle's path in first and last pixels only
56  float w_eff = std::abs(w_pred) - w_inner;
57 
58  //--- If the observed charge width is inconsistent with the expectations
59  //--- based on the track, do *not* use w_pred-w_innner. Instead, replace
60  //--- it with an *average* effective charge width, which is the average
61  //--- length of the edge pixels.
62  //
63  // bool usedEdgeAlgo = false;
64  if ((size >= size_cut) || ((w_eff / pitch < eff_charge_cut_low) | (w_eff / pitch > eff_charge_cut_high))) {
65  w_eff = pitch * 0.5f * sum_of_edge; // ave. length of edge pixels (first+last) (cm)
66  // usedEdgeAlgo = true;
67  }
68 
69  //--- Finally, compute the position in this projection
70  float q_diff = q_l - q_f;
71  float q_sum = q_l + q_f;
72 
73  //--- Temporary fix for clusters with both first and last pixel with charge = 0
74  if (q_sum == 0)
75  q_sum = 1.0f;
76 
77  float hit_pos = geom_center + 0.5f * (q_diff / q_sum) * w_eff;
78 
79  return hit_pos;
80  }
size
Write out results.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22