CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SiPixelTemplate Class Reference

#include <SiPixelTemplate.h>

Public Member Functions

float chi2xavg (int i)
 averaage x chi^2 in 4 charge bins More...
 
float chi2xavgc2m (int i)
 1st pass chi2 min search: average x-chisq for merged clusters More...
 
float chi2xavgone ()
 //!< average x chi^2 for 1 pixel clusters More...
 
float chi2xmin (int i)
 minimum y chi^2 in 4 charge bins More...
 
float chi2xminc2m (int i)
 1st pass chi2 min search: minimum x-chisq for merged clusters More...
 
float chi2xminone ()
 //!< minimum of x chi^2 for 1 pixel clusters More...
 
float chi2yavg (int i)
 average y chi^2 in 4 charge bins More...
 
float chi2yavgc2m (int i)
 1st pass chi2 min search: average y-chisq for merged clusters More...
 
float chi2yavgone ()
 //!< average y chi^2 for 1 pixel clusters More...
 
float chi2ymin (int i)
 minimum y chi^2 in 4 charge bins More...
 
float chi2yminc2m (int i)
 1st pass chi2 min search: minimum y-chisq for merged clusters More...
 
float chi2yminone ()
 //!< minimum of y chi^2 for 1 pixel clusters More...
 
float clslenx ()
 x-size of smaller interpolated template in pixels More...
 
float clsleny ()
 y-size of smaller interpolated template in pixels More...
 
int cxtemp ()
 Return central pixel of x-template pixels above readout threshold. More...
 
int cytemp ()
 Return central pixel of y template pixels above readout threshold. More...
 
float dxone ()
 mean offset/correction for one pixel x-clusters More...
 
float dxtwo ()
 mean offset/correction for one double-pixel x-clusters More...
 
float dyone ()
 mean offset/correction for one pixel y-clusters More...
 
float dytwo ()
 mean offset/correction for one double-pixel y-clusters More...
 
float fbin (int i)
 Return lower bound of Qbin definition. More...
 
float fracxone ()
 The simulated fraction of single pixel x-clusters. More...
 
float fracxtwo ()
 The simulated fraction of single double-size pixel x-clusters. More...
 
float fracyone ()
 The simulated fraction of single pixel y-clusters. More...
 
float fracytwo ()
 The simulated fraction of single double-size pixel y-clusters. More...
 
bool interpolate (int id, float cotalpha, float cotbeta)
 
bool interpolate (int id, float cotalpha, float cotbeta, float locBz)
 
bool interpolate (int id, float cotalpha, float cotbeta, float locBz, float locBx)
 
float kappavav ()
 kappa parameter for Vavilov distribution More...
 
float kappavav2 ()
 kappa parameter for 2-cluster Vavilov distribution More...
 
float lorxbias ()
 signed lorentz x-width (microns) More...
 
float lorxwidth ()
 signed lorentz x-width (microns) More...
 
float lorybias ()
 signed lorentz y-width (microns) More...
 
float lorywidth ()
 signed lorentz y-width (microns) More...
 
float mpvvav ()
 most probable charge in Vavilov distribution (not actually for larger kappa) More...
 
float mpvvav2 ()
 most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa) More...
 
float pixmax ()
 maximum pixel charge More...
 
float qavg ()
 average cluster charge for this set of track angles More...
 
int qbin (int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, float &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)
 
int qbin (int id, float cotalpha, float cotbeta, float locBz, float qclus, float &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)
 
int qbin (int id, float cotalpha, float cotbeta, float qclus)
 
int qbin (int id, float cotbeta, float qclus)
 
void qbin_dist (int id, float cotalpha, float cotbeta, float qbin_frac[4], float &ny1_frac, float &ny2_frac, float &nx1_frac, float &nx2_frac)
 
float qmin ()
 minimum cluster charge for valid hit (keeps 99.9% of simulated hits) More...
 
float qmin (int i)
 minimum cluster charge for valid hit (keeps 99.9% or 99.8% of simulated hits) More...
 
float qscale ()
 charge scaling factor More...
 
float r_qMeas_qTrue ()
 ratio of measured to true cluster charge More...
 
float s50 ()
 1/2 of the pixel threshold signal in electrons More...
 
float sigmavav ()
 "sigma" scale fctor for Vavilov distribution More...
 
float sigmavav2 ()
 "sigma" scale fctor for 2-cluster Vavilov distribution More...
 
bool simpletemplate2D (float xhitp, float yhitp, std::vector< bool > &ydouble, std::vector< bool > &xdouble, float template2d[13+2][21+2])
 Make simple 2-D templates from track angles set in interpolate and hit position. More...
 
 SiPixelTemplate (const std::vector< SiPixelTemplateStore > &thePixelTemp)
 Constructor for cases in which template store already exists. More...
 
float ss50 ()
 1/2 of the single pixel per double column threshold in electrons More...
 
float sxmax ()
 average pixel signal for x-projection of cluster More...
 
float sxone ()
 rms for one pixel x-clusters More...
 
float sxtwo ()
 rms for one double-pixel x-clusters More...
 
float symax ()
 average pixel signal for y-projection of cluster More...
 
float syone ()
 rms for one pixel y-clusters More...
 
float sytwo ()
 rms for one double-pixel y-clusters More...
 
void temperrors (int id, float cotalpha, float cotbeta, int qBin, float &sigmay, float &sigmax, float &sy1, float &sy2, float &sx1, float &sx2)
 
void vavilov2_pars (double &mpv, double &sigma, double &kappa)
 
void vavilov_pars (double &mpv, double &sigma, double &kappa)
 
float xavg (int i)
 average x-bias of reconstruction binned in 4 charge bins More...
 
float xavgc2m (int i)
 1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins More...
 
float xflcorr (int binq, float qflx)
 
float xgsig (int i)
 average sigma_x from Gaussian fit binned in 4 charge bins More...
 
float xgx0 (int i)
 average x0 from Gaussian fit binned in 4 charge bins More...
 
float xrms (int i)
 average x-rms of reconstruction binned in 4 charge bins More...
 
float xrmsc2m (int i)
 1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins More...
 
void xsigma2 (int fxpix, int lxpix, float sxthr, float xsum[13+4], float xsig2[13+4])
 
float xsize ()
 pixel x-size (microns) More...
 
void xtemp (int fxbin, int lxbin, float xtemplate[41][13+4])
 
void xtemp3d (int j, int k, std::vector< float > &xtemplate)
 
void xtemp3d_int (int nxpix, int &nxbins)
 
float xxratio ()
 fractional distance in x between cotalpha templates More...
 
float yavg (int i)
 average y-bias of reconstruction binned in 4 charge bins More...
 
float yavgc2m (int i)
 1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins More...
 
float yflcorr (int binq, float qfly)
 
float ygsig (int i)
 average sigma_y from Gaussian fit binned in 4 charge bins More...
 
float ygx0 (int i)
 average y0 from Gaussian fit binned in 4 charge bins More...
 
float yratio ()
 fractional distance in y between cotbeta templates More...
 
float yrms (int i)
 average y-rms of reconstruction binned in 4 charge bins More...
 
float yrmsc2m (int i)
 1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins More...
 
void ysigma2 (float qpixel, int index, float &ysig2)
 
void ysigma2 (int fypix, int lypix, float sythr, float ysum[21+4], float ysig2[21+4])
 
float ysize ()
 pixel y-size (microns) More...
 
void ytemp (int fybin, int lybin, float ytemplate[41][21+4])
 
void ytemp3d (int j, int k, std::vector< float > &ytemplate)
 
void ytemp3d_int (int nypix, int &nybins)
 
float yxratio ()
 fractional distance in y between cotalpha templates slices More...
 
float zsize ()
 pixel z-size or thickness (microns) More...
 

Static Public Member Functions

static void postInit (std::vector< SiPixelTemplateStore > &thePixelTemp_)
 
static bool pushfile (const SiPixelTemplateDBObject &dbobject, std::vector< SiPixelTemplateStore > &pixelTemp)
 
static bool pushfile (int filenum, std::vector< SiPixelTemplateStore > &pixelTemp, std::string dir="CalibTracker/SiPixelESProducers/data/")
 

Private Attributes

float abs_cotb_
 absolute value of cot beta More...
 
float chi2xavg_ [4]
 average x chi^2 in 4 charge bins More...
 
float chi2xavgc2m_ [4]
 1st pass chi2 min search: average x-chisq for merged clusters More...
 
float chi2xavgone_
 average x chi^2 for 1 pixel clusters More...
 
float chi2xmin_ [4]
 minimum of x chi^2 in 4 charge bins More...
 
float chi2xminc2m_ [4]
 1st pass chi2 min search: minimum x-chisq for merged clusters More...
 
float chi2xminone_
 minimum of x chi^2 for 1 pixel clusters More...
 
float chi2yavg_ [4]
 average y chi^2 in 4 charge bins More...
 
float chi2yavgc2m_ [4]
 1st pass chi2 min search: average y-chisq for merged clusters More...
 
float chi2yavgone_
 average y chi^2 for 1 pixel clusters More...
 
float chi2ymin_ [4]
 minimum of y chi^2 in 4 charge bins More...
 
float chi2yminc2m_ [4]
 1st pass chi2 min search: minimum y-chisq for merged clusters More...
 
float chi2yminone_
 minimum of y chi^2 for 1 pixel clusters More...
 
float clslenx_
 x-cluster length of smaller interpolated template in pixels More...
 
float clsleny_
 y-cluster length of smaller interpolated template in pixels More...
 
float cota_current_
 current cot alpha More...
 
float cotb_current_
 current cot beta More...
 
float delyavg_
 average difference between clsleny_ and cluster length [with threshold effects] More...
 
float delysig_
 rms of difference between clsleny_ and cluster length [with threshold effects] More...
 
int dtype_
 flags BPix (=0) or FPix (=1) More...
 
float dxone_
 mean offset/correction for one pixel x-clusters More...
 
float dxtwo_
 mean offset/correction for one double-pixel x-clusters More...
 
float dyone_
 mean offset/correction for one pixel y-clusters More...
 
float dytwo_
 mean offset/correction for one double-pixel y-clusters More...
 
const SiPixelTemplateEntryentry_sideloaded_
 
const SiPixelTemplateEntryentx00_
 
const SiPixelTemplateEntryentx02_
 
const SiPixelTemplateEntryentx20_
 
const SiPixelTemplateEntryentx21_
 
const SiPixelTemplateEntryentx22_
 
const SiPixelTemplateEntryenty0_
 
const SiPixelTemplateEntryenty1_
 
float fbin_ [3]
 The QBin definitions in Q_clus/Q_avg. More...
 
bool flip_x_
 flip x sign-sensitive quantities More...
 
bool flip_y_
 flip y sign-sensitive quantities More...
 
float fracxone_
 The simulated fraction of single pixel x-clusters. More...
 
float fracxtwo_
 The simulated fraction of single double-size pixel x-clusters. More...
 
float fracyone_
 The simulated fraction of single pixel y-clusters. More...
 
float fracytwo_
 The simulated fraction of single double-size pixel y-clusters. More...
 
int id_current_
 current id More...
 
int index_id_
 current index More...
 
float kappavav2_
 kappa parameter for 2-cluster Vavilov distribution More...
 
float kappavav_
 kappa parameter for Vavilov distribution More...
 
float lorxbias_
 Lorentz x-bias. More...
 
float lorxwidth_
 Lorentz x-width. More...
 
float lorybias_
 Lorentz y-bias. More...
 
float lorywidth_
 Lorentz y-width (sign corrected for fpix frame) More...
 
float mpvvav2_
 most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa) More...
 
float mpvvav_
 most probable charge in Vavilov distribution (not actually for larger kappa) More...
 
float nxbins_
 number of bins in each dimension of the x-splitting template More...
 
float nybins_
 number of bins in each dimension of the y-splitting template More...
 
float offsetx_ [4]
 x-offset in charge bins More...
 
float offsety_ [4]
 y-offset in charge bins More...
 
float pixmax_
 maximum pixel charge More...
 
float qavg_
 average cluster charge for this set of track angles More...
 
float qavg_avg_
 average of cluster charge less than qavg More...
 
float qmin2_
 tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits) More...
 
float qmin_
 minimum cluster charge for valid hit (keeps 99.9% of simulated hits) More...
 
float qscale_
 charge scaling factor More...
 
float r_qMeas_qTrue_
 ratio of measured to true cluster charges More...
 
float s50_
 1/2 of the pixel single col threshold signal in electrons More...
 
float scalex_ [4]
 x-error scale factor in charge bins More...
 
float scalexavg_
 average x-error scale factor More...
 
float scaley_ [4]
 y-error scale factor in charge bins More...
 
float scaleyavg_
 average y-error scale factor More...
 
float sigmavav2_
 "sigma" scale fctor for 2-cluster Vavilov distribution More...
 
float sigmavav_
 "sigma" scale fctor for Vavilov distribution More...
 
float ss50_
 1/2 of the pixel double col threshold signal in electrons More...
 
bool success_
 true if cotalpha, cotbeta are inside of the acceptance (dynamically loaded) More...
 
float sxmax_
 average pixel signal for x-projection of cluster More...
 
float sxone_
 rms for one pixel x-clusters More...
 
float sxparmax_
 maximum pixel signal for parameterization of x uncertainties More...
 
float sxtwo_
 rms for one double-pixel x-clusters More...
 
float symax_
 average pixel signal for y-projection of cluster More...
 
float syone_
 rms for one pixel y-clusters More...
 
float syparmax_
 maximum pixel signal for parameterization of y uncertainties More...
 
float sytwo_
 rms for one double-pixel y-clusters More...
 
boost::multi_array< float, 2 > temp2dx_
 2d-primitive for spltting 3-d template More...
 
boost::multi_array< float, 2 > temp2dy_
 2d-primitive for spltting 3-d template More...
 
const std::vector< SiPixelTemplateStore > & thePixelTemp_
 
float xavg_ [4]
 average x-bias of reconstruction binned in 4 charge bins More...
 
float xavgc2m_ [4]
 1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins More...
 
float xflparhh_ [4][6]
 Aqfl-parameterized x-correction in 4 charge bins for larger cotbeta, cotalpha. More...
 
float xflparhl_ [4][6]
 Aqfl-parameterized x-correction in 4 charge bins for larger cotbeta, smaller cotalpha. More...
 
float xflparlh_ [4][6]
 Aqfl-parameterized x-correction in 4 charge bins for smaller cotbeta, larger cotalpha. More...
 
float xflparll_ [4][6]
 Aqfl-parameterized x-correction in 4 charge bins for smaller cotbeta, cotalpha. More...
 
float xgsig_ [4]
 sigma from Gaussian fit binned in 4 charge bins More...
 
float xgx0_ [4]
 average x0 from Gaussian fit binned in 4 charge bins More...
 
float xpar0_ [2][5]
 projected x-pixel uncertainty parameterization for central cotalpha More...
 
float xparh_ [2][5]
 projected x-pixel uncertainty parameterization for larger cotalpha More...
 
float xparhy0_ [2][5]
 projected x-pixel uncertainty parameterization for larger cotbeta (central alpha) More...
 
float xparl_ [2][5]
 projected x-pixel uncertainty parameterization for smaller cotalpha More...
 
float xparly0_ [2][5]
 projected x-pixel uncertainty parameterization for smaller cotbeta (central alpha) More...
 
float xrms_ [4]
 average x-rms of reconstruction binned in 4 charge bins More...
 
float xrmsc2m_ [4]
 1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins More...
 
float xsize_
 Pixel x-size. More...
 
float xtemp_ [9][13+4]
 templates for x-reconstruction (binned over 5 central pixels) More...
 
float xxratio_
 fractional distance in x between cotalpha templates More...
 
float yavg_ [4]
 average y-bias of reconstruction binned in 4 charge bins More...
 
float yavgc2m_ [4]
 1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins More...
 
float yflparh_ [4][6]
 Aqfl-parameterized y-correction in 4 charge bins for larger cotbeta. More...
 
float yflparl_ [4][6]
 Aqfl-parameterized y-correction in 4 charge bins for smaller cotbeta. More...
 
float ygsig_ [4]
 average sigma_y from Gaussian fit binned in 4 charge bins More...
 
float ygx0_ [4]
 average y0 from Gaussian fit binned in 4 charge bins More...
 
float yparh_ [2][5]
 projected y-pixel uncertainty parameterization for larger cotbeta More...
 
float yparl_ [2][5]
 projected y-pixel uncertainty parameterization for smaller cotbeta More...
 
float yratio_
 fractional distance in y between cotbeta templates More...
 
float yrms_ [4]
 average y-rms of reconstruction binned in 4 charge bins More...
 
float yrmsc2m_ [4]
 1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins More...
 
float ysize_
 Pixel y-size. More...
 
float ytemp_ [9][21+4]
 templates for y-reconstruction (binned over 5 central pixels) More...
 
float yxratio_
 fractional distance in y between x-slices of cotalpha templates More...
 
float zsize_
 Pixel z-size (thickness) More...
 

Detailed Description

A template management class. SiPixelTemplate contains thePixelTemp (a std::vector of SiPixelTemplateStore, each of which is a collection of many SiPixelTemplateEntries). Each SiPixelTemplateStore corresponds to a given detector condition, and is valid for a range of runs. We allow more than one Store since the may change over time.

This class reads templates from files via pushfile() method.

The main functionality of SiPixelTemplate is interpolate(), which produces a template on the fly, given a specific track's alpha and beta. The results are kept in data members and accessed via inline getters.

The resulting template is then used by PixelTempReco2D() (a global function) which get the reference for SiPixelTemplate & templ and uses the current template to reconstruct the SiPixelRecHit.

Definition at line 255 of file SiPixelTemplate.h.

Constructor & Destructor Documentation

◆ SiPixelTemplate()

SiPixelTemplate::SiPixelTemplate ( const std::vector< SiPixelTemplateStore > &  thePixelTemp)
inline

Constructor for cases in which template store already exists.

Definition at line 257 of file SiPixelTemplate.h.

References cota_current_, cotb_current_, entry_sideloaded_, id_current_, and index_id_.

Member Function Documentation

◆ chi2xavg()

float SiPixelTemplate::chi2xavg ( int  i)
inline

averaage x chi^2 in 4 charge bins

Definition at line 551 of file SiPixelTemplate.h.

References cms::cuda::assert(), chi2xavg_, Exception, and mps_fire::i.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ chi2xavgc2m()

float SiPixelTemplate::chi2xavgc2m ( int  i)
inline

1st pass chi2 min search: average x-chisq for merged clusters

Definition at line 633 of file SiPixelTemplate.h.

References cms::cuda::assert(), chi2xavgc2m_, Exception, and mps_fire::i.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ chi2xavgone()

float SiPixelTemplate::chi2xavgone ( )
inline

//!< average x chi^2 for 1 pixel clusters

Definition at line 668 of file SiPixelTemplate.h.

References chi2xavgone_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ chi2xmin()

float SiPixelTemplate::chi2xmin ( int  i)
inline

minimum y chi^2 in 4 charge bins

Definition at line 561 of file SiPixelTemplate.h.

References cms::cuda::assert(), chi2xmin_, Exception, and mps_fire::i.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ chi2xminc2m()

float SiPixelTemplate::chi2xminc2m ( int  i)
inline

1st pass chi2 min search: minimum x-chisq for merged clusters

Definition at line 644 of file SiPixelTemplate.h.

References cms::cuda::assert(), chi2xminc2m_, Exception, and mps_fire::i.

◆ chi2xminone()

float SiPixelTemplate::chi2xminone ( )
inline

//!< minimum of x chi^2 for 1 pixel clusters

Definition at line 669 of file SiPixelTemplate.h.

References chi2xminone_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ chi2yavg()

float SiPixelTemplate::chi2yavg ( int  i)
inline

average y chi^2 in 4 charge bins

Definition at line 531 of file SiPixelTemplate.h.

References cms::cuda::assert(), chi2yavg_, Exception, and mps_fire::i.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ chi2yavgc2m()

float SiPixelTemplate::chi2yavgc2m ( int  i)
inline

1st pass chi2 min search: average y-chisq for merged clusters

Definition at line 591 of file SiPixelTemplate.h.

References cms::cuda::assert(), chi2yavgc2m_, Exception, and mps_fire::i.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ chi2yavgone()

float SiPixelTemplate::chi2yavgone ( )
inline

//!< average y chi^2 for 1 pixel clusters

Definition at line 666 of file SiPixelTemplate.h.

References chi2yavgone_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ chi2ymin()

float SiPixelTemplate::chi2ymin ( int  i)
inline

minimum y chi^2 in 4 charge bins

Definition at line 541 of file SiPixelTemplate.h.

References cms::cuda::assert(), chi2ymin_, Exception, and mps_fire::i.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ chi2yminc2m()

float SiPixelTemplate::chi2yminc2m ( int  i)
inline

1st pass chi2 min search: minimum y-chisq for merged clusters

Definition at line 602 of file SiPixelTemplate.h.

References cms::cuda::assert(), chi2yminc2m_, Exception, and mps_fire::i.

◆ chi2yminone()

float SiPixelTemplate::chi2yminone ( )
inline

//!< minimum of y chi^2 for 1 pixel clusters

Definition at line 667 of file SiPixelTemplate.h.

References chi2yminone_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ clslenx()

float SiPixelTemplate::clslenx ( )
inline

x-size of smaller interpolated template in pixels

Definition at line 447 of file SiPixelTemplate.h.

References clslenx_.

◆ clsleny()

float SiPixelTemplate::clsleny ( )
inline

y-size of smaller interpolated template in pixels

Definition at line 446 of file SiPixelTemplate.h.

References clsleny_.

Referenced by PixelCPEClusterRepair::checkRecommend2D().

◆ cxtemp()

int SiPixelTemplate::cxtemp ( )

Return central pixel of x-template pixels above readout threshold.

Definition at line 2702 of file SiPixelTemplate.cc.

2704 {
2705  // Retrieve already interpolated quantities
2706 
2707  // Local variables
2708  int j;
2709 
2710  // Analyze only pixels along the central entry
2711  // First, find the maximum signal and then work out to the edges
2712 
2713  float sigmax = 0.f;
2714  float qedge = 2. * s50_;
2715  int jmax = -1;
2716 
2717  for (j = 0; j < BXSIZE; ++j) {
2718  if (xtemp_[4][j] > sigmax) {
2719  sigmax = xtemp_[4][j];
2720  jmax = j;
2721  }
2722  }
2723  if (sigmax < qedge) {
2724  qedge = s50_;
2725  }
2726  if (sigmax < qedge || jmax < 1 || jmax > BXM2) {
2727  return -1;
2728  }
2729 
2730  // Now search forward and backward
2731 
2732  int jend = jmax;
2733 
2734  for (j = jmax + 1; j < BXM1; ++j) {
2735  if (xtemp_[4][j] < qedge)
2736  break;
2737  jend = j;
2738  }
2739 
2740  int jbeg = jmax;
2741 
2742  for (j = jmax - 1; j > 0; --j) {
2743  if (xtemp_[4][j] < qedge)
2744  break;
2745  jbeg = j;
2746  }
2747 
2748  return (jbeg + jend) / 2;
2749 
2750 } // End cxtemp

References BXM1, BXM2, BXSIZE, and dqmiolumiharvest::j.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ cytemp()

int SiPixelTemplate::cytemp ( )

Return central pixel of y template pixels above readout threshold.

Definition at line 2649 of file SiPixelTemplate.cc.

2651 {
2652  // Retrieve already interpolated quantities
2653 
2654  // Local variables
2655  int j;
2656 
2657  // Analyze only pixels along the central entry
2658  // First, find the maximum signal and then work out to the edges
2659 
2660  float sigmax = 0.f;
2661  float qedge = 2. * s50_;
2662  int jmax = -1;
2663 
2664  for (j = 0; j < BYSIZE; ++j) {
2665  if (ytemp_[4][j] > sigmax) {
2666  sigmax = ytemp_[4][j];
2667  jmax = j;
2668  }
2669  }
2670  if (sigmax < qedge) {
2671  qedge = s50_;
2672  }
2673  if (sigmax < qedge || jmax < 1 || jmax > BYM2) {
2674  return -1;
2675  }
2676 
2677  // Now search forward and backward
2678 
2679  int jend = jmax;
2680 
2681  for (j = jmax + 1; j < BYM1; ++j) {
2682  if (ytemp_[4][j] < qedge)
2683  break;
2684  jend = j;
2685  }
2686 
2687  int jbeg = jmax;
2688 
2689  for (j = jmax - 1; j > 0; --j) {
2690  if (ytemp_[4][j] < qedge)
2691  break;
2692  jbeg = j;
2693  }
2694 
2695  return (jbeg + jend) / 2;
2696 
2697 } // End cytemp

References BYM1, BYM2, BYSIZE, and dqmiolumiharvest::j.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ dxone()

float SiPixelTemplate::dxone ( )
inline

mean offset/correction for one pixel x-clusters

Definition at line 427 of file SiPixelTemplate.h.

References dxone_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ dxtwo()

float SiPixelTemplate::dxtwo ( )
inline

mean offset/correction for one double-pixel x-clusters

Definition at line 429 of file SiPixelTemplate.h.

References dxtwo_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ dyone()

float SiPixelTemplate::dyone ( )
inline

mean offset/correction for one pixel y-clusters

Definition at line 422 of file SiPixelTemplate.h.

References dyone_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ dytwo()

float SiPixelTemplate::dytwo ( )
inline

mean offset/correction for one double-pixel y-clusters

Definition at line 424 of file SiPixelTemplate.h.

References dytwo_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ fbin()

float SiPixelTemplate::fbin ( int  i)
inline

Return lower bound of Qbin definition.

Definition at line 655 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, fbin_, and mps_fire::i.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ fracxone()

float SiPixelTemplate::fracxone ( )
inline

The simulated fraction of single pixel x-clusters.

Definition at line 689 of file SiPixelTemplate.h.

References fracxone_.

◆ fracxtwo()

float SiPixelTemplate::fracxtwo ( )
inline

The simulated fraction of single double-size pixel x-clusters.

Definition at line 691 of file SiPixelTemplate.h.

References fracxtwo_.

◆ fracyone()

float SiPixelTemplate::fracyone ( )
inline

The simulated fraction of single pixel y-clusters.

Definition at line 688 of file SiPixelTemplate.h.

References fracyone_.

◆ fracytwo()

float SiPixelTemplate::fracytwo ( )
inline

The simulated fraction of single double-size pixel y-clusters.

Definition at line 690 of file SiPixelTemplate.h.

References fracytwo_.

◆ interpolate() [1/3]

bool SiPixelTemplate::interpolate ( int  id,
float  cotalpha,
float  cotbeta 
)

Interpolate input alpha and beta angles to produce a working template for each individual hit.

Parameters
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014) Use this for Phase 1, IP related hits

Definition at line 1872 of file SiPixelTemplate.cc.

1872  {
1873  // Interpolate for a new set of track angles
1874 
1875  // Local variables
1876  float locBx = 1.f;
1877  if (cotbeta < 0.f) {
1878  locBx = -1.f;
1879  }
1880  float locBz = locBx;
1881  if (cotalpha < 0.f) {
1882  locBz = -locBx;
1883  }
1884  return SiPixelTemplate::interpolate(id, cotalpha, cotbeta, locBz, locBx);
1885 }

References f, and interpolate().

◆ interpolate() [2/3]

bool SiPixelTemplate::interpolate ( int  id,
float  cotalpha,
float  cotbeta,
float  locBz 
)

Interpolate input alpha and beta angles to produce a working template for each individual hit.

Parameters
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014) Use this for Phase 0, IP related hits

Definition at line 1894 of file SiPixelTemplate.cc.

1894  {
1895  // Interpolate for a new set of track angles
1896 
1897  // Local variables
1898  float locBx = 1.f;
1899  return SiPixelTemplate::interpolate(id, cotalpha, cotbeta, locBz, locBx);
1900 }

References interpolate().

◆ interpolate() [3/3]

bool SiPixelTemplate::interpolate ( int  id,
float  cotalpha,
float  cotbeta,
float  locBz,
float  locBx 
)

Interpolate input alpha and beta angles to produce a working template for each individual hit.

Parameters
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014)
locBz- (input) the sign of this quantity is used to determine whether to flip cot(beta)<0 quantities from cot(beta)>0 (FPix only) for Phase 0 FPix IP-related tracks, locBz < 0 for cot(beta) > 0 and locBz > 0 for cot(beta) < 0 for Phase 1 FPix IP-related tracks, see next comment
locBx- (input) the sign of this quantity is used to determine whether to flip cot(alpha/beta)<0 quantities from cot(alpha/beta)>0 (FPix only) for Phase 1 FPix IP-related tracks, locBx/locBz > 0 for cot(alpha) > 0 and locBx/locBz < 0 for cot(alpha) < 0 for Phase 1 FPix IP-related tracks, locBx > 0 for cot(beta) > 0 and locBx < 0 for cot(beta) < 0

Definition at line 1327 of file SiPixelTemplate.cc.

