17 #include "boost/multi_array.hpp"
23 constexpr
float micronsToCm = 1.0e-4;
36 :
PixelCPEGeneric(conf, mag, geom, ttopo, lorentzAngle, genErrorDBObject, lorentzAngleWidth) {
38 LogDebug(
"PixelCPEGenericBricked") <<
"constructing a generic algorithm for ideal pixel detector.\n"
41 cout <<
"From PixelCPEGenericForBricked::PixelCPEGenericForBricked(...)" << endl;
68 float locBz = theDetParam.
bz;
69 float locBx = theDetParam.
bx;
72 theClusterParam.
pixmx = -999;
73 theClusterParam.
sigmay = -999.9;
74 theClusterParam.
deltay = -999.9;
75 theClusterParam.
sigmax = -999.9;
76 theClusterParam.
deltax = -999.9;
77 theClusterParam.
sy1 = -999.9;
78 theClusterParam.
dy1 = -999.9;
79 theClusterParam.
sy2 = -999.9;
80 theClusterParam.
dy2 = -999.9;
81 theClusterParam.
sx1 = -999.9;
82 theClusterParam.
dx1 = -999.9;
83 theClusterParam.
sx2 = -999.9;
84 theClusterParam.
dx2 = -999.9;
92 theClusterParam.
qBin_ = gtempl.
qbin(gtemplID_,
99 theClusterParam.
pixmx,
111 theClusterParam.
dx2);
115 bool useLAWidthFromGenError =
false;
116 if (useLAWidthFromGenError) {
117 chargeWidthX = (-micronsToCm * gtempl.
lorxwidth());
118 chargeWidthY = (-micronsToCm * gtempl.
lorywidth());
120 <<
"redefine la width (gen-error)" << chargeWidthX <<
" " << chargeWidthY;
122 edm::LogInfo(
"PixelCPEGeneric bricked localPosition():") <<
"GenError:" << gtemplID_;
125 theClusterParam.
deltax = theClusterParam.
deltax * micronsToCm;
126 theClusterParam.
dx1 = theClusterParam.
dx1 * micronsToCm;
127 theClusterParam.
dx2 = theClusterParam.
dx2 * micronsToCm;
129 theClusterParam.
deltay = theClusterParam.
deltay * micronsToCm;
130 theClusterParam.
dy1 = theClusterParam.
dy1 * micronsToCm;
131 theClusterParam.
dy2 = theClusterParam.
dy2 * micronsToCm;
133 theClusterParam.
sigmax = theClusterParam.
sigmax * micronsToCm;
134 theClusterParam.
sx1 = theClusterParam.
sx1 * micronsToCm;
135 theClusterParam.
sx2 = theClusterParam.
sx2 * micronsToCm;
137 theClusterParam.
sigmay = theClusterParam.
sigmay * micronsToCm;
138 theClusterParam.
sy1 = theClusterParam.
sy1 * micronsToCm;
139 theClusterParam.
sy2 = theClusterParam.
sy2 * micronsToCm;
143 theClusterParam.
qBin_ = 0;
152 int lowest_is_bricked = 1;
153 int highest_is_bricked = 0;
185 if (lowest_is_bricked)
188 if (highest_is_bricked)
209 cout <<
"\n\t >>> theClusterParam.theCluster->x = " << theClusterParam.
theCluster->
x()
210 <<
"\n\t >>> theClusterParam.theCluster->y = " << theClusterParam.
theCluster->
y()
215 <<
"\n\t >>> meas: inner lower left = " << meas_URcorn_LLpix.
x() <<
"," << meas_URcorn_LLpix.
y()
216 <<
"\n\t >>> meas: inner upper right = " << meas_LLcorn_URpix.x() <<
"," << meas_LLcorn_URpix.y() << endl;
228 cout <<
"\t >>> Generic:: processing X" << endl;
235 local_URcorn_LLpix.
x(),
236 local_LLcorn_URpix.
x(),
248 xPos = xPos + shiftX;
252 cout <<
"\t >>> Generic:: processing Y" << endl;
264 local_URcorn_LLpix.
y(),
265 local_LLcorn_URpix.
y(),
280 local_URcorn_LLpix.
y(),
281 local_LLcorn_URpix.
y(),
294 yPos = yPos + shiftY;
306 xPos -= theClusterParam.
dx1;
308 xPos -= theClusterParam.
dx2;
312 xPos -= theClusterParam.
deltax;
323 yPos -= theClusterParam.
dy1;
325 yPos -= theClusterParam.
dy2;
329 yPos -= theClusterParam.
deltay;
348 int& lowest_is_bricked,
349 int& highest_is_bricked,
386 for (
int i = 0;
i != isize; ++
i) {
389 int pix_adc =
pixel.adc;
400 if (
pixel.y == ymin) {
405 lowest_is_bricked = 0;
409 if (
pixel.y == ymax) {
414 highest_is_bricked = 1;
420 edm::LogInfo(
"PixelCPE: collect_edge_charges_bricked: l/h") << lowest_is_bricked <<
"it" << highest_is_bricked;
422 if (lowest_is_bricked)
427 if (highest_is_bricked)
433 for (
int i = 0;
i != isize; ++
i) {
435 int pix_adc =
pixel.adc;
439 if (lowest_is_bricked &&
pixel.y == ymin + 1 && !(
pixel.x % 2))
442 if (!highest_is_bricked &&
pixel.y == ymax - 1 && (
pixel.x % 2))
445 edm::LogInfo(
"PixelCPE: collect_edge_charges_bricked: Q") << q_l_b << q_f_b << q_f_X << q_l_X << q_f_Y << q_l_Y;
static void collect_edge_charges_bricked(ClusterParam &theClusterParam, int &q_f_X, int &q_l_X, int &q_f_Y, int &q_l_Y, int &Q_f_b, int &Q_l_b, int &lowest_is_bricked, int &highest_is_bricked, bool truncate)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
float the_eff_charge_cut_highY
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const SiPixelCluster * theCluster
static void collect_edge_charges(ClusterParam &theClusterParam, int &q_f_X, int &q_l_X, int &q_f_Y, int &q_l_Y, bool truncate)
std::vector< SiPixelGenErrorStore > thePixelGenError_
PixelCPEGenericForBricked(edm::ParameterSet const &conf, const MagneticField *, const TrackerGeometry &, const TrackerTopology &, const SiPixelLorentzAngle *, const SiPixelGenErrorDBObject *, const SiPixelLorentzAngle *)
The constructor.
bool IrradiationBiasCorrection_
const RectangularPixelTopology * theRecTopol
float generic_position_formula_y_bricked(int size, int q_f, int q_l, int q_f_b, int q_l_b, 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)
int qbin(int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, bool irradiationCorrections, int &pixmx, float &sigmay, float &deltay, float &sigmax, float &deltax, float &sy1, float &dy1, float &sy2, float &dy2, float &sx1, float &dx1, float &sx2, float &dx2)
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
const PixelTopology * theTopol
bool LoadTemplatesFromDB_
bool isItBigPixelInX(const int ixbin) const override
bool useErrorsFromTemplates_
virtual bool isBricked() const =0
float the_eff_charge_cut_lowX
const bool truncatePixelCharge_
float lorxwidth()
signed lorentz x-width (microns)
Log< level::Info, false > LogInfo
Topology::LocalTrackPred loc_trk_pred
LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
float the_eff_charge_cut_lowY
float lorywidth()
signed lorentz y-width (microns)
bool isItBigPixelInY(const int iybin) const override
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)
float the_eff_charge_cut_highX