89 #ifndef SiPixelTemplate_h 90 #define SiPixelTemplate_h 1 96 #include "boost/multi_array.hpp" 98 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 208 #ifndef SI_PIXEL_TEMPLATE_USE_BOOST 218 float* cotbetaY =
nullptr;
219 float* cotbetaX =
nullptr;
220 float* cotalphaX =
nullptr;
221 boost::multi_array<SiPixelTemplateEntry, 1> enty;
222 boost::multi_array<SiPixelTemplateEntry, 2> entx;
225 if (cotbetaY !=
nullptr)
227 if (cotbetaX !=
nullptr)
229 if (cotalphaX !=
nullptr)
256 SiPixelTemplate(
const std::vector<SiPixelTemplateStore>& thePixelTemp) : thePixelTemp_(thePixelTemp) {
265 #ifdef SI_PIXEL_TEMPLATE_STANDALONE 266 static bool pushfile(
int filenum, std::vector<SiPixelTemplateStore>& pixelTemp,
std::string dir =
"");
268 static bool pushfile(
int filenum,
269 std::vector<SiPixelTemplateStore>& pixelTemp,
273 std::vector<SiPixelTemplateStore>& pixelTemp);
277 static void postInit(std::vector<SiPixelTemplateStore>& thePixelTemp_);
283 bool interpolate(
int id,
float cotalpha,
float cotbeta,
float locBz);
286 bool interpolate(
int id,
float cotalpha,
float cotbeta);
289 void ytemp(
int fybin,
int lybin,
float ytemplate[41][
BYSIZE]);
291 void xtemp(
int fxbin,
int lxbin,
float xtemplate[41][
BXSIZE]);
300 void ytemp3d_int(
int nypix,
int& nybins);
302 void ytemp3d(
int j,
int k, std::vector<float>& ytemplate);
304 void xtemp3d_int(
int nxpix,
int& nxbins);
306 void xtemp3d(
int j,
int k, std::vector<float>& xtemplate);
309 void ysigma2(
int fypix,
int lypix,
float sythr,
float ysum[BYSIZE],
float ysig2[BYSIZE]);
311 void ysigma2(
float qpixel,
int index,
float& ysig2);
313 void xsigma2(
int fxpix,
int lxpix,
float sxthr,
float xsum[BXSIZE],
float xsig2[BXSIZE]);
316 float yflcorr(
int binq,
float qfly);
319 float xflcorr(
int binq,
float qflx);
361 int qbin(
int id,
float cotalpha,
float cotbeta,
float qclus);
364 int qbin(
int id,
float cotbeta,
float qclus);
367 void temperrors(
int id,
379 void qbin_dist(
int id,
389 bool simpletemplate2D(
390 float xhitp,
float yhitp, std::vector<bool>& ydouble, std::vector<bool>& xdouble,
float template2d[
BXM2][
BYM2]);
393 void vavilov_pars(
double& mpv,
double& sigma,
double&
kappa);
396 void vavilov2_pars(
double& mpv,
double& sigma,
double& kappa);
401 float s50() {
return s50_; }
415 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 416 if (i < 0 || i > 1) {
417 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::qmin called with illegal index = " << i << std::endl;
420 assert(i >= 0 && i < 2);
434 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 435 if (i < 0 || i > 3) {
436 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::yavg called with illegal index = " << i << std::endl;
439 assert(i >= 0 && i < 4);
444 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 445 if (i < 0 || i > 3) {
446 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::yrms called with illegal index = " << i << std::endl;
449 assert(i >= 0 && i < 4);
454 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 455 if (i < 0 || i > 3) {
456 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ygx0 called with illegal index = " << i << std::endl;
459 assert(i >= 0 && i < 4);
464 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 465 if (i < 0 || i > 3) {
466 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ygsig called with illegal index = " << i << std::endl;
469 assert(i >= 0 && i < 4);
474 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 475 if (i < 0 || i > 3) {
476 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xavg called with illegal index = " << i << std::endl;
479 assert(i >= 0 && i < 4);
484 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 485 if (i < 0 || i > 3) {
486 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xrms called with illegal index = " << i << std::endl;
489 assert(i >= 0 && i < 4);
494 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 495 if (i < 0 || i > 3) {
496 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xgx0 called with illegal index = " << i << std::endl;
499 assert(i >= 0 && i < 4);
504 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 505 if (i < 0 || i > 3) {
506 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xgsig called with illegal index = " << i << std::endl;
509 assert(i >= 0 && i < 4);
514 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 515 if (i < 0 || i > 3) {
516 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::chi2yavg called with illegal index = " << i << std::endl;
519 assert(i >= 0 && i < 4);
524 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 525 if (i < 0 || i > 3) {
526 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::chi2ymin called with illegal index = " << i << std::endl;
529 assert(i >= 0 && i < 4);
534 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 535 if (i < 0 || i > 3) {
536 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::chi2xavg called with illegal index = " << i << std::endl;
539 assert(i >= 0 && i < 4);
544 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 545 if (i < 0 || i > 3) {
546 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::chi2xmin called with illegal index = " << i << std::endl;
549 assert(i >= 0 && i < 4);
554 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 555 if (i < 0 || i > 3) {
556 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::yavgc2m called with illegal index = " << i << std::endl;
559 assert(i >= 0 && i < 4);
564 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 565 if (i < 0 || i > 3) {
566 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::yrmsc2m called with illegal index = " << i << std::endl;
569 assert(i >= 0 && i < 4);
574 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 575 if (i < 0 || i > 3) {
577 <<
"SiPixelTemplate::chi2yavgc2m called with illegal index = " << i << std::endl;
580 assert(i >= 0 && i < 4);
582 return chi2yavgc2m_[
i];
585 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 586 if (i < 0 || i > 3) {
588 <<
"SiPixelTemplate::chi2yminc2m called with illegal index = " << i << std::endl;
591 assert(i >= 0 && i < 4);
593 return chi2yminc2m_[
i];
596 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 597 if (i < 0 || i > 3) {
598 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xavgc2m called with illegal index = " << i << std::endl;
601 assert(i >= 0 && i < 4);
606 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 607 if (i < 0 || i > 3) {
608 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xrmsc2m called with illegal index = " << i << std::endl;
611 assert(i >= 0 && i < 4);
616 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 617 if (i < 0 || i > 3) {
619 <<
"SiPixelTemplate::chi2xavgc2m called with illegal index = " << i << std::endl;
622 assert(i >= 0 && i < 4);
624 return chi2xavgc2m_[
i];
627 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 628 if (i < 0 || i > 3) {
630 <<
"SiPixelTemplate::chi2xminc2m called with illegal index = " << i << std::endl;
633 assert(i >= 0 && i < 4);
635 return chi2xminc2m_[
i];
638 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 639 if (i < 0 || i > 2) {
640 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::fbin called with illegal index = " << i << std::endl;
643 assert(i >= 0 && i < 3);
712 float xparly0_[2][5];
713 float xparhy0_[2][5];
725 float yflparl_[4][6];
726 float yflparh_[4][6];
731 float xflparll_[4][6];
732 float xflparlh_[4][6];
733 float xflparhl_[4][6];
734 float xflparhh_[4][6];
741 float chi2yavgc2m_[4];
742 float chi2yminc2m_[4];
745 float chi2xavgc2m_[4];
746 float chi2xminc2m_[4];
float fracxone()
The simulated fraction of single pixel x-clusters.
float yrmsc2m(int i)
1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins ...
SiPixelTemplate(const std::vector< SiPixelTemplateStore > &thePixelTemp)
Constructor for cases in which template store already exists.
float cota_current_
current cot alpha
float qavg_avg
average cluster charge of clusters that are less than qavg (normalize 2-D simple templates) ...
float mpvvav_
most probable charge in Vavilov distribution (not actually for larger kappa)
int runnum
< Basic template entry corresponding to a single set of track angles
float xflpar[4][6]
Aqfl-parameterized x-correction in 4 charge bins.
float fbin(int i)
Return lower bound of Qbin definition.
float xrms[4]
average x-rms of reconstruction binned in 4 charge bins
float clslenx
cluster x-length in pixels at signal height sxmax/2
float chi2xminone()
//!< minimum of x chi^2 for 1 pixel clusters
float clsleny_
y-cluster length of smaller interpolated template in pixels
float qavg
average cluster charge for this set of track angles (now includes threshold effects) ...
float pixmax_
maximum pixel charge
float chi2yavgc2m(int i)
1st pass chi2 min search: average y-chisq for merged clusters
float syone
rms for one pixel y-clusters
float chi2yavgone
average y chi^2 for 1 pixel clusters
float symax()
average pixel signal for y-projection of cluster
float kappavav2()
kappa parameter for 2-cluster Vavilov distribution
float lorybias_
Lorentz y-bias.
float yavg(int i)
average y-bias of reconstruction binned in 4 charge bins
float abs_cotb_
absolute value of cot beta
float dyone
mean offset/correction for one pixel y-clusters
float sigmavav
"sigma" scale fctor for Vavilov distribution
float fracxtwo
fraction of double pixel sample with xsize = 1
float yavggen[4]
generic algorithm: average y-bias of reconstruction binned in 4 charge bins
float sxmax
average pixel signal for x-projection of cluster
float chi2yminc2m[4]
1st pass chi2 min search: minimum of y chi^2 in 4 charge bins (merged clusters)
float xavgc2m[4]
1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins ...
float chi2xavgone
average x chi^2 for 1 pixel clusters
float fracytwo
fraction of double pixel sample with ysize = 1
float yrms[4]
average y-rms of reconstruction binned in 4 charge bins
float ss50()
1/2 of the single pixel per double column threshold in electrons
float chi2xmin(int i)
minimum y chi^2 in 4 charge bins
float ss50_
1/2 of the pixel double col threshold signal in electrons
float mpvvav()
most probable charge in Vavilov distribution (not actually for larger kappa)
float mpvvav2
most probable charge in Vavilov distribution for 2 merged clusters (not actually for larger kappa) ...
float clslenx()
x-size of smaller interpolated template in pixels
float sxmax_
average pixel signal for x-projection of cluster
float ygx0gen[4]
generic algorithm: average y0 from Gaussian fit binned in 4 charge bins
float xavg[4]
average x-bias of reconstruction binned in 4 charge bins
float chi2yminone_
minimum of y chi^2 for 1 pixel clusters
float chi2ymin(int i)
minimum y chi^2 in 4 charge bins
float yratio()
fractional distance in y between cotbeta templates
float fracxone_
The simulated fraction of single pixel x-clusters.
float dytwo
mean offset/correction for one double-pixel y-clusters
float xrms(int i)
average x-rms of reconstruction binned in 4 charge bins
float dxone
mean offset/correction for one pixel x-clusters
float chi2xavgone_
average x chi^2 for 1 pixel clusters
float qmin()
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float pixmax
maximum charge for individual pixels in cluster
float zsize()
pixel z-size or thickness (microns)
float xavgc2m(int i)
1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins ...
float chi2yavgc2m[4]
1st pass chi2 min search: average y chi^2 in 4 charge bins (merged clusters)
float qmin
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float chi2xavgc2m[4]
1st pass chi2 min search: average x chi^2 in 4 charge bins (merged clusters)
float mpvvav2()
most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa) ...
float r_qMeas_qTrue()
ratio of measured to true cluster charge
float sytwo()
rms for one double-pixel y-clusters
float xgsiggen[4]
generic algorithm: average sigma_x from Gaussian fit binned in 4 charge bins
float cotb_current_
current cot beta
float s50_
1/2 of the pixel single col threshold signal in electrons
float chi2xminc2m[4]
1st pass chi2 min search: minimum of x chi^2 in 4 charge bins (merged clusters)
float cotalpha
cot(alpha) is proportional to cluster length in x and is basis of interpolation
float chi2yminone()
//!< minimum of y chi^2 for 1 pixel clusters
float ytemp[9][21]
templates for y-reconstruction (binned over 1 central pixel)
float sxone()
rms for one pixel x-clusters
float yrmsc2m[4]
1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins ...
float qavg_
average cluster charge for this set of track angles
float r_qMeas_qTrue_
ratio of measured to true cluster charges
float lorxbias_
Lorentz x-bias.
float qscale()
charge scaling factor
float xpar[2][5]
projected x-pixel uncertainty parameterization
float chi2xavgc2m(int i)
1st pass chi2 min search: average x-chisq for merged clusters
float ygx0[4]
average y0 from Gaussian fit binned in 4 charge bins
float xgx0gen[4]
generic algorithm: average x0 from Gaussian fit binned in 4 charge bins
float dxone()
mean offset/correction for one pixel x-clusters
float sxparmax_
maximum pixel signal for parameterization of x uncertainties
float kappavav2_
kappa parameter for 2-cluster Vavilov distribution
float symax
average pixel signal for y-projection of cluster
float sigmavav_
"sigma" scale fctor for Vavilov distribution
float kappavav2
kappa parameter for Vavilov distribution for 2 merged clusters
float xgsig[4]
average sigma_x from Gaussian fit binned in 4 charge bins
float kappavav()
kappa parameter for Vavilov distribution
float cotbeta
cot(beta) is proportional to cluster length in y and is basis of interpolation
float chi2yavg(int i)
average y chi^2 in 4 charge bins
float beta
beta track angle (defined in CMS CMS IN 2004/014)
float fracytwo()
The simulated fraction of single double-size pixel y-clusters.
float lorxwidth()
signed lorentz x-width (microns)
float lorywidth()
signed lorentz y-width (microns)
float ygsig(int i)
average sigma_y from Gaussian fit binned in 4 charge bins
float yrms(int i)
average y-rms of reconstruction binned in 4 charge bins
float lorywidth_
Lorentz y-width (sign corrected for fpix frame)
float clsleny()
y-size of smaller interpolated template in pixels
float fracxtwo()
The simulated fraction of single double-size pixel x-clusters.
float xrmsc2m[4]
1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins ...
float xgx0[4]
average x0 from Gaussian fit binned in 4 charge bins
float xsize()
pixel x-size (microns)
boost::multi_array< float, 2 > temp2dx_
2d-primitive for spltting 3-d template
float sigmavav2_
"sigma" scale fctor for 2-cluster Vavilov distribution
float sigmavav2()
"sigma" scale fctor for 2-cluster Vavilov distribution
float ygsiggen[4]
generic algorithm: average sigma_y from Gaussian fit binned in 4 charge bins
float fracxone
fraction of sample with xsize = 1
float sxtwo()
rms for one double-pixel x-clusters
float mpvvav
most probable charge in Vavilov distribution (not actually for larger kappa)
float ysize_
Pixel y-size.
float xsize_
Pixel x-size.
float dytwo()
mean offset/correction for one double-pixel y-clusters
float kappavav_
kappa parameter for Vavilov distribution
float sxtwo
rms for one double-pixel x-clusters
bool success_
true if cotalpha, cotbeta are inside of the acceptance (dynamically loaded)
float r_qMeas_qTrue
ratio of measured to true cluster charge
float syone_
rms for one pixel y-clusters
float chi2yavg[4]
average y chi^2 in 4 charge bins
float alpha
alpha track angle (defined in CMS CMS IN 2004/014)
float xtemp[9][13]
templates for x-reconstruction (binned over 1 central pixel)
float chi2yminc2m(int i)
1st pass chi2 min search: minimum y-chisq for merged clusters
SiPixelTemplateHeader head
< template storage structure
float s50()
1/2 of the pixel threshold signal in electrons
float chi2xminone
minimum of x chi^2 for 1 pixel clusters
float ypar[2][5]
projected y-pixel uncertainty parameterization
float chi2yavgone_
average y chi^2 for 1 pixel clusters
float dyone_
mean offset/correction for one pixel y-clusters
float yavgc2m(int i)
1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins ...
const std::vector< SiPixelTemplateStore > & thePixelTemp_
float sxone_
rms for one pixel x-clusters
float dxtwo_
mean offset/correction for one double-pixel x-clusters
float chi2xminc2m(int i)
1st pass chi2 min search: minimum x-chisq for merged clusters
float ygx0(int i)
average y0 from Gaussian fit binned in 4 charge bins
float qscale_
charge scaling factor
float qmin(int i)
minimum cluster charge for valid hit (keeps 99.9% or 99.8% of simulated hits)
float lorybias()
signed lorentz y-width (microns)
float qmin2_
tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)
float qbfrac[3]
fraction of sample in qbin = 0-2 (>=3 is the complement)
float syone()
rms for one pixel y-clusters
float sytwo_
rms for one double-pixel y-clusters
float qavg_avg_
average of cluster charge less than qavg
float fracyone
fraction of sample with ysize = 1
float fracyone()
The simulated fraction of single pixel y-clusters.
float chi2yavgone()
//!< average y chi^2 for 1 pixel clusters
float qmin2
tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)
float yxratio()
fractional distance in y between cotalpha templates slices
float chi2xminone_
minimum of x chi^2 for 1 pixel clusters
float yavg[4]
average y-bias of reconstruction binned in 4 charge bins
float qavg()
average cluster charge for this set of track angles
float sxtwo_
rms for one double-pixel x-clusters
float sxmax()
average pixel signal for x-projection of cluster
float clslenx_
x-cluster length of smaller interpolated template in pixels
boost::multi_array< float, 2 > temp2dy_
2d-primitive for spltting 3-d template
float chi2ymin[4]
minimum of y chi^2 in 4 charge bins
float fracyone_
The simulated fraction of single pixel y-clusters.
float yavgc2m[4]
1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins ...
float fracxtwo_
The simulated fraction of single double-size pixel x-clusters.
float symax_
average pixel signal for y-projection of cluster
float dxtwo
mean offset/correction for one double-pixel x-clusters
float chi2xavgone()
//!< average x chi^2 for 1 pixel clusters
float lorxbias()
signed lorentz x-width (microns)
float pixmax()
maximum pixel charge
float xxratio_
fractional distance in x between cotalpha templates
float sigmavav()
"sigma" scale fctor for Vavilov distribution
float yflpar[4][6]
Aqfl-parameterized y-correction in 4 charge bins.
float yxratio_
fractional distance in y between x-slices of cotalpha templates
float sxone
rms for one pixel x-clusters
float xgx0(int i)
average x0 from Gaussian fit binned in 4 charge bins
float qmin_
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float dxone_
mean offset/correction for one pixel x-clusters
float chi2xmin[4]
minimum of x chi^2 in 4 charge bins
static const G4double kappa
float lorxwidth_
Lorentz x-width.
float chi2xavg(int i)
averaage x chi^2 in 4 charge bins
int index_id_
current index
float chi2yminone
minimum of y chi^2 for 1 pixel clusters
float xgsig(int i)
average sigma_x from Gaussian fit binned in 4 charge bins
float costrk[3]
direction cosines of tracks used to generate this entry
float mpvvav2_
most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa) ...
float syparmax_
maximum pixel signal for parameterization of y uncertainties
float ygsig[4]
average sigma_y from Gaussian fit binned in 4 charge bins
float nxbins_
number of bins in each dimension of the x-splitting template
float fracytwo_
The simulated fraction of single double-size pixel y-clusters.
float sigmavav2
"sigma" scale fctor for Vavilov distribution for 2 merged clusters
float sytwo
rms for one double-pixel y-clusters
float dyone()
mean offset/correction for one pixel y-clusters
float xavg(int i)
average x-bias of reconstruction binned in 4 charge bins
float xrmsgen[4]
generic algorithm: average x-rms of reconstruction binned in 4 charge bins
float dytwo_
mean offset/correction for one double-pixel y-clusters
float dxtwo()
mean offset/correction for one double-pixel x-clusters
int id_current_
current id
float ysize()
pixel y-size (microns)
float zsize_
Pixel z-size (thickness)
float chi2xavg[4]
average x chi^2 in 4 charge bins
float xrmsc2m(int i)
1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins ...
float yratio_
fractional distance in y between cotbeta templates
float xxratio()
fractional distance in x between cotalpha templates
float kappavav
kappa parameter for Vavilov distribution
float xavggen[4]
generic algorithm: average x-bias of reconstruction binned in 4 charge bins
float yrmsgen[4]
generic algorithm: average y-rms of reconstruction binned in 4 charge bins
float nybins_
number of bins in each dimension of the y-splitting template
float clsleny
cluster y-length in pixels at signal height symax/2