1327  {
1328  // Interpolate for a new set of track angles
1329 
1330  // Local variables
1331  int i, j;
1332  int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx, imidy, imaxx;
1333  float yxratio, xxratio, sxmax, qcorrect, qxtempcor, symax, chi2xavgone, chi2xminone, cota, cotb, cotalpha0, cotbeta0;
1334  float chi2xavg[4], chi2xmin[4], chi2xavgc2m[4], chi2xminc2m[4];
1335 
1336  // If the sideloading is turned on, xtemp_ and ytemp_ are already set to what they need to be.
1337  // So we'll just exit.
1338  if (entry_sideloaded_ != nullptr) {
1339  success_ = true;
1340  return success_;
1341  }
1342 
1343  // Check to see if interpolation is valid
1344  if (id != id_current_ || cotalpha != cota_current_ || cotbeta != cotb_current_) {
1345  cota_current_ = cotalpha;
1346  cotb_current_ = cotbeta;
1347  success_ = true;
1348 
1349  if (id != id_current_) {
1350  // Find the index corresponding to id
1351 
1352  index_id_ = -1;
1353  for (i = 0; i < (int)thePixelTemp_.size(); ++i) {
1354  //std::cout<<i<<" "<<id<<" "<<thePixelTemp_[i].head.ID<<std::endl;
1355 
1356  if (id == thePixelTemp_[i].head.ID) {
1357  index_id_ = i;
1358  id_current_ = id;
1359 
1360  // Copy the detector type to the private variable
1361 
1362  dtype_ = thePixelTemp_[index_id_].head.Dtype;
1363 
1364  // Copy the charge scaling factor to the private variable
1365 
1366  qscale_ = thePixelTemp_[index_id_].head.qscale;
1367 
1368  // Copy the pseudopixel signal size to the private variable
1369 
1370  s50_ = thePixelTemp_[index_id_].head.s50;
1371 
1372  // Copy Qbinning info to private variables
1373 
1374  for (j = 0; j < 3; ++j) {
1375  fbin_[j] = thePixelTemp_[index_id_].head.fbin[j];
1376  }
1377  //std::cout<<" set fbin "<< fbin_[0]<<" "<<fbin_[1]<<" "<<fbin_[2]<<std::endl;
1378 
1379  // Pixel sizes to the private variables
1380 
1381  xsize_ = thePixelTemp_[index_id_].head.xsize;
1382  ysize_ = thePixelTemp_[index_id_].head.ysize;
1383  zsize_ = thePixelTemp_[index_id_].head.zsize;
1384 
1385  break;
1386  }
1387  }
1388  }
1389 
1390 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
1391  if (index_id_ < 0 || index_id_ >= (int)thePixelTemp_.size()) {
1392  throw cms::Exception("DataCorrupt")
1393  << "SiPixelTemplate::interpolate can't find needed template ID = " << id << std::endl;
1394  }
1395 #else
1396  assert(index_id_ >= 0 && index_id_ < (int)thePixelTemp_.size());
1397 #endif
1398 
1399  // qcorrect corrects the cot(alpha)=0 cluster charge for non-zero cot(alpha)
1400 
1401  cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
1402  qcorrect =
1403  std::sqrt((1.f + cotbeta * cotbeta + cotalpha * cotalpha) / (1.f + cotbeta * cotbeta + cotalpha0 * cotalpha0));
1404 
1405  // for some cosmics, the ususal gymnastics are incorrect
1406  cota = cotalpha;
1407  cotb = abs_cotb_ = std::abs(cotbeta);
1408  flip_x_ = false;
1409  flip_y_ = false;
1410  switch (dtype_) {
1411  case 0:
1412  if (cotbeta < 0.f) {
1413  flip_y_ = true;
1414  }
1415  break;
1416  case 1:
1417  if (locBz < 0.f) {
1418  cotb = cotbeta;
1419  } else {
1420  cotb = -cotbeta;
1421  flip_y_ = true;
1422  }
1423  break;
1424  case 2:
1425  case 3:
1426  case 4:
1427  case 5:
1428  if (locBx * locBz < 0.f) {
1429  cota = -cotalpha;
1430  flip_x_ = true;
1431  }
1432  if (locBx > 0.f) {
1433  cotb = cotbeta;
1434  } else {
1435  cotb = -cotbeta;
1436  flip_y_ = true;
1437  }
1438  break;
1439  default:
1440 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
1441  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::illegal subdetector ID = " << dtype_ << std::endl;
1442 #else
1443  std::cout << "SiPixelTemplate::illegal subdetector ID = " << dtype_ << std::endl;
1444 #endif
1445  }
1446 
1447  Ny = thePixelTemp_[index_id_].head.NTy;
1448  Nyx = thePixelTemp_[index_id_].head.NTyx;
1449  Nxx = thePixelTemp_[index_id_].head.NTxx;
1450 
1451 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
1452  if (Ny < 2 || Nyx < 1 || Nxx < 2) {
1453  throw cms::Exception("DataCorrupt")
1454  << "template ID = " << id_current_ << "has too few entries: Ny/Nyx/Nxx = " << Ny << "/" << Nyx << "/" << Nxx
1455  << std::endl;
1456  }
1457 #else
1458  assert(Ny > 1 && Nyx > 0 && Nxx > 1);
1459 #endif
1460  imaxx = Nyx - 1;
1461  imidy = Nxx / 2;
1462 
1463  // next, loop over all y-angle entries
1464 
1465  ilow = 0;
1466  yratio_ = 0.f;
1467 
1468  if (cotb >= thePixelTemp_[index_id_].enty[Ny - 1].cotbeta) {
1469  ilow = Ny - 2;
1470  yratio_ = 1.;
1471  success_ = false;
1472 
1473  } else {
1474  if (cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
1475  for (i = 0; i < Ny - 1; ++i) {
1476  if (thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i + 1].cotbeta) {
1477  ilow = i;
1478  yratio_ = (cotb - thePixelTemp_[index_id_].enty[i].cotbeta) /
1479  (thePixelTemp_[index_id_].enty[i + 1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
1480  break;
1481  }
1482  }
1483  } else {
1484  success_ = false;
1485  }
1486  }
1487 
1488  ihigh = ilow + 1;
1489 
1490  // Use pointers to the three angle pairs used in the interpolation
1491  //
1492  enty0_ = &thePixelTemp_[index_id_].enty[ilow];
1493  enty1_ = &thePixelTemp_[index_id_].enty[ihigh];
1494 
1495  // Interpolate/store all y-related quantities (flip displacements when flip_y_)
1496 
1497  qavg_ = (1.f - yratio_) * enty0_->qavg + yratio_ * enty1_->qavg;
1498  qavg_ *= qcorrect;
1499  symax = (1.f - yratio_) * enty0_->symax + yratio_ * enty1_->symax;
1500  syparmax_ = symax;
1501  sxmax = (1.f - yratio_) * enty0_->sxmax + yratio_ * enty1_->sxmax;
1502  dyone_ = (1.f - yratio_) * enty0_->dyone + yratio_ * enty1_->dyone;
1503  if (flip_y_) {
1504  dyone_ = -dyone_;
1505  }
1506  syone_ = (1.f - yratio_) * enty0_->syone + yratio_ * enty1_->syone;
1507  dytwo_ = (1.f - yratio_) * enty0_->dytwo + yratio_ * enty1_->dytwo;
1508  if (flip_y_) {
1509  dytwo_ = -dytwo_;
1510  }
1511  sytwo_ = (1.f - yratio_) * enty0_->sytwo + yratio_ * enty1_->sytwo;
1512  qmin_ = (1.f - yratio_) * enty0_->qmin + yratio_ * enty1_->qmin;
1513  qmin_ *= qcorrect;
1514  qmin2_ = (1.f - yratio_) * enty0_->qmin2 + yratio_ * enty1_->qmin2;
1515  qmin2_ *= qcorrect;
1516  mpvvav_ = (1.f - yratio_) * enty0_->mpvvav + yratio_ * enty1_->mpvvav;
1517  mpvvav_ *= qcorrect;
1520  mpvvav2_ = (1.f - yratio_) * enty0_->mpvvav2 + yratio_ * enty1_->mpvvav2;
1521  mpvvav2_ *= qcorrect;
1524  clsleny_ = fminf(enty0_->clsleny, enty1_->clsleny);
1526  qavg_avg_ *= qcorrect;
1527  for (i = 0; i < 2; ++i) {
1528  for (j = 0; j < 5; ++j) {
1529  // Charge loss switches sides when cot(beta) changes sign
1530 
1531  if (flip_y_) {
1532  yparl_[1 - i][j] = enty0_->ypar[i][j];
1533  yparh_[1 - i][j] = enty1_->ypar[i][j];
1534  } else {
1535  yparl_[i][j] = enty0_->ypar[i][j];
1536  yparh_[i][j] = enty1_->ypar[i][j];
1537  }
1538  if (flip_x_) {
1539  xparly0_[1 - i][j] = enty0_->xpar[i][j];
1540  xparhy0_[1 - i][j] = enty1_->xpar[i][j];
1541  } else {
1542  xparly0_[i][j] = enty0_->xpar[i][j];
1543  xparhy0_[i][j] = enty1_->xpar[i][j];
1544  }
1545  }
1546  }
1547 
1548  for (i = 0; i < 4; ++i) {
1549  yavg_[i] = (1.f - yratio_) * thePixelTemp_[index_id_].enty[ilow].yavg[i] +
1550  yratio_ * thePixelTemp_[index_id_].enty[ihigh].yavg[i];
1551  if (flip_y_) {
1552  yavg_[i] = -yavg_[i];
1553  }
1554  yavg_[i] = (1.f - yratio_) * enty0_->yavg[i] + yratio_ * enty1_->yavg[i];
1555  if (flip_y_) {
1556  yavg_[i] = -yavg_[i];
1557  }
1558  yrms_[i] = (1.f - yratio_) * enty0_->yrms[i] + yratio_ * enty1_->yrms[i];
1559  chi2yavg_[i] = (1.f - yratio_) * enty0_->chi2yavg[i] + yratio_ * enty1_->chi2yavg[i];
1560  chi2ymin_[i] = (1.f - yratio_) * enty0_->chi2ymin[i] + yratio_ * enty1_->chi2ymin[i];
1561  chi2xavg[i] = (1.f - yratio_) * enty0_->chi2xavg[i] + yratio_ * enty1_->chi2xavg[i];
1562  chi2xmin[i] = (1.f - yratio_) * enty0_->chi2xmin[i] + yratio_ * enty1_->chi2xmin[i];
1563  yavgc2m_[i] = (1.f - yratio_) * enty0_->yavgc2m[i] + yratio_ * enty1_->yavgc2m[i];
1564  if (flip_y_) {
1565  yavgc2m_[i] = -yavgc2m_[i];
1566  }
1567  yrmsc2m_[i] = (1.f - yratio_) * enty0_->yrmsc2m[i] + yratio_ * enty1_->yrmsc2m[i];
1569  // if(flip_y_) {chi2yavgc2m_[i] = -chi2yavgc2m_[i];}
1571  // xrmsc2m[i]=(1.f - yratio_)*enty0_->xrmsc2m[i] + yratio_*enty1_->xrmsc2m[i];
1574  for (j = 0; j < 6; ++j) {
1575  yflparl_[i][j] = enty0_->yflpar[i][j];
1576  yflparh_[i][j] = enty1_->yflpar[i][j];
1577 
1578  // Since Q_fl is odd under cotbeta, it flips qutomatically, change only even terms
1579 
1580  if (flip_y_ && (j == 0 || j == 2 || j == 4)) {
1581  yflparl_[i][j] = -yflparl_[i][j];
1582  yflparh_[i][j] = -yflparh_[i][j];
1583  }
1584  }
1585  }
1586 
1588 
1593 
1596  // If using y-spares
1597  // for(i=0; i<10; ++i) {
1598  // pyspare[i]=(1.f - yratio_)*enty0_->yspare[i] + yratio_*enty1_->yspare[i];
1599  // }
1600 
1601  // Interpolate and build the y-template
1602 
1603  for (i = 0; i < 9; ++i) {
1604  ytemp_[i][0] = 0.f;
1605  ytemp_[i][1] = 0.f;
1606  ytemp_[i][BYM2] = 0.f;
1607  ytemp_[i][BYM1] = 0.f;
1608  for (j = 0; j < TYSIZE; ++j) {
1609  // Flip the basic y-template when the cotbeta is negative
1610 
1611  if (flip_y_) {
1612  ytemp_[8 - i][BYM3 - j] = (1.f - yratio_) * enty0_->ytemp[i][j] + yratio_ * enty1_->ytemp[i][j];
1613  } else {
1614  ytemp_[i][j + 2] = (1.f - yratio_) * enty0_->ytemp[i][j] + yratio_ * enty1_->ytemp[i][j];
1615  }
1616  }
1617  }
1618 
1619  // next, loop over all x-angle entries, first, find relevant y-slices
1620 
1621  iylow = 0;
1622  yxratio = 0.f;
1623 
1624  if (abs_cotb_ >= thePixelTemp_[index_id_].entx[Nyx - 1][0].cotbeta) {
1625  iylow = Nyx - 2;
1626  yxratio = 1.f;
1627 
1628  } else if (abs_cotb_ >= thePixelTemp_[index_id_].entx[0][0].cotbeta) {
1629  for (i = 0; i < Nyx - 1; ++i) {
1630  if (thePixelTemp_[index_id_].entx[i][0].cotbeta <= abs_cotb_ &&
1631  abs_cotb_ < thePixelTemp_[index_id_].entx[i + 1][0].cotbeta) {
1632  iylow = i;
1633  yxratio = (abs_cotb_ - thePixelTemp_[index_id_].entx[i][0].cotbeta) /
1634  (thePixelTemp_[index_id_].entx[i + 1][0].cotbeta - thePixelTemp_[index_id_].entx[i][0].cotbeta);
1635  break;
1636  }
1637  }
1638  }
1639 
1640  iyhigh = iylow + 1;
1641 
1642  ilow = 0;
1643  xxratio = 0.f;
1644 
1645  if (cota >= thePixelTemp_[index_id_].entx[0][Nxx - 1].cotalpha) {
1646  ilow = Nxx - 2;
1647  xxratio = 1.f;
1648  success_ = false;
1649 
1650  } else {
1651  if (cota >= thePixelTemp_[index_id_].entx[0][0].cotalpha) {
1652  for (i = 0; i < Nxx - 1; ++i) {
1653  if (thePixelTemp_[index_id_].entx[0][i].cotalpha <= cota &&
1654  cota < thePixelTemp_[index_id_].entx[0][i + 1].cotalpha) {
1655  ilow = i;
1656  xxratio = (cota - thePixelTemp_[index_id_].entx[0][i].cotalpha) /
1657  (thePixelTemp_[index_id_].entx[0][i + 1].cotalpha - thePixelTemp_[index_id_].entx[0][i].cotalpha);
1658  break;
1659  }
1660  }
1661  } else {
1662  success_ = false;
1663  }
1664  }
1665 
1666  ihigh = ilow + 1;
1667 
1668  // Interpolate/store all x-related quantities
1669 
1670  yxratio_ = yxratio;
1671  xxratio_ = xxratio;
1672 
1673  // sxparmax defines the maximum charge for which the parameters xpar are defined (not rescaled by cotbeta)
1674 
1675  sxparmax_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[imaxx][ilow].sxmax +
1676  xxratio * thePixelTemp_[index_id_].entx[imaxx][ihigh].sxmax;
1677  sxmax_ = sxparmax_;
1678  if (thePixelTemp_[index_id_].entx[imaxx][imidy].sxmax != 0.f) {
1679  sxmax_ = sxmax_ / thePixelTemp_[index_id_].entx[imaxx][imidy].sxmax * sxmax;
1680  }
1681  symax_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[imaxx][ilow].symax +
1682  xxratio * thePixelTemp_[index_id_].entx[imaxx][ihigh].symax;
1683  if (thePixelTemp_[index_id_].entx[imaxx][imidy].symax != 0.f) {
1684  symax_ = symax_ / thePixelTemp_[index_id_].entx[imaxx][imidy].symax * symax;
1685  }
1686  dxone_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[0][ilow].dxone +
1687  xxratio * thePixelTemp_[index_id_].entx[0][ihigh].dxone;
1688  if (flip_x_) {
1689  dxone_ = -dxone_;
1690  }
1691  sxone_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[0][ilow].sxone +
1692  xxratio * thePixelTemp_[index_id_].entx[0][ihigh].sxone;
1693  dxtwo_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[0][ilow].dxtwo +
1694  xxratio * thePixelTemp_[index_id_].entx[0][ihigh].dxtwo;
1695  if (flip_x_) {
1696  dxtwo_ = -dxtwo_;
1697  }
1698  sxtwo_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[0][ilow].sxtwo +
1699  xxratio * thePixelTemp_[index_id_].entx[0][ihigh].sxtwo;
1700  clslenx_ = fminf(thePixelTemp_[index_id_].entx[0][ilow].clslenx, thePixelTemp_[index_id_].entx[0][ihigh].clslenx);
1701 
1702  for (i = 0; i < 2; ++i) {
1703  for (j = 0; j < 5; ++j) {
1704  // Charge loss switches sides when cot(alpha) changes sign
1705  if (flip_x_) {
1706  xpar0_[1 - i][j] = thePixelTemp_[index_id_].entx[imaxx][imidy].xpar[i][j];
1707  xparl_[1 - i][j] = thePixelTemp_[index_id_].entx[imaxx][ilow].xpar[i][j];
1708  xparh_[1 - i][j] = thePixelTemp_[index_id_].entx[imaxx][ihigh].xpar[i][j];
1709  } else {
1710  xpar0_[i][j] = thePixelTemp_[index_id_].entx[imaxx][imidy].xpar[i][j];
1711  xparl_[i][j] = thePixelTemp_[index_id_].entx[imaxx][ilow].xpar[i][j];
1712  xparh_[i][j] = thePixelTemp_[index_id_].entx[imaxx][ihigh].xpar[i][j];
1713  }
1714  }
1715  }
1716  // Pointers to the currently interpolated point.
1717  entx00_ = &thePixelTemp_[index_id_].entx[iylow][ilow];
1718  entx02_ = &thePixelTemp_[index_id_].entx[iylow][ihigh];
1719  entx20_ = &thePixelTemp_[index_id_].entx[iyhigh][ilow];
1720  entx22_ = &thePixelTemp_[index_id_].entx[iyhigh][ihigh];
1721  entx21_ = &thePixelTemp_[index_id_].entx[iyhigh][imidy];
1722 
1723  // pixmax is the maximum allowed pixel charge (used for truncation)
1724  pixmax_ = (1.f - yxratio) * ((1.f - xxratio) * entx00_->pixmax + xxratio * entx02_->pixmax) +
1725  yxratio * ((1.f - xxratio) * entx20_->pixmax + xxratio * entx22_->pixmax);
1726 
1729 
1730  for (i = 0; i < 4; ++i) {
1731  xavg_[i] = (1.f - yxratio) * ((1.f - xxratio) * entx00_->xavg[i] + xxratio * entx02_->xavg[i]) +
1732  yxratio * ((1.f - xxratio) * entx20_->xavg[i] + xxratio * entx22_->xavg[i]);
1733  if (flip_x_) {
1734  xavg_[i] = -xavg_[i];
1735  }
1736 
1737  xrms_[i] = (1.f - yxratio) * ((1.f - xxratio) * entx00_->xrms[i] + xxratio * entx02_->xrms[i]) +
1738  yxratio * ((1.f - xxratio) * entx20_->xrms[i] + xxratio * entx22_->xrms[i]);
1739 
1740  xavgc2m_[i] = (1.f - yxratio) * ((1.f - xxratio) * entx00_->xavgc2m[i] + xxratio * entx02_->xavgc2m[i]) +
1741  yxratio * ((1.f - xxratio) * entx20_->xavgc2m[i] + xxratio * entx22_->xavgc2m[i]);
1742  if (flip_x_) {
1743  xavgc2m_[i] = -xavgc2m_[i];
1744  }
1745 
1746  xrmsc2m_[i] = (1.f - yxratio) * ((1.f - xxratio) * entx00_->xrmsc2m[i] + xxratio * entx02_->xrmsc2m[i]) +
1747  yxratio * ((1.f - xxratio) * entx20_->xrmsc2m[i] + xxratio * entx22_->xrmsc2m[i]);
1748  //
1749  // Try new interpolation scheme instead
1750  //
1751  //
1752  // chi2xavgc2m_[i]=(1.f - yxratio)*((1.f - xxratio)*entx00_->chi2xavgc2m[i] + xxratio*entx02_->chi2xavgc2m[i])
1753  // +yxratio*((1.f - xxratio)*entx20_->chi2xavgc2m[i] + xxratio*entx22_->chi2xavgc2m[i]);
1754 
1755  // chi2xminc2m_[i]=(1.f - yxratio)*((1.f - xxratio)*entx00_->chi2xminc2m[i] + xxratio*entx02_->chi2xminc2m[i])
1756  // +yxratio*((1.f - xxratio)*entx20_->chi2xminc2m[i] + xxratio*entx22_->chi2xminc2m[i]);
1757  //
1758  // chi2xavg_[i]=((1.f - xxratio)*thePixelTemp_[index_id_].entx[imaxx][ilow].chi2xavg[i] + xxratio*thePixelTemp_[index_id_].entx[imaxx][ihigh].chi2xavg[i]);
1759  // if(thePixelTemp_[index_id_].entx[imaxx][imidy].chi2xavg[i] != 0.f) {chi2xavg_[i]=chi2xavg_[i]/thePixelTemp_[index_id_].entx[imaxx][imidy].chi2xavg[i]*chi2xavg[i];}
1760  //
1761  // chi2xmin_[i]=((1.f - xxratio)*thePixelTemp_[index_id_].entx[imaxx][ilow].chi2xmin[i] + xxratio*thePixelTemp_[index_id_].entx[imaxx][ihigh].chi2xmin[i]);
1762  // if(thePixelTemp_[index_id_].entx[imaxx][imidy].chi2xmin[i] != 0.f) {chi2xmin_[i]=chi2xmin_[i]/thePixelTemp_[index_id_].entx[imaxx][imidy].chi2xmin[i]*chi2xmin[i];}
1763  //
1764  chi2xavg_[i] = ((1.f - xxratio) * entx20_->chi2xavg[i] + xxratio * entx22_->chi2xavg[i]);
1765  if (entx21_->chi2xavg[i] != 0.f) {
1767  }
1768 
1769  chi2xmin_[i] = ((1.f - xxratio) * entx20_->chi2xmin[i] + xxratio * entx22_->chi2xmin[i]);
1770  if (entx21_->chi2xmin[i] != 0.f) {
1772  }
1773 
1775  if (entx21_->chi2xavgc2m[i] != 0.f) {
1777  }
1778 
1780  if (entx21_->chi2xminc2m[i] != 0.f) {
1782  }
1783 
1784  for (j = 0; j < 6; ++j) {
1785  xflparll_[i][j] = entx00_->xflpar[i][j];
1786  xflparlh_[i][j] = entx02_->xflpar[i][j];
1787  xflparhl_[i][j] = entx20_->xflpar[i][j];
1788  xflparhh_[i][j] = entx22_->xflpar[i][j];
1789  // Since Q_fl is odd under cotalpha, it flips qutomatically, change only even terms
1790  if (flip_x_ && (j == 0 || j == 2 || j == 4)) {
1791  xflparll_[i][j] = -xflparll_[i][j];
1792  xflparlh_[i][j] = -xflparlh_[i][j];
1793  xflparhl_[i][j] = -xflparhl_[i][j];
1794  xflparhh_[i][j] = -xflparhh_[i][j];
1795  }
1796  }
1797  }
1798 
1799  // Do the spares next
1800 
1802  if (entx21_->chi2xavgone != 0.f) {
1804  }
1805 
1807  if (entx21_->chi2xminone != 0.f) {
1809  }
1810 
1811  fracxone_ = (1.f - yxratio) * ((1.f - xxratio) * entx00_->fracxone + xxratio * entx02_->fracxone) +
1813  fracxtwo_ = (1.f - yxratio) * ((1.f - xxratio) * entx00_->fracxtwo + xxratio * entx02_->fracxtwo) +
1815 
1816  // If using x-spares
1817  // for(i=0; i<10; ++i) {
1818  // pxspare[i]=(1.f - yxratio)*((1.f - xxratio)*entx00_->xspare[i] + xxratio*entx02_->xspare[i])
1819  // +yxratio*((1.f - xxratio)*entx20_->xspare[i] + xxratio*entx22_->xspare[i]);
1820  // }
1821 
1822  // Interpolate and build the x-template
1823 
1824  // qxtempcor corrects the total charge to the actual track angles (not actually needed for the template fits, but useful for Guofan)
1825 
1826  cotbeta0 = thePixelTemp_[index_id_].entx[iyhigh][0].cotbeta;
1827  qxtempcor =
1828  std::sqrt((1.f + cotbeta * cotbeta + cotalpha * cotalpha) / (1.f + cotbeta0 * cotbeta0 + cotalpha * cotalpha));
1829 
1830  for (i = 0; i < 9; ++i) {
1831  xtemp_[i][0] = 0.f;
1832  xtemp_[i][1] = 0.f;
1833  xtemp_[i][BXM2] = 0.f;
1834  xtemp_[i][BXM1] = 0.f;
1835  for (j = 0; j < TXSIZE; ++j) {
1836  // Take next largest x-slice for the x-template (it reduces bias in the forward direction after irradiation)
1837  // xtemp_[i][j+2]=(1.f - xxratio)*thePixelTemp_[index_id_].entx[imaxx][ilow].xtemp[i][j] + xxratio*thePixelTemp_[index_id_].entx[imaxx][ihigh].xtemp[i][j];
1838  // xtemp_[i][j+2]=(1.f - xxratio)*entx20_->xtemp[i][j] + xxratio*entx22_->xtemp[i][j];
1839  if (flip_x_) {
1840  xtemp_[8 - i][BXM3 - j] =
1841  qxtempcor * ((1.f - xxratio) * entx20_->xtemp[i][j] + xxratio * entx22_->xtemp[i][j]);
1842  } else {
1843  xtemp_[i][j + 2] = qxtempcor * ((1.f - xxratio) * entx20_->xtemp[i][j] + xxratio * entx22_->xtemp[i][j]);
1844  }
1845  }
1846  }
1847 
1848  lorywidth_ = thePixelTemp_[index_id_].head.lorywidth;
1849  lorxwidth_ = thePixelTemp_[index_id_].head.lorxwidth;
1850  lorybias_ = thePixelTemp_[index_id_].head.lorybias;
1851  lorxbias_ = thePixelTemp_[index_id_].head.lorxbias;
1852  if (flip_x_) {
1854  lorxbias_ = -lorxbias_;
1855  }
1856  if (flip_y_) {
1858  lorybias_ = -lorybias_;
1859  }
1860  }
1861 
1862  return success_;
1863 } // interpolate

References funct::abs(), cms::cuda::assert(), BXM1, BXM2, BXM3, BYM1, BYM2, BYM3, gather_cfg::cout, Exception, f, cms::cuda::for(), mps_fire::i, triggerObjects_cff::id, createfilelist::int, dqmiolumiharvest::j, PixelTestBeamValidation_cfi::Ny, mathSSE::sqrt(), TXSIZE, and TYSIZE.

Referenced by PixelCPEClusterRepair::checkRecommend2D(), interpolate(), SiPixelTemplateReco::PixelTempReco1D(), SiPixelTemplateSplit::PixelTempSplit(), PixelTemplateSmearerBase::smearHit(), and PixelTemplateSmearerBase::smearMergeGroup().

◆ kappavav()

float SiPixelTemplate::kappavav ( )
inline

kappa parameter for Vavilov distribution

Definition at line 678 of file SiPixelTemplate.h.

References kappavav_.

Referenced by vavilov_pars().

◆ kappavav2()

float SiPixelTemplate::kappavav2 ( )
inline

kappa parameter for 2-cluster Vavilov distribution

Definition at line 683 of file SiPixelTemplate.h.

References kappavav2_.

Referenced by vavilov2_pars().

◆ lorxbias()

float SiPixelTemplate::lorxbias ( )
inline

signed lorentz x-width (microns)

Definition at line 675 of file SiPixelTemplate.h.

References lorxbias_.

Referenced by PixelCPETemplateReco::localPosition().

◆ lorxwidth()

float SiPixelTemplate::lorxwidth ( )
inline

signed lorentz x-width (microns)

Definition at line 671 of file SiPixelTemplate.h.

References lorxwidth_.

◆ lorybias()

float SiPixelTemplate::lorybias ( )
inline

signed lorentz y-width (microns)

Definition at line 674 of file SiPixelTemplate.h.

References lorybias_.

Referenced by PixelCPETemplateReco::localPosition().

◆ lorywidth()

float SiPixelTemplate::lorywidth ( )
inline

signed lorentz y-width (microns)

Definition at line 670 of file SiPixelTemplate.h.

References lorywidth_.

◆ mpvvav()

float SiPixelTemplate::mpvvav ( )
inline

most probable charge in Vavilov distribution (not actually for larger kappa)

Definition at line 676 of file SiPixelTemplate.h.

References mpvvav_.

Referenced by vavilov_pars().

◆ mpvvav2()

float SiPixelTemplate::mpvvav2 ( )
inline

most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa)

Definition at line 679 of file SiPixelTemplate.h.

References mpvvav2_.

Referenced by vavilov2_pars().

◆ pixmax()

float SiPixelTemplate::pixmax ( )
inline

maximum pixel charge

Definition at line 417 of file SiPixelTemplate.h.

References pixmax_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ postInit()

void SiPixelTemplate::postInit ( std::vector< SiPixelTemplateStore > &  thePixelTemp_)
static

Definition at line 1287 of file SiPixelTemplate.cc.

1287  {
1288  /*
1289  std::cout << "SiPixelTemplate size " << thePixelTemp_.size() << std::endl;
1290  #ifndef SI_PIXEL_TEMPLATE_USE_BOOST
1291  std::cout <<"uses C arrays" << std::endl;
1292  #endif
1293 
1294  int i=0;
1295  for (auto & templ : thePixelTemp_) {
1296  std::cout << i <<':' << templ.head.ID << ' ' << templ.head.NTy <<','<< templ.head.NTyx <<','<< templ.head.NTxx << std::endl;
1297  for ( auto iy=1; iy<templ.head.NTy; ++iy ) { auto & ent = templ.enty[iy]; std::cout << ent.cotbeta <<',' << ent.cotbeta-templ.enty[iy-1].cotbeta << ' '; }
1298  std::cout << std::endl;
1299  for ( auto ix=1; ix<templ.head.NTxx; ++ix ){ auto & ent = templ.entx[0][ix]; std::cout << ent.cotalpha <<','<< ent.cotalpha-templ.entx[0][ix-1].cotalpha << ' ';}
1300  std::cout << std::endl;
1301  ++i;
1302  }
1303  */
1304 
1305  for (auto& templ : thePixelTemp_) {
1306  for (auto iy = 0; iy < templ.head.NTy; ++iy)
1307  templ.cotbetaY[iy] = templ.enty[iy].cotbeta;
1308  for (auto iy = 0; iy < templ.head.NTyx; ++iy)
1309  templ.cotbetaX[iy] = templ.entx[iy][0].cotbeta;
1310  for (auto ix = 0; ix < templ.head.NTxx; ++ix)
1311  templ.cotalphaX[ix] = templ.entx[0][ix].cotalpha;
1312  }
1313 }

References cms::cuda::for().

◆ pushfile() [1/2]

bool SiPixelTemplate::pushfile ( const SiPixelTemplateDBObject dbobject,
std::vector< SiPixelTemplateStore > &  pixelTemp 
)
static

This routine initializes the global template structures from an external file template_summary_zpNNNN where NNNN are four digits

Parameters
dbobject- db storing multiple template calibrations

SiPixelTemplateStore theCurrentTemp; // large, don't allocate it on the stack

Definition at line 723 of file SiPixelTemplate.cc.

