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.

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

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

Referenced by PixelCPEGeneric::localPosition().

funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443