723  {
724  // Add template stored in external dbobject to theTemplateStore
725 
726  // Local variables
727  int i, j, k, l;
728  float qavg_avg;
729  const int code_version = {17};
730 
731  // We must create a new object because dbobject must be a const and our stream must not be
732  auto db(dbobject.reader());
733 
734  // Create a local template storage entry
736  auto tmpPtr = std::make_unique<SiPixelTemplateStore>(); // must be allocated on the heap instead
737  auto& theCurrentTemp = *tmpPtr;
738 
739  // Fill the template storage for each template calibration stored in the db
740  for (int m = 0; m < db.numOfTempl(); ++m) {
741  // Read-in a header string first and print it
742 
744  for (i = 0; i < 20; ++i) {
745  temp.f = db.sVector()[db.index()];
746  theCurrentTemp.head.title[4 * i] = temp.c[0];
747  theCurrentTemp.head.title[4 * i + 1] = temp.c[1];
748  theCurrentTemp.head.title[4 * i + 2] = temp.c[2];
749  theCurrentTemp.head.title[4 * i + 3] = temp.c[3];
750  db.incrementIndex(1);
751  }
752  theCurrentTemp.head.title[79] = '\0';
753  LOGINFO("SiPixelTemplate") << "Loading Pixel Template File - " << theCurrentTemp.head.title << ENDL;
754 
755  // next, the header information
756 
757  db >> theCurrentTemp.head.ID >> theCurrentTemp.head.templ_version >> theCurrentTemp.head.Bfield >>
758  theCurrentTemp.head.NTy >> theCurrentTemp.head.NTyx >> theCurrentTemp.head.NTxx >> theCurrentTemp.head.Dtype >>
759  theCurrentTemp.head.Vbias >> theCurrentTemp.head.temperature >> theCurrentTemp.head.fluence >>
760  theCurrentTemp.head.qscale >> theCurrentTemp.head.s50 >> theCurrentTemp.head.lorywidth >>
761  theCurrentTemp.head.lorxwidth >> theCurrentTemp.head.ysize >> theCurrentTemp.head.xsize >>
762  theCurrentTemp.head.zsize;
763 
764  if (db.fail()) {
765  LOGERROR("SiPixelTemplate") << "Error reading file 0A, no template load" << ENDL;
766  return false;
767  }
768 
769  LOGINFO("SiPixelTemplate") << "Loading Pixel Template File - " << theCurrentTemp.head.title
770  << " code version = " << code_version << " object version "
771  << theCurrentTemp.head.templ_version << ENDL;
772 
773  if (theCurrentTemp.head.templ_version > 17) {
774  db >> theCurrentTemp.head.ss50 >> theCurrentTemp.head.lorybias >> theCurrentTemp.head.lorxbias >>
775  theCurrentTemp.head.fbin[0] >> theCurrentTemp.head.fbin[1] >> theCurrentTemp.head.fbin[2];
776 
777  if (db.fail()) {
778  LOGERROR("SiPixelTemplate") << "Error reading file 0B, no template load" << ENDL;
779  return false;
780  }
781  } else {
782  theCurrentTemp.head.ss50 = theCurrentTemp.head.s50;
783  theCurrentTemp.head.lorybias = theCurrentTemp.head.lorywidth / 2.f;
784  theCurrentTemp.head.lorxbias = theCurrentTemp.head.lorxwidth / 2.f;
785  theCurrentTemp.head.fbin[0] = 1.50f;
786  theCurrentTemp.head.fbin[1] = 1.00f;
787  theCurrentTemp.head.fbin[2] = 0.85f;
788  //std::cout<<" set fbin "<< theCurrentTemp.head.fbin[0]<<" "<<theCurrentTemp.head.fbin[1]<<" "
789  // <<theCurrentTemp.head.fbin[2]<<std::endl;
790  }
791 
792  LOGINFO("SiPixelTemplate") << "Template ID = " << theCurrentTemp.head.ID << ", Template Version "
793  << theCurrentTemp.head.templ_version << ", Bfield = " << theCurrentTemp.head.Bfield
794  << ", NTy = " << theCurrentTemp.head.NTy << ", NTyx = " << theCurrentTemp.head.NTyx
795  << ", NTxx = " << theCurrentTemp.head.NTxx << ", Dtype = " << theCurrentTemp.head.Dtype
796  << ", Bias voltage " << theCurrentTemp.head.Vbias << ", temperature "
797  << theCurrentTemp.head.temperature << ", fluence " << theCurrentTemp.head.fluence
798  << ", Q-scaling factor " << theCurrentTemp.head.qscale << ", 1/2 multi dcol threshold "
799  << theCurrentTemp.head.s50 << ", 1/2 single dcol threshold " << theCurrentTemp.head.ss50
800  << ", y Lorentz Width " << theCurrentTemp.head.lorywidth << ", y Lorentz Bias "
801  << theCurrentTemp.head.lorybias << ", x Lorentz width " << theCurrentTemp.head.lorxwidth
802  << ", x Lorentz Bias " << theCurrentTemp.head.lorxbias
803  << ", Q/Q_avg fractions for Qbin defs " << theCurrentTemp.head.fbin[0] << ", "
804  << theCurrentTemp.head.fbin[1] << ", " << theCurrentTemp.head.fbin[2]
805  << ", pixel x-size " << theCurrentTemp.head.xsize << ", y-size "
806  << theCurrentTemp.head.ysize << ", zsize " << theCurrentTemp.head.zsize << ENDL;
807 
808  if (theCurrentTemp.head.templ_version < code_version) {
809  LOGINFO("SiPixelTemplate") << "code expects version " << code_version << " finds "
810  << theCurrentTemp.head.templ_version << ", load anyway " << ENDL;
811  //return false; // dk
812  }
813 
814 #ifdef SI_PIXEL_TEMPLATE_USE_BOOST
815 
816  // next, layout the 1-d/2-d structures needed to store template
817  theCurrentTemp.cotbetaY = new float[theCurrentTemp.head.NTy];
818  theCurrentTemp.cotbetaX = new float[theCurrentTemp.head.NTyx];
819  theCurrentTemp.cotalphaX = new float[theCurrentTemp.head.NTxx];
820  theCurrentTemp.enty.resize(boost::extents[theCurrentTemp.head.NTy]);
821  theCurrentTemp.entx.resize(boost::extents[theCurrentTemp.head.NTyx][theCurrentTemp.head.NTxx]);
822 
823 #endif
824 
825  // next, loop over all barrel y-angle entries
826 
827  for (i = 0; i < theCurrentTemp.head.NTy; ++i) {
828  db >> theCurrentTemp.enty[i].runnum >> theCurrentTemp.enty[i].costrk[0] >> theCurrentTemp.enty[i].costrk[1] >>
829  theCurrentTemp.enty[i].costrk[2];
830 
831  if (db.fail()) {
832  LOGERROR("SiPixelTemplate") << "Error reading file 1, no template load, run # " << theCurrentTemp.enty[i].runnum
833  << ENDL;
834  return false;
835  }
836 
837  // Calculate the alpha, beta, and cot(beta) for this entry
838 
839  theCurrentTemp.enty[i].alpha =
840  static_cast<float>(atan2((double)theCurrentTemp.enty[i].costrk[2], (double)theCurrentTemp.enty[i].costrk[0]));
841 
842  theCurrentTemp.enty[i].cotalpha = theCurrentTemp.enty[i].costrk[0] / theCurrentTemp.enty[i].costrk[2];
843 
844  theCurrentTemp.enty[i].beta =
845  static_cast<float>(atan2((double)theCurrentTemp.enty[i].costrk[2], (double)theCurrentTemp.enty[i].costrk[1]));
846 
847  theCurrentTemp.enty[i].cotbeta = theCurrentTemp.enty[i].costrk[1] / theCurrentTemp.enty[i].costrk[2];
848 
849  db >> theCurrentTemp.enty[i].qavg >> theCurrentTemp.enty[i].pixmax >> theCurrentTemp.enty[i].symax >>
850  theCurrentTemp.enty[i].dyone >> theCurrentTemp.enty[i].syone >> theCurrentTemp.enty[i].sxmax >>
851  theCurrentTemp.enty[i].dxone >> theCurrentTemp.enty[i].sxone;
852 
853  if (db.fail()) {
854  LOGERROR("SiPixelTemplate") << "Error reading file 2, no template load, run # " << theCurrentTemp.enty[i].runnum
855  << ENDL;
856  return false;
857  }
858 
859  db >> theCurrentTemp.enty[i].dytwo >> theCurrentTemp.enty[i].sytwo >> theCurrentTemp.enty[i].dxtwo >>
860  theCurrentTemp.enty[i].sxtwo >> theCurrentTemp.enty[i].qmin >> theCurrentTemp.enty[i].clsleny >>
861  theCurrentTemp.enty[i].clslenx;
862  // >> theCurrentTemp.enty[i].mpvvav >> theCurrentTemp.enty[i].sigmavav >> theCurrentTemp.enty[i].kappavav;
863 
864  if (db.fail()) {
865  LOGERROR("SiPixelTemplate") << "Error reading file 3, no template load, run # " << theCurrentTemp.enty[i].runnum
866  << ENDL;
867  return false;
868  }
869 
870  if (theCurrentTemp.enty[i].qmin <= 0.) {
871  LOGERROR("SiPixelTemplate") << "Error in template ID " << theCurrentTemp.head.ID
872  << " qmin = " << theCurrentTemp.enty[i].qmin << ", run # "
873  << theCurrentTemp.enty[i].runnum << ENDL;
874  return false;
875  }
876 
877  for (j = 0; j < 2; ++j) {
878  db >> theCurrentTemp.enty[i].ypar[j][0] >> theCurrentTemp.enty[i].ypar[j][1] >>
879  theCurrentTemp.enty[i].ypar[j][2] >> theCurrentTemp.enty[i].ypar[j][3] >> theCurrentTemp.enty[i].ypar[j][4];
880 
881  if (db.fail()) {
882  LOGERROR("SiPixelTemplate") << "Error reading file 4, no template load, run # "
883  << theCurrentTemp.enty[i].runnum << ENDL;
884  return false;
885  }
886  }
887 
888  for (j = 0; j < 9; ++j) {
889  for (k = 0; k < TYSIZE; ++k) {
890  db >> theCurrentTemp.enty[i].ytemp[j][k];
891  }
892 
893  if (db.fail()) {
894  LOGERROR("SiPixelTemplate") << "Error reading file 5, no template load, run # "
895  << theCurrentTemp.enty[i].runnum << ENDL;
896  return false;
897  }
898  }
899 
900  for (j = 0; j < 2; ++j) {
901  db >> theCurrentTemp.enty[i].xpar[j][0] >> theCurrentTemp.enty[i].xpar[j][1] >>
902  theCurrentTemp.enty[i].xpar[j][2] >> theCurrentTemp.enty[i].xpar[j][3] >> theCurrentTemp.enty[i].xpar[j][4];
903 
904  if (db.fail()) {
905  LOGERROR("SiPixelTemplate") << "Error reading file 6, no template load, run # "
906  << theCurrentTemp.enty[i].runnum << ENDL;
907  return false;
908  }
909  }
910 
911  qavg_avg = 0.f;
912  for (j = 0; j < 9; ++j) {
913  for (k = 0; k < TXSIZE; ++k) {
914  db >> theCurrentTemp.enty[i].xtemp[j][k];
915  qavg_avg += theCurrentTemp.enty[i].xtemp[j][k];
916  }
917 
918  if (db.fail()) {
919  LOGERROR("SiPixelTemplate") << "Error reading file 7, no template load, run # "
920  << theCurrentTemp.enty[i].runnum << ENDL;
921  return false;
922  }
923  }
924  theCurrentTemp.enty[i].qavg_avg = qavg_avg / 9.;
925 
926  for (j = 0; j < 4; ++j) {
927  db >> theCurrentTemp.enty[i].yavg[j] >> theCurrentTemp.enty[i].yrms[j] >> theCurrentTemp.enty[i].ygx0[j] >>
928  theCurrentTemp.enty[i].ygsig[j];
929 
930  if (db.fail()) {
931  LOGERROR("SiPixelTemplate") << "Error reading file 8, no template load, run # "
932  << theCurrentTemp.enty[i].runnum << ENDL;
933  return false;
934  }
935  }
936 
937  for (j = 0; j < 4; ++j) {
938  db >> theCurrentTemp.enty[i].yflpar[j][0] >> theCurrentTemp.enty[i].yflpar[j][1] >>
939  theCurrentTemp.enty[i].yflpar[j][2] >> theCurrentTemp.enty[i].yflpar[j][3] >>
940  theCurrentTemp.enty[i].yflpar[j][4] >> theCurrentTemp.enty[i].yflpar[j][5];
941 
942  if (db.fail()) {
943  LOGERROR("SiPixelTemplate") << "Error reading file 9, no template load, run # "
944  << theCurrentTemp.enty[i].runnum << ENDL;
945  return false;
946  }
947  }
948 
949  for (j = 0; j < 4; ++j) {
950  db >> theCurrentTemp.enty[i].xavg[j] >> theCurrentTemp.enty[i].xrms[j] >> theCurrentTemp.enty[i].xgx0[j] >>
951  theCurrentTemp.enty[i].xgsig[j];
952 
953  if (db.fail()) {
954  LOGERROR("SiPixelTemplate") << "Error reading file 10, no template load, run # "
955  << theCurrentTemp.enty[i].runnum << ENDL;
956  return false;
957  }
958  }
959 
960  for (j = 0; j < 4; ++j) {
961  db >> theCurrentTemp.enty[i].xflpar[j][0] >> theCurrentTemp.enty[i].xflpar[j][1] >>
962  theCurrentTemp.enty[i].xflpar[j][2] >> theCurrentTemp.enty[i].xflpar[j][3] >>
963  theCurrentTemp.enty[i].xflpar[j][4] >> theCurrentTemp.enty[i].xflpar[j][5];
964 
965  if (db.fail()) {
966  LOGERROR("SiPixelTemplate") << "Error reading file 11, no template load, run # "
967  << theCurrentTemp.enty[i].runnum << ENDL;
968  return false;
969  }
970  }
971 
972  for (j = 0; j < 4; ++j) {
973  db >> theCurrentTemp.enty[i].chi2yavg[j] >> theCurrentTemp.enty[i].chi2ymin[j] >>
974  theCurrentTemp.enty[i].chi2xavg[j] >> theCurrentTemp.enty[i].chi2xmin[j];
975 
976  if (db.fail()) {
977  LOGERROR("SiPixelTemplate") << "Error reading file 12, no template load, run # "
978  << theCurrentTemp.enty[i].runnum << ENDL;
979  return false;
980  }
981  }
982 
983  for (j = 0; j < 4; ++j) {
984  db >> theCurrentTemp.enty[i].yavgc2m[j] >> theCurrentTemp.enty[i].yrmsc2m[j] >>
985  theCurrentTemp.enty[i].chi2yavgc2m[j] >> theCurrentTemp.enty[i].chi2yminc2m[j];
986 
987  if (db.fail()) {
988  LOGERROR("SiPixelTemplate") << "Error reading file 13, no template load, run # "
989  << theCurrentTemp.enty[i].runnum << ENDL;
990  return false;
991  }
992  }
993 
994  for (j = 0; j < 4; ++j) {
995  db >> theCurrentTemp.enty[i].xavgc2m[j] >> theCurrentTemp.enty[i].xrmsc2m[j] >>
996  theCurrentTemp.enty[i].chi2xavgc2m[j] >> theCurrentTemp.enty[i].chi2xminc2m[j];
997 
998  if (db.fail()) {
999  LOGERROR("SiPixelTemplate") << "Error reading file 14, no template load, run # "
1000  << theCurrentTemp.enty[i].runnum << ENDL;
1001  return false;
1002  }
1003  }
1004 
1005  for (j = 0; j < 4; ++j) {
1006  db >> theCurrentTemp.enty[i].yavggen[j] >> theCurrentTemp.enty[i].yrmsgen[j] >>
1007  theCurrentTemp.enty[i].ygx0gen[j] >> theCurrentTemp.enty[i].ygsiggen[j];
1008 
1009  if (db.fail()) {
1010  LOGERROR("SiPixelTemplate") << "Error reading file 14a, no template load, run # "
1011  << theCurrentTemp.enty[i].runnum << ENDL;
1012  return false;
1013  }
1014  }
1015 
1016  for (j = 0; j < 4; ++j) {
1017  db >> theCurrentTemp.enty[i].xavggen[j] >> theCurrentTemp.enty[i].xrmsgen[j] >>
1018  theCurrentTemp.enty[i].xgx0gen[j] >> theCurrentTemp.enty[i].xgsiggen[j];
1019 
1020  if (db.fail()) {
1021  LOGERROR("SiPixelTemplate") << "Error reading file 14b, no template load, run # "
1022  << theCurrentTemp.enty[i].runnum << ENDL;
1023  return false;
1024  }
1025  }
1026 
1027  db >> theCurrentTemp.enty[i].chi2yavgone >> theCurrentTemp.enty[i].chi2yminone >>
1028  theCurrentTemp.enty[i].chi2xavgone >> theCurrentTemp.enty[i].chi2xminone >> theCurrentTemp.enty[i].qmin2 >>
1029  theCurrentTemp.enty[i].mpvvav >> theCurrentTemp.enty[i].sigmavav >> theCurrentTemp.enty[i].kappavav >>
1030  theCurrentTemp.enty[i].r_qMeas_qTrue >> theCurrentTemp.enty[i].spare[0];
1031 
1032  if (db.fail()) {
1033  LOGERROR("SiPixelTemplate") << "Error reading file 15, no template load, run # "
1034  << theCurrentTemp.enty[i].runnum << ENDL;
1035  return false;
1036  }
1037 
1038  db >> theCurrentTemp.enty[i].mpvvav2 >> theCurrentTemp.enty[i].sigmavav2 >> theCurrentTemp.enty[i].kappavav2 >>
1039  theCurrentTemp.enty[i].qbfrac[0] >> theCurrentTemp.enty[i].qbfrac[1] >> theCurrentTemp.enty[i].qbfrac[2] >>
1040  theCurrentTemp.enty[i].fracyone >> theCurrentTemp.enty[i].fracxone >> theCurrentTemp.enty[i].fracytwo >>
1041  theCurrentTemp.enty[i].fracxtwo;
1042  // theCurrentTemp.enty[i].qbfrac[3] = 1. - theCurrentTemp.enty[i].qbfrac[0] - theCurrentTemp.enty[i].qbfrac[1] - theCurrentTemp.enty[i].qbfrac[2];
1043 
1044  if (db.fail()) {
1045  LOGERROR("SiPixelTemplate") << "Error reading file 16, no template load, run # "
1046  << theCurrentTemp.enty[i].runnum << ENDL;
1047  return false;
1048  }
1049  }
1050 
1051  // next, loop over all barrel x-angle entries
1052 
1053  for (k = 0; k < theCurrentTemp.head.NTyx; ++k) {
1054  for (i = 0; i < theCurrentTemp.head.NTxx; ++i) {
1055  db >> theCurrentTemp.entx[k][i].runnum >> theCurrentTemp.entx[k][i].costrk[0] >>
1056  theCurrentTemp.entx[k][i].costrk[1] >> theCurrentTemp.entx[k][i].costrk[2];
1057 
1058  if (db.fail()) {
1059  LOGERROR("SiPixelTemplate") << "Error reading file 17, no template load, run # "
1060  << theCurrentTemp.entx[k][i].runnum << ENDL;
1061  return false;
1062  }
1063 
1064  // Calculate the alpha, beta, and cot(beta) for this entry
1065 
1066  theCurrentTemp.entx[k][i].alpha = static_cast<float>(
1067  atan2((double)theCurrentTemp.entx[k][i].costrk[2], (double)theCurrentTemp.entx[k][i].costrk[0]));
1068 
1069  theCurrentTemp.entx[k][i].cotalpha = theCurrentTemp.entx[k][i].costrk[0] / theCurrentTemp.entx[k][i].costrk[2];
1070 
1071  theCurrentTemp.entx[k][i].beta = static_cast<float>(
1072  atan2((double)theCurrentTemp.entx[k][i].costrk[2], (double)theCurrentTemp.entx[k][i].costrk[1]));
1073 
1074  theCurrentTemp.entx[k][i].cotbeta = theCurrentTemp.entx[k][i].costrk[1] / theCurrentTemp.entx[k][i].costrk[2];
1075 
1076  db >> theCurrentTemp.entx[k][i].qavg >> theCurrentTemp.entx[k][i].pixmax >> theCurrentTemp.entx[k][i].symax >>
1077  theCurrentTemp.entx[k][i].dyone >> theCurrentTemp.entx[k][i].syone >> theCurrentTemp.entx[k][i].sxmax >>
1078  theCurrentTemp.entx[k][i].dxone >> theCurrentTemp.entx[k][i].sxone;
1079 
1080  if (db.fail()) {
1081  LOGERROR("SiPixelTemplate") << "Error reading file 18, no template load, run # "
1082  << theCurrentTemp.entx[k][i].runnum << ENDL;
1083  return false;
1084  }
1085 
1086  db >> theCurrentTemp.entx[k][i].dytwo >> theCurrentTemp.entx[k][i].sytwo >> theCurrentTemp.entx[k][i].dxtwo >>
1087  theCurrentTemp.entx[k][i].sxtwo >> theCurrentTemp.entx[k][i].qmin >> theCurrentTemp.entx[k][i].clsleny >>
1088  theCurrentTemp.entx[k][i].clslenx;
1089  // >> theCurrentTemp.entx[k][i].mpvvav >> theCurrentTemp.entx[k][i].sigmavav >> theCurrentTemp.entx[k][i].kappavav;
1090 
1091  if (db.fail()) {
1092  LOGERROR("SiPixelTemplate") << "Error reading file 19, no template load, run # "
1093  << theCurrentTemp.entx[k][i].runnum << ENDL;
1094  return false;
1095  }
1096 
1097  for (j = 0; j < 2; ++j) {
1098  db >> theCurrentTemp.entx[k][i].ypar[j][0] >> theCurrentTemp.entx[k][i].ypar[j][1] >>
1099  theCurrentTemp.entx[k][i].ypar[j][2] >> theCurrentTemp.entx[k][i].ypar[j][3] >>
1100  theCurrentTemp.entx[k][i].ypar[j][4];
1101 
1102  if (db.fail()) {
1103  LOGERROR("SiPixelTemplate") << "Error reading file 20, no template load, run # "
1104  << theCurrentTemp.entx[k][i].runnum << ENDL;
1105  return false;
1106  }
1107  }
1108 
1109  for (j = 0; j < 9; ++j) {
1110  for (l = 0; l < TYSIZE; ++l) {
1111  db >> theCurrentTemp.entx[k][i].ytemp[j][l];
1112  }
1113 
1114  if (db.fail()) {
1115  LOGERROR("SiPixelTemplate") << "Error reading file 21, no template load, run # "
1116  << theCurrentTemp.entx[k][i].runnum << ENDL;
1117  return false;
1118  }
1119  }
1120 
1121  for (j = 0; j < 2; ++j) {
1122  db >> theCurrentTemp.entx[k][i].xpar[j][0] >> theCurrentTemp.entx[k][i].xpar[j][1] >>
1123  theCurrentTemp.entx[k][i].xpar[j][2] >> theCurrentTemp.entx[k][i].xpar[j][3] >>
1124  theCurrentTemp.entx[k][i].xpar[j][4];
1125 
1126  if (db.fail()) {
1127  LOGERROR("SiPixelTemplate") << "Error reading file 22, no template load, run # "
1128  << theCurrentTemp.entx[k][i].runnum << ENDL;
1129  return false;
1130  }
1131  }
1132 
1133  qavg_avg = 0.f;
1134  for (j = 0; j < 9; ++j) {
1135  for (l = 0; l < TXSIZE; ++l) {
1136  db >> theCurrentTemp.entx[k][i].xtemp[j][l];
1137  qavg_avg += theCurrentTemp.entx[k][i].xtemp[j][l];
1138  }
1139 
1140  if (db.fail()) {
1141  LOGERROR("SiPixelTemplate") << "Error reading file 23, no template load, run # "
1142  << theCurrentTemp.entx[k][i].runnum << ENDL;
1143  return false;
1144  }
1145  }
1146  theCurrentTemp.entx[k][i].qavg_avg = qavg_avg / 9.;
1147 
1148  for (j = 0; j < 4; ++j) {
1149  db >> theCurrentTemp.entx[k][i].yavg[j] >> theCurrentTemp.entx[k][i].yrms[j] >>
1150  theCurrentTemp.entx[k][i].ygx0[j] >> theCurrentTemp.entx[k][i].ygsig[j];
1151 
1152  if (db.fail()) {
1153  LOGERROR("SiPixelTemplate") << "Error reading file 24, no template load, run # "
1154  << theCurrentTemp.entx[k][i].runnum << ENDL;
1155  return false;
1156  }
1157  }
1158 
1159  for (j = 0; j < 4; ++j) {
1160  db >> theCurrentTemp.entx[k][i].yflpar[j][0] >> theCurrentTemp.entx[k][i].yflpar[j][1] >>
1161  theCurrentTemp.entx[k][i].yflpar[j][2] >> theCurrentTemp.entx[k][i].yflpar[j][3] >>
1162  theCurrentTemp.entx[k][i].yflpar[j][4] >> theCurrentTemp.entx[k][i].yflpar[j][5];
1163 
1164  if (db.fail()) {
1165  LOGERROR("SiPixelTemplate") << "Error reading file 25, no template load, run # "
1166  << theCurrentTemp.entx[k][i].runnum << ENDL;
1167  return false;
1168  }
1169  }
1170 
1171  for (j = 0; j < 4; ++j) {
1172  db >> theCurrentTemp.entx[k][i].xavg[j] >> theCurrentTemp.entx[k][i].xrms[j] >>
1173  theCurrentTemp.entx[k][i].xgx0[j] >> theCurrentTemp.entx[k][i].xgsig[j];
1174 
1175  if (db.fail()) {
1176  LOGERROR("SiPixelTemplate") << "Error reading file 26, no template load, run # "
1177  << theCurrentTemp.entx[k][i].runnum << ENDL;
1178  return false;
1179  }
1180  }
1181 
1182  for (j = 0; j < 4; ++j) {
1183  db >> theCurrentTemp.entx[k][i].xflpar[j][0] >> theCurrentTemp.entx[k][i].xflpar[j][1] >>
1184  theCurrentTemp.entx[k][i].xflpar[j][2] >> theCurrentTemp.entx[k][i].xflpar[j][3] >>
1185  theCurrentTemp.entx[k][i].xflpar[j][4] >> theCurrentTemp.entx[k][i].xflpar[j][5];
1186 
1187  if (db.fail()) {
1188  LOGERROR("SiPixelTemplate") << "Error reading file 27, no template load, run # "
1189  << theCurrentTemp.entx[k][i].runnum << ENDL;
1190  return false;
1191  }
1192  }
1193 
1194  for (j = 0; j < 4; ++j) {
1195  db >> theCurrentTemp.entx[k][i].chi2yavg[j] >> theCurrentTemp.entx[k][i].chi2ymin[j] >>
1196  theCurrentTemp.entx[k][i].chi2xavg[j] >> theCurrentTemp.entx[k][i].chi2xmin[j];
1197 
1198  if (db.fail()) {
1199  LOGERROR("SiPixelTemplate") << "Error reading file 28, no template load, run # "
1200  << theCurrentTemp.entx[k][i].runnum << ENDL;
1201  return false;
1202  }
1203  }
1204 
1205  for (j = 0; j < 4; ++j) {
1206  db >> theCurrentTemp.entx[k][i].yavgc2m[j] >> theCurrentTemp.entx[k][i].yrmsc2m[j] >>
1207  theCurrentTemp.entx[k][i].chi2yavgc2m[j] >> theCurrentTemp.entx[k][i].chi2yminc2m[j];
1208 
1209  if (db.fail()) {
1210  LOGERROR("SiPixelTemplate") << "Error reading file 29, no template load, run # "
1211  << theCurrentTemp.entx[k][i].runnum << ENDL;
1212  return false;
1213  }
1214  }
1215 
1216  for (j = 0; j < 4; ++j) {
1217  db >> theCurrentTemp.entx[k][i].xavgc2m[j] >> theCurrentTemp.entx[k][i].xrmsc2m[j] >>
1218  theCurrentTemp.entx[k][i].chi2xavgc2m[j] >> theCurrentTemp.entx[k][i].chi2xminc2m[j];
1219 
1220  if (db.fail()) {
1221  LOGERROR("SiPixelTemplate") << "Error reading file 30, no template load, run # "
1222  << theCurrentTemp.entx[k][i].runnum << ENDL;
1223  return false;
1224  }
1225  }
1226 
1227  for (j = 0; j < 4; ++j) {
1228  db >> theCurrentTemp.entx[k][i].yavggen[j] >> theCurrentTemp.entx[k][i].yrmsgen[j] >>
1229  theCurrentTemp.entx[k][i].ygx0gen[j] >> theCurrentTemp.entx[k][i].ygsiggen[j];
1230 
1231  if (db.fail()) {
1232  LOGERROR("SiPixelTemplate") << "Error reading file 30a, no template load, run # "
1233  << theCurrentTemp.entx[k][i].runnum << ENDL;
1234  return false;
1235  }
1236  }
1237 
1238  for (j = 0; j < 4; ++j) {
1239  db >> theCurrentTemp.entx[k][i].xavggen[j] >> theCurrentTemp.entx[k][i].xrmsgen[j] >>
1240  theCurrentTemp.entx[k][i].xgx0gen[j] >> theCurrentTemp.entx[k][i].xgsiggen[j];
1241 
1242  if (db.fail()) {
1243  LOGERROR("SiPixelTemplate") << "Error reading file 30b, no template load, run # "
1244  << theCurrentTemp.entx[k][i].runnum << ENDL;
1245  return false;
1246  }
1247  }
1248 
1249  db >> theCurrentTemp.entx[k][i].chi2yavgone >> theCurrentTemp.entx[k][i].chi2yminone >>
1250  theCurrentTemp.entx[k][i].chi2xavgone >> theCurrentTemp.entx[k][i].chi2xminone >>
1251  theCurrentTemp.entx[k][i].qmin2 >> theCurrentTemp.entx[k][i].mpvvav >> theCurrentTemp.entx[k][i].sigmavav >>
1252  theCurrentTemp.entx[k][i].kappavav >> theCurrentTemp.entx[k][i].r_qMeas_qTrue >>
1253  theCurrentTemp.entx[k][i].spare[0];
1254 
1255  if (db.fail()) {
1256  LOGERROR("SiPixelTemplate") << "Error reading file 31, no template load, run # "
1257  << theCurrentTemp.entx[k][i].runnum << ENDL;
1258  return false;
1259  }
1260 
1261  db >> theCurrentTemp.entx[k][i].mpvvav2 >> theCurrentTemp.entx[k][i].sigmavav2 >>
1262  theCurrentTemp.entx[k][i].kappavav2 >> theCurrentTemp.entx[k][i].qbfrac[0] >>
1263  theCurrentTemp.entx[k][i].qbfrac[1] >> theCurrentTemp.entx[k][i].qbfrac[2] >>
1264  theCurrentTemp.entx[k][i].fracyone >> theCurrentTemp.entx[k][i].fracxone >>
1265  theCurrentTemp.entx[k][i].fracytwo >> theCurrentTemp.entx[k][i].fracxtwo;
1266  // theCurrentTemp.entx[k][i].qbfrac[3] = 1. - theCurrentTemp.entx[k][i].qbfrac[0] - theCurrentTemp.entx[k][i].qbfrac[1] - theCurrentTemp.entx[k][i].qbfrac[2];
1267 
1268  if (db.fail()) {
1269  LOGERROR("SiPixelTemplate") << "Error reading file 32, no template load, run # "
1270  << theCurrentTemp.entx[k][i].runnum << ENDL;
1271  return false;
1272  }
1273  }
1274  }
1275 
1276  // Add this template to the store
1277 
1278  pixelTemp.push_back(theCurrentTemp);
1279  }
1280  postInit(pixelTemp);
1281  return true;
1282 
1283 } // TempInit

References dqmiodatasetharvest::db, ENDL, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, LOGERROR, LOGINFO, visualization-live-secondInstance_cfg::m, SiPixelTemplateDBObject::reader(), groupFilesInBlocks::temp, TXSIZE, and TYSIZE.

◆ pushfile() [2/2]

bool SiPixelTemplate::pushfile ( int  filenum,
std::vector< SiPixelTemplateStore > &  pixelTemp,
std::string  dir = "CalibTracker/SiPixelESProducers/data/" 
)
static

This routine initializes the global template structures from an external file template_summary_zpNNNN where NNNN are four digits of filenum.

Parameters
filenum- an integer NNNN used in the filename template_summary_zpNNNN

Alt implementation: for (unsigned cnt=4-tempfile.length(); cnt > 0; cnt– ){ tempfile = "0" + tempfile; }

Definition at line 129 of file SiPixelTemplate.cc.

129  {
130  // Add template stored in external file numbered filenum to theTemplateStore
131 
132  // Local variables
133  int i, j, k, l;
134  float qavg_avg;
135  char c;
136  const int code_version = {17};
137 
138  // Create a filename for this run
139  std::string tempfile = std::to_string(filenum);
140 
141 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
142  // If integer filenum has less than 4 digits, prepend 0's until we have four numerical characters, e.g. "0292"
143  int nzeros = 4 - tempfile.length();
144  if (nzeros > 0)
145  tempfile = std::string(nzeros, '0') + tempfile;
147 
148  tempfile = dir + "template_summary_zp" + tempfile + ".out";
149  edm::FileInPath file(tempfile); // Find the file in CMSSW
150  tempfile = file.fullPath(); // Put it back with the whole path.
151 
152 #else
153  // This is the same as above, but more elegant. (Elegance not allowed in CMSSW...)
154  std::ostringstream tout;
155  tout << "template_summary_zp" << std::setw(4) << std::setfill('0') << std::right << filenum << ".out" << std::ends;
156  tempfile = tout.str();
157 
158 #endif
159 
160  // Open the template file
161  //
162  std::ifstream in_file(tempfile);
163  if (in_file.is_open() && in_file.good()) {
164  // Create a local template storage entry
165 
166  SiPixelTemplateStore theCurrentTemp;
167 
168  // Read-in a header string first and print it
169 
170  for (i = 0; (c = in_file.get()) != '\n'; ++i) {
171  if (i < 79) {
172  theCurrentTemp.head.title[i] = c;
173  }
174  }
175  if (i > 78) {
176  i = 78;
177  }
178  theCurrentTemp.head.title[i + 1] = '\0';
179  LOGINFO("SiPixelTemplate") << "Loading Pixel Template File - " << theCurrentTemp.head.title << ENDL;
180 
181  // next, the header information
182 
183  in_file >> theCurrentTemp.head.ID >> theCurrentTemp.head.templ_version >> theCurrentTemp.head.Bfield >>
184  theCurrentTemp.head.NTy >> theCurrentTemp.head.NTyx >> theCurrentTemp.head.NTxx >> theCurrentTemp.head.Dtype >>
185  theCurrentTemp.head.Vbias >> theCurrentTemp.head.temperature >> theCurrentTemp.head.fluence >>
186  theCurrentTemp.head.qscale >> theCurrentTemp.head.s50 >> theCurrentTemp.head.lorywidth >>
187  theCurrentTemp.head.lorxwidth >> theCurrentTemp.head.ysize >> theCurrentTemp.head.xsize >>
188  theCurrentTemp.head.zsize;
189 
190  if (in_file.fail()) {
191  LOGERROR("SiPixelTemplate") << "Error reading file 0A, no template load" << ENDL;
192  return false;
193  }
194 
195  if (theCurrentTemp.head.templ_version > 17) {
196  in_file >> theCurrentTemp.head.ss50 >> theCurrentTemp.head.lorybias >> theCurrentTemp.head.lorxbias >>
197  theCurrentTemp.head.fbin[0] >> theCurrentTemp.head.fbin[1] >> theCurrentTemp.head.fbin[2];
198 
199  if (in_file.fail()) {
200  LOGERROR("SiPixelTemplate") << "Error reading file 0B, no template load" << ENDL;
201  return false;
202  }
203  } else {
204  theCurrentTemp.head.ss50 = theCurrentTemp.head.s50;
205  theCurrentTemp.head.lorybias = theCurrentTemp.head.lorywidth / 2.f;
206  theCurrentTemp.head.lorxbias = theCurrentTemp.head.lorxwidth / 2.f;
207  theCurrentTemp.head.fbin[0] = 1.5f;
208  theCurrentTemp.head.fbin[1] = 1.00f;
209  theCurrentTemp.head.fbin[2] = 0.85f;
210  }
211 
212  LOGINFO("SiPixelTemplate") << "Template ID = " << theCurrentTemp.head.ID << ", Template Version "
213  << theCurrentTemp.head.templ_version << ", Bfield = " << theCurrentTemp.head.Bfield
214  << ", NTy = " << theCurrentTemp.head.NTy << ", NTyx = " << theCurrentTemp.head.NTyx
215  << ", NTxx = " << theCurrentTemp.head.NTxx << ", Dtype = " << theCurrentTemp.head.Dtype
216  << ", Bias voltage " << theCurrentTemp.head.Vbias << ", temperature "
217  << theCurrentTemp.head.temperature << ", fluence " << theCurrentTemp.head.fluence
218  << ", Q-scaling factor " << theCurrentTemp.head.qscale << ", 1/2 multi dcol threshold "
219  << theCurrentTemp.head.s50 << ", 1/2 single dcol threshold " << theCurrentTemp.head.ss50
220  << ", y Lorentz Width " << theCurrentTemp.head.lorywidth << ", y Lorentz Bias "
221  << theCurrentTemp.head.lorybias << ", x Lorentz width " << theCurrentTemp.head.lorxwidth
222  << ", x Lorentz Bias " << theCurrentTemp.head.lorxbias
223  << ", Q/Q_avg fractions for Qbin defs " << theCurrentTemp.head.fbin[0] << ", "
224  << theCurrentTemp.head.fbin[1] << ", " << theCurrentTemp.head.fbin[2]
225  << ", pixel x-size " << theCurrentTemp.head.xsize << ", y-size "
226  << theCurrentTemp.head.ysize << ", zsize " << theCurrentTemp.head.zsize << ENDL;
227 
228  if (theCurrentTemp.head.templ_version < code_version) {
229  LOGERROR("SiPixelTemplate") << "code expects version " << code_version << " finds "
230  << theCurrentTemp.head.templ_version << ", no template load" << ENDL;
231  return false;
232  }
233 
234 #ifdef SI_PIXEL_TEMPLATE_USE_BOOST
235 
236  // next, layout the 1-d/2-d structures needed to store template
237 
238  theCurrentTemp.cotbetaY = new float[theCurrentTemp.head.NTy];
239  theCurrentTemp.cotbetaX = new float[theCurrentTemp.head.NTyx];
240  theCurrentTemp.cotalphaX = new float[theCurrentTemp.head.NTxx];
241 
242  theCurrentTemp.enty.resize(boost::extents[theCurrentTemp.head.NTy]);
243 
244  theCurrentTemp.entx.resize(boost::extents[theCurrentTemp.head.NTyx][theCurrentTemp.head.NTxx]);
245 
246 #endif
247 
248  // next, loop over all y-angle entries
249 
250  for (i = 0; i < theCurrentTemp.head.NTy; ++i) {
251  in_file >> theCurrentTemp.enty[i].runnum >> theCurrentTemp.enty[i].costrk[0] >>
252  theCurrentTemp.enty[i].costrk[1] >> theCurrentTemp.enty[i].costrk[2];
253 
254  if (in_file.fail()) {
255  LOGERROR("SiPixelTemplate") << "Error reading file 1, no template load, run # " << theCurrentTemp.enty[i].runnum
256  << ENDL;
257  return false;
258  }
259 
260  // Calculate the alpha, beta, and cot(beta) for this entry
261 
262  theCurrentTemp.enty[i].alpha =
263  static_cast<float>(atan2((double)theCurrentTemp.enty[i].costrk[2], (double)theCurrentTemp.enty[i].costrk[0]));
264 
265  theCurrentTemp.enty[i].cotalpha = theCurrentTemp.enty[i].costrk[0] / theCurrentTemp.enty[i].costrk[2];
266 
267  theCurrentTemp.enty[i].beta =
268  static_cast<float>(atan2((double)theCurrentTemp.enty[i].costrk[2], (double)theCurrentTemp.enty[i].costrk[1]));
269 
270  theCurrentTemp.enty[i].cotbeta = theCurrentTemp.enty[i].costrk[1] / theCurrentTemp.enty[i].costrk[2];
271 
272  in_file >> theCurrentTemp.enty[i].qavg >> theCurrentTemp.enty[i].pixmax >> theCurrentTemp.enty[i].symax >>
273  theCurrentTemp.enty[i].dyone >> theCurrentTemp.enty[i].syone >> theCurrentTemp.enty[i].sxmax >>
274  theCurrentTemp.enty[i].dxone >> theCurrentTemp.enty[i].sxone;
275 
276  if (in_file.fail()) {
277  LOGERROR("SiPixelTemplate") << "Error reading file 2, no template load, run # " << theCurrentTemp.enty[i].runnum
278  << ENDL;
279  return false;
280  }
281 
282  in_file >> theCurrentTemp.enty[i].dytwo >> theCurrentTemp.enty[i].sytwo >> theCurrentTemp.enty[i].dxtwo >>
283  theCurrentTemp.enty[i].sxtwo >> theCurrentTemp.enty[i].qmin >> theCurrentTemp.enty[i].clsleny >>
284  theCurrentTemp.enty[i].clslenx;
285 
286  if (in_file.fail()) {
287  LOGERROR("SiPixelTemplate") << "Error reading file 3, no template load, run # " << theCurrentTemp.enty[i].runnum
288  << ENDL;
289  return false;
290  }
291 
292  if (theCurrentTemp.enty[i].qmin <= 0.) {
293  LOGERROR("SiPixelTemplate") << "Error in template ID " << theCurrentTemp.head.ID
294  << " qmin = " << theCurrentTemp.enty[i].qmin << ", run # "
295  << theCurrentTemp.enty[i].runnum << ENDL;
296  return false;
297  }
298 
299  for (j = 0; j < 2; ++j) {
300  in_file >> theCurrentTemp.enty[i].ypar[j][0] >> theCurrentTemp.enty[i].ypar[j][1] >>
301  theCurrentTemp.enty[i].ypar[j][2] >> theCurrentTemp.enty[i].ypar[j][3] >> theCurrentTemp.enty[i].ypar[j][4];
302 
303  if (in_file.fail()) {
304  LOGERROR("SiPixelTemplate") << "Error reading file 4, no template load, run # "
305  << theCurrentTemp.enty[i].runnum << ENDL;
306  return false;
307  }
308  }
309 
310  for (j = 0; j < 9; ++j) {
311  for (k = 0; k < TYSIZE; ++k) {
312  in_file >> theCurrentTemp.enty[i].ytemp[j][k];
313  }
314 
315  if (in_file.fail()) {
316  LOGERROR("SiPixelTemplate") << "Error reading file 5, no template load, run # "
317  << theCurrentTemp.enty[i].runnum << ENDL;
318  return false;
319  }
320  }
321 
322  for (j = 0; j < 2; ++j) {
323  in_file >> theCurrentTemp.enty[i].xpar[j][0] >> theCurrentTemp.enty[i].xpar[j][1] >>
324  theCurrentTemp.enty[i].xpar[j][2] >> theCurrentTemp.enty[i].xpar[j][3] >> theCurrentTemp.enty[i].xpar[j][4];
325 
326  if (in_file.fail()) {
327  LOGERROR("SiPixelTemplate") << "Error reading file 6, no template load, run # "
328  << theCurrentTemp.enty[i].runnum << ENDL;
329  return false;
330  }
331  }
332 
333  qavg_avg = 0.f;
334  for (j = 0; j < 9; ++j) {
335  for (k = 0; k < TXSIZE; ++k) {
336  in_file >> theCurrentTemp.enty[i].xtemp[j][k];
337  qavg_avg += theCurrentTemp.enty[i].xtemp[j][k];
338  }
339 
340  if (in_file.fail()) {
341  LOGERROR("SiPixelTemplate") << "Error reading file 7, no template load, run # "
342  << theCurrentTemp.enty[i].runnum << ENDL;
343  return false;
344  }
345  }
346  theCurrentTemp.enty[i].qavg_avg = qavg_avg / 9.;
347 
348  for (j = 0; j < 4; ++j) {
349  in_file >> theCurrentTemp.enty[i].yavg[j] >> theCurrentTemp.enty[i].yrms[j] >> theCurrentTemp.enty[i].ygx0[j] >>
350  theCurrentTemp.enty[i].ygsig[j];
351 
352  if (in_file.fail()) {
353  LOGERROR("SiPixelTemplate") << "Error reading file 8, no template load, run # "
354  << theCurrentTemp.enty[i].runnum << ENDL;
355  return false;
356  }
357  }
358 
359  for (j = 0; j < 4; ++j) {
360  in_file >> theCurrentTemp.enty[i].yflpar[j][0] >> theCurrentTemp.enty[i].yflpar[j][1] >>
361  theCurrentTemp.enty[i].yflpar[j][2] >> theCurrentTemp.enty[i].yflpar[j][3] >>
362  theCurrentTemp.enty[i].yflpar[j][4] >> theCurrentTemp.enty[i].yflpar[j][5];
363 
364  if (in_file.fail()) {
365  LOGERROR("SiPixelTemplate") << "Error reading file 9, no template load, run # "
366  << theCurrentTemp.enty[i].runnum << ENDL;
367  return false;
368  }
369  }
370 
371  for (j = 0; j < 4; ++j) {
372  in_file >> theCurrentTemp.enty[i].xavg[j] >> theCurrentTemp.enty[i].xrms[j] >> theCurrentTemp.enty[i].xgx0[j] >>
373  theCurrentTemp.enty[i].xgsig[j];
374 
375  if (in_file.fail()) {
376  LOGERROR("SiPixelTemplate") << "Error reading file 10, no template load, run # "
377  << theCurrentTemp.enty[i].runnum << ENDL;
378  return false;
379  }
380  }
381 
382  for (j = 0; j < 4; ++j) {
383  in_file >> theCurrentTemp.enty[i].xflpar[j][0] >> theCurrentTemp.enty[i].xflpar[j][1] >>
384  theCurrentTemp.enty[i].xflpar[j][2] >> theCurrentTemp.enty[i].xflpar[j][3] >>
385  theCurrentTemp.enty[i].xflpar[j][4] >> theCurrentTemp.enty[i].xflpar[j][5];
386 
387  if (in_file.fail()) {
388  LOGERROR("SiPixelTemplate") << "Error reading file 11, no template load, run # "
389  << theCurrentTemp.enty[i].runnum << ENDL;
390  return false;
391  }
392  }
393 
394  for (j = 0; j < 4; ++j) {
395  in_file >> theCurrentTemp.enty[i].chi2yavg[j] >> theCurrentTemp.enty[i].chi2ymin[j] >>
396  theCurrentTemp.enty[i].chi2xavg[j] >> theCurrentTemp.enty[i].chi2xmin[j];
397 
398  if (in_file.fail()) {
399  LOGERROR("SiPixelTemplate") << "Error reading file 12, no template load, run # "
400  << theCurrentTemp.enty[i].runnum << ENDL;
401  return false;
402  }
403  }
404 
405  for (j = 0; j < 4; ++j) {
406  in_file >> theCurrentTemp.enty[i].yavgc2m[j] >> theCurrentTemp.enty[i].yrmsc2m[j] >>
407  theCurrentTemp.enty[i].chi2yavgc2m[j] >> theCurrentTemp.enty[i].chi2yminc2m[j];
408 
409  if (in_file.fail()) {
410  LOGERROR("SiPixelTemplate") << "Error reading file 13, no template load, run # "
411  << theCurrentTemp.enty[i].runnum << ENDL;
412  return false;
413  }
414  }
415 
416  for (j = 0; j < 4; ++j) {
417  in_file >> theCurrentTemp.enty[i].xavgc2m[j] >> theCurrentTemp.enty[i].xrmsc2m[j] >>
418  theCurrentTemp.enty[i].chi2xavgc2m[j] >> theCurrentTemp.enty[i].chi2xminc2m[j];
419 
420  if (in_file.fail()) {
421  LOGERROR("SiPixelTemplate") << "Error reading file 14, no template load, run # "
422  << theCurrentTemp.enty[i].runnum << ENDL;
423  return false;
424  }
425  }
426 
427  for (j = 0; j < 4; ++j) {
428  in_file >> theCurrentTemp.enty[i].yavggen[j] >> theCurrentTemp.enty[i].yrmsgen[j] >>
429  theCurrentTemp.enty[i].ygx0gen[j] >> theCurrentTemp.enty[i].ygsiggen[j];
430 
431  if (in_file.fail()) {
432  LOGERROR("SiPixelTemplate") << "Error reading file 14a, no template load, run # "
433  << theCurrentTemp.enty[i].runnum << ENDL;
434  return false;
435  }
436  }
437 
438  for (j = 0; j < 4; ++j) {
439  in_file >> theCurrentTemp.enty[i].xavggen[j] >> theCurrentTemp.enty[i].xrmsgen[j] >>
440  theCurrentTemp.enty[i].xgx0gen[j] >> theCurrentTemp.enty[i].xgsiggen[j];
441 
442  if (in_file.fail()) {
443  LOGERROR("SiPixelTemplate") << "Error reading file 14b, no template load, run # "
444  << theCurrentTemp.enty[i].runnum << ENDL;
445  return false;
446  }
447  }
448 
449  in_file >> theCurrentTemp.enty[i].chi2yavgone >> theCurrentTemp.enty[i].chi2yminone >>
450  theCurrentTemp.enty[i].chi2xavgone >> theCurrentTemp.enty[i].chi2xminone >> theCurrentTemp.enty[i].qmin2 >>
451  theCurrentTemp.enty[i].mpvvav >> theCurrentTemp.enty[i].sigmavav >> theCurrentTemp.enty[i].kappavav >>
452  theCurrentTemp.enty[i].r_qMeas_qTrue >> theCurrentTemp.enty[i].spare[0];
453 
454  if (in_file.fail()) {
455  LOGERROR("SiPixelTemplate") << "Error reading file 15, no template load, run # "
456  << theCurrentTemp.enty[i].runnum << ENDL;
457  return false;
458  }
459 
460  in_file >> theCurrentTemp.enty[i].mpvvav2 >> theCurrentTemp.enty[i].sigmavav2 >>
461  theCurrentTemp.enty[i].kappavav2 >> theCurrentTemp.enty[i].qbfrac[0] >> theCurrentTemp.enty[i].qbfrac[1] >>
462  theCurrentTemp.enty[i].qbfrac[2] >> theCurrentTemp.enty[i].fracyone >> theCurrentTemp.enty[i].fracxone >>
463  theCurrentTemp.enty[i].fracytwo >> theCurrentTemp.enty[i].fracxtwo;
464  // theCurrentTemp.enty[i].qbfrac[3] = 1. - theCurrentTemp.enty[i].qbfrac[0] - theCurrentTemp.enty[i].qbfrac[1] - theCurrentTemp.enty[i].qbfrac[2];
465 
466  if (in_file.fail()) {
467  LOGERROR("SiPixelTemplate") << "Error reading file 16, no template load, run # "
468  << theCurrentTemp.enty[i].runnum << ENDL;
469  return false;
470  }
471  }
472 
473  // next, loop over all barrel x-angle entries
474 
475  for (k = 0; k < theCurrentTemp.head.NTyx; ++k) {
476  for (i = 0; i < theCurrentTemp.head.NTxx; ++i) {
477  in_file >> theCurrentTemp.entx[k][i].runnum >> theCurrentTemp.entx[k][i].costrk[0] >>
478  theCurrentTemp.entx[k][i].costrk[1] >> theCurrentTemp.entx[k][i].costrk[2];
479 
480  if (in_file.fail()) {
481  LOGERROR("SiPixelTemplate") << "Error reading file 17, no template load, run # "
482  << theCurrentTemp.entx[k][i].runnum << ENDL;
483  return false;
484  }
485 
486  // Calculate the alpha, beta, and cot(beta) for this entry
487 
488  theCurrentTemp.entx[k][i].alpha = static_cast<float>(
489  atan2((double)theCurrentTemp.entx[k][i].costrk[2], (double)theCurrentTemp.entx[k][i].costrk[0]));
490 
491  theCurrentTemp.entx[k][i].cotalpha = theCurrentTemp.entx[k][i].costrk[0] / theCurrentTemp.entx[k][i].costrk[2];
492 
493  theCurrentTemp.entx[k][i].beta = static_cast<float>(
494  atan2((double)theCurrentTemp.entx[k][i].costrk[2], (double)theCurrentTemp.entx[k][i].costrk[1]));
495 
496  theCurrentTemp.entx[k][i].cotbeta = theCurrentTemp.entx[k][i].costrk[1] / theCurrentTemp.entx[k][i].costrk[2];
497 
498  in_file >> theCurrentTemp.entx[k][i].qavg >> theCurrentTemp.entx[k][i].pixmax >>
499  theCurrentTemp.entx[k][i].symax >> theCurrentTemp.entx[k][i].dyone >> theCurrentTemp.entx[k][i].syone >>
500  theCurrentTemp.entx[k][i].sxmax >> theCurrentTemp.entx[k][i].dxone >> theCurrentTemp.entx[k][i].sxone;
501 
502  if (in_file.fail()) {
503  LOGERROR("SiPixelTemplate") << "Error reading file 18, no template load, run # "
504  << theCurrentTemp.entx[k][i].runnum << ENDL;
505  return false;
506  }
507 
508  in_file >> theCurrentTemp.entx[k][i].dytwo >> theCurrentTemp.entx[k][i].sytwo >>
509  theCurrentTemp.entx[k][i].dxtwo >> theCurrentTemp.entx[k][i].sxtwo >> theCurrentTemp.entx[k][i].qmin >>
510  theCurrentTemp.entx[k][i].clsleny >> theCurrentTemp.entx[k][i].clslenx;
511  // >> theCurrentTemp.entx[k][i].mpvvav >> theCurrentTemp.entx[k][i].sigmavav >> theCurrentTemp.entx[k][i].kappavav;
512 
513  if (in_file.fail()) {
514  LOGERROR("SiPixelTemplate") << "Error reading file 19, no template load, run # "
515  << theCurrentTemp.entx[k][i].runnum << ENDL;
516  return false;
517  }
518 
519  for (j = 0; j < 2; ++j) {
520  in_file >> theCurrentTemp.entx[k][i].ypar[j][0] >> theCurrentTemp.entx[k][i].ypar[j][1] >>
521  theCurrentTemp.entx[k][i].ypar[j][2] >> theCurrentTemp.entx[k][i].ypar[j][3] >>
522  theCurrentTemp.entx[k][i].ypar[j][4];
523 
524  if (in_file.fail()) {
525  LOGERROR("SiPixelTemplate") << "Error reading file 20, no template load, run # "
526  << theCurrentTemp.entx[k][i].runnum << ENDL;
527  return false;
528  }
529  }
530 
531  for (j = 0; j < 9; ++j) {
532  for (l = 0; l < TYSIZE; ++l) {
533  in_file >> theCurrentTemp.entx[k][i].ytemp[j][l];
534  }
535 
536  if (in_file.fail()) {
537  LOGERROR("SiPixelTemplate") << "Error reading file 21, no template load, run # "
538  << theCurrentTemp.entx[k][i].runnum << ENDL;
539  return false;
540  }
541  }
542 
543  for (j = 0; j < 2; ++j) {
544  in_file >> theCurrentTemp.entx[k][i].xpar[j][0] >> theCurrentTemp.entx[k][i].xpar[j][1] >>
545  theCurrentTemp.entx[k][i].xpar[j][2] >> theCurrentTemp.entx[k][i].xpar[j][3] >>
546  theCurrentTemp.entx[k][i].xpar[j][4];
547 
548  if (in_file.fail()) {
549  LOGERROR("SiPixelTemplate") << "Error reading file 22, no template load, run # "
550  << theCurrentTemp.entx[k][i].runnum << ENDL;
551  return false;
552  }
553  }
554 
555  qavg_avg = 0.f;
556  for (j = 0; j < 9; ++j) {
557  for (l = 0; l < TXSIZE; ++l) {
558  in_file >> theCurrentTemp.entx[k][i].xtemp[j][l];
559  qavg_avg += theCurrentTemp.entx[k][i].xtemp[j][l];
560  }
561 
562  if (in_file.fail()) {
563  LOGERROR("SiPixelTemplate") << "Error reading file 23, no template load, run # "
564  << theCurrentTemp.entx[k][i].runnum << ENDL;
565  return false;
566  }
567  }
568  theCurrentTemp.entx[k][i].qavg_avg = qavg_avg / 9.;
569 
570  for (j = 0; j < 4; ++j) {
571  in_file >> theCurrentTemp.entx[k][i].yavg[j] >> theCurrentTemp.entx[k][i].yrms[j] >>
572  theCurrentTemp.entx[k][i].ygx0[j] >> theCurrentTemp.entx[k][i].ygsig[j];
573 
574  if (in_file.fail()) {
575  LOGERROR("SiPixelTemplate") << "Error reading file 24, no template load, run # "
576  << theCurrentTemp.entx[k][i].runnum << ENDL;
577  return false;
578  }
579  }
580 
581  for (j = 0; j < 4; ++j) {
582  in_file >> theCurrentTemp.entx[k][i].yflpar[j][0] >> theCurrentTemp.entx[k][i].yflpar[j][1] >>
583  theCurrentTemp.entx[k][i].yflpar[j][2] >> theCurrentTemp.entx[k][i].yflpar[j][3] >>
584  theCurrentTemp.entx[k][i].yflpar[j][4] >> theCurrentTemp.entx[k][i].yflpar[j][5];
585 
586  if (in_file.fail()) {
587  LOGERROR("SiPixelTemplate") << "Error reading file 25, no template load, run # "
588  << theCurrentTemp.entx[k][i].runnum << ENDL;
589  return false;
590  }
591  }
592 
593  for (j = 0; j < 4; ++j) {
594  in_file >> theCurrentTemp.entx[k][i].xavg[j] >> theCurrentTemp.entx[k][i].xrms[j] >>
595  theCurrentTemp.entx[k][i].xgx0[j] >> theCurrentTemp.entx[k][i].xgsig[j];
596 
597  if (in_file.fail()) {
598  LOGERROR("SiPixelTemplate") << "Error reading file 26, no template load, run # "
599  << theCurrentTemp.entx[k][i].runnum << ENDL;
600  return false;
601  }
602  }
603 
604  for (j = 0; j < 4; ++j) {
605  in_file >> theCurrentTemp.entx[k][i].xflpar[j][0] >> theCurrentTemp.entx[k][i].xflpar[j][1] >>
606  theCurrentTemp.entx[k][i].xflpar[j][2] >> theCurrentTemp.entx[k][i].xflpar[j][3] >>
607  theCurrentTemp.entx[k][i].xflpar[j][4] >> theCurrentTemp.entx[k][i].xflpar[j][5];
608 
609  if (in_file.fail()) {
610  LOGERROR("SiPixelTemplate") << "Error reading file 27, no template load, run # "
611  << theCurrentTemp.entx[k][i].runnum << ENDL;
612  return false;
613  }
614  }
615 
616  for (j = 0; j < 4; ++j) {
617  in_file >> theCurrentTemp.entx[k][i].chi2yavg[j] >> theCurrentTemp.entx[k][i].chi2ymin[j] >>
618  theCurrentTemp.entx[k][i].chi2xavg[j] >> theCurrentTemp.entx[k][i].chi2xmin[j];
619 
620  if (in_file.fail()) {
621  LOGERROR("SiPixelTemplate") << "Error reading file 28, no template load, run # "
622  << theCurrentTemp.entx[k][i].runnum << ENDL;
623  return false;
624  }
625  }
626 
627  for (j = 0; j < 4; ++j) {
628  in_file >> theCurrentTemp.entx[k][i].yavgc2m[j] >> theCurrentTemp.entx[k][i].yrmsc2m[j] >>
629  theCurrentTemp.entx[k][i].chi2yavgc2m[j] >> theCurrentTemp.entx[k][i].chi2yminc2m[j];
630 
631  if (in_file.fail()) {
632  LOGERROR("SiPixelTemplate") << "Error reading file 29, no template load, run # "
633  << theCurrentTemp.entx[k][i].runnum << ENDL;
634  return false;
635  }
636  }
637 
638  for (j = 0; j < 4; ++j) {
639  in_file >> theCurrentTemp.entx[k][i].xavgc2m[j] >> theCurrentTemp.entx[k][i].xrmsc2m[j] >>
640  theCurrentTemp.entx[k][i].chi2xavgc2m[j] >> theCurrentTemp.entx[k][i].chi2xminc2m[j];
641 
642  if (in_file.fail()) {
643  LOGERROR("SiPixelTemplate") << "Error reading file 30, no template load, run # "
644  << theCurrentTemp.entx[k][i].runnum << ENDL;
645  return false;
646  }
647  }
648 
649  for (j = 0; j < 4; ++j) {
650  in_file >> theCurrentTemp.entx[k][i].yavggen[j] >> theCurrentTemp.entx[k][i].yrmsgen[j] >>
651  theCurrentTemp.entx[k][i].ygx0gen[j] >> theCurrentTemp.entx[k][i].ygsiggen[j];
652 
653  if (in_file.fail()) {
654  LOGERROR("SiPixelTemplate") << "Error reading file 30a, no template load, run # "
655  << theCurrentTemp.entx[k][i].runnum << ENDL;
656  return false;
657  }
658  }
659 
660  for (j = 0; j < 4; ++j) {
661  in_file >> theCurrentTemp.entx[k][i].xavggen[j] >> theCurrentTemp.entx[k][i].xrmsgen[j] >>
662  theCurrentTemp.entx[k][i].xgx0gen[j] >> theCurrentTemp.entx[k][i].xgsiggen[j];
663 
664  if (in_file.fail()) {
665  LOGERROR("SiPixelTemplate") << "Error reading file 30b, no template load, run # "
666  << theCurrentTemp.entx[k][i].runnum << ENDL;
667  return false;
668  }
669  }
670 
671  in_file >> theCurrentTemp.entx[k][i].chi2yavgone >> theCurrentTemp.entx[k][i].chi2yminone >>
672  theCurrentTemp.entx[k][i].chi2xavgone >> theCurrentTemp.entx[k][i].chi2xminone >>
673  theCurrentTemp.entx[k][i].qmin2 >> theCurrentTemp.entx[k][i].mpvvav >> theCurrentTemp.entx[k][i].sigmavav >>
674  theCurrentTemp.entx[k][i].kappavav >> theCurrentTemp.entx[k][i].r_qMeas_qTrue >>
675  theCurrentTemp.entx[k][i].spare[0];
676 
677  if (in_file.fail()) {
678  LOGERROR("SiPixelTemplate") << "Error reading file 31, no template load, run # "
679  << theCurrentTemp.entx[k][i].runnum << ENDL;
680  return false;
681  }
682 
683  in_file >> theCurrentTemp.entx[k][i].mpvvav2 >> theCurrentTemp.entx[k][i].sigmavav2 >>
684  theCurrentTemp.entx[k][i].kappavav2 >> theCurrentTemp.entx[k][i].qbfrac[0] >>
685  theCurrentTemp.entx[k][i].qbfrac[1] >> theCurrentTemp.entx[k][i].qbfrac[2] >>
686  theCurrentTemp.entx[k][i].fracyone >> theCurrentTemp.entx[k][i].fracxone >>
687  theCurrentTemp.entx[k][i].fracytwo >> theCurrentTemp.entx[k][i].fracxtwo;
688  // theCurrentTemp.entx[k][i].qbfrac[3] = 1. - theCurrentTemp.entx[k][i].qbfrac[0] - theCurrentTemp.entx[k][i].qbfrac[1] - theCurrentTemp.entx[k][i].qbfrac[2];
689 
690  if (in_file.fail()) {
691  LOGERROR("SiPixelTemplate") << "Error reading file 32, no template load, run # "
692  << theCurrentTemp.entx[k][i].runnum << ENDL;
693  return false;
694  }
695  }
696  }
697 
698  in_file.close();
699 
700  // Add this template to the store
701 
702  pixelTemp.push_back(theCurrentTemp);
703 
704  postInit(pixelTemp);
705  return true;
706 
707  } else {
708  // If file didn't open, report this
709 
710  LOGERROR("SiPixelTemplate") << "Error opening File" << tempfile << ENDL;
711  return false;
712  }
713 
714 } // TempInit

References SiPixelTemplateEntry::alpha, SiPixelTemplateEntry::beta, SiPixelTemplateHeader::Bfield, HltBtagPostValidation_cff::c, SiPixelTemplateEntry::chi2xavg, SiPixelTemplateEntry::chi2xavgc2m, SiPixelTemplateEntry::chi2xavgone, SiPixelTemplateEntry::chi2xmin, SiPixelTemplateEntry::chi2xminc2m, SiPixelTemplateEntry::chi2xminone, SiPixelTemplateEntry::chi2yavg, SiPixelTemplateEntry::chi2yavgc2m, SiPixelTemplateEntry::chi2yavgone, SiPixelTemplateEntry::chi2ymin, SiPixelTemplateEntry::chi2yminc2m, SiPixelTemplateEntry::chi2yminone, SiPixelTemplateEntry::clslenx, SiPixelTemplateEntry::clsleny, SiPixelTemplateEntry::costrk, SiPixelTemplateEntry::cotalpha, SiPixelTemplateStore::cotalphaX, SiPixelTemplateEntry::cotbeta, SiPixelTemplateStore::cotbetaX, SiPixelTemplateStore::cotbetaY, DeadROC_duringRun::dir, SiPixelTemplateHeader::Dtype, SiPixelTemplateEntry::dxone, SiPixelTemplateEntry::dxtwo, SiPixelTemplateEntry::dyone, SiPixelTemplateEntry::dytwo, ENDL, SiPixelTemplateStore::entx, SiPixelTemplateStore::enty, SiPixelTemplateHeader::fbin, FrontierConditions_GlobalTag_cff::file, SiPixelTemplateHeader::fluence, SiPixelTemplateEntry::fracxone, SiPixelTemplateEntry::fracxtwo, SiPixelTemplateEntry::fracyone, SiPixelTemplateEntry::fracytwo, SiPixelTemplateStore::head, mps_fire::i, SiPixelTemplateHeader::ID, dqmiolumiharvest::j, dqmdumpme::k, SiPixelTemplateEntry::kappavav, SiPixelTemplateEntry::kappavav2, cmsLHEtoEOSManager::l, LOGERROR, LOGINFO, SiPixelTemplateHeader::lorxbias, SiPixelTemplateHeader::lorxwidth, SiPixelTemplateHeader::lorybias, SiPixelTemplateHeader::lorywidth, SiPixelTemplateEntry::mpvvav, SiPixelTemplateEntry::mpvvav2, SiPixelTemplateHeader::NTxx, SiPixelTemplateHeader::NTy, SiPixelTemplateHeader::NTyx, SiPixelTemplateEntry::pixmax, SiPixelTemplateEntry::qavg, SiPixelTemplateEntry::qavg_avg, SiPixelTemplateEntry::qbfrac, SiPixelTemplateEntry::qmin, SiPixelTemplateEntry::qmin2, SiPixelTemplateHeader::qscale, SiPixelTemplateEntry::r_qMeas_qTrue, SiPixelTemplateEntry::runnum, SiPixelTemplateHeader::s50, SiPixelTemplateEntry::sigmavav, SiPixelTemplateEntry::sigmavav2, SiPixelTemplateEntry::spare, SiPixelTemplateHeader::ss50, AlCaHLTBitMon_QueryRunRegistry::string, SiPixelTemplateEntry::sxmax, SiPixelTemplateEntry::sxone, SiPixelTemplateEntry::sxtwo, SiPixelTemplateEntry::symax, SiPixelTemplateEntry::syone, SiPixelTemplateEntry::sytwo, SiPixelTemplateHeader::temperature, SiPixelTemplateHeader::templ_version, SiPixelTemplateHeader::title, TXSIZE, TYSIZE, SiPixelTemplateHeader::Vbias, SiPixelTemplateEntry::xavg, SiPixelTemplateEntry::xavgc2m, SiPixelTemplateEntry::xavggen, SiPixelTemplateEntry::xflpar, SiPixelTemplateEntry::xgsig, SiPixelTemplateEntry::xgsiggen, SiPixelTemplateEntry::xgx0, SiPixelTemplateEntry::xgx0gen, SiPixelTemplateEntry::xpar, SiPixelTemplateEntry::xrms, SiPixelTemplateEntry::xrmsc2m, SiPixelTemplateEntry::xrmsgen, SiPixelTemplateHeader::xsize, SiPixelTemplateEntry::xtemp, SiPixelTemplateEntry::yavg, SiPixelTemplateEntry::yavgc2m, SiPixelTemplateEntry::yavggen, SiPixelTemplateEntry::yflpar, SiPixelTemplateEntry::ygsig, SiPixelTemplateEntry::ygsiggen, SiPixelTemplateEntry::ygx0, SiPixelTemplateEntry::ygx0gen, SiPixelTemplateEntry::ypar, SiPixelTemplateEntry::yrms, SiPixelTemplateEntry::yrmsc2m, SiPixelTemplateEntry::yrmsgen, SiPixelTemplateHeader::ysize, SiPixelTemplateEntry::ytemp, and SiPixelTemplateHeader::zsize.

Referenced by TrackingRecHitProducer::beginRun(), PixelCPEClusterRepair::PixelCPEClusterRepair(), PixelCPETemplateReco::PixelCPETemplateReco(), and PixelTemplateSmearerBase::PixelTemplateSmearerBase().

◆ qavg()

float SiPixelTemplate::qavg ( )
inline

average cluster charge for this set of track angles

Definition at line 416 of file SiPixelTemplate.h.

References qavg_.

Referenced by PixelCPEClusterRepair::checkRecommend2D(), SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ qbin() [1/4]

int SiPixelTemplate::qbin ( int  id,
float  cotalpha,
float  cotbeta,
float  locBz,
float  locBx,
float  qclus,
float &  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 
)

Interpolate beta/alpha angles to produce an expected average charge. Return int (0-4) describing the charge of the cluster [0: 1.5<Q/Qavg, 1: 1<Q/Qavg<1.5, 2: 0.85<Q/Qavg<1, 3: 0.95Qmin<Q<0.85Qavg, 4: Q<0.95Qmin].

Parameters
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014)
locBz- (input) the sign of this quantity is used to determine whether to flip cot(beta)<0 quantities from cot(beta)>0 (FPix only) for Phase 0 FPix IP-related tracks, locBz < 0 for cot(beta) > 0 and locBz > 0 for cot(beta) < 0 for Phase 1 FPix IP-related tracks, see next comment
locBx- (input) the sign of this quantity is used to determine whether to flip cot(alpha/beta)<0 quantities from cot(alpha/beta)>0 (FPix only) for Phase 1 FPix IP-related tracks, locBx/locBz > 0 for cot(alpha) > 0 and locBx/locBz < 0 for cot(alpha) < 0 for Phase 1 FPix IP-related tracks, locBx > 0 for cot(beta) > 0 and locBx < 0 for cot(beta) < 0//!
qclus- (input) the cluster charge in electrons
pixmax- (output) the maximum pixel charge in electrons (truncation value)
sigmay- (output) the estimated y-error for CPEGeneric in microns
deltay- (output) the estimated y-bias for CPEGeneric in microns
sigmax- (output) the estimated x-error for CPEGeneric in microns
deltax- (output) the estimated x-bias for CPEGeneric in microns
sy1- (output) the estimated y-error for 1 single-pixel clusters in microns
dy1- (output) the estimated y-bias for 1 single-pixel clusters in microns
sy2- (output) the estimated y-error for 1 double-pixel clusters in microns
dy2- (output) the estimated y-bias for 1 double-pixel clusters in microns
sx1- (output) the estimated x-error for 1 single-pixel clusters in microns
dx1- (output) the estimated x-bias for 1 single-pixel clusters in microns
sx2- (output) the estimated x-error for 1 double-pixel clusters in microns
dx2- (output) the estimated x-bias for 1 double-pixel clusters in microns
lorywidth- (output) the estimated y Lorentz width
lorxwidth- (output) the estimated x Lorentz width

Definition at line 2984 of file SiPixelTemplate.cc.

3003 {
3004  // Interpolate for a new set of track angles
3005 
3006  // &&& New approach: use cached pointers.
3007 
3008  // Find the index corresponding to id
3009 
3010  int index = -1;
3011  for (int i = 0; i < (int)thePixelTemp_.size(); ++i) {
3012  if (id == thePixelTemp_[i].head.ID) {
3013  index = i;
3014  break;
3015  }
3016  }
3017 
3018 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3019  if (index < 0 || index >= (int)thePixelTemp_.size()) {
3020  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::qbin can't find needed template ID = " << id << std::endl;
3021  }
3022 #else
3023  assert(index >= 0 && index < (int)thePixelTemp_.size());
3024 #endif
3025 
3026  //
3027 
3028  auto const& templ = thePixelTemp_[index];
3029 
3030  // Interpolate the absolute value of cot(beta)
3031 
3032  auto acotb = std::abs(cotbeta);
3033 
3034  // qcorrect corrects the cot(alpha)=0 cluster charge for non-zero cot(alpha)
3035 
3036  auto cotalpha0 = thePixelTemp_[index].enty[0].cotalpha;
3037  auto qcorrect =
3038  std::sqrt((1.f + cotbeta * cotbeta + cotalpha * cotalpha) / (1.f + cotbeta * cotbeta + cotalpha0 * cotalpha0));
3039 
3040  // for some cosmics, the ususal gymnastics are incorrect
3041 
3042  float cota = cotalpha;
3043  bool flip_x = false;
3044  //y flipping already taken care of by interpolate
3045  switch (dtype_) {
3046  case 0:
3047  case 1:
3048  case 2:
3049  case 3:
3050  case 4:
3051  case 5:
3052  if (locBx * locBz < 0.f) {
3053  cota = -cotalpha;
3054  flip_x = true;
3055  }
3056  break;
3057  default:
3058 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3059  throw cms::Exception("DataCorrupt")
3060  << "SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
3061 #else
3062  std::cout << "SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
3063 #endif
3064  }
3065 
3066  // Copy the charge scaling factor to the private variable
3067 
3068  auto qscale = thePixelTemp_[index].head.qscale;
3069 
3070  /*
3071  lorywidth = thePixelTemp_[index].head.lorywidth;
3072  if(locBz > 0.f) {lorywidth = -lorywidth;}
3073  lorxwidth = thePixelTemp_[index].head.lorxwidth;
3074  */
3075 
3076  auto Ny = thePixelTemp_[index].head.NTy;
3077  auto Nyx = thePixelTemp_[index].head.NTyx;
3078  auto Nxx = thePixelTemp_[index].head.NTxx;
3079 
3080 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3081  if (Ny < 2 || Nyx < 1 || Nxx < 2) {
3082  throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny/Nyx/Nxx = " << Ny
3083  << "/" << Nyx << "/" << Nxx << std::endl;
3084  }
3085 #else
3086  assert(Ny > 1 && Nyx > 0 && Nxx > 1);
3087 #endif
3088 
3089  // Interpolate/store all y-related quantities (flip displacements when flip_y)
3090 
3091  dy1 = (1.f - yratio_) * enty0_->dyone + yratio_ * enty1_->dyone;
3092  if (flip_y_) {
3093  dy1 = -dy1;
3094  }
3095  sy1 = (1.f - yratio_) * enty0_->syone + yratio_ * enty1_->syone;
3096  dy2 = (1.f - yratio_) * enty0_->dytwo + yratio_ * enty1_->dytwo;
3097  if (flip_y_) {
3098  dy2 = -dy2;
3099  }
3100  sy2 = (1.f - yratio_) * enty0_->sytwo + yratio_ * enty1_->sytwo;
3101 
3102  auto qavg = (1.f - yratio_) * enty0_->qavg + yratio_ * enty1_->qavg;
3103  qavg *= qcorrect;
3104  auto qmin = (1.f - yratio_) * enty0_->qmin + yratio_ * enty1_->qmin;
3105  qmin *= qcorrect;
3106  auto qmin2 = (1.f - yratio_) * enty0_->qmin2 + yratio_ * enty1_->qmin2;
3107  qmin2 *= qcorrect;
3108 
3109 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3110  if (qavg <= 0.f || qmin <= 0.f) {
3111  throw cms::Exception("DataCorrupt")
3112  << "SiPixelTemplate::qbin, qavg or qmin <= 0,"
3113  << " Probably someone called the generic pixel reconstruction with an illegal trajectory state" << std::endl;
3114  }
3115 #else
3116  assert(qavg > 0.f && qmin > 0.f);
3117 #endif
3118 
3119  // Scale the input charge to account for differences between pixelav and CMSSW simulation or data
3120 
3121  auto qtotal = qscale * qclus;
3122 
3123  // uncertainty and final corrections depend upon total charge bin
3124  auto fq = qtotal / qavg;
3125  int binq;
3126 
3127  if (fq > fbin_[0]) {
3128  binq = 0;
3129  //std::cout<<" fq "<<fq<<" "<<qtotal<<" "<<qavg<<" "<<qclus<<" "<<qscale<<" "
3130  // <<fbin_[0]<<" "<<fbin_[1]<<" "<<fbin_[2]<<std::endl;
3131  } else {
3132  if (fq > fbin_[1]) {
3133  binq = 1;
3134  } else {
3135  if (fq > fbin_[2]) {
3136  binq = 2;
3137  } else {
3138  binq = 3;
3139  }
3140  }
3141  }
3142 
3143  auto yavggen = (1.f - yratio_) * enty0_->yavggen[binq] + yratio_ * enty1_->yavggen[binq];
3144  if (flip_y_) {
3145  yavggen = -yavggen;
3146  }
3147  auto yrmsgen = (1.f - yratio_) * enty0_->yrmsgen[binq] + yratio_ * enty1_->yrmsgen[binq];
3148 
3149  // next, loop over all x-angle entries, first, find relevant y-slices
3150 
3151  auto iylow = 0;
3152  auto iyhigh = 0;
3153  auto yxratio = 0.f;
3154 
3155  {
3156  auto j = std::lower_bound(templ.cotbetaX, templ.cotbetaX + Nyx, acotb);
3157  if (j == templ.cotbetaX + Nyx) {
3158  --j;
3159  yxratio = 1.f;
3160  } else if (j == templ.cotbetaX) {
3161  ++j;
3162  yxratio = 0.f;
3163  } else {
3164  yxratio = (acotb - (*(j - 1))) / ((*j) - (*(j - 1)));
3165  }
3166 
3167  iyhigh = j - templ.cotbetaX;
3168  iylow = iyhigh - 1;
3169  }
3170 
3171  auto ilow = 0;
3172  auto ihigh = 0;
3173  auto xxratio = 0.f;
3174 
3175  {
3176  auto j = std::lower_bound(templ.cotalphaX, templ.cotalphaX + Nxx, cota);
3177  if (j == templ.cotalphaX + Nxx) {
3178  --j;
3179  xxratio = 1.f;
3180  } else if (j == templ.cotalphaX) {
3181  ++j;
3182  xxratio = 0.f;
3183  } else {
3184  xxratio = (cota - (*(j - 1))) / ((*j) - (*(j - 1)));
3185  }
3186 
3187  ihigh = j - templ.cotalphaX;
3188  ilow = ihigh - 1;
3189  }
3190 
3191  dx1 =
3192  (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].dxone + xxratio * thePixelTemp_[index].entx[0][ihigh].dxone;
3193  if (flip_x) {
3194  dx1 = -dx1;
3195  }
3196  sx1 =
3197  (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].sxone + xxratio * thePixelTemp_[index].entx[0][ihigh].sxone;
3198  dx2 =
3199  (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].dxtwo + xxratio * thePixelTemp_[index].entx[0][ihigh].dxtwo;
3200  if (flip_x) {
3201  dx2 = -dx2;
3202  }
3203  sx2 =
3204  (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].sxtwo + xxratio * thePixelTemp_[index].entx[0][ihigh].sxtwo;
3205 
3206  // pixmax is the maximum allowed pixel charge (used for truncation)
3207 
3208  pixmx = (1.f - yxratio) * ((1.f - xxratio) * thePixelTemp_[index].entx[iylow][ilow].pixmax +
3209  xxratio * thePixelTemp_[index].entx[iylow][ihigh].pixmax) +
3210  yxratio * ((1.f - xxratio) * thePixelTemp_[index].entx[iyhigh][ilow].pixmax +
3211  xxratio * thePixelTemp_[index].entx[iyhigh][ihigh].pixmax);
3212 
3213  auto xavggen = (1.f - yxratio) * ((1.f - xxratio) * thePixelTemp_[index].entx[iylow][ilow].xavggen[binq] +
3214  xxratio * thePixelTemp_[index].entx[iylow][ihigh].xavggen[binq]) +
3215  yxratio * ((1.f - xxratio) * thePixelTemp_[index].entx[iyhigh][ilow].xavggen[binq] +
3216  xxratio * thePixelTemp_[index].entx[iyhigh][ihigh].xavggen[binq]);
3217  if (flip_x) {
3218  xavggen = -xavggen;
3219  }
3220 
3221  auto xrmsgen = (1.f - yxratio) * ((1.f - xxratio) * thePixelTemp_[index].entx[iylow][ilow].xrmsgen[binq] +
3222  xxratio * thePixelTemp_[index].entx[iylow][ihigh].xrmsgen[binq]) +
3223  yxratio * ((1.f - xxratio) * thePixelTemp_[index].entx[iyhigh][ilow].xrmsgen[binq] +
3224  xxratio * thePixelTemp_[index].entx[iyhigh][ihigh].xrmsgen[binq]);
3225 
3226  // Take the errors and bias from the correct charge bin
3227 
3228  sigmay = yrmsgen;
3229  deltay = yavggen;
3230 
3231  sigmax = xrmsgen;
3232  deltax = xavggen;
3233 
3234  // If the charge is too small (then flag it)
3235 
3236  if (qtotal < 0.95f * qmin) {
3237  binq = 5;
3238  } else {
3239  if (qtotal < 0.95f * qmin2) {
3240  binq = 4;
3241  }
3242  }
3243 
3244  return binq;
3245 
3246 } // qbin

References funct::abs(), cms::cuda::assert(), gather_cfg::cout, Exception, f, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, cuda_std::lower_bound(), PixelTestBeamValidation_cfi::Ny, and mathSSE::sqrt().

Referenced by qbin().

◆ qbin() [2/4]

int SiPixelTemplate::qbin ( int  id,
float  cotalpha,
float  cotbeta,
float  locBz,
float  qclus,
float &  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 
)

Interpolate beta/alpha angles to produce an expected average charge. Return int (0-4) describing the charge of the cluster [0: 1.5<Q/Qavg, 1: 1<Q/Qavg<1.5, 2: 0.85<Q/Qavg<1, 3: 0.95Qmin<Q<0.85Qavg, 4: Q<0.95Qmin].

Parameters
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014)
locBz- (input) the sign of this quantity is used to determine whether to flip cot(beta)<0 quantities from cot(beta)>0 (FPix only) for Phase 0 FPix IP-related tracks, locBz < 0 for cot(beta) > 0 and locBz > 0 for cot(beta) < 0 for Phase 1 FPix IP-related tracks, see next comment
locBx- (input) the sign of this quantity is used to determine whether to flip cot(alpha/beta)<0 quantities from cot(alpha/beta)>0 (FPix only) for Phase 1 FPix IP-related tracks, locBx/locBz > 0 for cot(alpha) > 0 and locBx/locBz < 0 for cot(alpha) < 0 for Phase 1 FPix IP-related tracks, locBx > 0 for cot(beta) > 0 and locBx < 0 for cot(beta) < 0//!
qclus- (input) the cluster charge in electrons
pixmax- (output) the maximum pixel charge in electrons (truncation value)
sigmay- (output) the estimated y-error for CPEGeneric in microns
deltay- (output) the estimated y-bias for CPEGeneric in microns
sigmax- (output) the estimated x-error for CPEGeneric in microns
deltax- (output) the estimated x-bias for CPEGeneric in microns
sy1- (output) the estimated y-error for 1 single-pixel clusters in microns
dy1- (output) the estimated y-bias for 1 single-pixel clusters in microns
sy2- (output) the estimated y-error for 1 double-pixel clusters in microns
dy2- (output) the estimated y-bias for 1 double-pixel clusters in microns
sx1- (output) the estimated x-error for 1 single-pixel clusters in microns
dx1- (output) the estimated x-bias for 1 single-pixel clusters in microns
sx2- (output) the estimated x-error for 1 double-pixel clusters in microns
dx2- (output) the estimated x-bias for 1 double-pixel clusters in microns
lorywidth- (output) the estimated y Lorentz width
lorxwidth- (output) the estimated x Lorentz width

Definition at line 3277 of file SiPixelTemplate.cc.

3295 {
3296  // Interpolate for a new set of track angles
3297 
3298  // Local variables
3299  float locBx = 1.f; // lorywidth, lorxwidth;
3300 
3301  return SiPixelTemplate::qbin(id,
3302  cotalpha,
3303  cotbeta,
3304  locBz,
3305  locBx,
3306  qclus,
3307  pixmx,
3308  sigmay,
3309  deltay,
3310  sigmax,
3311  deltax,
3312  sy1,
3313  dy1,
3314  sy2,
3315  dy2,
3316  sx1,
3317  dx1,
3318  sx2,
3319  dx2); // , lorywidth, lorxwidth);
3320 
3321 } // qbin

References qbin().

◆ qbin() [3/4]

int SiPixelTemplate::qbin ( int  id,
float  cotalpha,
float  cotbeta,
float  qclus 
)

Interpolate beta/alpha angles to produce an expected average charge. Return int (0-4) describing the charge of the cluster [0: 1.5<Q/Qavg, 1: 1<Q/Qavg<1.5, 2: 0.85<Q/Qavg<1, 3: 0.95Qmin<Q<0.85Qavg, 4: Q<0.95Qmin].

Parameters
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014)
locBz- (input) the sign of this quantity is used to determine whether to flip cot(beta)<0 quantities from cot(beta)>0 (FPix only) for FPix IP-related tracks, locBz < 0 for cot(beta) > 0 and locBz > 0 for cot(beta) < 0
qclus- (input) the cluster charge in electrons
pixmax- (output) the maximum pixel charge in electrons (truncation value)
sigmay- (output) the estimated y-error for CPEGeneric in microns
deltay- (output) the estimated y-bias for CPEGeneric in microns
sigmax- (output) the estimated x-error for CPEGeneric in microns
deltax- (output) the estimated x-bias for CPEGeneric in microns
sy1- (output) the estimated y-error for 1 single-pixel clusters in microns
dy1- (output) the estimated y-bias for 1 single-pixel clusters in microns
sy2- (output) the estimated y-error for 1 double-pixel clusters in microns
dy2- (output) the estimated y-bias for 1 double-pixel clusters in microns
sx1- (output) the estimated x-error for 1 single-pixel clusters in microns
dx1- (output) the estimated x-bias for 1 single-pixel clusters in microns
sx2- (output) the estimated x-error for 1 double-pixel clusters in microns
dx2- (output) the estimated x-bias for 1 double-pixel clusters in microns Interpolate beta/alpha angles to produce an expected average charge. Return int (0-4) describing the charge of the cluster [0: 1.5<Q/Qavg, 1: 1<Q/Qavg<1.5, 2: 0.85<Q/Qavg<1, 3: 0.95Qmin<Q<0.85Qavg, 4: Q<0.95Qmin].
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014)
qclus- (input) the cluster charge in electrons

Definition at line 3366 of file SiPixelTemplate.cc.

3366  {
3367  // Interpolate for a new set of track angles
3368 
3369  // Local variables
3370  float pixmx, sigmay, deltay, sigmax, deltax, sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2, locBz; // lorywidth, lorxwidth;
3371  // Local variables
3372  float locBx = 1.f;
3373  if (cotbeta < 0.f) {
3374  locBx = -1.f;
3375  }
3376  locBz = locBx;
3377  if (cotalpha < 0.f) {
3378  locBz = -locBx;
3379  }
3380 
3381  return SiPixelTemplate::qbin(id,
3382  cotalpha,
3383  cotbeta,
3384  locBz,
3385  locBx,
3386  qclus,
3387  pixmx,
3388  sigmay,
3389  deltay,
3390  sigmax,
3391  deltax,
3392  sy1,
3393  dy1,
3394  sy2,
3395  dy2,
3396  sx1,
3397  dx1,
3398  sx2,
3399  dx2); // , lorywidth, lorxwidth);
3400 
3401 } // qbin

References f, and qbin().

◆ qbin() [4/4]

int SiPixelTemplate::qbin ( int  id,
float  cotbeta,
float  qclus 
)

Interpolate beta/alpha angles to produce an expected average charge. Return int (0-4) describing the charge of the cluster [0: 1.5<Q/Qavg, 1: 1<Q/Qavg<1.5, 2: 0.85<Q/Qavg<1, 3: 0.95Qmin<Q<0.85Qavg, 4: Q<0.95Qmin].

Parameters
id- (input) index of the template to use
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014)
qclus- (input) the cluster charge in electrons

Definition at line 3410 of file SiPixelTemplate.cc.

3410  {
3411  // Interpolate for a new set of track angles
3412 
3413  // Local variables
3414  float pixmx, sigmay, deltay, sigmax, deltax, sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2, locBz,
3415  locBx; //, lorywidth, lorxwidth;
3416  const float cotalpha = 0.f;
3417  locBx = 1.f;
3418  if (cotbeta < 0.f) {
3419  locBx = -1.f;
3420  }
3421  locBz = locBx;
3422  if (cotalpha < 0.f) {
3423  locBz = -locBx;
3424  }
3425  return SiPixelTemplate::qbin(id,
3426  cotalpha,
3427  cotbeta,
3428  locBz,
3429  locBx,
3430  qclus,
3431  pixmx,
3432  sigmay,
3433  deltay,
3434  sigmax,
3435  deltax,
3436  sy1,
3437  dy1,
3438  sy2,
3439  dy2,
3440  sx1,
3441  dx1,
3442  sx2,
3443  dx2); // , lorywidth, lorxwidth);
3444 
3445 } // qbin

References f, and qbin().

◆ qbin_dist()

void SiPixelTemplate::qbin_dist ( int  id,
float  cotalpha,
float  cotbeta,
float  qbin_frac[4],
float &  ny1_frac,
float &  ny2_frac,
float &  nx1_frac,
float &  nx2_frac 
)

Interpolate beta/alpha angles to produce estimated errors for fastsim

Parameters
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014)
qbin_frac[4]- (output) the integrated probability for qbin=0, 0+1, 0+1+2, 0+1+2+3 (1.)
ny1_frac- (output) the probability for ysize = 1 for a single-size pixel
ny2_frac- (output) the probability for ysize = 1 for a double-size pixel
nx1_frac- (output) the probability for xsize = 1 for a single-size pixel
nx2_frac- (output) the probability for xsize = 1 for a double-size pixel

Definition at line 3620 of file SiPixelTemplate.cc.

3629 {
3630  // Interpolate for a new set of track angles
3631 
3632  // Local variables
3633  int i;
3634  int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx, index;
3635  float yxratio, xxratio;
3636  float acotb;
3637  float qfrac[4];
3638  //bool flip_y;
3639 
3640  // Find the index corresponding to id
3641 
3642  index = -1;
3643  for (i = 0; i < (int)thePixelTemp_.size(); ++i) {
3644  if (id == thePixelTemp_[i].head.ID) {
3645  index = i;
3646  // id_current_ = id;
3647  break;
3648  }
3649  }
3650 
3651 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3652  if (index < 0 || index >= (int)thePixelTemp_.size()) {
3653  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::temperrors can't find needed template ID = " << id
3654  << std::endl;
3655  }
3656 #else
3657  assert(index >= 0 && index < (int)thePixelTemp_.size());
3658 #endif
3659 
3660  //
3661 
3662  // Interpolate the absolute value of cot(beta)
3663 
3664  acotb = fabs((double)cotbeta);
3665 
3666  // Copy the charge scaling factor to the private variable
3667 
3668  Ny = thePixelTemp_[index].head.NTy;
3669  Nyx = thePixelTemp_[index].head.NTyx;
3670  Nxx = thePixelTemp_[index].head.NTxx;
3671 
3672 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3673  if (Ny < 2 || Nyx < 1 || Nxx < 2) {
3674  throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny/Nyx/Nxx = " << Ny
3675  << "/" << Nyx << "/" << Nxx << std::endl;
3676  }
3677 #else
3678  assert(Ny > 1 && Nyx > 0 && Nxx > 1);
3679 #endif
3680 
3681  // Interpolate/store all y-related quantities (flip displacements when flip_y)
3682  ny1_frac = (1.f - yratio_) * enty0_->fracyone + yratio_ * enty1_->fracyone;
3683  ny2_frac = (1.f - yratio_) * enty0_->fracytwo + yratio_ * enty1_->fracytwo;
3684 
3685  // next, loop over all x-angle entries, first, find relevant y-slices
3686 
3687  iylow = 0;
3688  yxratio = 0.f;
3689 
3690  if (acotb >= thePixelTemp_[index].entx[Nyx - 1][0].cotbeta) {
3691  iylow = Nyx - 2;
3692  yxratio = 1.f;
3693 
3694  } else if (acotb >= thePixelTemp_[index].entx[0][0].cotbeta) {
3695  for (i = 0; i < Nyx - 1; ++i) {
3696  if (thePixelTemp_[index].entx[i][0].cotbeta <= acotb && acotb < thePixelTemp_[index].entx[i + 1][0].cotbeta) {
3697  iylow = i;
3698  yxratio = (acotb - thePixelTemp_[index].entx[i][0].cotbeta) /
3699  (thePixelTemp_[index].entx[i + 1][0].cotbeta - thePixelTemp_[index].entx[i][0].cotbeta);
3700  break;
3701  }
3702  }
3703  }
3704 
3705  iyhigh = iylow + 1;
3706 
3707  ilow = 0;
3708  xxratio = 0.f;
3709 
3710  if (cotalpha >= thePixelTemp_[index].entx[0][Nxx - 1].cotalpha) {
3711  ilow = Nxx - 2;
3712  xxratio = 1.f;
3713 
3714  } else {
3715  if (cotalpha >= thePixelTemp_[index].entx[0][0].cotalpha) {
3716  for (i = 0; i < Nxx - 1; ++i) {
3717  if (thePixelTemp_[index].entx[0][i].cotalpha <= cotalpha &&
3718  cotalpha < thePixelTemp_[index].entx[0][i + 1].cotalpha) {
3719  ilow = i;
3720  xxratio = (cotalpha - thePixelTemp_[index].entx[0][i].cotalpha) /
3721  (thePixelTemp_[index].entx[0][i + 1].cotalpha - thePixelTemp_[index].entx[0][i].cotalpha);
3722  break;
3723  }
3724  }
3725  }
3726  }
3727 
3728  ihigh = ilow + 1;
3729 
3730  for (i = 0; i < 3; ++i) {
3731  qfrac[i] = (1.f - yxratio) * ((1.f - xxratio) * thePixelTemp_[index].entx[iylow][ilow].qbfrac[i] +
3732  xxratio * thePixelTemp_[index].entx[iylow][ihigh].qbfrac[i]) +
3733  yxratio * ((1.f - xxratio) * thePixelTemp_[index].entx[iyhigh][ilow].qbfrac[i] +
3734  xxratio * thePixelTemp_[index].entx[iyhigh][ihigh].qbfrac[i]);
3735  }
3736  nx1_frac = (1.f - yxratio) * ((1.f - xxratio) * thePixelTemp_[index].entx[iylow][ilow].fracxone +
3737  xxratio * thePixelTemp_[index].entx[iylow][ihigh].fracxone) +
3738  yxratio * ((1.f - xxratio) * thePixelTemp_[index].entx[iyhigh][ilow].fracxone +
3739  xxratio * thePixelTemp_[index].entx[iyhigh][ihigh].fracxone);
3740  nx2_frac = (1.f - yxratio) * ((1.f - xxratio) * thePixelTemp_[index].entx[iylow][ilow].fracxtwo +
3741  xxratio * thePixelTemp_[index].entx[iylow][ihigh].fracxtwo) +
3742  yxratio * ((1.f - xxratio) * thePixelTemp_[index].entx[iyhigh][ilow].fracxtwo +
3743  xxratio * thePixelTemp_[index].entx[iyhigh][ihigh].fracxtwo);
3744 
3745  qbin_frac[0] = qfrac[0];
3746  qbin_frac[1] = qbin_frac[0] + qfrac[1];
3747  qbin_frac[2] = qbin_frac[1] + qfrac[2];
3748  qbin_frac[3] = 1.f;
3749  return;
3750 
3751 } // qbin_dist

References cms::cuda::assert(), enty0_, enty1_, Exception, f, SiPixelTemplateEntry::fracyone, SiPixelTemplateEntry::fracytwo, mps_fire::i, id_current_, createfilelist::int, PixelTestBeamValidation_cfi::Ny, thePixelTemp_, xxratio(), yratio_, and yxratio().

Referenced by PixelTemplateSmearerBase::smearHit(), and PixelTemplateSmearerBase::smearMergeGroup().

◆ qmin() [1/2]

float SiPixelTemplate::qmin ( )
inline

minimum cluster charge for valid hit (keeps 99.9% of simulated hits)

Definition at line 431 of file SiPixelTemplate.h.

References qmin_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ qmin() [2/2]

float SiPixelTemplate::qmin ( int  i)
inline

minimum cluster charge for valid hit (keeps 99.9% or 99.8% of simulated hits)

Definition at line 432 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, qmin2_, and qmin_.

◆ qscale()

float SiPixelTemplate::qscale ( )
inline

charge scaling factor

Definition at line 418 of file SiPixelTemplate.h.

References qscale_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ r_qMeas_qTrue()

float SiPixelTemplate::r_qMeas_qTrue ( )
inline

ratio of measured to true cluster charge

Definition at line 687 of file SiPixelTemplate.h.

References r_qMeas_qTrue_.

◆ s50()

float SiPixelTemplate::s50 ( )
inline

1/2 of the pixel threshold signal in electrons

Definition at line 419 of file SiPixelTemplate.h.

References s50_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), SiPixelTemplateSplit::PixelTempSplit(), and PixelTemplateSmearerBase::smearHit().

◆ sigmavav()

float SiPixelTemplate::sigmavav ( )
inline

"sigma" scale fctor for Vavilov distribution

Definition at line 677 of file SiPixelTemplate.h.

References sigmavav_.

Referenced by vavilov_pars().

◆ sigmavav2()

float SiPixelTemplate::sigmavav2 ( )
inline

"sigma" scale fctor for 2-cluster Vavilov distribution

Definition at line 682 of file SiPixelTemplate.h.

References sigmavav2_.

Referenced by vavilov2_pars().

◆ simpletemplate2D()

bool SiPixelTemplate::simpletemplate2D ( float  xhit,
float  yhit,
std::vector< bool > &  ydouble,
std::vector< bool > &  xdouble,
float  template2d[13+2][21+2] 
)

Make simple 2-D templates from track angles set in interpolate and hit position.

Parameters
xhit- (input) x-position of hit relative to the lower left corner of pixel[1][1] (to allow for the "padding" of the two-d clusters in the splitter)
yhit- (input) y-position of hit relative to the lower left corner of pixel[1][1]
ydouble- (input) STL vector of 21 element array to flag a double-pixel starting at cluster[1][1]
xdouble- (input) STL vector of 11 element array to flag a double-pixel starting at cluster[1][1]
template2d- (output) 2d template of size matched to the cluster. Input must be zeroed since charge is added only.

Definition at line 3763 of file SiPixelTemplate.cc.

3764  {
3765  // Local variables
3766 
3767  float x0, y0, xf, yf, xi, yi, sf, si, s0, qpix, slopey, slopex, ds;
3768  int i, j, jpix0, ipix0, jpixf, ipixf, jpix, ipix, nx, ny, anx, any, jmax, imax;
3769  float qtotal;
3770  // double path;
3771  std::list<SimplePixel> list;
3772  std::list<SimplePixel>::iterator listIter, listEnd;
3773 
3774  // Calculate the entry and exit points for the line charge from the track
3775 
3776  x0 = xhit - 0.5 * zsize_ * cota_current_;
3777  y0 = yhit - 0.5 * zsize_ * cotb_current_;
3778 
3779  jpix0 = floor(x0 / xsize_) + 1;
3780  ipix0 = floor(y0 / ysize_) + 1;
3781 
3782  if (jpix0 < 0 || jpix0 > BXM3) {
3783  return false;
3784  }
3785  if (ipix0 < 0 || ipix0 > BYM3) {
3786  return false;
3787  }
3788 
3789  xf = xhit + 0.5 * zsize_ * cota_current_ + lorxwidth_;
3790  yf = yhit + 0.5 * zsize_ * cotb_current_ + lorywidth_;
3791 
3792  jpixf = floor(xf / xsize_) + 1;
3793  ipixf = floor(yf / ysize_) + 1;
3794 
3795  if (jpixf < 0 || jpixf > BXM3) {
3796  return false;
3797  }
3798  if (ipixf < 0 || ipixf > BYM3) {
3799  return false;
3800  }
3801 
3802  // total charge length
3803 
3804  sf = std::sqrt((xf - x0) * (xf - x0) + (yf - y0) * (yf - y0));
3805  if ((xf - x0) != 0.f) {
3806  slopey = (yf - y0) / (xf - x0);
3807  } else {
3808  slopey = 1.e10;
3809  }
3810  if ((yf - y0) != 0.f) {
3811  slopex = (xf - x0) / (yf - y0);
3812  } else {
3813  slopex = 1.e10;
3814  }
3815 
3816  // use average charge in this direction
3817 
3818  qtotal = qavg_avg_;
3819 
3820  SimplePixel element;
3821  element.s = sf;
3822  element.x = xf;
3823  element.y = yf;
3824  element.i = ipixf;
3825  element.j = jpixf;
3826  element.btype = 0;
3827  list.push_back(element);
3828 
3829  // nx is the number of x interfaces crossed by the line charge
3830 
3831  nx = jpixf - jpix0;
3832  anx = abs(nx);
3833  if (anx > 0) {
3834  if (nx > 0) {
3835  for (j = jpix0; j < jpixf; ++j) {
3836  xi = xsize_ * j;
3837  yi = slopey * (xi - x0) + y0;
3838  ipix = (int)(yi / ysize_) + 1;
3839  si = std::sqrt((xi - x0) * (xi - x0) + (yi - y0) * (yi - y0));
3840  element.s = si;
3841  element.x = xi;
3842  element.y = yi;
3843  element.i = ipix;
3844  element.j = j;
3845  element.btype = 1;
3846  list.push_back(element);
3847  }
3848  } else {
3849  for (j = jpix0; j > jpixf; --j) {
3850  xi = xsize_ * (j - 1);
3851  yi = slopey * (xi - x0) + y0;
3852  ipix = (int)(yi / ysize_) + 1;
3853  si = std::sqrt((xi - x0) * (xi - x0) + (yi - y0) * (yi - y0));
3854  element.s = si;
3855  element.x = xi;
3856  element.y = yi;
3857  element.i = ipix;
3858  element.j = j;
3859  element.btype = 1;
3860  list.push_back(element);
3861  }
3862  }
3863  }
3864 
3865  ny = ipixf - ipix0;
3866  any = abs(ny);
3867  if (any > 0) {
3868  if (ny > 0) {
3869  for (i = ipix0; i < ipixf; ++i) {
3870  yi = ysize_ * i;
3871  xi = slopex * (yi - y0) + x0;
3872  jpix = (int)(xi / xsize_) + 1;
3873  si = std::sqrt((xi - x0) * (xi - x0) + (yi - y0) * (yi - y0));
3874  element.s = si;
3875  element.x = xi;
3876  element.y = yi;
3877  element.i = i;
3878  element.j = jpix;
3879  element.btype = 2;
3880  list.push_back(element);
3881  }
3882  } else {
3883  for (i = ipix0; i > ipixf; --i) {
3884  yi = ysize_ * (i - 1);
3885  xi = slopex * (yi - y0) + x0;
3886  jpix = (int)(xi / xsize_) + 1;
3887  si = std::sqrt((xi - x0) * (xi - x0) + (yi - y0) * (yi - y0));
3888  element.s = si;
3889  element.x = xi;
3890  element.y = yi;
3891  element.i = i;
3892  element.j = jpix;
3893  element.btype = 2;
3894  list.push_back(element);
3895  }
3896  }
3897  }
3898 
3899  imax = std::max(ipix0, ipixf);
3900  jmax = std::max(jpix0, jpixf);
3901 
3902  // Sort the list according to the distance from the initial point
3903 
3904  list.sort();
3905 
3906  // Look for double pixels and adjust the list appropriately
3907 
3908  for (i = 1; i < imax; ++i) {
3909  if (ydouble[i - 1]) {
3910  listIter = list.begin();
3911  if (ny > 0) {
3912  while (listIter != list.end()) {
3913  if (listIter->i == i && listIter->btype == 2) {
3914  listIter = list.erase(listIter);
3915  continue;
3916  }
3917  if (listIter->i > i) {
3918  --(listIter->i);
3919  }
3920  ++listIter;
3921  }
3922  } else {
3923  while (listIter != list.end()) {
3924  if (listIter->i == i + 1 && listIter->btype == 2) {
3925  listIter = list.erase(listIter);
3926  continue;
3927  }
3928  if (listIter->i > i + 1) {
3929  --(listIter->i);
3930  }
3931  ++listIter;
3932  }
3933  }
3934  }
3935  }
3936 
3937  for (j = 1; j < jmax; ++j) {
3938  if (xdouble[j - 1]) {
3939  listIter = list.begin();
3940  if (nx > 0) {
3941  while (listIter != list.end()) {
3942  if (listIter->j == j && listIter->btype == 1) {
3943  listIter = list.erase(listIter);
3944  continue;
3945  }
3946  if (listIter->j > j) {
3947  --(listIter->j);
3948  }
3949  ++listIter;
3950  }
3951  } else {
3952  while (listIter != list.end()) {
3953  if (listIter->j == j + 1 && listIter->btype == 1) {
3954  listIter = list.erase(listIter);
3955  continue;
3956  }
3957  if (listIter->j > j + 1) {
3958  --(listIter->j);
3959  }
3960  ++listIter;
3961  }
3962  }
3963  }
3964  }
3965 
3966  // The list now contains the path lengths of the line charge in each pixel from (x0,y0). Cacluate the lengths of the segments and the charge.
3967 
3968  s0 = 0.f;
3969  listIter = list.begin();
3970  listEnd = list.end();
3971  for (; listIter != listEnd; ++listIter) {
3972  si = listIter->s;
3973  ds = si - s0;
3974  s0 = si;
3975  j = listIter->j;
3976  i = listIter->i;
3977  if (sf > 0.f) {
3978  qpix = qtotal * ds / sf;
3979  } else {
3980  qpix = qtotal;
3981  }
3982  template2d[j][i] += qpix;
3983  }
3984 
3985  return true;
3986 
3987 } // simpletemplate2D

References funct::abs(), any(), SimplePixel::btype, BXM3, BYM3, cota_current_, cotb_current_, f, SimplePixel::i, mps_fire::i, createfilelist::int, SimplePixel::j, dqmiolumiharvest::j, list(), lorxwidth_, lorywidth_, SiStripPI::max, qavg_avg_, SimplePixel::s, mathSSE::sqrt(), SimplePixel::x, hybridSuperClusters_cfi::xi, xsize_, SimplePixel::y, ysize_, and zsize_.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ ss50()

float SiPixelTemplate::ss50 ( )
inline

1/2 of the single pixel per double column threshold in electrons

Definition at line 420 of file SiPixelTemplate.h.

References ss50_.

◆ sxmax()

float SiPixelTemplate::sxmax ( )
inline

average pixel signal for x-projection of cluster

Definition at line 426 of file SiPixelTemplate.h.

References sxmax_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ sxone()

float SiPixelTemplate::sxone ( )
inline

rms for one pixel x-clusters

Definition at line 428 of file SiPixelTemplate.h.

References sxone_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), SiPixelTemplateSplit::PixelTempSplit(), and temperrors().

◆ sxtwo()

float SiPixelTemplate::sxtwo ( )
inline

rms for one double-pixel x-clusters

Definition at line 430 of file SiPixelTemplate.h.

References sxtwo_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), SiPixelTemplateSplit::PixelTempSplit(), and temperrors().

◆ symax()

float SiPixelTemplate::symax ( )
inline

average pixel signal for y-projection of cluster

Definition at line 421 of file SiPixelTemplate.h.

References symax_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ syone()

float SiPixelTemplate::syone ( )
inline

rms for one pixel y-clusters

Definition at line 423 of file SiPixelTemplate.h.

References syone_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ sytwo()

float SiPixelTemplate::sytwo ( )
inline

rms for one double-pixel y-clusters

Definition at line 425 of file SiPixelTemplate.h.

References sytwo_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ temperrors()

void SiPixelTemplate::temperrors ( int  id,
float  cotalpha,
float  cotbeta,
int  qBin,
float &  sigmay,
float &  sigmax,
float &  sy1,
float &  sy2,
float &  sx1,
float &  sx2 
)

Interpolate beta/alpha angles to produce estimated errors for fastsim

Parameters
id- (input) index of the template to use
cotalpha- (input) the cotangent of the alpha track angle (see CMS IN 2004/014)
cotbeta- (input) the cotangent of the beta track angle (see CMS IN 2004/014)
qBin- (input) charge bin from 0-3
sigmay- (output) the estimated y-error for CPETemplate in microns
sigmax- (output) the estimated x-error for CPETemplate in microns
sy1- (output) the estimated y-error for 1 single-pixel clusters in microns
sy2- (output) the estimated y-error for 1 double-pixel clusters in microns
sx1- (output) the estimated x-error for 1 single-pixel clusters in microns
sx2- (output) the estimated x-error for 1 double-pixel clusters in microns

Definition at line 3460 of file SiPixelTemplate.cc.

3471 {
3472  // Interpolate for a new set of track angles
3473 
3474  // Local variables
3475  int i;
3476  int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx, index;
3477  float yxratio, xxratio;
3478  float acotb;
3479  float yrms, xrms;
3480  //bool flip_y;
3481 
3482  // Find the index corresponding to id
3483 
3484  index = -1;
3485  for (i = 0; i < (int)thePixelTemp_.size(); ++i) {
3486  if (id == thePixelTemp_[i].head.ID) {
3487  index = i;
3488  break;
3489  }
3490  }
3491 
3492 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3493  if (index < 0 || index >= (int)thePixelTemp_.size()) {
3494  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::temperrors can't find needed template ID = " << id
3495  << std::endl;
3496  }
3497 #else
3498  assert(index >= 0 && index < (int)thePixelTemp_.size());
3499 #endif
3500 
3501 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3502  if (qBin < 0 || qBin > 5) {
3503  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::temperrors called with illegal qBin = " << qBin
3504  << std::endl;
3505  }
3506 #else
3507  assert(qBin >= 0 && qBin < 6);
3508 #endif
3509 
3510  // The error information for qBin > 3 is taken to be the same as qBin=3
3511 
3512  if (qBin > 3) {
3513  qBin = 3;
3514  }
3515  //
3516 
3517  // Interpolate the absolute value of cot(beta)
3518 
3519  acotb = std::abs(cotbeta);
3520 
3521  // Copy the charge scaling factor to the private variable
3522 
3523  Ny = thePixelTemp_[index].head.NTy;
3524  Nyx = thePixelTemp_[index].head.NTyx;
3525  Nxx = thePixelTemp_[index].head.NTxx;
3526 
3527 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
3528  if (Ny < 2 || Nyx < 1 || Nxx < 2) {
3529  throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny/Nyx/Nxx = " << Ny
3530  << "/" << Nyx << "/" << Nxx << std::endl;
3531  }
3532 #else
3533  assert(Ny > 1 && Nyx > 0 && Nxx > 1);
3534 #endif
3535 
3536  // next, loop over all y-angle entries
3537 
3538  // Interpolate/store all y-related quantities (flip displacements when flip_y)
3539 
3540  sy1 = (1.f - yratio_) * enty0_->syone + yratio_ * enty1_->syone;
3541  sy2 = (1.f - yratio_) * enty0_->sytwo + yratio_ * enty1_->sytwo;
3542  yrms = (1.f - yratio_) * enty0_->yrms[qBin] + yratio_ * enty1_->yrms[qBin];
3543 
3544  // next, loop over all x-angle entries, first, find relevant y-slices
3545 
3546  iylow = 0;
3547  yxratio = 0.f;
3548 
3549  if (acotb >= thePixelTemp_[index].entx[Nyx - 1][0].cotbeta) {
3550  iylow = Nyx - 2;
3551  yxratio = 1.f;
3552 
3553  } else if (acotb >= thePixelTemp_[index].entx[0][0].cotbeta) {
3554  for (i = 0; i < Nyx - 1; ++i) {
3555  if (thePixelTemp_[index].entx[i][0].cotbeta <= acotb && acotb < thePixelTemp_[index].entx[i + 1][0].cotbeta) {
3556  iylow = i;
3557  yxratio = (acotb - thePixelTemp_[index].entx[i][0].cotbeta) /
3558  (thePixelTemp_[index].entx[i + 1][0].cotbeta - thePixelTemp_[index].entx[i][0].cotbeta);
3559  break;
3560  }
3561  }
3562  }
3563 
3564  iyhigh = iylow + 1;
3565 
3566  ilow = 0;
3567  xxratio = 0.f;
3568 
3569  if (cotalpha >= thePixelTemp_[index].entx[0][Nxx - 1].cotalpha) {
3570  ilow = Nxx - 2;
3571  xxratio = 1.f;
3572 
3573  } else {
3574  if (cotalpha >= thePixelTemp_[index].entx[0][0].cotalpha) {
3575  for (i = 0; i < Nxx - 1; ++i) {
3576  if (thePixelTemp_[index].entx[0][i].cotalpha <= cotalpha &&
3577  cotalpha < thePixelTemp_[index].entx[0][i + 1].cotalpha) {
3578  ilow = i;
3579  xxratio = (cotalpha - thePixelTemp_[index].entx[0][i].cotalpha) /
3580  (thePixelTemp_[index].entx[0][i + 1].cotalpha - thePixelTemp_[index].entx[0][i].cotalpha);
3581  break;
3582  }
3583  }
3584  }
3585  }
3586 
3587  ihigh = ilow + 1;
3588 
3589  sx1 =
3590  (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].sxone + xxratio * thePixelTemp_[index].entx[0][ihigh].sxone;
3591  sx2 =
3592  (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].sxtwo + xxratio * thePixelTemp_[index].entx[0][ihigh].sxtwo;
3593 
3594  xrms = (1.f - yxratio) * ((1.f - xxratio) * thePixelTemp_[index].entx[iylow][ilow].xrms[qBin] +
3595  xxratio * thePixelTemp_[index].entx[iylow][ihigh].xrms[qBin]) +
3596  yxratio * ((1.f - xxratio) * thePixelTemp_[index].entx[iyhigh][ilow].xrms[qBin] +
3597  xxratio * thePixelTemp_[index].entx[iyhigh][ihigh].xrms[qBin]);
3598 
3599  // Take the errors and bias from the correct charge bin
3600 
3601  sigmay = yrms;
3602 
3603  sigmax = xrms;
3604 
3605  return;
3606 
3607 } // temperrors

References funct::abs(), cms::cuda::assert(), enty0_, enty1_, Exception, f, mps_fire::i, id_current_, createfilelist::int, PixelTestBeamValidation_cfi::Ny, ApeEstimator_cff::qBin, sxone(), sxtwo(), SiPixelTemplateEntry::syone, SiPixelTemplateEntry::sytwo, thePixelTemp_, xrms(), xxratio(), yratio_, SiPixelTemplateEntry::yrms, yrms(), and yxratio().

Referenced by PixelTemplateSmearerBase::smearHit(), and PixelTemplateSmearerBase::smearMergeGroup().

◆ vavilov2_pars()

void SiPixelTemplate::vavilov2_pars ( double &  mpv,
double &  sigma,
double &  kappa 
)

Interpolate beta/alpha angles to produce Vavilov parameters for the 2-cluster charge distribution

Parameters
mpv- (output) the Vavilov most probable charge (well, not really the most probable esp at large kappa)
sigma- (output) the Vavilov sigma parameter
kappa- (output) the Vavilov kappa parameter [0.01 (Landau-like) < kappa < 10 (Gaussian-like)

Definition at line 4079 of file SiPixelTemplate.cc.

4081 {
4082  // Local variables
4083  int i;
4084  int ilow, ihigh, Ny;
4085  float yratio, cotb, cotalpha0, arg;
4086 
4087  // Interpolate in cotbeta only for the correct total path length (converts cotalpha, cotbeta into an effective cotbeta)
4088 
4089  cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
4090  arg = cotb_current_ * cotb_current_ + cota_current_ * cota_current_ - cotalpha0 * cotalpha0;
4091  if (arg < 0.f)
4092  arg = 0.f;
4093  cotb = std::sqrt(arg);
4094 
4095  // Copy the charge scaling factor to the private variable
4096 
4097  Ny = thePixelTemp_[index_id_].head.NTy;
4098 
4099 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
4100  if (Ny < 2) {
4101  throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny = " << Ny
4102  << std::endl;
4103  }
4104 #else
4105  assert(Ny > 1);
4106 #endif
4107 
4108  // next, loop over all y-angle entries
4109 
4110  ilow = 0;
4111  yratio = 0.f;
4112 
4113  if (cotb >= thePixelTemp_[index_id_].enty[Ny - 1].cotbeta) {
4114  ilow = Ny - 2;
4115  yratio = 1.f;
4116 
4117  } else {
4118  if (cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
4119  for (i = 0; i < Ny - 1; ++i) {
4120  if (thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i + 1].cotbeta) {
4121  ilow = i;
4122  yratio = (cotb - thePixelTemp_[index_id_].enty[i].cotbeta) /
4123  (thePixelTemp_[index_id_].enty[i + 1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
4124  break;
4125  }
4126  }
4127  }
4128  }
4129 
4130  ihigh = ilow + 1;
4131 
4132  // Interpolate Vavilov parameters
4133 
4134  mpvvav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].mpvvav2 +
4135  yratio * thePixelTemp_[index_id_].enty[ihigh].mpvvav2;
4136  sigmavav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].sigmavav2 +
4137  yratio * thePixelTemp_[index_id_].enty[ihigh].sigmavav2;
4138  kappavav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].kappavav2 +
4139  yratio * thePixelTemp_[index_id_].enty[ihigh].kappavav2;
4140 
4141  // Copy to parameter list
4142 
4143  mpv = (double)mpvvav2_;
4144  sigma = (double)sigmavav2_;
4145  kappa = (double)kappavav2_;
4146 
4147  return;
4148 
4149 } // vavilov2_pars

References cms::cuda::assert(), cota_current_, cotb_current_, Exception, f, mps_fire::i, id_current_, index_id_, kappa, kappavav2(), kappavav2_, mpvvav2(), mpvvav2_, PixelTestBeamValidation_cfi::Ny, sigmavav2(), sigmavav2_, mathSSE::sqrt(), thePixelTemp_, and yratio().

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ vavilov_pars()

void SiPixelTemplate::vavilov_pars ( double &  mpv,
double &  sigma,
double &  kappa 
)

Interpolate beta/alpha angles to produce Vavilov parameters for the charge distribution

Parameters
mpv- (output) the Vavilov most probable charge (well, not really the most probable esp at large kappa)
sigma- (output) the Vavilov sigma parameter
kappa- (output) the Vavilov kappa parameter [0.01 (Landau-like) < kappa < 10 (Gaussian-like)

Definition at line 3995 of file SiPixelTemplate.cc.

3997 {
3998  // Local variables
3999  int i;
4000  int ilow, ihigh, Ny;
4001  float yratio, cotb, cotalpha0, arg;
4002 
4003  // Interpolate in cotbeta only for the correct total path length (converts cotalpha, cotbeta into an effective cotbeta)
4004 
4005  cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
4006  arg = cotb_current_ * cotb_current_ + cota_current_ * cota_current_ - cotalpha0 * cotalpha0;
4007  if (arg < 0.f)
4008  arg = 0.f;
4009  cotb = std::sqrt(arg);
4010 
4011  // Copy the charge scaling factor to the private variable
4012 
4013  Ny = thePixelTemp_[index_id_].head.NTy;
4014 
4015 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
4016  if (Ny < 2) {
4017  throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny = " << Ny
4018  << std::endl;
4019  }
4020 #else
4021  assert(Ny > 1);
4022 #endif
4023 
4024  // next, loop over all y-angle entries
4025 
4026  ilow = 0;
4027  yratio = 0.f;
4028 
4029  if (cotb >= thePixelTemp_[index_id_].enty[Ny - 1].cotbeta) {
4030  ilow = Ny - 2;
4031  yratio = 1.f;
4032 
4033  } else {
4034  if (cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
4035  for (i = 0; i < Ny - 1; ++i) {
4036  if (thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i + 1].cotbeta) {
4037  ilow = i;
4038  yratio = (cotb - thePixelTemp_[index_id_].enty[i].cotbeta) /
4039  (thePixelTemp_[index_id_].enty[i + 1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
4040  break;
4041  }
4042  }
4043  }
4044  }
4045 
4046  ihigh = ilow + 1;
4047 
4048  // Interpolate Vavilov parameters
4049 
4050  mpvvav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].mpvvav +
4051  yratio * thePixelTemp_[index_id_].enty[ihigh].mpvvav;
4052  sigmavav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].sigmavav +
4053  yratio * thePixelTemp_[index_id_].enty[ihigh].sigmavav;
4054  kappavav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].kappavav +
4055  yratio * thePixelTemp_[index_id_].enty[ihigh].kappavav;
4056 
4057  // Copy to parameter list
4058 
4059  //Avoid rounding difference between floats and doubles causing issues later
4060  if (kappavav_ <= 0.01f) {
4061  LOGERROR("SiPixelTemplate") << "Vavilov kappa value is " << kappavav_ << " changing it to be above 0.01" << ENDL;
4062  kappavav_ = 0.01f + 0.0000001f;
4063  }
4064 
4065  mpv = (double)mpvvav_;
4066  sigma = (double)sigmavav_;
4067  kappa = (double)kappavav_;
4068 
4069  return;
4070 
4071 } // vavilov_pars

References cms::cuda::assert(), cota_current_, cotb_current_, ENDL, Exception, f, mps_fire::i, id_current_, index_id_, kappa, kappavav(), kappavav_, LOGERROR, mpvvav(), mpvvav_, PixelTestBeamValidation_cfi::Ny, sigmavav(), sigmavav_, mathSSE::sqrt(), thePixelTemp_, and yratio().

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ xavg()

float SiPixelTemplate::xavg ( int  i)
inline

average x-bias of reconstruction binned in 4 charge bins

Definition at line 491 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and xavg_.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ xavgc2m()

float SiPixelTemplate::xavgc2m ( int  i)
inline

1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins

Definition at line 613 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and xavgc2m_.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ xflcorr()

float SiPixelTemplate::xflcorr ( int  binq,
float  qflx 
)

Return interpolated x-correction for input charge bin and qflx

Parameters
binq- (input) charge bin [0-3]
qflx- (input) (Q_f-Q_l)/(Q_f+Q_l) for this cluster

Definition at line 2441 of file SiPixelTemplate.cc.

2443 {
2444  // Interpolate using quantities already stored in the private variables
2445 
2446  // Local variables
2447  float qfl, qfl2, qfl3, qfl4, qfl5, dx;
2448 
2449  // Make sure that input is OK
2450 
2451 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2452  if (binq < 0 || binq > 3) {
2453  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xflcorr called with binq = " << binq << std::endl;
2454  }
2455 #else
2456  assert(binq >= 0 && binq < 4);
2457 #endif
2458 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2459  if (fabs((double)qflx) > 1.) {
2460  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xflcorr called with qflx = " << qflx << std::endl;
2461  }
2462 #else
2463  assert(fabs((double)qflx) <= 1.);
2464 #endif
2465 
2466  // Define the maximum signal to allow before de-weighting a pixel
2467 
2468  qfl = qflx;
2469 
2470  if (qfl < -0.9f) {
2471  qfl = -0.9f;
2472  }
2473  if (qfl > 0.9f) {
2474  qfl = 0.9f;
2475  }
2476 
2477  // Interpolate between the two polynomials
2478 
2479  qfl2 = qfl * qfl;
2480  qfl3 = qfl2 * qfl;
2481  qfl4 = qfl3 * qfl;
2482  qfl5 = qfl4 * qfl;
2483  dx = (1.f - yxratio_) *
2484  ((1.f - xxratio_) * (xflparll_[binq][0] + xflparll_[binq][1] * qfl + xflparll_[binq][2] * qfl2 +
2485  xflparll_[binq][3] * qfl3 + xflparll_[binq][4] * qfl4 + xflparll_[binq][5] * qfl5) +
2486  xxratio_ * (xflparlh_[binq][0] + xflparlh_[binq][1] * qfl + xflparlh_[binq][2] * qfl2 +
2487  xflparlh_[binq][3] * qfl3 + xflparlh_[binq][4] * qfl4 + xflparlh_[binq][5] * qfl5)) +
2488  yxratio_ *
2489  ((1.f - xxratio_) * (xflparhl_[binq][0] + xflparhl_[binq][1] * qfl + xflparhl_[binq][2] * qfl2 +
2490  xflparhl_[binq][3] * qfl3 + xflparhl_[binq][4] * qfl4 + xflparhl_[binq][5] * qfl5) +
2491  xxratio_ * (xflparhh_[binq][0] + xflparhh_[binq][1] * qfl + xflparhh_[binq][2] * qfl2 +
2492  xflparhh_[binq][3] * qfl3 + xflparhh_[binq][4] * qfl4 + xflparhh_[binq][5] * qfl5));
2493 
2494  return dx;
2495 
2496 } // End xflcorr

References cms::cuda::assert(), PVValHelper::dx, Exception, and f.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ xgsig()

float SiPixelTemplate::xgsig ( int  i)
inline

average sigma_x from Gaussian fit binned in 4 charge bins

Definition at line 521 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and xgsig_.

◆ xgx0()

float SiPixelTemplate::xgx0 ( int  i)
inline

average x0 from Gaussian fit binned in 4 charge bins

Definition at line 511 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and xgx0_.

◆ xrms()

float SiPixelTemplate::xrms ( int  i)
inline

average x-rms of reconstruction binned in 4 charge bins

Definition at line 501 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and xrms_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and temperrors().

◆ xrmsc2m()

float SiPixelTemplate::xrmsc2m ( int  i)
inline

1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins

Definition at line 623 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and xrmsc2m_.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ xsigma2()

void SiPixelTemplate::xsigma2 ( int  fxpix,
int  lxpix,
float  sxthr,
float  xsum[13+4],
float  xsig2[13+4] 
)

Return vector of x errors (squared) for an input vector of projected signals Add large Q scaling for use in cluster splitting.

Parameters
fxpix- (input) index of the first real pixel in the projected cluster (doesn't include pseudopixels)
lxpix- (input) index of the last real pixel in the projected cluster (doesn't include pseudopixels)
sxthr- (input) maximum signal before de-weighting
xsum- (input) 11-element vector of pixel signals
xsig2- (output) 11-element vector of x errors (squared)

Definition at line 2267 of file SiPixelTemplate.cc.

2269 {
2270  // Interpolate using quantities already stored in the private variables
2271 
2272  // Local variables
2273  int i;
2274  float sigi, sigi2, sigi3, sigi4, yint, sxmax, x0, qscale, s25;
2275 
2276  // Make sure that input is OK
2277 
2278 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2279  if (fxpix < 2 || fxpix >= BXM2) {
2280  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xsigma2 called with fxpix = " << fxpix << std::endl;
2281  }
2282 #else
2283  assert(fxpix > 1 && fxpix < BXM2);
2284 #endif
2285 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2286  if (lxpix < fxpix || lxpix >= BXM2) {
2287  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xsigma2 called with lxpix/fxpix = " << lxpix << "/"
2288  << fxpix << std::endl;
2289  }
2290 #else
2291  assert(lxpix >= fxpix && lxpix < BXM2);
2292 #endif
2293 
2294  // Define the maximum signal to use in the parameterization
2295 
2296  sxmax = sxmax_;
2297  s25 = 0.5f * s50_;
2298  if (sxmax_ > sxparmax_) {
2299  sxmax = sxparmax_;
2300  }
2301 
2302  // Evaluate pixel-by-pixel uncertainties (weights) for the templ analysis
2303 
2304  for (i = fxpix - 2; i <= lxpix + 2; ++i) {
2305  if (i < fxpix || i > lxpix) {
2306  // Nearest pseudopixels have uncertainties of 50% of threshold, next-nearest have 10% of threshold
2307 
2308  xsig2[i] = s50_ * s50_;
2309  } else {
2310  if (xsum[i] < sxmax) {
2311  sigi = xsum[i];
2312  qscale = 1.f;
2313  if (sigi < s25)
2314  sigi = s25;
2315  } else {
2316  sigi = sxmax;
2317  qscale = xsum[i] / sxmax;
2318  }
2319  sigi2 = sigi * sigi;
2320  sigi3 = sigi2 * sigi;
2321  sigi4 = sigi3 * sigi;
2322 
2323  // First, do the cotbeta interpolation
2324 
2325  if (i <= BHX) {
2326  yint = (1.f - yratio_) * (xparly0_[0][0] + xparly0_[0][1] * sigi + xparly0_[0][2] * sigi2 +
2327  xparly0_[0][3] * sigi3 + xparly0_[0][4] * sigi4) +
2328  yratio_ * (xparhy0_[0][0] + xparhy0_[0][1] * sigi + xparhy0_[0][2] * sigi2 + xparhy0_[0][3] * sigi3 +
2329  xparhy0_[0][4] * sigi4);
2330  } else {
2331  yint = (1.f - yratio_) * (xparly0_[1][0] + xparly0_[1][1] * sigi + xparly0_[1][2] * sigi2 +
2332  xparly0_[1][3] * sigi3 + xparly0_[1][4] * sigi4) +
2333  yratio_ * (xparhy0_[1][0] + xparhy0_[1][1] * sigi + xparhy0_[1][2] * sigi2 + xparhy0_[1][3] * sigi3 +
2334  xparhy0_[1][4] * sigi4);
2335  }
2336 
2337  // Next, do the cotalpha interpolation
2338 
2339  if (i <= BHX) {
2340  xsig2[i] = (1.f - xxratio_) * (xparl_[0][0] + xparl_[0][1] * sigi + xparl_[0][2] * sigi2 +
2341  xparl_[0][3] * sigi3 + xparl_[0][4] * sigi4) +
2342  xxratio_ * (xparh_[0][0] + xparh_[0][1] * sigi + xparh_[0][2] * sigi2 + xparh_[0][3] * sigi3 +
2343  xparh_[0][4] * sigi4);
2344  } else {
2345  xsig2[i] = (1.f - xxratio_) * (xparl_[1][0] + xparl_[1][1] * sigi + xparl_[1][2] * sigi2 +
2346  xparl_[1][3] * sigi3 + xparl_[1][4] * sigi4) +
2347  xxratio_ * (xparh_[1][0] + xparh_[1][1] * sigi + xparh_[1][2] * sigi2 + xparh_[1][3] * sigi3 +
2348  xparh_[1][4] * sigi4);
2349  }
2350 
2351  // Finally, get the mid-point value of the cotalpha function
2352 
2353  if (i <= BHX) {
2354  x0 = xpar0_[0][0] + xpar0_[0][1] * sigi + xpar0_[0][2] * sigi2 + xpar0_[0][3] * sigi3 + xpar0_[0][4] * sigi4;
2355  } else {
2356  x0 = xpar0_[1][0] + xpar0_[1][1] * sigi + xpar0_[1][2] * sigi2 + xpar0_[1][3] * sigi3 + xpar0_[1][4] * sigi4;
2357  }
2358 
2359  // Finally, rescale the yint value for cotalpha variation
2360 
2361  if (x0 != 0.f) {
2362  xsig2[i] = xsig2[i] / x0 * yint;
2363  }
2364  xsig2[i] *= qscale;
2365  if (xsum[i] > sxthr) {
2366  xsig2[i] = 1.e8;
2367  }
2368  if (xsig2[i] <= 0.f) {
2369  LOGERROR("SiPixelTemplate") << "neg x-error-squared, id = " << id_current_ << ", index = " << index_id_
2370  << ", cot(alpha) = " << cota_current_ << ", cot(beta) = " << cotb_current_
2371  << ", sigi = " << sigi << ENDL;
2372  }
2373  }
2374  }
2375 
2376  return;
2377 
2378 } // End xsigma2

References cms::cuda::assert(), BHX, BXM2, ENDL, Exception, f, mps_fire::i, and LOGERROR.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ xsize()

float SiPixelTemplate::xsize ( )
inline

pixel x-size (microns)

Definition at line 684 of file SiPixelTemplate.h.

References xsize_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ xtemp()

void SiPixelTemplate::xtemp ( int  fxbin,
int  lxbin,
float  xtemplate[41][13+4] 
)

Return interpolated y-template in single call

Parameters
fxbin- (input) index of first bin (0-40) to fill
fxbin- (input) index of last bin (0-40) to fill
xtemplate- (output) a 41x11 output buffer

Definition at line 2580 of file SiPixelTemplate.cc.

2580  {
2581  // Retrieve already interpolated quantities
2582 
2583  // Local variables
2584  int i, j;
2585 
2586  // Verify that input parameters are in valid range
2587 
2588 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2589  if (fxbin < 0 || fxbin > 40) {
2590  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xtemp called with fxbin = " << fxbin << std::endl;
2591  }
2592 #else
2593  assert(fxbin >= 0 && fxbin < 41);
2594 #endif
2595 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2596  if (lxbin < 0 || lxbin > 40) {
2597  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xtemp called with lxbin = " << lxbin << std::endl;
2598  }
2599 #else
2600  assert(lxbin >= 0 && lxbin < 41);
2601 #endif
2602 
2603  // Build the x-template, the central 25 bins are here in all cases
2604 
2605  for (i = 0; i < 9; ++i) {
2606  for (j = 0; j < BXSIZE; ++j) {
2607  xtemplate[i + 16][j] = xtemp_[i][j];
2608  }
2609  }
2610  for (i = 0; i < 8; ++i) {
2611  xtemplate[i + 8][BXM1] = 0.f;
2612  for (j = 0; j < BXM1; ++j) {
2613  xtemplate[i + 8][j] = xtemp_[i][j + 1];
2614  }
2615  }
2616  for (i = 1; i < 9; ++i) {
2617  xtemplate[i + 24][0] = 0.f;
2618  for (j = 0; j < BXM1; ++j) {
2619  xtemplate[i + 24][j + 1] = xtemp_[i][j];
2620  }
2621  }
2622  // Add more bins if needed
2623  if (fxbin < 8) {
2624  for (i = 0; i < 8; ++i) {
2625  xtemplate[i][BXM2] = 0.f;
2626  xtemplate[i][BXM1] = 0.f;
2627  for (j = 0; j < BXM2; ++j) {
2628  xtemplate[i][j] = xtemp_[i][j + 2];
2629  }
2630  }
2631  }
2632  if (lxbin > 32) {
2633  for (i = 1; i < 9; ++i) {
2634  xtemplate[i + 32][0] = 0.f;
2635  xtemplate[i + 32][1] = 0.f;
2636  for (j = 0; j < BXM2; ++j) {
2637  xtemplate[i + 32][j + 2] = xtemp_[i][j];
2638  }
2639  }
2640  }
2641 
2642  return;
2643 
2644 } // End xtemp

References cms::cuda::assert(), BXM1, BXM2, BXSIZE, Exception, mps_fire::i, and dqmiolumiharvest::j.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), PixelTemplateSmearerBase::smearHit(), and PixelTemplateSmearerBase::smearMergeGroup().

◆ xtemp3d()

void SiPixelTemplate::xtemp3d ( int  i,
int  j,
std::vector< float > &  xtemplate 
)

Return interpolated 3d x-template in single call

Parameters
i,j- (input) template indices
xtemplate- (output) a boost 3d array containing two sets of temlate indices and the combined pixel signals

Definition at line 2937 of file SiPixelTemplate.cc.

2939 {
2940  // Sum two 2-d templates to make the 3-d template
2941  if (i >= 0 && i < nxbins_ && j <= i) {
2942  for (int k = 0; k < BXSIZE; ++k) {
2943  xtemplate[k] = temp2dx_[i][k] + temp2dx_[j][k];
2944  }
2945  } else {
2946  for (int k = 0; k < BXSIZE; ++k) {
2947  xtemplate[k] = 0.;
2948  }
2949  }
2950 
2951  return;
2952 
2953 } // End xtemp3d

References BXSIZE, mps_fire::i, dqmiolumiharvest::j, and dqmdumpme::k.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ xtemp3d_int()

void SiPixelTemplate::xtemp3d_int ( int  nxpix,
int &  nxbins 
)

Make interpolated 3d x-template (stored as class variables)

Parameters
nxpix- (input) number of pixels in cluster (needed to size template)
nxbins- (output) number of bins needed for each template projection

Definition at line 2858 of file SiPixelTemplate.cc.

2860 {
2861  // Retrieve already interpolated quantities
2862 
2863  // Local variables
2864  int i, j, k;
2865  int ioff0, ioffp, ioffm;
2866 
2867  // Verify that input parameters are in valid range
2868 
2869 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2870  if (nxpix < 1 || nxpix >= BXM3) {
2871  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xtemp3d called with nxpix = " << nxpix << std::endl;
2872  }
2873 #else
2874  assert(nxpix > 0 && nxpix < BXM3);
2875 #endif
2876 
2877  // Calculate the size of the shift in pixels needed to span the entire cluster
2878 
2879  float diff = fabsf(nxpix - clslenx_) / 2.f + 1.f;
2880  int nshift = (int)diff;
2881  if ((diff - nshift) > 0.5f) {
2882  ++nshift;
2883  }
2884 
2885  // Calculate the number of bins needed to specify each hit range
2886 
2887  nxbins_ = 9 + 16 * nshift;
2888 
2889  // Create a 2-d working template with the correct size
2890 
2891  temp2dx_.resize(boost::extents[nxbins_][BXSIZE]);
2892 
2893  // The 9 central bins are copied from the interpolated private store
2894 
2895  ioff0 = 8 * nshift;
2896 
2897  for (i = 0; i < 9; ++i) {
2898  for (j = 0; j < BXSIZE; ++j) {
2899  temp2dx_[i + ioff0][j] = xtemp_[i][j];
2900  }
2901  }
2902 
2903  // Add the +- shifted templates
2904 
2905  for (k = 1; k <= nshift; ++k) {
2906  ioffm = ioff0 - k * 8;
2907  for (i = 0; i < 8; ++i) {
2908  for (j = 0; j < k; ++j) {
2909  temp2dx_[i + ioffm][BXM1 - j] = 0.f;
2910  }
2911  for (j = 0; j < BXSIZE - k; ++j) {
2912  temp2dx_[i + ioffm][j] = xtemp_[i][j + k];
2913  }
2914  }
2915  ioffp = ioff0 + k * 8;
2916  for (i = 1; i < 9; ++i) {
2917  for (j = 0; j < k; ++j) {
2918  temp2dx_[i + ioffp][j] = 0.f;
2919  }
2920  for (j = 0; j < BXSIZE - k; ++j) {
2921  temp2dx_[i + ioffp][j + k] = xtemp_[i][j];
2922  }
2923  }
2924  }
2925 
2926  nxbins = nxbins_;
2927 
2928  return;
2929 
2930 } // End xtemp3d_int

References cms::cuda::assert(), BXM1, BXM3, BXSIZE, change_name::diff, Exception, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, and dqmdumpme::k.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ xxratio()

float SiPixelTemplate::xxratio ( )
inline

fractional distance in x between cotalpha templates

Definition at line 450 of file SiPixelTemplate.h.

References xxratio_.

Referenced by qbin_dist(), and temperrors().

◆ yavg()

float SiPixelTemplate::yavg ( int  i)
inline

average y-bias of reconstruction binned in 4 charge bins

Definition at line 451 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and yavg_.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ yavgc2m()

float SiPixelTemplate::yavgc2m ( int  i)
inline

1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins

Definition at line 571 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and yavgc2m_.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ yflcorr()

float SiPixelTemplate::yflcorr ( int  binq,
float  qfly 
)

Return interpolated y-correction for input charge bin and qfly

Parameters
binq- (input) charge bin [0-3]
qfly- (input) (Q_f-Q_l)/(Q_f+Q_l) for this cluster

Definition at line 2385 of file SiPixelTemplate.cc.

2387 {
2388  // Interpolate using quantities already stored in the private variables
2389 
2390  // Local variables
2391  float qfl, qfl2, qfl3, qfl4, qfl5, dy;
2392 
2393  // Make sure that input is OK
2394 
2395 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2396  if (binq < 0 || binq > 3) {
2397  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::yflcorr called with binq = " << binq << std::endl;
2398  }
2399 #else
2400  assert(binq >= 0 && binq < 4);
2401 #endif
2402 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2403  if (fabs((double)qfly) > 1.) {
2404  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::yflcorr called with qfly = " << qfly << std::endl;
2405  }
2406 #else
2407  assert(fabs((double)qfly) <= 1.);
2408 #endif
2409 
2410  // Define the maximum signal to allow before de-weighting a pixel
2411 
2412  qfl = qfly;
2413 
2414  if (qfl < -0.9f) {
2415  qfl = -0.9f;
2416  }
2417  if (qfl > 0.9f) {
2418  qfl = 0.9f;
2419  }
2420 
2421  // Interpolate between the two polynomials
2422 
2423  qfl2 = qfl * qfl;
2424  qfl3 = qfl2 * qfl;
2425  qfl4 = qfl3 * qfl;
2426  qfl5 = qfl4 * qfl;
2427  dy = (1.f - yratio_) * (yflparl_[binq][0] + yflparl_[binq][1] * qfl + yflparl_[binq][2] * qfl2 +
2428  yflparl_[binq][3] * qfl3 + yflparl_[binq][4] * qfl4 + yflparl_[binq][5] * qfl5) +
2429  yratio_ * (yflparh_[binq][0] + yflparh_[binq][1] * qfl + yflparh_[binq][2] * qfl2 + yflparh_[binq][3] * qfl3 +
2430  yflparh_[binq][4] * qfl4 + yflparh_[binq][5] * qfl5);
2431 
2432  return dy;
2433 
2434 } // End yflcorr

References cms::cuda::assert(), PVValHelper::dy, Exception, and f.

Referenced by SiPixelTemplateReco::PixelTempReco1D().

◆ ygsig()

float SiPixelTemplate::ygsig ( int  i)
inline

average sigma_y from Gaussian fit binned in 4 charge bins

Definition at line 481 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and ygsig_.

◆ ygx0()

float SiPixelTemplate::ygx0 ( int  i)
inline

average y0 from Gaussian fit binned in 4 charge bins

Definition at line 471 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and ygx0_.

◆ yratio()

float SiPixelTemplate::yratio ( )
inline

fractional distance in y between cotbeta templates

Definition at line 448 of file SiPixelTemplate.h.

References yratio_.

Referenced by vavilov2_pars(), and vavilov_pars().

◆ yrms()

float SiPixelTemplate::yrms ( int  i)
inline

average y-rms of reconstruction binned in 4 charge bins

Definition at line 461 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and yrms_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and temperrors().

◆ yrmsc2m()

float SiPixelTemplate::yrmsc2m ( int  i)
inline

1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins

Definition at line 581 of file SiPixelTemplate.h.

References cms::cuda::assert(), Exception, mps_fire::i, and yrmsc2m_.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ ysigma2() [1/2]

void SiPixelTemplate::ysigma2 ( float  qpixel,
int  index,
float &  ysig2 
)

Return y error (squared) for an input signal and yindex Add large Q scaling for use in cluster splitting.

Parameters
qpixel- (input) pixel charge
index- (input) y-index index of pixel
ysig2- (output) square error

Definition at line 2194 of file SiPixelTemplate.cc.

2196 {
2197  // Interpolate using quantities already stored in the private variables
2198 
2199  // Local variables
2200  float sigi, sigi2, sigi3, sigi4, symax, qscale, err2, s25;
2201 
2202  // Make sure that input is OK
2203 
2204 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2205  if (index < 2 || index >= BYM2) {
2206  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::ysigma2 called with index = " << index << std::endl;
2207  }
2208 #else
2209  assert(index > 1 && index < BYM2);
2210 #endif
2211 
2212  // Define the maximum signal to use in the parameterization
2213 
2214  symax = symax_;
2215  s25 = 0.5f * s50_;
2216  if (symax_ > syparmax_) {
2217  symax = syparmax_;
2218  }
2219 
2220  // Evaluate pixel-by-pixel uncertainties (weights) for the templ analysis
2221 
2222  if (qpixel < symax) {
2223  sigi = qpixel;
2224  qscale = 1.f;
2225  if (sigi < s25)
2226  sigi = s25;
2227  } else {
2228  sigi = symax;
2229  qscale = qpixel / symax;
2230  }
2231  sigi2 = sigi * sigi;
2232  sigi3 = sigi2 * sigi;
2233  sigi4 = sigi3 * sigi;
2234  if (index <= BHY) {
2235  err2 =
2236  (1.f - yratio_) *
2237  (yparl_[0][0] + yparl_[0][1] * sigi + yparl_[0][2] * sigi2 + yparl_[0][3] * sigi3 + yparl_[0][4] * sigi4) +
2238  yratio_ *
2239  (yparh_[0][0] + yparh_[0][1] * sigi + yparh_[0][2] * sigi2 + yparh_[0][3] * sigi3 + yparh_[0][4] * sigi4);
2240  } else {
2241  err2 =
2242  (1.f - yratio_) *
2243  (yparl_[1][0] + yparl_[1][1] * sigi + yparl_[1][2] * sigi2 + yparl_[1][3] * sigi3 + yparl_[1][4] * sigi4) +
2244  yratio_ *
2245  (yparh_[1][0] + yparh_[1][1] * sigi + yparh_[1][2] * sigi2 + yparh_[1][3] * sigi3 + yparh_[1][4] * sigi4);
2246  }
2247  ysig2 = qscale * err2;
2248  if (ysig2 <= 0.f) {
2249  LOGERROR("SiPixelTemplate") << "neg y-error-squared, id = " << id_current_ << ", index = " << index_id_
2250  << ", cot(alpha) = " << cota_current_ << ", cot(beta) = " << cotb_current_
2251  << ", sigi = " << sigi << ENDL;
2252  }
2253 
2254  return;
2255 
2256 } // End ysigma2

References cms::cuda::assert(), BHY, BYM2, ENDL, Exception, f, and LOGERROR.

◆ ysigma2() [2/2]

void SiPixelTemplate::ysigma2 ( int  fypix,
int  lypix,
float  sythr,
float  ysum[21+4],
float  ysig2[21+4] 
)

◆ ysize()

float SiPixelTemplate::ysize ( )
inline

pixel y-size (microns)

Definition at line 685 of file SiPixelTemplate.h.

References ysize_.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), and SiPixelTemplateSplit::PixelTempSplit().

◆ ytemp()

void SiPixelTemplate::ytemp ( int  fybin,
int  lybin,
float  ytemplate[41][21+4] 
)

Return interpolated y-template in single call

Parameters
fybin- (input) index of first bin (0-40) to fill
fybin- (input) index of last bin (0-40) to fill
ytemplate- (output) a 41x25 output buffer

Definition at line 2504 of file SiPixelTemplate.cc.

2506 {
2507  // Retrieve already interpolated quantities
2508 
2509  // Local variables
2510  int i, j;
2511 
2512  // Verify that input parameters are in valid range
2513 
2514 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2515  if (fybin < 0 || fybin > 40) {
2516  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::ytemp called with fybin = " << fybin << std::endl;
2517  }
2518 #else
2519  assert(fybin >= 0 && fybin < 41);
2520 #endif
2521 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2522  if (lybin < 0 || lybin > 40) {
2523  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::ytemp called with lybin = " << lybin << std::endl;
2524  }
2525 #else
2526  assert(lybin >= 0 && lybin < 41);
2527 #endif
2528 
2529  // Build the y-template, the central 25 bins are here in all cases
2530 
2531  for (i = 0; i < 9; ++i) {
2532  for (j = 0; j < BYSIZE; ++j) {
2533  ytemplate[i + 16][j] = ytemp_[i][j];
2534  }
2535  }
2536  for (i = 0; i < 8; ++i) {
2537  ytemplate[i + 8][BYM1] = 0.f;
2538  for (j = 0; j < BYM1; ++j) {
2539  ytemplate[i + 8][j] = ytemp_[i][j + 1];
2540  }
2541  }
2542  for (i = 1; i < 9; ++i) {
2543  ytemplate[i + 24][0] = 0.f;
2544  for (j = 0; j < BYM1; ++j) {
2545  ytemplate[i + 24][j + 1] = ytemp_[i][j];
2546  }
2547  }
2548 
2549  // Add more bins if needed
2550 
2551  if (fybin < 8) {
2552  for (i = 0; i < 8; ++i) {
2553  ytemplate[i][BYM2] = 0.f;
2554  ytemplate[i][BYM1] = 0.f;
2555  for (j = 0; j < BYM2; ++j) {
2556  ytemplate[i][j] = ytemp_[i][j + 2];
2557  }
2558  }
2559  }
2560  if (lybin > 32) {
2561  for (i = 1; i < 9; ++i) {
2562  ytemplate[i + 32][0] = 0.f;
2563  ytemplate[i + 32][1] = 0.f;
2564  for (j = 0; j < BYM2; ++j) {
2565  ytemplate[i + 32][j + 2] = ytemp_[i][j];
2566  }
2567  }
2568  }
2569 
2570  return;
2571 
2572 } // End ytemp

References cms::cuda::assert(), BYM1, BYM2, BYSIZE, Exception, mps_fire::i, and dqmiolumiharvest::j.

Referenced by SiPixelTemplateReco::PixelTempReco1D(), PixelTemplateSmearerBase::smearHit(), and PixelTemplateSmearerBase::smearMergeGroup().

◆ ytemp3d()

void SiPixelTemplate::ytemp3d ( int  i,
int  j,
std::vector< float > &  ytemplate 
)

Return interpolated 3d y-template in single call

Parameters
i,j- (input) template indices
ytemplate- (output) a boost 3d array containing two sets of temlate indices and the combined pixel signals

Definition at line 2835 of file SiPixelTemplate.cc.

2837 {
2838  // Sum two 2-d templates to make the 3-d template
2839  if (i >= 0 && i < nybins_ && j <= i) {
2840  for (int k = 0; k < BYSIZE; ++k) {
2841  ytemplate[k] = temp2dy_[i][k] + temp2dy_[j][k];
2842  }
2843  } else {
2844  for (int k = 0; k < BYSIZE; ++k) {
2845  ytemplate[k] = 0.;
2846  }
2847  }
2848 
2849  return;
2850 
2851 } // End ytemp3d

References BYSIZE, mps_fire::i, dqmiolumiharvest::j, and dqmdumpme::k.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ ytemp3d_int()

void SiPixelTemplate::ytemp3d_int ( int  nypix,
int &  nybins 
)

Make interpolated 3d y-template (stored as class variables)

Parameters
nypix- (input) number of pixels in cluster (needed to size template)
nybins- (output) number of bins needed for each template projection

Definition at line 2757 of file SiPixelTemplate.cc.

2759 {
2760  // Retrieve already interpolated quantities
2761 
2762  // Local variables
2763  int i, j, k;
2764  int ioff0, ioffp, ioffm;
2765 
2766  // Verify that input parameters are in valid range
2767 
2768 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
2769  if (nypix < 1 || nypix >= BYM3) {
2770  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::ytemp3d called with nypix = " << nypix << std::endl;
2771  }
2772 #else
2773  assert(nypix > 0 && nypix < BYM3);
2774 #endif
2775 
2776  // Calculate the size of the shift in pixels needed to span the entire cluster
2777 
2778  float diff = fabsf(nypix - clsleny_) / 2. + 1.f;
2779  int nshift = (int)diff;
2780  if ((diff - nshift) > 0.5f) {
2781  ++nshift;
2782  }
2783 
2784  // Calculate the number of bins needed to specify each hit range
2785 
2786  nybins_ = 9 + 16 * nshift;
2787 
2788  // Create a 2-d working template with the correct size
2789 
2790  temp2dy_.resize(boost::extents[nybins_][BYSIZE]);
2791 
2792  // The 9 central bins are copied from the interpolated private store
2793 
2794  ioff0 = 8 * nshift;
2795 
2796  for (i = 0; i < 9; ++i) {
2797  for (j = 0; j < BYSIZE; ++j) {
2798  temp2dy_[i + ioff0][j] = ytemp_[i][j];
2799  }
2800  }
2801 
2802  // Add the +- shifted templates
2803 
2804  for (k = 1; k <= nshift; ++k) {
2805  ioffm = ioff0 - k * 8;
2806  for (i = 0; i < 8; ++i) {
2807  for (j = 0; j < k; ++j) {
2808  temp2dy_[i + ioffm][BYM1 - j] = 0.f;
2809  }
2810  for (j = 0; j < BYSIZE - k; ++j) {
2811  temp2dy_[i + ioffm][j] = ytemp_[i][j + k];
2812  }
2813  }
2814  ioffp = ioff0 + k * 8;
2815  for (i = 1; i < 9; ++i) {
2816  for (j = 0; j < k; ++j) {
2817  temp2dy_[i + ioffp][j] = 0.f;
2818  }
2819  for (j = 0; j < BYSIZE - k; ++j) {
2820  temp2dy_[i + ioffp][j + k] = ytemp_[i][j];
2821  }
2822  }
2823  }
2824 
2825  nybins = nybins_;
2826  return;
2827 
2828 } // End ytemp3d_int

References cms::cuda::assert(), BYM1, BYM3, BYSIZE, change_name::diff, Exception, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, and dqmdumpme::k.

Referenced by SiPixelTemplateSplit::PixelTempSplit().

◆ yxratio()

float SiPixelTemplate::yxratio ( )
inline

fractional distance in y between cotalpha templates slices

Definition at line 449 of file SiPixelTemplate.h.

References yxratio_.

Referenced by qbin_dist(), and temperrors().

◆ zsize()

float SiPixelTemplate::zsize ( )
inline

pixel z-size or thickness (microns)

Definition at line 686 of file SiPixelTemplate.h.

References zsize_.

Member Data Documentation

◆ abs_cotb_

float SiPixelTemplate::abs_cotb_
private

absolute value of cot beta

Definition at line 702 of file SiPixelTemplate.h.

◆ chi2xavg_

float SiPixelTemplate::chi2xavg_[4]
private

average x chi^2 in 4 charge bins

Definition at line 767 of file SiPixelTemplate.h.

Referenced by chi2xavg().

◆ chi2xavgc2m_

float SiPixelTemplate::chi2xavgc2m_[4]
private

1st pass chi2 min search: average x-chisq for merged clusters

Definition at line 775 of file SiPixelTemplate.h.

Referenced by chi2xavgc2m().

◆ chi2xavgone_

float SiPixelTemplate::chi2xavgone_
private

average x chi^2 for 1 pixel clusters

Definition at line 779 of file SiPixelTemplate.h.

Referenced by chi2xavgone().

◆ chi2xmin_

float SiPixelTemplate::chi2xmin_[4]
private

minimum of x chi^2 in 4 charge bins

Definition at line 768 of file SiPixelTemplate.h.

Referenced by chi2xmin().

◆ chi2xminc2m_

float SiPixelTemplate::chi2xminc2m_[4]
private

1st pass chi2 min search: minimum x-chisq for merged clusters

Definition at line 776 of file SiPixelTemplate.h.

Referenced by chi2xminc2m().

◆ chi2xminone_

float SiPixelTemplate::chi2xminone_
private

minimum of x chi^2 for 1 pixel clusters

Definition at line 780 of file SiPixelTemplate.h.

Referenced by chi2xminone().

◆ chi2yavg_

float SiPixelTemplate::chi2yavg_[4]
private

average y chi^2 in 4 charge bins

Definition at line 765 of file SiPixelTemplate.h.

Referenced by chi2yavg().

◆ chi2yavgc2m_

float SiPixelTemplate::chi2yavgc2m_[4]
private

1st pass chi2 min search: average y-chisq for merged clusters

Definition at line 771 of file SiPixelTemplate.h.

Referenced by chi2yavgc2m().

◆ chi2yavgone_

float SiPixelTemplate::chi2yavgone_
private

average y chi^2 for 1 pixel clusters

Definition at line 777 of file SiPixelTemplate.h.

Referenced by chi2yavgone().

◆ chi2ymin_

float SiPixelTemplate::chi2ymin_[4]
private

minimum of y chi^2 in 4 charge bins

Definition at line 766 of file SiPixelTemplate.h.

Referenced by chi2ymin().

◆ chi2yminc2m_

float SiPixelTemplate::chi2yminc2m_[4]
private

1st pass chi2 min search: minimum y-chisq for merged clusters

Definition at line 772 of file SiPixelTemplate.h.

Referenced by chi2yminc2m().

◆ chi2yminone_

float SiPixelTemplate::chi2yminone_
private

minimum of y chi^2 for 1 pixel clusters

Definition at line 778 of file SiPixelTemplate.h.

Referenced by chi2yminone().

◆ clslenx_

float SiPixelTemplate::clslenx_
private

x-cluster length of smaller interpolated template in pixels

Definition at line 729 of file SiPixelTemplate.h.

Referenced by clslenx().

◆ clsleny_

float SiPixelTemplate::clsleny_
private

y-cluster length of smaller interpolated template in pixels

Definition at line 728 of file SiPixelTemplate.h.

Referenced by clsleny().

◆ cota_current_

float SiPixelTemplate::cota_current_
private

current cot alpha

Definition at line 700 of file SiPixelTemplate.h.

Referenced by simpletemplate2D(), SiPixelTemplate(), vavilov2_pars(), and vavilov_pars().

◆ cotb_current_

float SiPixelTemplate::cotb_current_
private

current cot beta

Definition at line 701 of file SiPixelTemplate.h.

Referenced by simpletemplate2D(), SiPixelTemplate(), vavilov2_pars(), and vavilov_pars().

◆ delyavg_

float SiPixelTemplate::delyavg_
private

average difference between clsleny_ and cluster length [with threshold effects]

Definition at line 732 of file SiPixelTemplate.h.

◆ delysig_

float SiPixelTemplate::delysig_
private

rms of difference between clsleny_ and cluster length [with threshold effects]

Definition at line 733 of file SiPixelTemplate.h.

◆ dtype_

int SiPixelTemplate::dtype_
private

flags BPix (=0) or FPix (=1)

Definition at line 703 of file SiPixelTemplate.h.

◆ dxone_

float SiPixelTemplate::dxone_
private

mean offset/correction for one pixel x-clusters

Definition at line 723 of file SiPixelTemplate.h.

Referenced by dxone().

◆ dxtwo_

float SiPixelTemplate::dxtwo_
private

mean offset/correction for one double-pixel x-clusters

Definition at line 725 of file SiPixelTemplate.h.

Referenced by dxtwo().

◆ dyone_

float SiPixelTemplate::dyone_
private

mean offset/correction for one pixel y-clusters

Definition at line 717 of file SiPixelTemplate.h.

Referenced by dyone().

◆ dytwo_

float SiPixelTemplate::dytwo_
private

mean offset/correction for one double-pixel y-clusters

Definition at line 719 of file SiPixelTemplate.h.

Referenced by dytwo().

◆ entry_sideloaded_

const SiPixelTemplateEntry* SiPixelTemplate::entry_sideloaded_
private

Definition at line 818 of file SiPixelTemplate.h.

Referenced by SiPixelTemplate().

◆ entx00_

const SiPixelTemplateEntry* SiPixelTemplate::entx00_
private

Definition at line 811 of file SiPixelTemplate.h.

◆ entx02_

const SiPixelTemplateEntry* SiPixelTemplate::entx02_
private

Definition at line 812 of file SiPixelTemplate.h.

◆ entx20_

const SiPixelTemplateEntry* SiPixelTemplate::entx20_
private

Definition at line 813 of file SiPixelTemplate.h.

◆ entx21_

const SiPixelTemplateEntry* SiPixelTemplate::entx21_
private

Definition at line 815 of file SiPixelTemplate.h.

◆ entx22_

const SiPixelTemplateEntry* SiPixelTemplate::entx22_
private

Definition at line 814 of file SiPixelTemplate.h.

◆ enty0_

const SiPixelTemplateEntry* SiPixelTemplate::enty0_
private

Definition at line 808 of file SiPixelTemplate.h.

Referenced by qbin_dist(), and temperrors().

◆ enty1_

const SiPixelTemplateEntry* SiPixelTemplate::enty1_
private

Definition at line 809 of file SiPixelTemplate.h.

Referenced by qbin_dist(), and temperrors().

◆ fbin_

float SiPixelTemplate::fbin_[3]
private

The QBin definitions in Q_clus/Q_avg.

Definition at line 799 of file SiPixelTemplate.h.

Referenced by fbin().

◆ flip_x_

bool SiPixelTemplate::flip_x_
private

flip x sign-sensitive quantities

Definition at line 705 of file SiPixelTemplate.h.

◆ flip_y_

bool SiPixelTemplate::flip_y_
private

flip y sign-sensitive quantities

Definition at line 704 of file SiPixelTemplate.h.

◆ fracxone_

float SiPixelTemplate::fracxone_
private

The simulated fraction of single pixel x-clusters.

Definition at line 801 of file SiPixelTemplate.h.

Referenced by fracxone().

◆ fracxtwo_

float SiPixelTemplate::fracxtwo_
private

The simulated fraction of single double-size pixel x-clusters.

Definition at line 803 of file SiPixelTemplate.h.

Referenced by fracxtwo().

◆ fracyone_

float SiPixelTemplate::fracyone_
private

The simulated fraction of single pixel y-clusters.

Definition at line 800 of file SiPixelTemplate.h.

Referenced by fracyone().

◆ fracytwo_

float SiPixelTemplate::fracytwo_
private

The simulated fraction of single double-size pixel y-clusters.

Definition at line 802 of file SiPixelTemplate.h.

Referenced by fracytwo().

◆ id_current_

int SiPixelTemplate::id_current_
private

current id

Definition at line 698 of file SiPixelTemplate.h.

Referenced by qbin_dist(), SiPixelTemplate(), temperrors(), vavilov2_pars(), and vavilov_pars().

◆ index_id_

int SiPixelTemplate::index_id_
private

current index

Definition at line 699 of file SiPixelTemplate.h.

Referenced by SiPixelTemplate(), vavilov2_pars(), and vavilov_pars().

◆ kappavav2_

float SiPixelTemplate::kappavav2_
private

kappa parameter for 2-cluster Vavilov distribution

Definition at line 787 of file SiPixelTemplate.h.

Referenced by kappavav2(), and vavilov2_pars().

◆ kappavav_

float SiPixelTemplate::kappavav_
private

kappa parameter for Vavilov distribution

Definition at line 784 of file SiPixelTemplate.h.

Referenced by kappavav(), and vavilov_pars().

◆ lorxbias_

float SiPixelTemplate::lorxbias_
private

Lorentz x-bias.

Definition at line 791 of file SiPixelTemplate.h.

Referenced by lorxbias().

◆ lorxwidth_

float SiPixelTemplate::lorxwidth_
private

Lorentz x-width.

Definition at line 789 of file SiPixelTemplate.h.

Referenced by lorxwidth(), and simpletemplate2D().

◆ lorybias_

float SiPixelTemplate::lorybias_
private

Lorentz y-bias.

Definition at line 790 of file SiPixelTemplate.h.

Referenced by lorybias().

◆ lorywidth_

float SiPixelTemplate::lorywidth_
private

Lorentz y-width (sign corrected for fpix frame)

Definition at line 788 of file SiPixelTemplate.h.

Referenced by lorywidth(), and simpletemplate2D().

◆ mpvvav2_

float SiPixelTemplate::mpvvav2_
private

most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa)

Definition at line 785 of file SiPixelTemplate.h.

Referenced by mpvvav2(), and vavilov2_pars().

◆ mpvvav_

float SiPixelTemplate::mpvvav_
private

most probable charge in Vavilov distribution (not actually for larger kappa)

Definition at line 782 of file SiPixelTemplate.h.

Referenced by mpvvav(), and vavilov_pars().

◆ nxbins_

float SiPixelTemplate::nxbins_
private

number of bins in each dimension of the x-splitting template

Definition at line 797 of file SiPixelTemplate.h.

◆ nybins_

float SiPixelTemplate::nybins_
private

number of bins in each dimension of the y-splitting template

Definition at line 796 of file SiPixelTemplate.h.

◆ offsetx_

float SiPixelTemplate::offsetx_[4]
private

x-offset in charge bins

Definition at line 736 of file SiPixelTemplate.h.

◆ offsety_

float SiPixelTemplate::offsety_[4]
private

y-offset in charge bins

Definition at line 737 of file SiPixelTemplate.h.

◆ pixmax_

float SiPixelTemplate::pixmax_
private

maximum pixel charge

Definition at line 711 of file SiPixelTemplate.h.

Referenced by pixmax().

◆ qavg_

float SiPixelTemplate::qavg_
private

average cluster charge for this set of track angles

Definition at line 710 of file SiPixelTemplate.h.

Referenced by qavg().

◆ qavg_avg_

float SiPixelTemplate::qavg_avg_
private

average of cluster charge less than qavg

Definition at line 795 of file SiPixelTemplate.h.

Referenced by simpletemplate2D().

◆ qmin2_

float SiPixelTemplate::qmin2_
private

tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)

Definition at line 781 of file SiPixelTemplate.h.

Referenced by qmin().

◆ qmin_

float SiPixelTemplate::qmin_
private

minimum cluster charge for valid hit (keeps 99.9% of simulated hits)

Definition at line 727 of file SiPixelTemplate.h.

Referenced by qmin().

◆ qscale_

float SiPixelTemplate::qscale_
private

charge scaling factor

Definition at line 712 of file SiPixelTemplate.h.

Referenced by qscale().

◆ r_qMeas_qTrue_

float SiPixelTemplate::r_qMeas_qTrue_
private

ratio of measured to true cluster charges

Definition at line 798 of file SiPixelTemplate.h.

Referenced by r_qMeas_qTrue().

◆ s50_

float SiPixelTemplate::s50_
private

1/2 of the pixel single col threshold signal in electrons

Definition at line 713 of file SiPixelTemplate.h.

Referenced by s50().

◆ scalex_

float SiPixelTemplate::scalex_[4]
private

x-error scale factor in charge bins

Definition at line 734 of file SiPixelTemplate.h.

◆ scalexavg_

float SiPixelTemplate::scalexavg_
private

average x-error scale factor

Definition at line 730 of file SiPixelTemplate.h.

◆ scaley_

float SiPixelTemplate::scaley_[4]
private

y-error scale factor in charge bins

Definition at line 735 of file SiPixelTemplate.h.

◆ scaleyavg_

float SiPixelTemplate::scaleyavg_
private

average y-error scale factor

Definition at line 731 of file SiPixelTemplate.h.

◆ sigmavav2_

float SiPixelTemplate::sigmavav2_
private

"sigma" scale fctor for 2-cluster Vavilov distribution

Definition at line 786 of file SiPixelTemplate.h.

Referenced by sigmavav2(), and vavilov2_pars().

◆ sigmavav_

float SiPixelTemplate::sigmavav_
private

"sigma" scale fctor for Vavilov distribution

Definition at line 783 of file SiPixelTemplate.h.

Referenced by sigmavav(), and vavilov_pars().

◆ ss50_

float SiPixelTemplate::ss50_
private

1/2 of the pixel double col threshold signal in electrons

Definition at line 714 of file SiPixelTemplate.h.

Referenced by ss50().

◆ success_

bool SiPixelTemplate::success_
private

true if cotalpha, cotbeta are inside of the acceptance (dynamically loaded)

Definition at line 706 of file SiPixelTemplate.h.

◆ sxmax_

float SiPixelTemplate::sxmax_
private

average pixel signal for x-projection of cluster

Definition at line 721 of file SiPixelTemplate.h.

Referenced by sxmax().

◆ sxone_

float SiPixelTemplate::sxone_
private

rms for one pixel x-clusters

Definition at line 724 of file SiPixelTemplate.h.

Referenced by sxone().

◆ sxparmax_

float SiPixelTemplate::sxparmax_
private

maximum pixel signal for parameterization of x uncertainties

Definition at line 722 of file SiPixelTemplate.h.

◆ sxtwo_

float SiPixelTemplate::sxtwo_
private

rms for one double-pixel x-clusters

Definition at line 726 of file SiPixelTemplate.h.

Referenced by sxtwo().

◆ symax_

float SiPixelTemplate::symax_
private

average pixel signal for y-projection of cluster

Definition at line 715 of file SiPixelTemplate.h.

Referenced by symax().

◆ syone_

float SiPixelTemplate::syone_
private

rms for one pixel y-clusters

Definition at line 718 of file SiPixelTemplate.h.

Referenced by syone().

◆ syparmax_

float SiPixelTemplate::syparmax_
private

maximum pixel signal for parameterization of y uncertainties

Definition at line 716 of file SiPixelTemplate.h.

◆ sytwo_

float SiPixelTemplate::sytwo_
private

rms for one double-pixel y-clusters

Definition at line 720 of file SiPixelTemplate.h.

Referenced by sytwo().

◆ temp2dx_

boost::multi_array<float, 2> SiPixelTemplate::temp2dx_
private

2d-primitive for spltting 3-d template

Definition at line 805 of file SiPixelTemplate.h.

◆ temp2dy_

boost::multi_array<float, 2> SiPixelTemplate::temp2dy_
private

2d-primitive for spltting 3-d template

Definition at line 804 of file SiPixelTemplate.h.

◆ thePixelTemp_

const std::vector<SiPixelTemplateStore>& SiPixelTemplate::thePixelTemp_
private

Definition at line 821 of file SiPixelTemplate.h.

Referenced by qbin_dist(), temperrors(), vavilov2_pars(), and vavilov_pars().

◆ xavg_

float SiPixelTemplate::xavg_[4]
private

average x-bias of reconstruction binned in 4 charge bins

Definition at line 757 of file SiPixelTemplate.h.

Referenced by xavg().

◆ xavgc2m_

float SiPixelTemplate::xavgc2m_[4]
private

1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins

Definition at line 773 of file SiPixelTemplate.h.

Referenced by xavgc2m().

◆ xflparhh_

float SiPixelTemplate::xflparhh_[4][6]
private

Aqfl-parameterized x-correction in 4 charge bins for larger cotbeta, cotalpha.

Definition at line 764 of file SiPixelTemplate.h.

◆ xflparhl_

float SiPixelTemplate::xflparhl_[4][6]
private

Aqfl-parameterized x-correction in 4 charge bins for larger cotbeta, smaller cotalpha.

Definition at line 763 of file SiPixelTemplate.h.

◆ xflparlh_

float SiPixelTemplate::xflparlh_[4][6]
private

Aqfl-parameterized x-correction in 4 charge bins for smaller cotbeta, larger cotalpha.

Definition at line 762 of file SiPixelTemplate.h.

◆ xflparll_

float SiPixelTemplate::xflparll_[4][6]
private

Aqfl-parameterized x-correction in 4 charge bins for smaller cotbeta, cotalpha.

Definition at line 761 of file SiPixelTemplate.h.

◆ xgsig_

float SiPixelTemplate::xgsig_[4]
private

sigma from Gaussian fit binned in 4 charge bins

Definition at line 760 of file SiPixelTemplate.h.

Referenced by xgsig().

◆ xgx0_

float SiPixelTemplate::xgx0_[4]
private

average x0 from Gaussian fit binned in 4 charge bins

Definition at line 759 of file SiPixelTemplate.h.

Referenced by xgx0().

◆ xpar0_

float SiPixelTemplate::xpar0_[2][5]
private

projected x-pixel uncertainty parameterization for central cotalpha

Definition at line 747 of file SiPixelTemplate.h.

◆ xparh_

float SiPixelTemplate::xparh_[2][5]
private

projected x-pixel uncertainty parameterization for larger cotalpha

Definition at line 749 of file SiPixelTemplate.h.

◆ xparhy0_

float SiPixelTemplate::xparhy0_[2][5]
private

projected x-pixel uncertainty parameterization for larger cotbeta (central alpha)

Definition at line 743 of file SiPixelTemplate.h.

◆ xparl_

float SiPixelTemplate::xparl_[2][5]
private

projected x-pixel uncertainty parameterization for smaller cotalpha

Definition at line 748 of file SiPixelTemplate.h.

◆ xparly0_

float SiPixelTemplate::xparly0_[2][5]
private

projected x-pixel uncertainty parameterization for smaller cotbeta (central alpha)

Definition at line 742 of file SiPixelTemplate.h.

◆ xrms_

float SiPixelTemplate::xrms_[4]
private

average x-rms of reconstruction binned in 4 charge bins

Definition at line 758 of file SiPixelTemplate.h.

Referenced by xrms().

◆ xrmsc2m_

float SiPixelTemplate::xrmsc2m_[4]
private

1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins

Definition at line 774 of file SiPixelTemplate.h.

Referenced by xrmsc2m().

◆ xsize_

float SiPixelTemplate::xsize_
private

Pixel x-size.

Definition at line 792 of file SiPixelTemplate.h.

Referenced by simpletemplate2D(), and xsize().

◆ xtemp_

float SiPixelTemplate::xtemp_[9][ 13+4]
private

templates for x-reconstruction (binned over 5 central pixels)

Definition at line 750 of file SiPixelTemplate.h.

◆ xxratio_

float SiPixelTemplate::xxratio_
private

fractional distance in x between cotalpha templates

Definition at line 746 of file SiPixelTemplate.h.

Referenced by xxratio().

◆ yavg_

float SiPixelTemplate::yavg_[4]
private

average y-bias of reconstruction binned in 4 charge bins

Definition at line 751 of file SiPixelTemplate.h.

Referenced by yavg().

◆ yavgc2m_

float SiPixelTemplate::yavgc2m_[4]
private

1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins

Definition at line 769 of file SiPixelTemplate.h.

Referenced by yavgc2m().

◆ yflparh_

float SiPixelTemplate::yflparh_[4][6]
private

Aqfl-parameterized y-correction in 4 charge bins for larger cotbeta.

Definition at line 756 of file SiPixelTemplate.h.

◆ yflparl_

float SiPixelTemplate::yflparl_[4][6]
private

Aqfl-parameterized y-correction in 4 charge bins for smaller cotbeta.

Definition at line 755 of file SiPixelTemplate.h.

◆ ygsig_

float SiPixelTemplate::ygsig_[4]
private

average sigma_y from Gaussian fit binned in 4 charge bins

Definition at line 754 of file SiPixelTemplate.h.

Referenced by ygsig().

◆ ygx0_

float SiPixelTemplate::ygx0_[4]
private

average y0 from Gaussian fit binned in 4 charge bins

Definition at line 753 of file SiPixelTemplate.h.

Referenced by ygx0().

◆ yparh_

float SiPixelTemplate::yparh_[2][5]
private

projected y-pixel uncertainty parameterization for larger cotbeta

Definition at line 741 of file SiPixelTemplate.h.

◆ yparl_

float SiPixelTemplate::yparl_[2][5]
private

projected y-pixel uncertainty parameterization for smaller cotbeta

Definition at line 740 of file SiPixelTemplate.h.

◆ yratio_

float SiPixelTemplate::yratio_
private

fractional distance in y between cotbeta templates

Definition at line 739 of file SiPixelTemplate.h.

Referenced by qbin_dist(), temperrors(), and yratio().

◆ yrms_

float SiPixelTemplate::yrms_[4]
private

average y-rms of reconstruction binned in 4 charge bins

Definition at line 752 of file SiPixelTemplate.h.

Referenced by yrms().

◆ yrmsc2m_

float SiPixelTemplate::yrmsc2m_[4]
private

1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins

Definition at line 770 of file SiPixelTemplate.h.

Referenced by yrmsc2m().

◆ ysize_

float SiPixelTemplate::ysize_
private

Pixel y-size.

Definition at line 793 of file SiPixelTemplate.h.

Referenced by simpletemplate2D(), and ysize().

◆ ytemp_

float SiPixelTemplate::ytemp_[9][ 21+4]
private

templates for y-reconstruction (binned over 5 central pixels)

Definition at line 744 of file SiPixelTemplate.h.

◆ yxratio_

float SiPixelTemplate::yxratio_
private

fractional distance in y between x-slices of cotalpha templates

Definition at line 745 of file SiPixelTemplate.h.

Referenced by yxratio().

◆ zsize_

float SiPixelTemplate::zsize_
private

Pixel z-size (thickness)

Definition at line 794 of file SiPixelTemplate.h.

Referenced by simpletemplate2D(), and zsize().

SiPixelTemplateEntry::sigmavav2
float sigmavav2
"sigma" scale fctor for Vavilov distribution for 2 merged clusters
Definition: SiPixelTemplate.h:136
SiPixelTemplate::xflparll_
float xflparll_[4][6]
Aqfl-parameterized x-correction in 4 charge bins for smaller cotbeta, cotalpha.
Definition: SiPixelTemplate.h:761
SiPixelTemplate::xparl_
float xparl_[2][5]
projected x-pixel uncertainty parameterization for smaller cotalpha
Definition: SiPixelTemplate.h:748
SiPixelTemplate::postInit
static void postInit(std::vector< SiPixelTemplateStore > &thePixelTemp_)
Definition: SiPixelTemplate.cc:1287
SiPixelTemplateEntry::fracytwo
float fracytwo
fraction of double pixel sample with ysize = 1
Definition: SiPixelTemplate.h:175
SiPixelTemplateEntry::qavg_avg
float qavg_avg
average cluster charge of clusters that are less than qavg (normalize 2-D simple templates)
Definition: SiPixelTemplate.h:177
SiPixelTemplate::sxmax
float sxmax()
average pixel signal for x-projection of cluster
Definition: SiPixelTemplate.h:426
SiPixelTemplateEntry::yavggen
float yavggen[4]
generic algorithm: average y-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:125
SiPixelTemplateHeader::fbin
float fbin[3]
The QBin definitions in Q_clus/Q_avg.
Definition: SiPixelTemplate.h:201
change_name.diff
diff
Definition: change_name.py:13
SiPixelTemplate::xsize_
float xsize_
Pixel x-size.
Definition: SiPixelTemplate.h:792
SiPixelTemplate::temp2dy_
boost::multi_array< float, 2 > temp2dy_
2d-primitive for spltting 3-d template
Definition: SiPixelTemplate.h:804
BXM3
#define BXM3
Definition: SiPixelTemplateDefs.h:37
SiPixelTemplateEntry::xavggen
float xavggen[4]
generic algorithm: average x-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:127
SiPixelTemplate::yrmsc2m_
float yrmsc2m_[4]
1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:770
SiPixelTemplate::fracytwo_
float fracytwo_
The simulated fraction of single double-size pixel y-clusters.
Definition: SiPixelTemplate.h:802
SiPixelTemplateEntry::chi2yminc2m
float chi2yminc2m[4]
1st pass chi2 min search: minimum of y chi^2 in 4 charge bins (merged clusters)
Definition: SiPixelTemplate.h:163
SiPixelTemplate::qavg_
float qavg_
average cluster charge for this set of track angles
Definition: SiPixelTemplate.h:710
SiPixelTemplate::syone_
float syone_
rms for one pixel y-clusters
Definition: SiPixelTemplate.h:718
SiPixelTemplateHeader::Vbias
float Vbias
detector bias potential in Volts
Definition: SiPixelTemplate.h:193
SiPixelTemplate::dytwo_
float dytwo_
mean offset/correction for one double-pixel y-clusters
Definition: SiPixelTemplate.h:719
SiPixelTemplate::dxtwo
float dxtwo()
mean offset/correction for one double-pixel x-clusters
Definition: SiPixelTemplate.h:429
SiPixelTemplateEntry::syone
float syone
rms for one pixel y-clusters
Definition: SiPixelTemplate.h:115
SiPixelTemplate::xrmsc2m_
float xrmsc2m_[4]
1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:774
SiPixelTemplateDBObject::reader
Reader reader() const
Definition: SiPixelTemplateDBObject.h:58
mps_fire.i
i
Definition: mps_fire.py:355
SiPixelTemplateHeader::lorxbias
float lorxbias
estimate of x-lorentz bias
Definition: SiPixelTemplate.h:192
SiPixelTemplate::entx02_
const SiPixelTemplateEntry * entx02_
Definition: SiPixelTemplate.h:812
SiPixelTemplate::qavg
float qavg()
average cluster charge for this set of track angles
Definition: SiPixelTemplate.h:416
BYSIZE
#define BYSIZE
Definition: SiPixelTemplateDefs.h:25
SiPixelTemplate::sxone
float sxone()
rms for one pixel x-clusters
Definition: SiPixelTemplate.h:428
SiPixelTemplate::xflparhl_
float xflparhl_[4][6]
Aqfl-parameterized x-correction in 4 charge bins for larger cotbeta, smaller cotalpha.
Definition: SiPixelTemplate.h:763
SiPixelTemplate::fracyone_
float fracyone_
The simulated fraction of single pixel y-clusters.
Definition: SiPixelTemplate.h:800
SimplePixel::btype
int btype
type of boundary (0=end, 1 = x-boundary, 2 = y-boundary)
Definition: SimplePixel.h:29
SiPixelTemplate::symax_
float symax_
average pixel signal for y-projection of cluster
Definition: SiPixelTemplate.h:715
SiPixelTemplateHeader::NTyx
int NTyx
number of Template y-slices of x entries
Definition: SiPixelTemplate.h:185
SiPixelTemplate::lorxbias_
float lorxbias_
Lorentz x-bias.
Definition: SiPixelTemplate.h:791
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
SiPixelTemplate::chi2xminc2m
float chi2xminc2m(int i)
1st pass chi2 min search: minimum x-chisq for merged clusters
Definition: SiPixelTemplate.h:644
BXSIZE
#define BXSIZE
Definition: SiPixelTemplateDefs.h:33
SiPixelTemplate::sxparmax_
float sxparmax_
maximum pixel signal for parameterization of x uncertainties
Definition: SiPixelTemplate.h:722
SiPixelTemplate::dxone_
float dxone_
mean offset/correction for one pixel x-clusters
Definition: SiPixelTemplate.h:723
SiPixelTemplate::entx20_
const SiPixelTemplateEntry * entx20_
Definition: SiPixelTemplate.h:813
SiPixelTemplateEntry::yrms
float yrms[4]
average y-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:143
SiPixelTemplate::lorxwidth_
float lorxwidth_
Lorentz x-width.
Definition: SiPixelTemplate.h:789
SiPixelTemplate::yavg_
float yavg_[4]
average y-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:751
SiPixelTemplateEntry::qmin
float qmin
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
Definition: SiPixelTemplate.h:123
SiPixelTemplateHeader::templ_version
int templ_version
Version number of the template to ensure code compatibility.
Definition: SiPixelTemplate.h:199
SiPixelTemplateEntry::yflpar
float yflpar[4][6]
Aqfl-parameterized y-correction in 4 charge bins.
Definition: SiPixelTemplate.h:146
SiPixelTemplateEntry::kappavav
float kappavav
kappa parameter for Vavilov distribution
Definition: SiPixelTemplate.h:134
SiPixelTemplateEntry::chi2xminone
float chi2xminone
minimum of x chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:159
SiPixelTemplate::syparmax_
float syparmax_
maximum pixel signal for parameterization of y uncertainties
Definition: SiPixelTemplate.h:716
SiPixelTemplate::mpvvav2
float mpvvav2()
most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa)
Definition: SiPixelTemplate.h:679
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hybridSuperClusters_cfi.xi
xi
Definition: hybridSuperClusters_cfi.py:10
SiPixelTemplate::cotb_current_
float cotb_current_
current cot beta
Definition: SiPixelTemplate.h:701
SiPixelTemplate::chi2yavgone_
float chi2yavgone_
average y chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:777
SiPixelTemplateHeader::ysize
float ysize
pixel size (for future use in upgraded geometry)
Definition: SiPixelTemplate.h:203
SiPixelTemplateDBObject::char2float
Definition: SiPixelTemplateDBObject.h:111
SiPixelTemplateHeader::temperature
float temperature
detector temperature in deg K
Definition: SiPixelTemplate.h:194
SiPixelTemplateEntry::sxmax
float sxmax
average pixel signal for x-projection of cluster
Definition: SiPixelTemplate.h:116
SiPixelTemplate::flip_y_
bool flip_y_
flip y sign-sensitive quantities
Definition: SiPixelTemplate.h:704
SiPixelTemplateEntry::ygx0
float ygx0[4]
average y0 from Gaussian fit binned in 4 charge bins
Definition: SiPixelTemplate.h:144
SiPixelTemplateEntry::chi2yavgc2m
float chi2yavgc2m[4]
1st pass chi2 min search: average y chi^2 in 4 charge bins (merged clusters)
Definition: SiPixelTemplate.h:162
SiPixelTemplate::sxtwo_
float sxtwo_
rms for one double-pixel x-clusters
Definition: SiPixelTemplate.h:726
SiPixelTemplateHeader::fluence
float fluence
radiation fluence in n_eq/cm^2
Definition: SiPixelTemplate.h:195
cms::cuda::assert
assert(be >=bs)
SiPixelTemplateEntry::chi2xminc2m
float chi2xminc2m[4]
1st pass chi2 min search: minimum of x chi^2 in 4 charge bins (merged clusters)
Definition: SiPixelTemplate.h:167
SiPixelTemplate::entx22_
const SiPixelTemplateEntry * entx22_
Definition: SiPixelTemplate.h:814
SiPixelTemplate::chi2yavgc2m_
float chi2yavgc2m_[4]
1st pass chi2 min search: average y-chisq for merged clusters
Definition: SiPixelTemplate.h:771
SiPixelTemplate::xxratio
float xxratio()
fractional distance in x between cotalpha templates
Definition: SiPixelTemplate.h:450
SiPixelTemplateHeader::qscale
float qscale
Charge scaling to match cmssw and pixelav.
Definition: SiPixelTemplate.h:188
SiPixelTemplateEntry::chi2yavgone
float chi2yavgone
average y chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:156
SiPixelTemplateEntry::chi2xmin
float chi2xmin[4]
minimum of x chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:155
SiPixelTemplateEntry::xrmsgen
float xrmsgen[4]
generic algorithm: average x-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:128
SiPixelTemplateEntry::dxtwo
float dxtwo
mean offset/correction for one double-pixel x-clusters
Definition: SiPixelTemplate.h:121
SiPixelTemplateEntry::clslenx
float clslenx
cluster x-length in pixels at signal height sxmax/2
Definition: SiPixelTemplate.h:131
SiPixelTemplateHeader::Bfield
float Bfield
Bfield in Tesla.
Definition: SiPixelTemplate.h:200
SiPixelTemplate::flip_x_
bool flip_x_
flip x sign-sensitive quantities
Definition: SiPixelTemplate.h:705
ENDL
#define ENDL
Definition: SiPixelTemplate.cc:112
SiPixelTemplateEntry::costrk
float costrk[3]
direction cosines of tracks used to generate this entry
Definition: SiPixelTemplate.h:110
PixelTestBeamValidation_cfi.Ny
Ny
Definition: PixelTestBeamValidation_cfi.py:8
SiPixelTemplateEntry::xrms
float xrms[4]
average x-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:148
SiPixelTemplateEntry::chi2yavg
float chi2yavg[4]
average y chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:152
SiPixelTemplate::temp2dx_
boost::multi_array< float, 2 > temp2dx_
2d-primitive for spltting 3-d template
Definition: SiPixelTemplate.h:805
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
SiPixelTemplate::sigmavav2_
float sigmavav2_
"sigma" scale fctor for 2-cluster Vavilov distribution
Definition: SiPixelTemplate.h:786
SiPixelTemplateEntry::xgx0gen
float xgx0gen[4]
generic algorithm: average x0 from Gaussian fit binned in 4 charge bins
Definition: SiPixelTemplate.h:170
SiPixelTemplateEntry::sigmavav
float sigmavav
"sigma" scale fctor for Vavilov distribution
Definition: SiPixelTemplate.h:133
SiPixelTemplate::success_
bool success_
true if cotalpha, cotbeta are inside of the acceptance (dynamically loaded)
Definition: SiPixelTemplate.h:706
SiPixelTemplate::chi2xavgc2m
float chi2xavgc2m(int i)
1st pass chi2 min search: average x-chisq for merged clusters
Definition: SiPixelTemplate.h:633
SiPixelTemplate::chi2xmin
float chi2xmin(int i)
minimum y chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:561
TXSIZE
#define TXSIZE
Definition: SiPixelTemplateDefs.h:30
SiPixelTemplate::mpvvav
float mpvvav()
most probable charge in Vavilov distribution (not actually for larger kappa)
Definition: SiPixelTemplate.h:676
any
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:34
SiPixelTemplateHeader::s50
float s50
1/2 of the multihit dcol threshold in electrons
Definition: SiPixelTemplate.h:196
SiPixelTemplate::sigmavav_
float sigmavav_
"sigma" scale fctor for Vavilov distribution
Definition: SiPixelTemplate.h:783
SiPixelTemplateEntry::xgsiggen
float xgsiggen[4]
generic algorithm: average sigma_x from Gaussian fit binned in 4 charge bins
Definition: SiPixelTemplate.h:171
dqmiodatasetharvest.db
db
Definition: dqmiodatasetharvest.py:119
BXM1
#define BXM1
Definition: SiPixelTemplateDefs.h:35
edm::FileInPath
Definition: FileInPath.h:64
SiPixelTemplateEntry::xflpar
float xflpar[4][6]
Aqfl-parameterized x-correction in 4 charge bins.
Definition: SiPixelTemplate.h:151
SiPixelTemplate::enty0_
const SiPixelTemplateEntry * enty0_
Definition: SiPixelTemplate.h:808
SiPixelTemplateStore::cotbetaX
float cotbetaX[60]
Definition: SiPixelTemplate.h:211
SiPixelTemplate::fracxone_
float fracxone_
The simulated fraction of single pixel x-clusters.
Definition: SiPixelTemplate.h:801
SiPixelTemplate::xparh_
float xparh_[2][5]
projected x-pixel uncertainty parameterization for larger cotalpha
Definition: SiPixelTemplate.h:749
SiPixelTemplateEntry::xgx0
float xgx0[4]
average x0 from Gaussian fit binned in 4 charge bins
Definition: SiPixelTemplate.h:149
SiPixelTemplate::lorybias_
float lorybias_
Lorentz y-bias.
Definition: SiPixelTemplate.h:790
SiPixelTemplateEntry::pixmax
float pixmax
maximum charge for individual pixels in cluster
Definition: SiPixelTemplate.h:112
SiPixelTemplate::dyone_
float dyone_
mean offset/correction for one pixel y-clusters
Definition: SiPixelTemplate.h:717
SiPixelTemplate::enty1_
const SiPixelTemplateEntry * enty1_
Definition: SiPixelTemplate.h:809
SiPixelTemplate::qmin2_
float qmin2_
tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)
Definition: SiPixelTemplate.h:781
SiPixelTemplate::yrms_
float yrms_[4]
average y-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:752
SiPixelTemplate::zsize_
float zsize_
Pixel z-size (thickness)
Definition: SiPixelTemplate.h:794
SiPixelTemplate::pixmax_
float pixmax_
maximum pixel charge
Definition: SiPixelTemplate.h:711
BYM2
#define BYM2
Definition: SiPixelTemplateDefs.h:28
SiPixelTemplate::chi2xavg_
float chi2xavg_[4]
average x chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:767
SimplePixel::y
float y
y coordinate of boundary intersection
Definition: SimplePixel.h:26
BYM1
#define BYM1
Definition: SiPixelTemplateDefs.h:27
SiPixelTemplateEntry::yavg
float yavg[4]
average y-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:142
SiPixelTemplate::yxratio_
float yxratio_
fractional distance in y between x-slices of cotalpha templates
Definition: SiPixelTemplate.h:745
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
SiPixelTemplateHeader::lorywidth
float lorywidth
estimate of y-lorentz width for optimal resolution
Definition: SiPixelTemplate.h:189
BXM2
#define BXM2
Definition: SiPixelTemplateDefs.h:36
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SiPixelTemplate::sigmavav2
float sigmavav2()
"sigma" scale fctor for 2-cluster Vavilov distribution
Definition: SiPixelTemplate.h:682
BHX
#define BHX
Definition: SiPixelTemplateDefs.h:34
SiPixelTemplate::xpar0_
float xpar0_[2][5]
projected x-pixel uncertainty parameterization for central cotalpha
Definition: SiPixelTemplate.h:747
SiPixelTemplateEntry::beta
float beta
beta track angle (defined in CMS CMS IN 2004/014)
Definition: SiPixelTemplate.h:108
SiPixelTemplate::chi2xminone_
float chi2xminone_
minimum of x chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:780
SiPixelTemplate::xavgc2m_
float xavgc2m_[4]
1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:773
SiPixelTemplate::entx21_
const SiPixelTemplateEntry * entx21_
Definition: SiPixelTemplate.h:815
SiPixelTemplate::chi2xmin_
float chi2xmin_[4]
minimum of x chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:768
SiPixelTemplate::ysize_
float ysize_
Pixel y-size.
Definition: SiPixelTemplate.h:793
SiPixelTemplate::chi2yminc2m_
float chi2yminc2m_[4]
1st pass chi2 min search: minimum y-chisq for merged clusters
Definition: SiPixelTemplate.h:772
SiPixelTemplateHeader::lorxwidth
float lorxwidth
estimate of x-lorentz width for optimal resolution
Definition: SiPixelTemplate.h:190
SiPixelTemplate::qavg_avg_
float qavg_avg_
average of cluster charge less than qavg
Definition: SiPixelTemplate.h:795
SiPixelTemplate::nxbins_
float nxbins_
number of bins in each dimension of the x-splitting template
Definition: SiPixelTemplate.h:797
SiPixelTemplateHeader::ss50
float ss50
1/2 of the single hit dcol threshold in electrons
Definition: SiPixelTemplate.h:197
SiPixelTemplateEntry::ytemp
float ytemp[9][21]
templates for y-reconstruction (binned over 1 central pixel)
Definition: SiPixelTemplate.h:139
SiPixelTemplate::yflparh_
float yflparh_[4][6]
Aqfl-parameterized y-correction in 4 charge bins for larger cotbeta.
Definition: SiPixelTemplate.h:756
dqmdumpme.k
k
Definition: dqmdumpme.py:60
SiPixelTemplateEntry::symax
float symax
average pixel signal for y-projection of cluster
Definition: SiPixelTemplate.h:113
SiPixelTemplateEntry::chi2xavgone
float chi2xavgone
average x chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:158
SiPixelTemplate::entx00_
const SiPixelTemplateEntry * entx00_
Definition: SiPixelTemplate.h:811
SiPixelTemplate::id_current_
int id_current_
current id
Definition: SiPixelTemplate.h:698
SiPixelTemplateEntry::yrmsgen
float yrmsgen[4]
generic algorithm: average y-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:126
SiPixelTemplateEntry::ygsiggen
float ygsiggen[4]
generic algorithm: average sigma_y from Gaussian fit binned in 4 charge bins
Definition: SiPixelTemplate.h:169
cuda_std::lower_bound
__host__ constexpr __device__ RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Definition: cudastdAlgorithm.h:27
SiPixelTemplateEntry::dytwo
float dytwo
mean offset/correction for one double-pixel y-clusters
Definition: SiPixelTemplate.h:119
SiPixelTemplateEntry::r_qMeas_qTrue
float r_qMeas_qTrue
ratio of measured to true cluster charge
Definition: SiPixelTemplate.h:178
SiPixelTemplate::chi2xavgone_
float chi2xavgone_
average x chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:779
SiPixelTemplateEntry::cotbeta
float cotbeta
cot(beta) is proportional to cluster length in y and is basis of interpolation
Definition: SiPixelTemplate.h:109
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelTemplateEntry::alpha
float alpha
alpha track angle (defined in CMS CMS IN 2004/014)
Definition: SiPixelTemplate.h:106
SiPixelTemplate::sxmax_
float sxmax_
average pixel signal for x-projection of cluster
Definition: SiPixelTemplate.h:721
SiPixelTemplate::ytemp_
float ytemp_[9][21+4]
templates for y-reconstruction (binned over 5 central pixels)
Definition: SiPixelTemplate.h:744
SiPixelTemplate::yratio_
float yratio_
fractional distance in y between cotbeta templates
Definition: SiPixelTemplate.h:739
BYM3
#define BYM3
Definition: SiPixelTemplateDefs.h:29
SiPixelTemplateEntry::xgsig
float xgsig[4]
average sigma_x from Gaussian fit binned in 4 charge bins
Definition: SiPixelTemplate.h:150
SiPixelTemplate::chi2yminone_
float chi2yminone_
minimum of y chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:778
SiPixelTemplate::xrms_
float xrms_[4]
average x-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:758
SiPixelTemplateHeader::ID
int ID
< template header structure
Definition: SiPixelTemplate.h:183
SiPixelTemplateHeader::NTxx
int NTxx
number of Template x-entries in each slice
Definition: SiPixelTemplate.h:186
SiPixelTemplate::dxone
float dxone()
mean offset/correction for one pixel x-clusters
Definition: SiPixelTemplate.h:427
SiPixelTemplate::dxtwo_
float dxtwo_
mean offset/correction for one double-pixel x-clusters
Definition: SiPixelTemplate.h:725
SimplePixel::s
float s
distance from track entry
Definition: SimplePixel.h:24
SiPixelTemplateEntry::ypar
float ypar[2][5]
projected y-pixel uncertainty parameterization
Definition: SiPixelTemplate.h:138
SiPixelTemplate::yratio
float yratio()
fractional distance in y between cotbeta templates
Definition: SiPixelTemplate.h:448
SiPixelTemplate::yparh_
float yparh_[2][5]
projected y-pixel uncertainty parameterization for larger cotbeta
Definition: SiPixelTemplate.h:741
SiPixelTemplate::chi2xavgone
float chi2xavgone()
//!< average x chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:668
SiPixelTemplate::symax
float symax()
average pixel signal for y-projection of cluster
Definition: SiPixelTemplate.h:421
SiPixelTemplate::s50_
float s50_
1/2 of the pixel single col threshold signal in electrons
Definition: SiPixelTemplate.h:713
SiPixelTemplate::xtemp_
float xtemp_[9][13+4]
templates for x-reconstruction (binned over 5 central pixels)
Definition: SiPixelTemplate.h:750
SiPixelTemplate::xxratio_
float xxratio_
fractional distance in x between cotalpha templates
Definition: SiPixelTemplate.h:746
SiPixelTemplate::chi2yavg_
float chi2yavg_[4]
average y chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:765
SiPixelTemplate::index_id_
int index_id_
current index
Definition: SiPixelTemplate.h:699
SiPixelTemplateEntry::yrmsc2m
float yrmsc2m[4]
1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:161
SiPixelTemplateEntry::dyone
float dyone
mean offset/correction for one pixel y-clusters
Definition: SiPixelTemplate.h:114
SiPixelTemplate::sigmavav
float sigmavav()
"sigma" scale fctor for Vavilov distribution
Definition: SiPixelTemplate.h:677
SiPixelTemplateEntry::sytwo
float sytwo
rms for one double-pixel y-clusters
Definition: SiPixelTemplate.h:120
SiPixelTemplateEntry::xavg
float xavg[4]
average x-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:147
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
SiPixelTemplate::mpvvav2_
float mpvvav2_
most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa)
Definition: SiPixelTemplate.h:785
SiPixelTemplateEntry::ygsig
float ygsig[4]
average sigma_y from Gaussian fit binned in 4 charge bins
Definition: SiPixelTemplate.h:145
SiPixelTemplate::mpvvav_
float mpvvav_
most probable charge in Vavilov distribution (not actually for larger kappa)
Definition: SiPixelTemplate.h:782
SimplePixel::j
int j
y index of traversed pixel
Definition: SimplePixel.h:28
SiPixelTemplateEntry::qavg
float qavg
average cluster charge for this set of track angles (now includes threshold effects)
Definition: SiPixelTemplate.h:111
SiPixelTemplate::chi2xavgc2m_
float chi2xavgc2m_[4]
1st pass chi2 min search: average x-chisq for merged clusters
Definition: SiPixelTemplate.h:775
SiPixelTemplate::fbin_
float fbin_[3]
The QBin definitions in Q_clus/Q_avg.
Definition: SiPixelTemplate.h:799
createfilelist.int
int
Definition: createfilelist.py:10
SiPixelTemplate::chi2xavg
float chi2xavg(int i)
averaage x chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:551
TYSIZE
#define TYSIZE
Definition: SiPixelTemplateDefs.h:21
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
SiPixelTemplate::clsleny_
float clsleny_
y-cluster length of smaller interpolated template in pixels
Definition: SiPixelTemplate.h:728
SiPixelTemplate::yxratio
float yxratio()
fractional distance in y between cotalpha templates slices
Definition: SiPixelTemplate.h:449
SiPixelTemplate::yavgc2m_
float yavgc2m_[4]
1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:769
SiPixelTemplateEntry::chi2xavgc2m
float chi2xavgc2m[4]
1st pass chi2 min search: average x chi^2 in 4 charge bins (merged clusters)
Definition: SiPixelTemplate.h:166
SiPixelTemplate::dtype_
int dtype_
flags BPix (=0) or FPix (=1)
Definition: SiPixelTemplate.h:703
SiPixelTemplate::clslenx_
float clslenx_
x-cluster length of smaller interpolated template in pixels
Definition: SiPixelTemplate.h:729
SiPixelTemplate::clslenx
float clslenx()
x-size of smaller interpolated template in pixels
Definition: SiPixelTemplate.h:447
SiPixelTemplateEntry::qmin2
float qmin2
tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)
Definition: SiPixelTemplate.h:124
SiPixelTemplateStore::cotalphaX
float cotalphaX[60]
60 y templates spanning cluster lengths from 0px to +18px
Definition: SiPixelTemplate.h:212
PVValHelper::dy
Definition: PVValidationHelpers.h:49
SiPixelTemplate::xparly0_
float xparly0_[2][5]
projected x-pixel uncertainty parameterization for smaller cotbeta (central alpha)
Definition: SiPixelTemplate.h:742
SiPixelTemplateEntry::spare
float spare[1]
Definition: SiPixelTemplate.h:179
SiPixelTemplateEntry::mpvvav
float mpvvav
most probable charge in Vavilov distribution (not actually for larger kappa)
Definition: SiPixelTemplate.h:132
SiPixelTemplate::yparl_
float yparl_[2][5]
projected y-pixel uncertainty parameterization for smaller cotbeta
Definition: SiPixelTemplate.h:740
SiPixelTemplate::r_qMeas_qTrue_
float r_qMeas_qTrue_
ratio of measured to true cluster charges
Definition: SiPixelTemplate.h:798
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
SiPixelTemplateEntry::fracxtwo
float fracxtwo
fraction of double pixel sample with xsize = 1
Definition: SiPixelTemplate.h:176
SiPixelTemplate::nybins_
float nybins_
number of bins in each dimension of the y-splitting template
Definition: SiPixelTemplate.h:796
cms::cuda::for
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
Definition: HistoContainer.h:27
SiPixelTemplateHeader::title
char title[80]
template title
Definition: SiPixelTemplate.h:198
SiPixelTemplate::kappavav_
float kappavav_
kappa parameter for Vavilov distribution
Definition: SiPixelTemplate.h:784
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
BHY
#define BHY
Definition: SiPixelTemplateDefs.h:26
SiPixelTemplateEntry::chi2ymin
float chi2ymin[4]
minimum of y chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:153
SiPixelTemplate::qscale
float qscale()
charge scaling factor
Definition: SiPixelTemplate.h:418
SiPixelTemplateEntry::xpar
float xpar[2][5]
projected x-pixel uncertainty parameterization
Definition: SiPixelTemplate.h:140
SiPixelTemplateHeader::Dtype
int Dtype
detector type (0=BPix, 1=FPix)
Definition: SiPixelTemplate.h:187
SiPixelTemplateEntry::chi2yminone
float chi2yminone
minimum of y chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:157
SiPixelTemplateEntry::xrmsc2m
float xrmsc2m[4]
1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:165
SiPixelTemplate::yrms
float yrms(int i)
average y-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:461
SiPixelTemplate::xavg_
float xavg_[4]
average x-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:757
SiPixelTemplate::kappavav2_
float kappavav2_
kappa parameter for 2-cluster Vavilov distribution
Definition: SiPixelTemplate.h:787
SiPixelTemplate::qmin_
float qmin_
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
Definition: SiPixelTemplate.h:727
SiPixelTemplateEntry::fracyone
float fracyone
fraction of sample with ysize = 1
Definition: SiPixelTemplate.h:173
SiPixelTemplateEntry::runnum
int runnum
< Basic template entry corresponding to a single set of track angles
Definition: SiPixelTemplate.h:105
SiPixelTemplateEntry::ygx0gen
float ygx0gen[4]
generic algorithm: average y0 from Gaussian fit binned in 4 charge bins
Definition: SiPixelTemplate.h:168
SiPixelTemplate::cota_current_
float cota_current_
current cot alpha
Definition: SiPixelTemplate.h:700
SiPixelTemplateEntry::xtemp
float xtemp[9][13]
templates for x-reconstruction (binned over 1 central pixel)
Definition: SiPixelTemplate.h:141
SiPixelTemplateHeader::lorybias
float lorybias
estimate of y-lorentz bias
Definition: SiPixelTemplate.h:191
SiPixelTemplate::sxone_
float sxone_
rms for one pixel x-clusters
Definition: SiPixelTemplate.h:724
SiPixelTemplateEntry::fracxone
float fracxone
fraction of sample with xsize = 1
Definition: SiPixelTemplate.h:174
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
SiPixelTemplate::qscale_
float qscale_
charge scaling factor
Definition: SiPixelTemplate.h:712
SiPixelTemplate::xrms
float xrms(int i)
average x-rms of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:501
SiPixelTemplate::abs_cotb_
float abs_cotb_
absolute value of cot beta
Definition: SiPixelTemplate.h:702
Exception
Definition: hltDiff.cc:246
SiPixelTemplateEntry::sxtwo
float sxtwo
rms for one double-pixel x-clusters
Definition: SiPixelTemplate.h:122
SiPixelTemplateStore::enty
SiPixelTemplateEntry enty[60]
60 Barrel x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 6...
Definition: SiPixelTemplate.h:214
SiPixelTemplateHeader::zsize
float zsize
pixel size (for future use in upgraded geometry)
Definition: SiPixelTemplate.h:204
SiPixelTemplateStore::head
SiPixelTemplateHeader head
< template storage structure
Definition: SiPixelTemplate.h:208
SiPixelTemplateEntry::qbfrac
float qbfrac[3]
fraction of sample in qbin = 0-2 (>=3 is the complement)
Definition: SiPixelTemplate.h:172
SiPixelTemplate::sxtwo
float sxtwo()
rms for one double-pixel x-clusters
Definition: SiPixelTemplate.h:430
SiPixelTemplate::xflparlh_
float xflparlh_[4][6]
Aqfl-parameterized x-correction in 4 charge bins for smaller cotbeta, larger cotalpha.
Definition: SiPixelTemplate.h:762
SiPixelTemplate::xparhy0_
float xparhy0_[2][5]
projected x-pixel uncertainty parameterization for larger cotbeta (central alpha)
Definition: SiPixelTemplate.h:743
SiPixelTemplate::sytwo_
float sytwo_
rms for one double-pixel y-clusters
Definition: SiPixelTemplate.h:720
LOGINFO
#define LOGINFO(x)
Definition: SiPixelTemplate.cc:110
SiPixelTemplate::kappavav2
float kappavav2()
kappa parameter for 2-cluster Vavilov distribution
Definition: SiPixelTemplate.h:683
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
SiPixelTemplate::xflparhh_
float xflparhh_[4][6]
Aqfl-parameterized x-correction in 4 charge bins for larger cotbeta, cotalpha.
Definition: SiPixelTemplate.h:764
SiPixelTemplate::chi2xminc2m_
float chi2xminc2m_[4]
1st pass chi2 min search: minimum x-chisq for merged clusters
Definition: SiPixelTemplate.h:776
SiPixelTemplateEntry::yavgc2m
float yavgc2m[4]
1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:160
funct::arg
A arg
Definition: Factorize.h:36
SiPixelTemplateEntry::xavgc2m
float xavgc2m[4]
1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:164
SiPixelTemplateHeader::xsize
float xsize
pixel size (for future use in upgraded geometry)
Definition: SiPixelTemplate.h:202
ApeEstimator_cff.qBin
qBin
Definition: ApeEstimator_cff.py:34
list
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
SiPixelTemplateEntry::chi2xavg
float chi2xavg[4]
average x chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:154
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
kappa
static const G4double kappa
Definition: UrbanMscModel93.cc:35
SiPixelTemplate::kappavav
float kappavav()
kappa parameter for Vavilov distribution
Definition: SiPixelTemplate.h:678
SiPixelTemplateHeader::NTy
int NTy
number of Template y entries
Definition: SiPixelTemplate.h:184
SiPixelTemplate::fracxtwo_
float fracxtwo_
The simulated fraction of single double-size pixel x-clusters.
Definition: SiPixelTemplate.h:803
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiPixelTemplate::yflparl_
float yflparl_[4][6]
Aqfl-parameterized y-correction in 4 charge bins for smaller cotbeta.
Definition: SiPixelTemplate.h:755
SiPixelTemplate::lorywidth_
float lorywidth_
Lorentz y-width (sign corrected for fpix frame)
Definition: SiPixelTemplate.h:788
SiPixelTemplateStore
Definition: SiPixelTemplate.h:207
SiPixelTemplateEntry::dxone
float dxone
mean offset/correction for one pixel x-clusters
Definition: SiPixelTemplate.h:117
SimplePixel::x
float x
x coordinate of boundary intersection
Definition: SimplePixel.h:25
SiPixelTemplateEntry::clsleny
float clsleny
cluster y-length in pixels at signal height symax/2
Definition: SiPixelTemplate.h:130
SiPixelTemplate::chi2xminone
float chi2xminone()
//!< minimum of x chi^2 for 1 pixel clusters
Definition: SiPixelTemplate.h:669
LOGERROR
#define LOGERROR(x)
Definition: SiPixelTemplate.cc:109
SimplePixel
Definition: SimplePixel.h:8
SiPixelTemplate::chi2ymin_
float chi2ymin_[4]
minimum of y chi^2 in 4 charge bins
Definition: SiPixelTemplate.h:766
PVValHelper::dx
Definition: PVValidationHelpers.h:48
SiPixelTemplate::entry_sideloaded_
const SiPixelTemplateEntry * entry_sideloaded_
Definition: SiPixelTemplate.h:818
SiPixelTemplate::thePixelTemp_
const std::vector< SiPixelTemplateStore > & thePixelTemp_
Definition: SiPixelTemplate.h:821
SimplePixel::i
int i
x index of traversed pixel
Definition: SimplePixel.h:27
SiPixelTemplateEntry::kappavav2
float kappavav2
kappa parameter for Vavilov distribution for 2 merged clusters
Definition: SiPixelTemplate.h:137
SiPixelTemplateStore::cotbetaY
float cotbetaY[60]
Definition: SiPixelTemplate.h:210
SiPixelTemplate::interpolate
bool interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx)
Definition: SiPixelTemplate.cc:1327
SiPixelTemplate::yavg
float yavg(int i)
average y-bias of reconstruction binned in 4 charge bins
Definition: SiPixelTemplate.h:451
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
SiPixelTemplate::qmin
float qmin()
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
Definition: SiPixelTemplate.h:431
SiPixelTemplateEntry::mpvvav2
float mpvvav2
most probable charge in Vavilov distribution for 2 merged clusters (not actually for larger kappa)
Definition: SiPixelTemplate.h:135
SiPixelTemplateEntry::sxone
float sxone
rms for one pixel x-clusters
Definition: SiPixelTemplate.h:118
SiPixelTemplateEntry::cotalpha
float cotalpha
cot(alpha) is proportional to cluster length in x and is basis of interpolation
Definition: SiPixelTemplate.h:107
SiPixelTemplate::qbin
int qbin(int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, float &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)
Definition: SiPixelTemplate.cc:2984
SiPixelTemplateStore::entx
SiPixelTemplateEntry entx[60][60]
Definition: SiPixelTemplate.h:216