CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiStripTemplate Class Reference

#include <SiStripTemplate.h>

List of all members.

Public Member Functions

float chi2xavg (int i)
 averaage x chi^2 in 4 charge bins
float chi2xavgc2m (int i)
 1st pass chi2 min search: average x-chisq for merged clusters
float chi2xavgone ()
 //!< average x chi^2 for 1 strip clusters
float chi2xmin (int i)
 minimum y chi^2 in 4 charge bins
float chi2xminc2m (int i)
 1st pass chi2 min search: minimum x-chisq for merged clusters
float chi2xminone ()
 //!< minimum of x chi^2 for 1 strip clusters
float clslenx ()
 x-size of smaller interpolated template in strips
int cxtemp ()
 Return central pixel of x-template pixels above readout threshold.
float dxone ()
 mean offset/correction for one strip x-clusters
bool interpolate (int id, float cotalpha, float cotbeta)
bool interpolate (int id, float cotalpha, float cotbeta, float locBy)
float kappavav ()
 kappa parameter for Vavilov distribution
float lorxwidth ()
 signed lorentz x-width (microns)
float mpvvav ()
 most probable charge in Vavilov distribution (not actually for larger kappa)
bool pushfile (int filenum)
bool pushfile (const SiPixelTemplateDBObject &dbobject)
float qavg ()
 average cluster charge for this set of track angles
int qbin (int id, float cotalpha, float cotbeta, float qclus)
float qmin ()
 minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float qmin (int i)
 minimum cluster charge for valid hit (keeps 99.9% or 99.8% of simulated hits)
float qscale ()
 charge scaling factor
float s50 ()
 1/2 of the strip threshold signal in electrons
float sigmavav ()
 "sigma" scale fctor for Vavilov distribution
 SiStripTemplate ()
 Default constructor.
float sxmax ()
 average strip signal for x-projection of cluster
float sxone ()
 rms for one strip x-clusters
void sxtemp (float xhit, std::vector< float > &cluster)
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
float xavgbcn (int i)
 1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins
float xavgc2m (int i)
 1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins
float xflcorr (int binq, float qflx)
float xgsig (int i)
 average sigma_x from Gaussian fit binned in 4 charge bins
float xgsigbcn (int i)
 1st pass chi2 min search: average sigma_x from Gaussian fit binned in 4 charge bins
float xgsigc2m (int i)
 1st pass chi2 min search: average sigma_x from Gaussian fit binned in 4 charge bins
float xgx0 (int i)
 average x0 from Gaussian fit binned in 4 charge bins
float xgx0bcn (int i)
 1st pass chi2 min search: average x0 from Gaussian fit binned in 4 charge bins
float xgx0c2m (int i)
 1st pass chi2 min search: average x0 from Gaussian fit binned in 4 charge bins
float xrms (int i)
 average x-rms of reconstruction binned in 4 charge bins
float xrmsbcn (int i)
 1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins
float xrmsc2m (int i)
 1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins
void xsigma2 (int fxstrp, int lxstrp, float sxthr, float xsum[BSXSIZE], float xsig2[BSXSIZE])
float xsize ()
 strip x-size (microns)
void xtemp (int fxbin, int lxbin, float xtemplate[41][BSXSIZE])
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
float yratio ()
 fractional distance in y between cotbeta templates
float ysize ()
 strip y-size (microns)
float yxratio ()
 fractional distance in y between cotalpha templates slices
float zsize ()
 strip z-size or thickness (microns)

Private Attributes

float abs_cotb_
 absolute value of cot beta
float chi2xavg_ [4]
 average x chi^2 in 4 charge bins
float chi2xavgc2m_ [4]
 1st pass chi2 min search: average x-chisq for merged clusters
float chi2xavgone_
 average x chi^2 for 1 strip clusters
float chi2xmin_ [4]
 minimum of x chi^2 in 4 charge bins
float chi2xminc2m_ [4]
 1st pass chi2 min search: minimum x-chisq for merged clusters
float chi2xminone_
 minimum of x chi^2 for 1 strip clusters
float clslenx_
 x-cluster length of smaller interpolated template in strips
float cota_current_
 current cot alpha
float cotb_current_
 current cot beta
float dxone_
 mean offset/correction for one strip x-clusters
float dxtwo_
 mean offset/correction for one double-strip x-clusters
int id_current_
 current id
int index_id_
 current index
float kappavav2_
 kappa parameter for 2-cluster Vavilov distribution
float kappavav_
 kappa parameter for Vavilov distribution
float lorxwidth_
 Lorentz x-width.
float mpvvav2_
 most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa)
float mpvvav_
 most probable charge in Vavilov distribution (not actually for larger kappa)
float nxbins_
 number of bins in each dimension of the x-splitting template
float pixmax_
 maximum strip charge
float qavg_
 average cluster charge for this set of track angles
float qavg_avg_
 average of cluster charge less than qavg
float qmin2_
 tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)
float qmin_
 minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float qscale_
 charge scaling factor
float s50_
 1/2 of the strip threshold signal in adc units
float sigmavav2_
 "sigma" scale fctor for 2-cluster Vavilov distribution
float sigmavav_
 "sigma" scale fctor for Vavilov distribution
bool success_
 true if cotalpha, cotbeta are inside of the acceptance (dynamically loaded)
float sxmax_
 average strip signal for x-projection of cluster
float sxone_
 rms for one strip x-clusters
float sxparmax_
 maximum strip signal for parameterization of x uncertainties
float sxtwo_
 rms for one double-strip x-clusters
float syparmax_
 maximum strip signal for parameterization of y-slice x uncertainties
boost::multi_array< float, 2 > temp2dx_
 2d-primitive for spltting 3-d template
std::vector< SiStripTemplateStoretheStripTemp_
float xavg_ [4]
 average x-bias of reconstruction binned in 4 charge bins
float xavgbcn_ [4]
 barycenter: average x-bias of reconstruction binned in 4 charge bins
float xavgc2m_ [4]
 1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins
float xflparhh_ [4][6]
 Aqfl-parameterized x-correction in 4 charge bins for larger cotbeta, cotalpha.
float xflparhl_ [4][6]
 Aqfl-parameterized x-correction in 4 charge bins for larger cotbeta, smaller cotalpha.
float xflparlh_ [4][6]
 Aqfl-parameterized x-correction in 4 charge bins for smaller cotbeta, larger cotalpha.
float xflparll_ [4][6]
 Aqfl-parameterized x-correction in 4 charge bins for smaller cotbeta, cotalpha.
float xgsig_ [4]
 sigma from Gaussian fit binned in 4 charge bins
float xgsigbcn_ [4]
 barycenter: average x-rms of reconstruction binned in 4 charge bins
float xgsigc2m_ [4]
 1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins
float xgx0_ [4]
 average x0 from Gaussian fit binned in 4 charge bins
float xgx0bcn_ [4]
 barycenter: average x-bias of reconstruction binned in 4 charge bins
float xgx0c2m_ [4]
 1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins
float xpar0_ [2][5]
 projected x-strip uncertainty parameterization for central cotalpha
float xparh_ [2][5]
 projected x-strip uncertainty parameterization for larger cotalpha
float xparhy0_ [2][5]
 projected x-strip uncertainty parameterization for larger cotbeta (central alpha)
float xparl_ [2][5]
 projected x-strip uncertainty parameterization for smaller cotalpha
float xparly0_ [2][5]
 projected x-strip uncertainty parameterization for smaller cotbeta (central alpha)
float xrms_ [4]
 average x-rms of reconstruction binned in 4 charge bins
float xrmsbcn_ [4]
 barycenter: average x-rms of reconstruction binned in 4 charge bins
float xrmsc2m_ [4]
 1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins
float xsize_
 Pixel x-size.
float xtemp_ [9][BSXSIZE]
 templates for x-reconstruction (binned over 5 central strips)
float xxratio_
 fractional distance in x between cotalpha templates
float yratio_
 fractional distance in y between y-slices of cotbeta templates
float ysize_
 Pixel y-size.
float yxratio_
 fractional distance in y between x-slices of cotalpha templates
float zsize_
 Pixel z-size (thickness)

Detailed Description

A template management class. SiStripTemplate contains theStripTemp (a std::vector of SiStripTemplateStore, each of which is a collection of many SiStripTemplateEntries). Each SiStripTemplateStore 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 SiStripTemplate 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 StripTempReco2D() (a global function) which get the reference for SiStripTemplate & templ and uses the current template to reconstruct the SiStripRecHit.

Definition at line 139 of file SiStripTemplate.h.


Constructor & Destructor Documentation

SiStripTemplate::SiStripTemplate ( ) [inline]

Default constructor.

Definition at line 141 of file SiStripTemplate.h.

References cota_current_, cotb_current_, id_current_, and index_id_.


Member Function Documentation

float SiStripTemplate::chi2xavg ( int  i) [inline]

averaage x chi^2 in 4 charge bins

Definition at line 232 of file SiStripTemplate.h.

References chi2xavg_, Exception, and i.

Referenced by SiStripTemplateReco::StripTempReco1D().

float SiStripTemplate::chi2xavgc2m ( int  i) [inline]

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

Definition at line 274 of file SiStripTemplate.h.

References chi2xavgc2m_, Exception, and i.

Referenced by SiStripTemplateSplit::StripTempSplit().

float SiStripTemplate::chi2xavgone ( ) [inline]

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

Definition at line 316 of file SiStripTemplate.h.

References chi2xavgone_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

float SiStripTemplate::chi2xmin ( int  i) [inline]

minimum y chi^2 in 4 charge bins

Definition at line 239 of file SiStripTemplate.h.

References chi2xmin_, Exception, and i.

Referenced by SiStripTemplateReco::StripTempReco1D().

float SiStripTemplate::chi2xminc2m ( int  i) [inline]

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

Definition at line 281 of file SiStripTemplate.h.

References chi2xminc2m_, Exception, and i.

float SiStripTemplate::chi2xminone ( ) [inline]

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

Definition at line 317 of file SiStripTemplate.h.

References chi2xminone_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

float SiStripTemplate::clslenx ( ) [inline]

x-size of smaller interpolated template in strips

Definition at line 200 of file SiStripTemplate.h.

References clslenx_.

int SiStripTemplate::cxtemp ( )

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

Definition at line 1314 of file SiStripTemplate.cc.

References BSXM1, BSXM2, BSXSIZE, and j.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

{
        // Retrieve already interpolated quantities
        
        // Local variables 
        int j;
        
        // Analyze only pixels along the central entry
        // First, find the maximum signal and then work out to the edges
        
        float sigmax = 0.f;
        int jmax = -1;
        
        for(j=0; j<BSXSIZE; ++j) {
                if(xtemp_[4][j] > sigmax) {
                        sigmax = xtemp_[4][j];
                        jmax = j;
                }       
        }
        if(sigmax < 2.*s50_ || jmax<1 || jmax>BSXM2) {return -1;}
        
        //  Now search forward and backward
        
        int jend = jmax;
        
        for(j=jmax+1; j<BSXM1; ++j) {
                if(xtemp_[4][j] < 2.*s50_) break;
           jend = j;
   }

   int jbeg = jmax;

   for(j=jmax-1; j>0; --j) {
           if(xtemp_[4][j] < 2.*s50_) break;
           jbeg = j;
   }

   return (jbeg+jend)/2;

} // End cxtemp
float SiStripTemplate::dxone ( ) [inline]

mean offset/correction for one strip x-clusters

Definition at line 190 of file SiStripTemplate.h.

References dxone_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

bool SiStripTemplate::interpolate ( int  id,
float  cotalpha,
float  cotbeta 
)
bool SiStripTemplate::interpolate ( int  id,
float  cotalpha,
float  cotbeta,
float  locBy 
)

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)
locBy- (input) the sign of the y-component of the local magnetic field (if positive, flip things)

Definition at line 641 of file SiStripTemplate.cc.

References abs, BSXM1, BSXM2, BSXM3, Exception, f, i, j, mathSSE::sqrt(), and TSXSIZE.

Referenced by TrackClusterSplitter::splitCluster(), SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

{
    // Interpolate for a new set of track angles 
    
    // Local variables 
    int i, j;
        int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx, imidy, imaxx;
        float yratio, yxratio, xxratio, sxmax, qcorrect, qxtempcor, chi2xavgone, chi2xminone, cota, cotb, cotalpha0, cotbeta0;
        bool flip_x;
//      std::vector <float> xrms(4), xgsig(4), xrmsc2m(4), xgsigc2m(4);
        std::vector <float> chi2xavg(4), chi2xmin(4), chi2xavgc2m(4), chi2xminc2m(4);


// Check to see if interpolation is valid     

if(id != id_current_ || cotalpha != cota_current_ || cotbeta != cotb_current_) {

        cota_current_ = cotalpha; cotb_current_ = cotbeta; success_ = true;
        
        if(id != id_current_) {

// Find the index corresponding to id

       index_id_ = -1;
       for(i=0; i<(int)theStripTemp_.size(); ++i) {
        
              if(id == theStripTemp_[i].head.ID) {
           
                 index_id_ = i;
                      id_current_ = id;
                                
// Copy the charge scaling factor to the private variable     
                                
                                qscale_ = theStripTemp_[index_id_].head.qscale;
                                
// Copy the pseudopixel signal size to the private variable     
                                
                                s50_ = theStripTemp_[index_id_].head.s50;
                        
// Pixel sizes to the private variables     
                                
                                xsize_ = theStripTemp_[index_id_].head.xsize;
                                ysize_ = theStripTemp_[index_id_].head.ysize;
                                zsize_ = theStripTemp_[index_id_].head.zsize;
                                
                                break;
          }
            }
     }
         
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
    if(index_id_ < 0 || index_id_ >= (int)theStripTemp_.size()) {
                throw cms::Exception("DataCorrupt") << "SiStripTemplate::interpolate can't find needed template ID = " << id << std::endl;
        }
#else
        assert(index_id_ >= 0 && index_id_ < (int)theStripTemp_.size());
#endif
         
// Interpolate the absolute value of cot(beta)     
    
        abs_cotb_ = std::abs(cotbeta);
        cotb = abs_cotb_; 
        
//      qcorrect corrects the cot(alpha)=0 cluster charge for non-zero cot(alpha)       

        cotalpha0 =  theStripTemp_[index_id_].enty[0].cotalpha;
        qcorrect=std::sqrt((1.f+cotbeta*cotbeta+cotalpha*cotalpha)/(1.f+cotbeta*cotbeta+cotalpha0*cotalpha0));  
// flip quantities when the magnetic field in in the positive y local direction  
        if(locBy > 0.f) {
                flip_x = true;
        } else {
                flip_x = false;
        }
                
        Ny = theStripTemp_[index_id_].head.NTy;
        Nyx = theStripTemp_[index_id_].head.NTyx;
        Nxx = theStripTemp_[index_id_].head.NTxx;
                
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(Ny < 2 || Nyx < 1 || Nxx < 2) {
                throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny/Nyx/Nxx = " << Ny << "/" << Nyx << "/" << Nxx << std::endl;
        }
#else
        assert(Ny > 1 && Nyx > 0 && Nxx > 1);
#endif
        imaxx = Nyx - 1;
        imidy = Nxx/2;
        
// next, loop over all y-angle entries   

        ilow = 0;
        yratio = 0.f;

        if(cotb >= theStripTemp_[index_id_].enty[Ny-1].cotbeta) {
        
                ilow = Ny-2;
                yratio = 1.f;
                success_ = false;
                
        } else {
           
                if(cotb >= theStripTemp_[index_id_].enty[0].cotbeta) {

                        for (i=0; i<Ny-1; ++i) { 
    
                        if( theStripTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < theStripTemp_[index_id_].enty[i+1].cotbeta) {
                  
                                ilow = i;
                                yratio = (cotb - theStripTemp_[index_id_].enty[i].cotbeta)/(theStripTemp_[index_id_].enty[i+1].cotbeta - theStripTemp_[index_id_].enty[i].cotbeta);
                                break;                   
                        }
                }
        } else { success_ = false; }
  }
        
        ihigh=ilow + 1;
                          
// Interpolate/store all y-related quantities (flip displacements when flip_y)

        yratio_ = yratio;
        qavg_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].qavg + yratio*theStripTemp_[index_id_].enty[ihigh].qavg;
        qavg_ *= qcorrect;
        sxmax = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].sxmax + yratio*theStripTemp_[index_id_].enty[ihigh].sxmax;
        syparmax_ = sxmax;
        qmin_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].qmin + yratio*theStripTemp_[index_id_].enty[ihigh].qmin;
        qmin_ *= qcorrect;
        qmin2_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].qmin2 + yratio*theStripTemp_[index_id_].enty[ihigh].qmin2;
        qmin2_ *= qcorrect;
        mpvvav_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].mpvvav + yratio*theStripTemp_[index_id_].enty[ihigh].mpvvav;
        mpvvav_ *= qcorrect;
        sigmavav_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].sigmavav + yratio*theStripTemp_[index_id_].enty[ihigh].sigmavav;
        kappavav_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].kappavav + yratio*theStripTemp_[index_id_].enty[ihigh].kappavav;
        mpvvav2_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].mpvvav2 + yratio*theStripTemp_[index_id_].enty[ihigh].mpvvav2;
        mpvvav2_ *= qcorrect;
        sigmavav2_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].sigmavav2 + yratio*theStripTemp_[index_id_].enty[ihigh].sigmavav2;
        kappavav2_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].kappavav2 + yratio*theStripTemp_[index_id_].enty[ihigh].kappavav2;
        qavg_avg_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].qavg_avg + yratio*theStripTemp_[index_id_].enty[ihigh].qavg_avg;
        qavg_avg_ *= qcorrect;
        for(i=0; i<2 ; ++i) {
                for(j=0; j<5 ; ++j) {
// Charge loss switches sides when cot(alpha) changes sign
                        if(flip_x) {
                                xparly0_[1-i][j] = theStripTemp_[index_id_].enty[ilow].xpar[i][j];
                                xparhy0_[1-i][j] = theStripTemp_[index_id_].enty[ihigh].xpar[i][j];
                        } else {
                                xparly0_[i][j] = theStripTemp_[index_id_].enty[ilow].xpar[i][j];
                                xparhy0_[i][j] = theStripTemp_[index_id_].enty[ihigh].xpar[i][j];
                        }
                }
        }
        for(i=0; i<4; ++i) {
                chi2xavg[i]=(1.f - yratio)*theStripTemp_[index_id_].enty[ilow].chi2xavg[i] + yratio*theStripTemp_[index_id_].enty[ihigh].chi2xavg[i];
                chi2xmin[i]=(1.f - yratio)*theStripTemp_[index_id_].enty[ilow].chi2xmin[i] + yratio*theStripTemp_[index_id_].enty[ihigh].chi2xmin[i];
                chi2xavgc2m[i]=(1.f - yratio)*theStripTemp_[index_id_].enty[ilow].chi2xavgc2m[i] + yratio*theStripTemp_[index_id_].enty[ihigh].chi2xavgc2m[i];
                chi2xminc2m[i]=(1.f - yratio)*theStripTemp_[index_id_].enty[ilow].chi2xminc2m[i] + yratio*theStripTemp_[index_id_].enty[ihigh].chi2xminc2m[i];
        }
           

        chi2xavgone=(1.f - yratio)*theStripTemp_[index_id_].enty[ilow].chi2xavgone + yratio*theStripTemp_[index_id_].enty[ihigh].chi2xavgone;
        chi2xminone=(1.f - yratio)*theStripTemp_[index_id_].enty[ilow].chi2xminone + yratio*theStripTemp_[index_id_].enty[ihigh].chi2xminone;
                //       for(i=0; i<10; ++i) {
//                  pyspare[i]=(1.f - yratio)*theStripTemp_[index_id_].enty[ilow].yspare[i] + yratio*theStripTemp_[index_id_].enty[ihigh].yspare[i];
//       }
                          
        
// next, loop over all x-angle entries, first, find relevant y-slices   
        
        iylow = 0;
        yxratio = 0.f;

        if(abs_cotb_ >= theStripTemp_[index_id_].entx[Nyx-1][0].cotbeta) {
        
                iylow = Nyx-2;
                yxratio = 1.f;
                
        } else if(abs_cotb_ >= theStripTemp_[index_id_].entx[0][0].cotbeta) {

                for (i=0; i<Nyx-1; ++i) { 
    
                        if( theStripTemp_[index_id_].entx[i][0].cotbeta <= abs_cotb_ && abs_cotb_ < theStripTemp_[index_id_].entx[i+1][0].cotbeta) {
                  
                           iylow = i;
                           yxratio = (abs_cotb_ - theStripTemp_[index_id_].entx[i][0].cotbeta)/(theStripTemp_[index_id_].entx[i+1][0].cotbeta - theStripTemp_[index_id_].entx[i][0].cotbeta);
                           break;                        
                        }
                }
        }
        
        iyhigh=iylow + 1;

        ilow = 0;
        xxratio = 0.f;
        if(flip_x) {cota = -cotalpha;} else {cota = cotalpha;}

        if(cota >= theStripTemp_[index_id_].entx[0][Nxx-1].cotalpha) {
        
                ilow = Nxx-2;
                xxratio = 1.f;
                success_ = false;
                
        } else {
           
                if(cota >= theStripTemp_[index_id_].entx[0][0].cotalpha) {

                        for (i=0; i<Nxx-1; ++i) { 
    
                           if( theStripTemp_[index_id_].entx[0][i].cotalpha <= cota && cota < theStripTemp_[index_id_].entx[0][i+1].cotalpha) {
                  
                                  ilow = i;
                                  xxratio = (cota - theStripTemp_[index_id_].entx[0][i].cotalpha)/(theStripTemp_[index_id_].entx[0][i+1].cotalpha - theStripTemp_[index_id_].entx[0][i].cotalpha);
                                  break;
                        }
                  }
                } else { success_ = false; }
        }
        
        ihigh=ilow + 1;
                          
// Interpolate/store all x-related quantities 

        yxratio_ = yxratio;
        xxratio_ = xxratio;             
                          
// sxparmax defines the maximum charge for which the parameters xpar are defined (not rescaled by cotbeta) 

        sxparmax_ = (1.f - xxratio)*theStripTemp_[index_id_].entx[imaxx][ilow].sxmax + xxratio*theStripTemp_[index_id_].entx[imaxx][ihigh].sxmax;
        sxmax_ = sxparmax_;
        if(theStripTemp_[index_id_].entx[imaxx][imidy].sxmax != 0.f) {sxmax_=sxmax_/theStripTemp_[index_id_].entx[imaxx][imidy].sxmax*sxmax;}
        dxone_ = (1.f - xxratio)*theStripTemp_[index_id_].entx[0][ilow].dxone + xxratio*theStripTemp_[index_id_].entx[0][ihigh].dxone;
        if(flip_x) {dxone_ = -dxone_;}
        sxone_ = (1.f - xxratio)*theStripTemp_[index_id_].entx[0][ilow].sxone + xxratio*theStripTemp_[index_id_].entx[0][ihigh].sxone;
        clslenx_ = fminf(theStripTemp_[index_id_].entx[0][ilow].clslenx, theStripTemp_[index_id_].entx[0][ihigh].clslenx);
        for(i=0; i<2 ; ++i) {
                for(j=0; j<5 ; ++j) {
                        if(flip_x) {
                 xpar0_[1-i][j] = theStripTemp_[index_id_].entx[imaxx][imidy].xpar[i][j];
                 xparl_[1-i][j] = theStripTemp_[index_id_].entx[imaxx][ilow].xpar[i][j];
                 xparh_[1-i][j] = theStripTemp_[index_id_].entx[imaxx][ihigh].xpar[i][j];
                        } else {
                 xpar0_[i][j] = theStripTemp_[index_id_].entx[imaxx][imidy].xpar[i][j];
                 xparl_[i][j] = theStripTemp_[index_id_].entx[imaxx][ilow].xpar[i][j];
                 xparh_[i][j] = theStripTemp_[index_id_].entx[imaxx][ihigh].xpar[i][j];
                        }
                }
        }
                          
// sxmax is the maximum allowed strip charge (used for truncation)

        sxmax_=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].sxmax + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].sxmax)
                        +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].sxmax + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].sxmax);
                          
        for(i=0; i<4; ++i) {
                xavg_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xavg[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xavg[i])
                                +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xavg[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xavg[i]);
                if(flip_x) {xavg_[i] = -xavg_[i];}
                  
                xrms_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xrms[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xrms[i])
                                +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xrms[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xrms[i]);
                  
//            xgx0_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xgx0[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xgx0[i])
//                        +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xgx0[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xgx0[i]);
                                                        
//            xgsig_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xgsig[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xgsig[i])
//                        +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xgsig[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xgsig[i]);
                                  
                xavgc2m_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xavgc2m[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xavgc2m[i])
                                +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xavgc2m[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xavgc2m[i]);
                if(flip_x) {xavgc2m_[i] = -xavgc2m_[i];}
                  
                xrmsc2m_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xrmsc2m[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xrmsc2m[i])
                                +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xrmsc2m[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xrmsc2m[i]);
                  
                xavgbcn_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xavgbcn[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xavgbcn[i])
        +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xavgbcn[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xavgbcn[i]);
                if(flip_x) {xavgbcn_[i] = -xavgbcn_[i];}
        
                xrmsbcn_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xrmsbcn[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xrmsbcn[i])
        +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xrmsbcn[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xrmsbcn[i]);
        
//            xgx0c2m_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xgx0c2m[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xgx0c2m[i])
//                        +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xgx0c2m[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xgx0c2m[i]);
                                                        
//            xgsigc2m_[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xgsigc2m[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xgsigc2m[i])
//                        +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xgsigc2m[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xgsigc2m[i]);
//
//  Try new interpolation scheme
//                                                                                                                      
//            chi2xavg_[i]=((1.f - xxratio)*theStripTemp_[index_id_].entx[imaxx][ilow].chi2xavg[i] + xxratio*theStripTemp_[index_id_].entx[imaxx][ihigh].chi2xavg[i]);
//                if(theStripTemp_[index_id_].entx[imaxx][imidy].chi2xavg[i] != 0.f) {chi2xavg_[i]=chi2xavg_[i]/theStripTemp_[index_id_].entx[imaxx][imidy].chi2xavg[i]*chi2xavg[i];}
//                                                      
//            chi2xmin_[i]=((1.f - xxratio)*theStripTemp_[index_id_].entx[imaxx][ilow].chi2xmin[i] + xxratio*theStripTemp_[index_id_].entx[imaxx][ihigh].chi2xmin[i]);
//                if(theStripTemp_[index_id_].entx[imaxx][imidy].chi2xmin[i] != 0.f) {chi2xmin_[i]=chi2xmin_[i]/theStripTemp_[index_id_].entx[imaxx][imidy].chi2xmin[i]*chi2xmin[i];}
//                
                chi2xavg_[i]=((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].chi2xavg[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].chi2xavg[i]);
                if(theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xavg[i] != 0.f) {chi2xavg_[i]=chi2xavg_[i]/theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xavg[i]*chi2xavg[i];}
                                                        
                chi2xmin_[i]=((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].chi2xmin[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].chi2xmin[i]);
                if(theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xmin[i] != 0.f) {chi2xmin_[i]=chi2xmin_[i]/theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xmin[i]*chi2xmin[i];}

                chi2xavgc2m_[i]=((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].chi2xavgc2m[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].chi2xavgc2m[i]);
                if(theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xavgc2m[i] != 0.f) {chi2xavgc2m_[i]=chi2xavgc2m_[i]/theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xavgc2m[i]*chi2xavgc2m[i];}
                
                chi2xminc2m_[i]=((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].chi2xminc2m[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].chi2xminc2m[i]);
                if(theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xminc2m[i] != 0.f) {chi2xminc2m_[i]=chi2xminc2m_[i]/theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xminc2m[i]*chi2xminc2m[i];}    
                
                for(j=0; j<6 ; ++j) {
                 xflparll_[i][j] = theStripTemp_[index_id_].entx[iylow][ilow].xflpar[i][j];
                 xflparlh_[i][j] = theStripTemp_[index_id_].entx[iylow][ihigh].xflpar[i][j];
                 xflparhl_[i][j] = theStripTemp_[index_id_].entx[iyhigh][ilow].xflpar[i][j];
                 xflparhh_[i][j] = theStripTemp_[index_id_].entx[iyhigh][ihigh].xflpar[i][j];
                        // Since Q_fl is odd under cotbeta, it flips qutomatically, change only even terms
                        
                        if(flip_x && (j == 0 || j == 2 || j == 4)) {
                 xflparll_[i][j] = -xflparll_[i][j];
                 xflparlh_[i][j] = -xflparlh_[i][j];
                 xflparhl_[i][j] = -xflparhl_[i][j];
                 xflparhh_[i][j] = -xflparhh_[i][j];
                        }
                }
        }
           
// Do the spares next

        chi2xavgone_=((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].chi2xavgone + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].chi2xavgone);
        if(theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xavgone != 0.f) {chi2xavgone_=chi2xavgone_/theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xavgone*chi2xavgone;}
                
        chi2xminone_=((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].chi2xminone + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].chi2xminone);
        if(theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xminone != 0.f) {chi2xminone_=chi2xminone_/theStripTemp_[index_id_].entx[iyhigh][imidy].chi2xminone*chi2xminone;}
                //       for(i=0; i<10; ++i) {
//            pxspare[i]=(1.f - yxratio)*((1.f - xxratio)*theStripTemp_[index_id_].entx[iylow][ilow].xspare[i] + xxratio*theStripTemp_[index_id_].entx[iylow][ihigh].xspare[i])
//                        +yxratio*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xspare[i] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xspare[i]);
//       }
                          
// Interpolate and build the x-template 
        
//      qxtempcor corrects the total charge to the actual track angles (not actually needed for the template fits, but useful for Guofan)
        
        cotbeta0 =  theStripTemp_[index_id_].entx[iyhigh][0].cotbeta;
        qxtempcor=std::sqrt((1.f+cotbeta*cotbeta+cotalpha*cotalpha)/(1.f+cotbeta0*cotbeta0+cotalpha*cotalpha));
        
        for(i=0; i<9; ++i) {
                xtemp_[i][0] = 0.f;
                xtemp_[i][1] = 0.f;
                xtemp_[i][BSXM2] = 0.f;
                xtemp_[i][BSXM1] = 0.f;
                for(j=0; j<TSXSIZE; ++j) {
//  Take next largest x-slice for the x-template (it reduces bias in the forward direction after irradiation)
//                 xtemp_[i][j+2]=(1.f - xxratio)*theStripTemp_[index_id_].entx[imaxx][ilow].xtemp[i][j] + xxratio*theStripTemp_[index_id_].entx[imaxx][ihigh].xtemp[i][j];
         if(flip_x) {
                                xtemp_[8-i][BSXM3-j]=qxtempcor*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xtemp[i][j] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xtemp[i][j]);
                        } else {
            xtemp_[i][j+2]=qxtempcor*((1.f - xxratio)*theStripTemp_[index_id_].entx[iyhigh][ilow].xtemp[i][j] + xxratio*theStripTemp_[index_id_].entx[iyhigh][ihigh].xtemp[i][j]);
                        }
                }
        }
        
        lorxwidth_ = theStripTemp_[index_id_].head.lorxwidth;
        if(locBy > 0.f) {lorxwidth_ = -lorxwidth_;}
        
  }
        
  return success_;
} // interpolate
float SiStripTemplate::kappavav ( ) [inline]

kappa parameter for Vavilov distribution

Definition at line 321 of file SiStripTemplate.h.

References kappavav_.

float SiStripTemplate::lorxwidth ( ) [inline]

signed lorentz x-width (microns)

Definition at line 318 of file SiStripTemplate.h.

References lorxwidth_.

Referenced by SiStripTemplateReco::StripTempReco1D().

float SiStripTemplate::mpvvav ( ) [inline]

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

Definition at line 319 of file SiStripTemplate.h.

References mpvvav_.

bool SiStripTemplate::pushfile ( const SiPixelTemplateDBObject dbobject)

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

Definition at line 358 of file SiStripTemplate.cc.

References SiStripTemplateEntry::alpha, SiStripTemplateEntry::beta, SiStripTemplateHeader::Bfield, SiPixelTemplateDBObject::char2float::c, SiStripTemplateEntry::chi2xavg, SiStripTemplateEntry::chi2xavgc2m, SiStripTemplateEntry::chi2xavgone, SiStripTemplateEntry::chi2xmin, SiStripTemplateEntry::chi2xminc2m, SiStripTemplateEntry::chi2xminone, SiStripTemplateEntry::clslenx, SiStripTemplateEntry::costrk, SiStripTemplateEntry::cotalpha, SiStripTemplateEntry::cotbeta, EcalCondDB::db, SiStripTemplateHeader::Dtype, SiStripTemplateEntry::dxone, ENDL, SiStripTemplateStore::entx, SiStripTemplateStore::enty, SiPixelTemplateDBObject::char2float::f, SiPixelTemplateDBObject::fail(), SiStripTemplateHeader::fluence, SiStripTemplateEntry::fracxone, SiStripTemplateStore::head, i, SiStripTemplateHeader::ID, SiPixelTemplateDBObject::incrementIndex(), SiPixelTemplateDBObject::index(), j, gen::k, SiStripTemplateEntry::kappavav, SiStripTemplateEntry::kappavav2, prof2calltree::l, LOGERROR, LOGINFO, SiStripTemplateHeader::lorxwidth, SiStripTemplateHeader::lorywidth, m, SiStripTemplateEntry::mpvvav, SiStripTemplateEntry::mpvvav2, SiStripTemplateHeader::NTxx, SiStripTemplateHeader::NTy, SiStripTemplateHeader::NTyx, SiPixelTemplateDBObject::numOfTempl(), SiStripTemplateEntry::qavg, SiStripTemplateEntry::qavg_avg, SiStripTemplateEntry::qbfrac, SiStripTemplateEntry::qmin, SiStripTemplateEntry::qmin2, SiStripTemplateHeader::qscale, SiStripTemplateEntry::runnum, SiStripTemplateHeader::s50, SiStripTemplateEntry::sigmavav, SiStripTemplateEntry::sigmavav2, SiStripTemplateEntry::spare, SiPixelTemplateDBObject::sVector(), SiStripTemplateEntry::sxmax, SiStripTemplateEntry::sxone, groupFilesInBlocks::temp, SiStripTemplateHeader::temperature, SiStripTemplateHeader::templ_version, SiStripTemplateHeader::title, TSXSIZE, SiStripTemplateHeader::Vbias, SiStripTemplateEntry::xavg, SiStripTemplateEntry::xavgbcn, SiStripTemplateEntry::xavgc2m, SiStripTemplateEntry::xavggen, SiStripTemplateEntry::xflpar, SiStripTemplateEntry::xgsig, SiStripTemplateEntry::xgsigbcn, SiStripTemplateEntry::xgsigc2m, SiStripTemplateEntry::xgsiggen, SiStripTemplateEntry::xgx0, SiStripTemplateEntry::xgx0bcn, SiStripTemplateEntry::xgx0c2m, SiStripTemplateEntry::xgx0gen, SiStripTemplateEntry::xpar, SiStripTemplateEntry::xrms, SiStripTemplateEntry::xrmsbcn, SiStripTemplateEntry::xrmsc2m, SiStripTemplateEntry::xrmsgen, SiStripTemplateHeader::xsize, SiStripTemplateEntry::xtemp, SiStripTemplateHeader::ysize, and SiStripTemplateHeader::zsize.

{
        // Add template stored in external dbobject to theTemplateStore
    
        // Local variables 
        int i, j, k, l;
        float qavg_avg;
        //      const char *tempfile;
        const int code_version={17};
        
        // We must create a new object because dbobject must be a const and our stream must not be
        SiPixelTemplateDBObject db = dbobject;
        
        // Create a local template storage entry
        SiStripTemplateStore theCurrentTemp;
        
        // Fill the template storage for each template calibration stored in the db
        for(int m=0; m<db.numOfTempl(); ++m)
        {
                
                // Read-in a header string first and print it    
                
                SiPixelTemplateDBObject::char2float temp;
                for (i=0; i<20; ++i) {
                        temp.f = db.sVector()[db.index()];
                        theCurrentTemp.head.title[4*i] = temp.c[0];
                        theCurrentTemp.head.title[4*i+1] = temp.c[1];
                        theCurrentTemp.head.title[4*i+2] = temp.c[2];
                        theCurrentTemp.head.title[4*i+3] = temp.c[3];
                        db.incrementIndex(1);
                }
                theCurrentTemp.head.title[79] = '\0';
                LOGINFO("SiStripTemplate") << "Loading Strip Template File - " << theCurrentTemp.head.title << ENDL;
                
                // next, the header information     
                
                db >> theCurrentTemp.head.ID  >> theCurrentTemp.head.templ_version >> theCurrentTemp.head.Bfield >> theCurrentTemp.head.NTy >> theCurrentTemp.head.NTyx >> theCurrentTemp.head.NTxx
                >> theCurrentTemp.head.Dtype >> theCurrentTemp.head.Vbias >> theCurrentTemp.head.temperature >> theCurrentTemp.head.fluence >> theCurrentTemp.head.qscale
                >> theCurrentTemp.head.s50 >> theCurrentTemp.head.lorywidth >> theCurrentTemp.head.lorxwidth >> theCurrentTemp.head.ysize >> theCurrentTemp.head.xsize >> theCurrentTemp.head.zsize;
                
                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file, no template load" << ENDL; return false;}
                
                LOGINFO("SiStripTemplate") << "Template ID = " << theCurrentTemp.head.ID << ", Template Version " << theCurrentTemp.head.templ_version << ", Bfield = " << theCurrentTemp.head.Bfield 
                << ", NTy = " << theCurrentTemp.head.NTy << ", NTyx = " << theCurrentTemp.head.NTyx<< ", NTxx = " << theCurrentTemp.head.NTxx << ", Dtype = " << theCurrentTemp.head.Dtype
                << ", Bias voltage " << theCurrentTemp.head.Vbias << ", temperature "
                << theCurrentTemp.head.temperature << ", fluence " << theCurrentTemp.head.fluence << ", Q-scaling factor " << theCurrentTemp.head.qscale
                << ", 1/2 threshold " << theCurrentTemp.head.s50 << ", y Lorentz Width " << theCurrentTemp.head.lorywidth << ", x Lorentz width " << theCurrentTemp.head.lorxwidth    
                << ", pixel x-size " << theCurrentTemp.head.xsize << ", y-size " << theCurrentTemp.head.ysize << ", zsize " << theCurrentTemp.head.zsize << ENDL;
                
                if(theCurrentTemp.head.templ_version < code_version) {LOGERROR("SiStripTemplate") << "code expects version " << code_version << ", no template load" << ENDL; return false;}
                
                
#ifdef SI_PIXEL_TEMPLATE_USE_BOOST 
                
// next, layout the 1-d/2-d structures needed to store template
                
                theCurrentTemp.enty.resize(boost::extents[theCurrentTemp.head.NTy]);
                
                theCurrentTemp.entx.resize(boost::extents[theCurrentTemp.head.NTyx][theCurrentTemp.head.NTxx]);
                
#endif
                                
                // next, loop over all y-angle entries   
                
                for (i=0; i < theCurrentTemp.head.NTy; ++i) {     
                        
                        db >> theCurrentTemp.enty[i].runnum >> theCurrentTemp.enty[i].costrk[0] 
                        >> theCurrentTemp.enty[i].costrk[1] >> theCurrentTemp.enty[i].costrk[2]; 
                        
                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 1, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        
                        // Calculate the alpha, beta, and cot(beta) for this entry 
                        
                        theCurrentTemp.enty[i].alpha = static_cast<float>(atan2((double)theCurrentTemp.enty[i].costrk[2], (double)theCurrentTemp.enty[i].costrk[0]));
                        
                        theCurrentTemp.enty[i].cotalpha = theCurrentTemp.enty[i].costrk[0]/theCurrentTemp.enty[i].costrk[2];
                        
                        theCurrentTemp.enty[i].beta = static_cast<float>(atan2((double)theCurrentTemp.enty[i].costrk[2], (double)theCurrentTemp.enty[i].costrk[1]));
                        
                        theCurrentTemp.enty[i].cotbeta = theCurrentTemp.enty[i].costrk[1]/theCurrentTemp.enty[i].costrk[2];
                        
                        db >> theCurrentTemp.enty[i].qavg >> theCurrentTemp.enty[i].sxmax >> theCurrentTemp.enty[i].dxone >> theCurrentTemp.enty[i].sxone >> theCurrentTemp.enty[i].qmin >> theCurrentTemp.enty[i].clslenx;
                        
                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 2, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        
                        for (j=0; j<2; ++j) {
                                
                                db >> theCurrentTemp.enty[i].xpar[j][0] >> theCurrentTemp.enty[i].xpar[j][1] 
                                >> theCurrentTemp.enty[i].xpar[j][2] >> theCurrentTemp.enty[i].xpar[j][3] >> theCurrentTemp.enty[i].xpar[j][4];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 6, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                                
                        }
                        
                        qavg_avg = 0.f;
                        for (j=0; j<9; ++j) {
                                
                                for (k=0; k<TSXSIZE; ++k) {db >> theCurrentTemp.enty[i].xtemp[j][k]; qavg_avg += theCurrentTemp.enty[i].xtemp[j][k];} 
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 7, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        }
                        theCurrentTemp.enty[i].qavg_avg = qavg_avg/9.;
                        
                        for (j=0; j<4; ++j) {
                                
                                db >> theCurrentTemp.enty[i].xavg[j] >> theCurrentTemp.enty[i].xrms[j] >> theCurrentTemp.enty[i].xgx0[j] >> theCurrentTemp.enty[i].xgsig[j];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 10, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        }
                        
                        for (j=0; j<4; ++j) {
                                
                                db >> theCurrentTemp.enty[i].xflpar[j][0] >> theCurrentTemp.enty[i].xflpar[j][1] >> theCurrentTemp.enty[i].xflpar[j][2] 
                                >> theCurrentTemp.enty[i].xflpar[j][3] >> theCurrentTemp.enty[i].xflpar[j][4] >> theCurrentTemp.enty[i].xflpar[j][5];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 11, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        }
                        
                        for (j=0; j<4; ++j) {
                                
                                db >> theCurrentTemp.enty[i].chi2xavg[j] >> theCurrentTemp.enty[i].chi2xmin[j] >> theCurrentTemp.enty[i].chi2xavgc2m[j] >> theCurrentTemp.enty[i].chi2xminc2m[j];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 12, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        }
                        
                        for (j=0; j<4; ++j) {
                                
                                db >> theCurrentTemp.enty[i].xavgc2m[j] >> theCurrentTemp.enty[i].xrmsc2m[j] >> theCurrentTemp.enty[i].xgx0c2m[j] >> theCurrentTemp.enty[i].xgsigc2m[j];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 14, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        } 
                        
                        for (j=0; j<4; ++j) {
                                
                                db >> theCurrentTemp.enty[i].xavggen[j] >> theCurrentTemp.enty[i].xrmsgen[j] >> theCurrentTemp.enty[i].xgx0gen[j] >> theCurrentTemp.enty[i].xgsiggen[j];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 14b, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        } 
                        
                        for (j=0; j<4; ++j) {
                                
                                db >> theCurrentTemp.enty[i].xavgbcn[j] >> theCurrentTemp.enty[i].xrmsbcn[j] >> theCurrentTemp.enty[i].xgx0bcn[j] >> theCurrentTemp.enty[i].xgsigbcn[j];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 14c, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        } 
                        
                        db >> theCurrentTemp.enty[i].chi2xavgone >> theCurrentTemp.enty[i].chi2xminone >> theCurrentTemp.enty[i].qmin2
                        >> theCurrentTemp.enty[i].mpvvav >> theCurrentTemp.enty[i].sigmavav >> theCurrentTemp.enty[i].kappavav 
                        >> theCurrentTemp.enty[i].mpvvav2 >> theCurrentTemp.enty[i].sigmavav2 >> theCurrentTemp.enty[i].kappavav2 >> theCurrentTemp.enty[i].spare[0];
                        
                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 15, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        
                        db >> theCurrentTemp.enty[i].qbfrac[0] >> theCurrentTemp.enty[i].qbfrac[1] >> theCurrentTemp.enty[i].qbfrac[2] >> theCurrentTemp.enty[i].fracxone
                        >> theCurrentTemp.enty[i].spare[1] >> theCurrentTemp.enty[i].spare[2] >> theCurrentTemp.enty[i].spare[3] >> theCurrentTemp.enty[i].spare[4]
                        >> theCurrentTemp.enty[i].spare[5] >> theCurrentTemp.enty[i].spare[6];
                        
                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 16, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        
                }
                
                // next, loop over all barrel x-angle entries   
                
                for (k=0; k < theCurrentTemp.head.NTyx; ++k) { 
                        
                        for (i=0; i < theCurrentTemp.head.NTxx; ++i) { 
                                
                                db >> theCurrentTemp.entx[k][i].runnum >> theCurrentTemp.entx[k][i].costrk[0] 
                                >> theCurrentTemp.entx[k][i].costrk[1] >> theCurrentTemp.entx[k][i].costrk[2]; 
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 17, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                
                                // Calculate the alpha, beta, and cot(beta) for this entry 
                                
                                theCurrentTemp.entx[k][i].alpha = static_cast<float>(atan2((double)theCurrentTemp.entx[k][i].costrk[2], (double)theCurrentTemp.entx[k][i].costrk[0]));
                                
                                theCurrentTemp.entx[k][i].cotalpha = theCurrentTemp.entx[k][i].costrk[0]/theCurrentTemp.entx[k][i].costrk[2];
                                
                                theCurrentTemp.entx[k][i].beta = static_cast<float>(atan2((double)theCurrentTemp.entx[k][i].costrk[2], (double)theCurrentTemp.entx[k][i].costrk[1]));
                                
                                theCurrentTemp.entx[k][i].cotbeta = theCurrentTemp.entx[k][i].costrk[1]/theCurrentTemp.entx[k][i].costrk[2];
                                
                                db >> theCurrentTemp.entx[k][i].qavg >> theCurrentTemp.entx[k][i].sxmax >> theCurrentTemp.entx[k][i].dxone >> theCurrentTemp.entx[k][i].sxone >> theCurrentTemp.entx[k][i].qmin >> theCurrentTemp.entx[k][i].clslenx;
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 18, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                
                                for (j=0; j<2; ++j) {
                                        
                                        db >> theCurrentTemp.entx[k][i].xpar[j][0] >> theCurrentTemp.entx[k][i].xpar[j][1] 
                                        >> theCurrentTemp.entx[k][i].xpar[j][2] >> theCurrentTemp.entx[k][i].xpar[j][3] >> theCurrentTemp.entx[k][i].xpar[j][4];
                                        
                                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 19, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                        
                                }
                                
                                qavg_avg = 0.f;
                                for (j=0; j<9; ++j) {
                                        
                                        for (l=0; l<TSXSIZE; ++k) {db >> theCurrentTemp.entx[k][i].xtemp[j][l]; qavg_avg += theCurrentTemp.entx[k][i].xtemp[j][l];} 
                                        
                                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 20, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                }
                                theCurrentTemp.entx[k][i].qavg_avg = qavg_avg/9.;
                                
                                for (j=0; j<4; ++j) {
                                        
                                        db >> theCurrentTemp.entx[k][i].xavg[j] >> theCurrentTemp.entx[k][i].xrms[j] >> theCurrentTemp.entx[k][i].xgx0[j] >> theCurrentTemp.entx[k][i].xgsig[j];
                                        
                                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 21, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                }
                                
                                for (j=0; j<4; ++j) {
                                        
                                        db >> theCurrentTemp.entx[k][i].xflpar[j][0] >> theCurrentTemp.entx[k][i].xflpar[j][1] >> theCurrentTemp.entx[k][i].xflpar[j][2] 
                                        >> theCurrentTemp.entx[k][i].xflpar[j][3] >> theCurrentTemp.entx[k][i].xflpar[j][4] >> theCurrentTemp.entx[k][i].xflpar[j][5];
                                        
                                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 22, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                }
                                
                                for (j=0; j<4; ++j) {
                                        
                                        db >> theCurrentTemp.entx[k][i].chi2xavg[j] >> theCurrentTemp.entx[k][i].chi2xmin[j] >> theCurrentTemp.entx[k][i].chi2xavgc2m[j] >> theCurrentTemp.entx[k][i].chi2xminc2m[j];
                                        
                                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 23, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                }
                                
                                for (j=0; j<4; ++j) {
                                        
                                        db >> theCurrentTemp.entx[k][i].xavgc2m[j] >> theCurrentTemp.entx[k][i].xrmsc2m[j] >> theCurrentTemp.entx[k][i].xgx0c2m[j] >> theCurrentTemp.entx[k][i].xgsigc2m[j];
                                        
                                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 24, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                } 
                                
                                for (j=0; j<4; ++j) {
                                        
                                        db >> theCurrentTemp.entx[k][i].xavggen[j] >> theCurrentTemp.entx[k][i].xrmsgen[j] >> theCurrentTemp.entx[k][i].xgx0gen[j] >> theCurrentTemp.entx[k][i].xgsiggen[j];
                                        
                                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 25, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                } 
                                
                                for (j=0; j<4; ++j) {
                                        
                                        db >> theCurrentTemp.entx[k][i].xavgbcn[j] >> theCurrentTemp.entx[k][i].xrmsbcn[j] >> theCurrentTemp.entx[k][i].xgx0bcn[j] >> theCurrentTemp.entx[k][i].xgsigbcn[j];
                                        
                                        if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 26, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                } 
                                
                                db >> theCurrentTemp.entx[k][i].chi2xavgone >> theCurrentTemp.entx[k][i].chi2xminone >> theCurrentTemp.entx[k][i].qmin2
                                >> theCurrentTemp.entx[k][i].mpvvav >> theCurrentTemp.entx[k][i].sigmavav >> theCurrentTemp.entx[k][i].kappavav 
                                >> theCurrentTemp.entx[k][i].mpvvav2 >> theCurrentTemp.entx[k][i].sigmavav2 >> theCurrentTemp.entx[k][i].kappavav2 >> theCurrentTemp.entx[k][i].spare[0];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 27, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                
                                db >> theCurrentTemp.entx[k][i].qbfrac[0] >> theCurrentTemp.entx[k][i].qbfrac[1] >> theCurrentTemp.entx[k][i].qbfrac[2] >> theCurrentTemp.entx[k][i].fracxone
                                >> theCurrentTemp.entx[k][i].spare[1] >> theCurrentTemp.entx[k][i].spare[2] >> theCurrentTemp.entx[k][i].spare[3] >> theCurrentTemp.entx[k][i].spare[4]
                                >> theCurrentTemp.entx[k][i].spare[5] >> theCurrentTemp.entx[k][i].spare[6];
                                
                                if(db.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 28, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                
                                
                                
                        }
                }       
                
                
                // Add this template to the store
                
                theStripTemp_.push_back(theCurrentTemp);
                
        }
        return true;
        
} // TempInit 
bool SiStripTemplate::pushfile ( int  filenum)

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

Definition at line 54 of file SiStripTemplate.cc.

References SiStripTemplateEntry::alpha, SiStripTemplateEntry::beta, SiStripTemplateHeader::Bfield, trackerHits::c, SiStripTemplateEntry::chi2xavg, SiStripTemplateEntry::chi2xavgc2m, SiStripTemplateEntry::chi2xavgone, SiStripTemplateEntry::chi2xmin, SiStripTemplateEntry::chi2xminc2m, SiStripTemplateEntry::chi2xminone, SiStripTemplateEntry::clslenx, SiStripTemplateEntry::costrk, SiStripTemplateEntry::cotalpha, SiStripTemplateEntry::cotbeta, SiStripTemplateHeader::Dtype, SiStripTemplateEntry::dxone, ENDL, SiStripTemplateStore::entx, SiStripTemplateStore::enty, mergeVDriftHistosByStation::file, SiStripTemplateHeader::fluence, SiStripTemplateEntry::fracxone, SiStripTemplateStore::head, i, SiStripTemplateHeader::ID, recoMuon::in, j, gen::k, SiStripTemplateEntry::kappavav, SiStripTemplateEntry::kappavav2, prof2calltree::l, LOGERROR, LOGINFO, SiStripTemplateHeader::lorxwidth, SiStripTemplateHeader::lorywidth, SiStripTemplateEntry::mpvvav, SiStripTemplateEntry::mpvvav2, SiStripTemplateHeader::NTxx, SiStripTemplateHeader::NTy, SiStripTemplateHeader::NTyx, SiStripTemplateEntry::qavg, SiStripTemplateEntry::qavg_avg, SiStripTemplateEntry::qbfrac, SiStripTemplateEntry::qmin, SiStripTemplateEntry::qmin2, SiStripTemplateHeader::qscale, SiStripTemplateEntry::runnum, SiStripTemplateHeader::s50, SiStripTemplateEntry::sigmavav, SiStripTemplateEntry::sigmavav2, SiStripTemplateEntry::spare, AlCaHLTBitMon_QueryRunRegistry::string, SiStripTemplateEntry::sxmax, SiStripTemplateEntry::sxone, SiStripTemplateHeader::temperature, SiStripTemplateHeader::templ_version, SiStripTemplateHeader::title, TSXSIZE, SiStripTemplateHeader::Vbias, SiStripTemplateEntry::xavg, SiStripTemplateEntry::xavgbcn, SiStripTemplateEntry::xavgc2m, SiStripTemplateEntry::xavggen, SiStripTemplateEntry::xflpar, SiStripTemplateEntry::xgsig, SiStripTemplateEntry::xgsigbcn, SiStripTemplateEntry::xgsigc2m, SiStripTemplateEntry::xgsiggen, SiStripTemplateEntry::xgx0, SiStripTemplateEntry::xgx0bcn, SiStripTemplateEntry::xgx0c2m, SiStripTemplateEntry::xgx0gen, SiStripTemplateEntry::xpar, SiStripTemplateEntry::xrms, SiStripTemplateEntry::xrmsbcn, SiStripTemplateEntry::xrmsc2m, SiStripTemplateEntry::xrmsgen, SiStripTemplateHeader::xsize, SiStripTemplateEntry::xtemp, SiStripTemplateHeader::ysize, and SiStripTemplateHeader::zsize.

Referenced by StripCPEfromTemplate::StripCPEfromTemplate(), and TrackClusterSplitter::TrackClusterSplitter().

{
    // Add template stored in external file numbered filenum to theTemplateStore
    
    // Local variables 
    int i, j, k, l;
        float qavg_avg;
        const char *tempfile;
        //      char title[80]; remove this
    char c;
        const int code_version={18};
        
        
        
        //  Create a filename for this run 
        
        std::ostringstream tout;
        
        //  Create different path in CMSSW than standalone
        
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        tout << "CalibTracker/SiPixelESProducers/data/stemplate_summary_p" << std::setw(4) << std::setfill('0') << std::right << filenum << ".out" << std::ends;
        std::string tempf = tout.str();
        edm::FileInPath file( tempf.c_str() );
        tempfile = (file.fullPath()).c_str();
#else
        tout << "stemplate_summary_p" << std::setw(4) << std::setfill('0') << std::right << filenum << ".out" << std::ends;
        std::string tempf = tout.str();
        tempfile = tempf.c_str();
#endif
        
        //  open the template file 
        
        std::ifstream in_file(tempfile, std::ios::in);
        
        if(in_file.is_open()) {
                
                // Create a local template storage entry
                
                SiStripTemplateStore theCurrentTemp;
                
                // Read-in a header string first and print it    
                
                for (i=0; (c=in_file.get()) != '\n'; ++i) {
                        if(i < 79) {theCurrentTemp.head.title[i] = c;}
                }
                if(i > 78) {i=78;}
                theCurrentTemp.head.title[i+1] ='\0';
                LOGINFO("SiStripTemplate") << "Loading Strip Template File - " << theCurrentTemp.head.title << ENDL;
                
                // next, the header information     
                
                in_file >> theCurrentTemp.head.ID  >> theCurrentTemp.head.templ_version >> theCurrentTemp.head.Bfield >> theCurrentTemp.head.NTy >> theCurrentTemp.head.NTyx >> theCurrentTemp.head.NTxx
                >> theCurrentTemp.head.Dtype >> theCurrentTemp.head.Vbias >> theCurrentTemp.head.temperature >> theCurrentTemp.head.fluence >> theCurrentTemp.head.qscale
                >> theCurrentTemp.head.s50 >> theCurrentTemp.head.lorywidth >> theCurrentTemp.head.lorxwidth >> theCurrentTemp.head.ysize >> theCurrentTemp.head.xsize >> theCurrentTemp.head.zsize;
                
                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file, no template load" << ENDL; return false;}
                
                LOGINFO("SiStripTemplate") << "Template ID = " << theCurrentTemp.head.ID << ", Template Version " << theCurrentTemp.head.templ_version << ", Bfield = " << theCurrentTemp.head.Bfield 
                << ", NTy = " << theCurrentTemp.head.NTy << ", NTyx = " << theCurrentTemp.head.NTyx<< ", NTxx = " << theCurrentTemp.head.NTxx << ", Dtype = " << theCurrentTemp.head.Dtype
                << ", Bias voltage " << theCurrentTemp.head.Vbias << ", temperature "
                << theCurrentTemp.head.temperature << ", fluence " << theCurrentTemp.head.fluence << ", Q-scaling factor " << theCurrentTemp.head.qscale
                << ", 1/2 threshold " << theCurrentTemp.head.s50 << ", y Lorentz Width " << theCurrentTemp.head.lorywidth << ", x Lorentz width " << theCurrentTemp.head.lorxwidth    
                << ", pixel x-size " << theCurrentTemp.head.xsize << ", y-size " << theCurrentTemp.head.ysize << ", zsize " << theCurrentTemp.head.zsize << ENDL;
                
                if(theCurrentTemp.head.templ_version < code_version) {LOGERROR("SiStripTemplate") << "code expects version " << code_version << ", no template load" << ENDL; return false;}
                
#ifdef SI_STRIP_TEMPLATE_USE_BOOST 
                
// next, layout the 1-d/2-d structures needed to store template
                                
                theCurrentTemp.enty.resize(boost::extents[theCurrentTemp.head.NTy]);

                theCurrentTemp.entx.resize(boost::extents[theCurrentTemp.head.NTyx][theCurrentTemp.head.NTxx]);
                
#endif
                
// next, loop over all y-angle entries   
                
                for (i=0; i < theCurrentTemp.head.NTy; ++i) {     
                        
                        in_file >> theCurrentTemp.enty[i].runnum >> theCurrentTemp.enty[i].costrk[0] 
                        >> theCurrentTemp.enty[i].costrk[1] >> theCurrentTemp.enty[i].costrk[2]; 
                        
                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 1, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        
                        // Calculate the alpha, beta, and cot(beta) for this entry 
                        
                        theCurrentTemp.enty[i].alpha = static_cast<float>(atan2((double)theCurrentTemp.enty[i].costrk[2], (double)theCurrentTemp.enty[i].costrk[0]));
                        
                        theCurrentTemp.enty[i].cotalpha = theCurrentTemp.enty[i].costrk[0]/theCurrentTemp.enty[i].costrk[2];
                        
                        theCurrentTemp.enty[i].beta = static_cast<float>(atan2((double)theCurrentTemp.enty[i].costrk[2], (double)theCurrentTemp.enty[i].costrk[1]));
                        
                        theCurrentTemp.enty[i].cotbeta = theCurrentTemp.enty[i].costrk[1]/theCurrentTemp.enty[i].costrk[2];
                        
                        in_file >> theCurrentTemp.enty[i].qavg >> theCurrentTemp.enty[i].sxmax >> theCurrentTemp.enty[i].dxone >> theCurrentTemp.enty[i].sxone >> theCurrentTemp.enty[i].qmin >> theCurrentTemp.enty[i].clslenx;
                        
                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 2, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        for (j=0; j<2; ++j) {
                                
                                in_file >> theCurrentTemp.enty[i].xpar[j][0] >> theCurrentTemp.enty[i].xpar[j][1] 
                                >> theCurrentTemp.enty[i].xpar[j][2] >> theCurrentTemp.enty[i].xpar[j][3] >> theCurrentTemp.enty[i].xpar[j][4];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 6, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                                
                        }
                        
                        qavg_avg = 0.f;
                        for (j=0; j<9; ++j) {
                                
                                for (k=0; k<TSXSIZE; ++k) {in_file >> theCurrentTemp.enty[i].xtemp[j][k]; qavg_avg += theCurrentTemp.enty[i].xtemp[j][k];} 
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 7, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        }
                        theCurrentTemp.enty[i].qavg_avg = qavg_avg/9.;
                        
                        for (j=0; j<4; ++j) {
                                
                                in_file >> theCurrentTemp.enty[i].xavg[j] >> theCurrentTemp.enty[i].xrms[j] >> theCurrentTemp.enty[i].xgx0[j] >> theCurrentTemp.enty[i].xgsig[j];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 10, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        }
                        
                        for (j=0; j<4; ++j) {
                                
                                in_file >> theCurrentTemp.enty[i].xflpar[j][0] >> theCurrentTemp.enty[i].xflpar[j][1] >> theCurrentTemp.enty[i].xflpar[j][2] 
                                >> theCurrentTemp.enty[i].xflpar[j][3] >> theCurrentTemp.enty[i].xflpar[j][4] >> theCurrentTemp.enty[i].xflpar[j][5];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 11, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        }
                        
                        for (j=0; j<4; ++j) {
                                
                                in_file >> theCurrentTemp.enty[i].chi2xavg[j] >> theCurrentTemp.enty[i].chi2xmin[j] >> theCurrentTemp.enty[i].chi2xavgc2m[j] >> theCurrentTemp.enty[i].chi2xminc2m[j];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 12, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        }
                        
                                for (j=0; j<4; ++j) {
                                
                                in_file >> theCurrentTemp.enty[i].xavgc2m[j] >> theCurrentTemp.enty[i].xrmsc2m[j] >> theCurrentTemp.enty[i].xgx0c2m[j] >> theCurrentTemp.enty[i].xgsigc2m[j];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 14, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        } 
                        
                                for (j=0; j<4; ++j) {
                                
                                in_file >> theCurrentTemp.enty[i].xavggen[j] >> theCurrentTemp.enty[i].xrmsgen[j] >> theCurrentTemp.enty[i].xgx0gen[j] >> theCurrentTemp.enty[i].xgsiggen[j];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 14b, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        } 
                        
                        for (j=0; j<4; ++j) {
                                
                                in_file >> theCurrentTemp.enty[i].xavgbcn[j] >> theCurrentTemp.enty[i].xrmsbcn[j] >> theCurrentTemp.enty[i].xgx0bcn[j] >> theCurrentTemp.enty[i].xgsigbcn[j];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 14c, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        } 
                        
                        in_file >> theCurrentTemp.enty[i].chi2xavgone >> theCurrentTemp.enty[i].chi2xminone >> theCurrentTemp.enty[i].qmin2
                        >> theCurrentTemp.enty[i].mpvvav >> theCurrentTemp.enty[i].sigmavav >> theCurrentTemp.enty[i].kappavav 
                        >> theCurrentTemp.enty[i].mpvvav2 >> theCurrentTemp.enty[i].sigmavav2 >> theCurrentTemp.enty[i].kappavav2 >> theCurrentTemp.enty[i].spare[0];
                        
                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 15, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        
                        in_file >> theCurrentTemp.enty[i].qbfrac[0] >> theCurrentTemp.enty[i].qbfrac[1] >> theCurrentTemp.enty[i].qbfrac[2] >> theCurrentTemp.enty[i].fracxone
                        >> theCurrentTemp.enty[i].spare[1] >> theCurrentTemp.enty[i].spare[2] >> theCurrentTemp.enty[i].spare[3] >> theCurrentTemp.enty[i].spare[4]
                        >> theCurrentTemp.enty[i].spare[5] >> theCurrentTemp.enty[i].spare[6];
                        
                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 16, no template load, run # " << theCurrentTemp.enty[i].runnum << ENDL; return false;}
                        
                }
                
                // next, loop over all barrel x-angle entries   
                
                for (k=0; k < theCurrentTemp.head.NTyx; ++k) { 
                        
                        for (i=0; i < theCurrentTemp.head.NTxx; ++i) { 
                                
                                in_file >> theCurrentTemp.entx[k][i].runnum >> theCurrentTemp.entx[k][i].costrk[0] 
                                >> theCurrentTemp.entx[k][i].costrk[1] >> theCurrentTemp.entx[k][i].costrk[2]; 
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 17, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                
                                // Calculate the alpha, beta, and cot(beta) for this entry 
                                
                                theCurrentTemp.entx[k][i].alpha = static_cast<float>(atan2((double)theCurrentTemp.entx[k][i].costrk[2], (double)theCurrentTemp.entx[k][i].costrk[0]));
                                
                                theCurrentTemp.entx[k][i].cotalpha = theCurrentTemp.entx[k][i].costrk[0]/theCurrentTemp.entx[k][i].costrk[2];
                                
                                theCurrentTemp.entx[k][i].beta = static_cast<float>(atan2((double)theCurrentTemp.entx[k][i].costrk[2], (double)theCurrentTemp.entx[k][i].costrk[1]));
                                
                                theCurrentTemp.entx[k][i].cotbeta = theCurrentTemp.entx[k][i].costrk[1]/theCurrentTemp.entx[k][i].costrk[2];
                                
                                in_file >> theCurrentTemp.entx[k][i].qavg >> theCurrentTemp.entx[k][i].sxmax >> theCurrentTemp.entx[k][i].dxone >> theCurrentTemp.entx[k][i].sxone >> theCurrentTemp.entx[k][i].qmin >> theCurrentTemp.entx[k][i].clslenx;
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 18, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                
                                for (j=0; j<2; ++j) {
                                        
                                        in_file >> theCurrentTemp.entx[k][i].xpar[j][0] >> theCurrentTemp.entx[k][i].xpar[j][1] 
                                        >> theCurrentTemp.entx[k][i].xpar[j][2] >> theCurrentTemp.entx[k][i].xpar[j][3] >> theCurrentTemp.entx[k][i].xpar[j][4];
                                        
                                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 19, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                        
                                }
                                
                                qavg_avg = 0.f;
                                for (j=0; j<9; ++j) {
                                        
                                        for (l=0; l<TSXSIZE; ++l) {in_file >> theCurrentTemp.entx[k][i].xtemp[j][l]; qavg_avg += theCurrentTemp.entx[k][i].xtemp[j][l];} 
                                        
                                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 20, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                }
                                theCurrentTemp.entx[k][i].qavg_avg = qavg_avg/9.;
                                
                                for (j=0; j<4; ++j) {
                                        
                                        in_file >> theCurrentTemp.entx[k][i].xavg[j] >> theCurrentTemp.entx[k][i].xrms[j] >> theCurrentTemp.entx[k][i].xgx0[j] >> theCurrentTemp.entx[k][i].xgsig[j];
                                        
                                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 21, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                }
                                
                                for (j=0; j<4; ++j) {
                                        
                                        in_file >> theCurrentTemp.entx[k][i].xflpar[j][0] >> theCurrentTemp.entx[k][i].xflpar[j][1] >> theCurrentTemp.entx[k][i].xflpar[j][2] 
                                        >> theCurrentTemp.entx[k][i].xflpar[j][3] >> theCurrentTemp.entx[k][i].xflpar[j][4] >> theCurrentTemp.entx[k][i].xflpar[j][5];
                                        
                                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 22, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                }
                                
                                for (j=0; j<4; ++j) {
                                        
                                        in_file >> theCurrentTemp.entx[k][i].chi2xavg[j] >> theCurrentTemp.entx[k][i].chi2xmin[j] >> theCurrentTemp.entx[k][i].chi2xavgc2m[j] >> theCurrentTemp.entx[k][i].chi2xminc2m[j];
                                        
                                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 23, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                }
                                
                                for (j=0; j<4; ++j) {
                                        
                                        in_file >> theCurrentTemp.entx[k][i].xavgc2m[j] >> theCurrentTemp.entx[k][i].xrmsc2m[j] >> theCurrentTemp.entx[k][i].xgx0c2m[j] >> theCurrentTemp.entx[k][i].xgsigc2m[j];
                                        
                                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 24, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                } 
                                
                                for (j=0; j<4; ++j) {
                                        
                                        in_file >> theCurrentTemp.entx[k][i].xavggen[j] >> theCurrentTemp.entx[k][i].xrmsgen[j] >> theCurrentTemp.entx[k][i].xgx0gen[j] >> theCurrentTemp.entx[k][i].xgsiggen[j];
                                        
                                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 25, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                } 
                                
                                for (j=0; j<4; ++j) {
                                        
                                        in_file >> theCurrentTemp.entx[k][i].xavgbcn[j] >> theCurrentTemp.entx[k][i].xrmsbcn[j] >> theCurrentTemp.entx[k][i].xgx0bcn[j] >> theCurrentTemp.entx[k][i].xgsigbcn[j];
                                        
                                        if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 26, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                } 
                                
                                in_file >> theCurrentTemp.entx[k][i].chi2xavgone >> theCurrentTemp.entx[k][i].chi2xminone >> theCurrentTemp.entx[k][i].qmin2
                                >> theCurrentTemp.entx[k][i].mpvvav >> theCurrentTemp.entx[k][i].sigmavav >> theCurrentTemp.entx[k][i].kappavav 
                                >> theCurrentTemp.entx[k][i].mpvvav2 >> theCurrentTemp.entx[k][i].sigmavav2 >> theCurrentTemp.entx[k][i].kappavav2 >> theCurrentTemp.entx[k][i].spare[0];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 27, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                
                                in_file >> theCurrentTemp.entx[k][i].qbfrac[0] >> theCurrentTemp.entx[k][i].qbfrac[1] >> theCurrentTemp.entx[k][i].qbfrac[2] >> theCurrentTemp.entx[k][i].fracxone
                                >> theCurrentTemp.entx[k][i].spare[1] >> theCurrentTemp.entx[k][i].spare[2] >> theCurrentTemp.entx[k][i].spare[3] >> theCurrentTemp.entx[k][i].spare[4]
                                >> theCurrentTemp.entx[k][i].spare[5] >> theCurrentTemp.entx[k][i].spare[6];
                                
                                if(in_file.fail()) {LOGERROR("SiStripTemplate") << "Error reading file 28, no template load, run # " << theCurrentTemp.entx[k][i].runnum << ENDL; return false;}
                                

                        }
                }       
                
                
                in_file.close();
                
                // Add this template to the store
                
                theStripTemp_.push_back(theCurrentTemp);
                
                return true;
                
        } else {
                
                // If file didn't open, report this
                
                LOGERROR("SiStripTemplate") << "Error opening File " << tempfile << ENDL;
                return false;
                
        }
        
} // TempInit 
float SiStripTemplate::qavg ( ) [inline]

average cluster charge for this set of track angles

Definition at line 186 of file SiStripTemplate.h.

References qavg_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

int SiStripTemplate::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)
qclus- (input) the cluster charge in electrons

Definition at line 1469 of file SiStripTemplate.cc.

References Exception, f, i, getHLTprescales::index, and mathSSE::sqrt().

Referenced by TrackClusterSplitter::splitCluster().

{
    // Interpolate for a new set of track angles 
    
    // Local variables 
    int i, binq;
        int ilow, ihigh, Ny, Nxx, Nyx, index;
        float yratio;
        float acotb, qscale, qavg, qmin, qmin2, fq, qtotal, qcorrect, cotalpha0;
        

// Find the index corresponding to id

       index = -1;
       for(i=0; i<(int)theStripTemp_.size(); ++i) {
        
              if(id == theStripTemp_[i].head.ID) {
           
                 index = i;
                     break;
          }
            }
         
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
           if(index < 0 || index >= (int)theStripTemp_.size()) {
              throw cms::Exception("DataCorrupt") << "SiStripTemplate::qbin can't find needed template ID = " << id << std::endl;
           }
#else
           assert(index >= 0 && index < (int)theStripTemp_.size());
#endif
         
//              

// Interpolate the absolute value of cot(beta)     
    
    acotb = fabs((double)cotbeta);
        
//      qcorrect corrects the cot(alpha)=0 cluster charge for non-zero cot(alpha)       

        //      qcorrect corrects the cot(alpha)=0 cluster charge for non-zero cot(alpha)       
        
        cotalpha0 =  theStripTemp_[index].enty[0].cotalpha;
        qcorrect=std::sqrt((1.f+cotbeta*cotbeta+cotalpha*cotalpha)/(1.f+cotbeta*cotbeta+cotalpha0*cotalpha0));
                                        
        // Copy the charge scaling factor to the private variable     
                
           qscale = theStripTemp_[index].head.qscale;
                
       Ny = theStripTemp_[index].head.NTy;
       Nyx = theStripTemp_[index].head.NTyx;
       Nxx = theStripTemp_[index].head.NTxx;
                
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
                if(Ny < 2 || Nyx < 1 || Nxx < 2) {
                        throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny/Nyx/Nxx = " << Ny << "/" << Nyx << "/" << Nxx << std::endl;
                }
#else
                assert(Ny > 1 && Nyx > 0 && Nxx > 1);
#endif
        
// next, loop over all y-angle entries   

           ilow = 0;
           yratio = 0.f;

           if(acotb >= theStripTemp_[index].enty[Ny-1].cotbeta) {
        
               ilow = Ny-2;
                   yratio = 1.f;
                
           } else {
           
              if(acotb >= theStripTemp_[index].enty[0].cotbeta) {

             for (i=0; i<Ny-1; ++i) { 
    
                if( theStripTemp_[index].enty[i].cotbeta <= acotb && acotb < theStripTemp_[index].enty[i+1].cotbeta) {
                  
                       ilow = i;
                           yratio = (acotb - theStripTemp_[index].enty[i].cotbeta)/(theStripTemp_[index].enty[i+1].cotbeta - theStripTemp_[index].enty[i].cotbeta);
                           break;                        
                        }
                 }
                  } 
           }
        
           ihigh=ilow + 1;
                          
// Interpolate/store all y-related quantities (flip displacements when flip_y)

           qavg = (1.f - yratio)*theStripTemp_[index].enty[ilow].qavg + yratio*theStripTemp_[index].enty[ihigh].qavg;
           qavg *= qcorrect;
           qmin = (1.f - yratio)*theStripTemp_[index].enty[ilow].qmin + yratio*theStripTemp_[index].enty[ihigh].qmin;
           qmin *= qcorrect;
           qmin2 = (1.f - yratio)*theStripTemp_[index].enty[ilow].qmin2 + yratio*theStripTemp_[index].enty[ihigh].qmin2;
           qmin2 *= qcorrect;
           
        
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(qavg <= 0.f || qmin <= 0.f) {
                throw cms::Exception("DataCorrupt") << "SiStripTemplate::qbin, qavg or qmin <= 0," 
                << " Probably someone called the generic pixel reconstruction with an illegal trajectory state" << std::endl;
        }
#else
        assert(qavg > 0.f && qmin > 0.f);
#endif
        
//  Scale the input charge to account for differences between pixelav and CMSSW simulation or data      
        
        qtotal = qscale*qclus;
        
// uncertainty and final corrections depend upon total charge bin          
           
        fq = qtotal/qavg;
        if(fq > 1.5f) {
           binq=0;
        } else {
           if(fq > 1.0f) {
              binq=1;
           } else {
                  if(fq > 0.85f) {
                         binq=2;
                  } else {
                         binq=3;
                  }
           }
        }
        
// If the charge is too small (then flag it)
        
        if(qtotal < 0.95f*qmin) {binq = 5;} else {if(qtotal < 0.95f*qmin2) {binq = 4;}}
                
    return binq;
  
} // qbin
float SiStripTemplate::qmin ( ) [inline]

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

Definition at line 192 of file SiStripTemplate.h.

References qmin_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

float SiStripTemplate::qmin ( int  i) [inline]

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

Definition at line 193 of file SiStripTemplate.h.

References Exception, qmin2_, and qmin_.

float SiStripTemplate::qscale ( ) [inline]

charge scaling factor

Definition at line 187 of file SiStripTemplate.h.

References qscale_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

float SiStripTemplate::s50 ( ) [inline]

1/2 of the strip threshold signal in electrons

Definition at line 188 of file SiStripTemplate.h.

References s50_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

float SiStripTemplate::sigmavav ( ) [inline]

"sigma" scale fctor for Vavilov distribution

Definition at line 320 of file SiStripTemplate.h.

References sigmavav_.

float SiStripTemplate::sxmax ( ) [inline]

average strip signal for x-projection of cluster

Definition at line 189 of file SiStripTemplate.h.

References sxmax_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

float SiStripTemplate::sxone ( ) [inline]

rms for one strip x-clusters

Definition at line 191 of file SiStripTemplate.h.

References sxone_.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

void SiStripTemplate::sxtemp ( float  xhit,
std::vector< float > &  cluster 
)

Interpolate the template in xhit and return scaled charges (ADC units) in the vector container

Parameters:
xhit- (input) coordinate of the hit (0 at center of first strip: cluster[0])
cluster- (output) vector array of TSXSIZE (or any other)

Definition at line 1259 of file SiStripTemplate.cc.

References BSHX, BSXSIZE, Exception, f, i, j, edm::min(), and edm::shift.

Referenced by TrackClusterSplitter::splitCluster().

{
        // Retrieve already interpolated quantities
        
        // Local variables 
        int i, j;
        
        // Extract x template based upon the hit position 
   
        float xpix = xhit/xsize_ + 0.5f;
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(xpix < 0.f) {
                throw cms::Exception("DataCorrupt") << "SiStripTemplate::2xtemp called with xhit = " << xhit << std::endl;
        }
#else
        assert(xpix >= 0.f);
#endif
        
// cpix is struck pixel(strip) of the cluster   
        
        int cpix = (int)xpix;
        int shift = BSHX - cpix;
        
// xbin the floating bin number and cbin is the bin number (between 0 and 7) of the interpolated template
        
        float xbin = 8.*(xpix-(float)cpix);
        int cbin = (int)xbin;
        
        float xfrac = xbin-(float)cbin;
        
        int sizex = std::min((int)cluster.size(), BSXSIZE);
        
// shift and interpolate the correct cluster shape      
        
        for(i=0; i<sizex; ++i) {
                j = i+shift;
                if(j < 0 || j > sizex-1) {cluster[i] = 0.f;} else {
              cluster[i]=(1.f-xfrac)*xtemp_[cbin][j]+xfrac*xtemp_[cbin+1][j];
                        if(cluster[i] < s50_) cluster[i] = 0.f;
                }
                
// Return cluster in same charge units          
                
                cluster[i] /= qscale_;
        }

        
        return;
        
} // End sxtemp
void SiStripTemplate::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 1691 of file SiStripTemplate.cc.

References cmsCodeRulesChecker::arg, Exception, f, i, and mathSSE::sqrt().

Referenced by SiStripTemplateSplit::StripTempSplit().

{
        // Local variables 
        int i;
        int ilow, ihigh, Ny;
        float yratio, cotb, cotalpha0, arg;
        
// Interpolate in cotbeta only for the correct total path length (converts cotalpha, cotbeta into an effective cotbeta) 
        
        cotalpha0 =  theStripTemp_[index_id_].enty[0].cotalpha;
    arg = cotb_current_*cotb_current_ + cota_current_*cota_current_ - cotalpha0*cotalpha0;
    if(arg < 0.f) arg = 0.f;
        cotb = std::sqrt(arg);
        
        // Copy the charge scaling factor to the private variable     
        
        Ny = theStripTemp_[index_id_].head.NTy;
        
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(Ny < 2) {
                throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny = " << Ny << std::endl;
        }
#else
        assert(Ny > 1);
#endif
        
        // next, loop over all y-angle entries   
        
        ilow = 0;
        yratio = 0.f;
        
        if(cotb >= theStripTemp_[index_id_].enty[Ny-1].cotbeta) {
                
                ilow = Ny-2;
                yratio = 1.f;
                
        } else {
                
                if(cotb >= theStripTemp_[index_id_].enty[0].cotbeta) {
                        
                        for (i=0; i<Ny-1; ++i) { 
                                
                                if( theStripTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < theStripTemp_[index_id_].enty[i+1].cotbeta) {
                                        
                                        ilow = i;
                                        yratio = (cotb - theStripTemp_[index_id_].enty[i].cotbeta)/(theStripTemp_[index_id_].enty[i+1].cotbeta - theStripTemp_[index_id_].enty[i].cotbeta);
                                        break;                   
                                }
                        }
                } 
        }
        
        ihigh=ilow + 1;
        
        // Interpolate Vavilov parameters
        
        mpvvav2_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].mpvvav2 + yratio*theStripTemp_[index_id_].enty[ihigh].mpvvav2;
        sigmavav2_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].sigmavav2 + yratio*theStripTemp_[index_id_].enty[ihigh].sigmavav2;
        kappavav2_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].kappavav2 + yratio*theStripTemp_[index_id_].enty[ihigh].kappavav2;
        
        // Copy to parameter list
        
        mpv = (double)mpvvav2_;
        sigma = (double)sigmavav2_;
        kappa = (double)kappavav2_;
        
        return;
        
} // vavilov2_pars
void SiStripTemplate::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 1613 of file SiStripTemplate.cc.

References cmsCodeRulesChecker::arg, Exception, f, i, and mathSSE::sqrt().

Referenced by SiStripTemplateReco::StripTempReco1D().

{
        // Local variables 
        int i;
        int ilow, ihigh, Ny;
        float yratio, cotb, cotalpha0, arg;
        
// Interpolate in cotbeta only for the correct total path length (converts cotalpha, cotbeta into an effective cotbeta) 
        
        cotalpha0 =  theStripTemp_[index_id_].enty[0].cotalpha;
    arg = cotb_current_*cotb_current_ + cota_current_*cota_current_ - cotalpha0*cotalpha0;
    if(arg < 0.f) arg = 0.f;
        cotb = std::sqrt(arg);
                
// Copy the charge scaling factor to the private variable     
        
        Ny = theStripTemp_[index_id_].head.NTy;
        
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(Ny < 2) {
                throw cms::Exception("DataCorrupt") << "template ID = " << id_current_ << "has too few entries: Ny = " << Ny << std::endl;
        }
#else
        assert(Ny > 1);
#endif
        
// next, loop over all y-angle entries   
        
        ilow = 0;
        yratio = 0.f;
        
        if(cotb >= theStripTemp_[index_id_].enty[Ny-1].cotbeta) {
                
                ilow = Ny-2;
                yratio = 1.f;
                
        } else {
                
                if(cotb >= theStripTemp_[index_id_].enty[0].cotbeta) {
                        
                        for (i=0; i<Ny-1; ++i) { 
                                
                                if( theStripTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < theStripTemp_[index_id_].enty[i+1].cotbeta) {
                                        
                                        ilow = i;
                                        yratio = (cotb - theStripTemp_[index_id_].enty[i].cotbeta)/(theStripTemp_[index_id_].enty[i+1].cotbeta - theStripTemp_[index_id_].enty[i].cotbeta);
                                        break;                   
                                }
                        }
                } 
        }
        
        ihigh=ilow + 1;
        
// Interpolate Vavilov parameters
        
        mpvvav_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].mpvvav + yratio*theStripTemp_[index_id_].enty[ihigh].mpvvav;
        sigmavav_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].sigmavav + yratio*theStripTemp_[index_id_].enty[ihigh].sigmavav;
        kappavav_ = (1.f - yratio)*theStripTemp_[index_id_].enty[ilow].kappavav + yratio*theStripTemp_[index_id_].enty[ihigh].kappavav;
        
// Copy to parameter list
        
        
        mpv = (double)mpvvav_;
        sigma = (double)sigmavav_;
        kappa = (double)kappavav_;
        
        return;
        
} // vavilov_pars
float SiStripTemplate::xavg ( int  i) [inline]

average x-bias of reconstruction binned in 4 charge bins

Definition at line 204 of file SiStripTemplate.h.

References Exception, i, and xavg_.

Referenced by SiStripTemplateReco::StripTempReco1D().

float SiStripTemplate::xavgbcn ( int  i) [inline]

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

Definition at line 288 of file SiStripTemplate.h.

References Exception, i, and xavgbcn_.

Referenced by SiStripTemplateReco::StripTempReco1D().

float SiStripTemplate::xavgc2m ( int  i) [inline]

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

Definition at line 246 of file SiStripTemplate.h.

References Exception, i, and xavgc2m_.

Referenced by SiStripTemplateSplit::StripTempSplit().

float SiStripTemplate::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 1132 of file SiStripTemplate.cc.

References Exception, and f.

Referenced by SiStripTemplateReco::StripTempReco1D().

{
    // Interpolate using quantities already stored in the private variables
    
    // Local variables 
        float qfl, qfl2, qfl3, qfl4, qfl5, dx;
        
    // Make sure that input is OK
    
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(binq < 0 || binq > 3) {
                throw cms::Exception("DataCorrupt") << "SiStripTemplate::xflcorr called with binq = " << binq << std::endl;
        }
#else
        assert(binq >= 0 && binq < 4);
#endif
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(fabs((double)qflx) > 1.) {
                throw cms::Exception("DataCorrupt") << "SiStripTemplate::xflcorr called with qflx = " << qflx << std::endl;
        }
#else
        assert(fabs((double)qflx) <= 1.);
#endif
                     
// Define the maximum signal to allow before de-weighting a pixel 

       qfl = qflx;

       if(qfl < -0.9f) {qfl = -0.9f;}
           if(qfl > 0.9f) {qfl = 0.9f;}
           
// Interpolate between the two polynomials

           qfl2 = qfl*qfl; qfl3 = qfl2*qfl; qfl4 = qfl3*qfl; qfl5 = qfl4*qfl;
           dx = (1.f - yxratio_)*((1.f-xxratio_)*(xflparll_[binq][0]+xflparll_[binq][1]*qfl+xflparll_[binq][2]*qfl2+xflparll_[binq][3]*qfl3+xflparll_[binq][4]*qfl4+xflparll_[binq][5]*qfl5)
                  + xxratio_*(xflparlh_[binq][0]+xflparlh_[binq][1]*qfl+xflparlh_[binq][2]*qfl2+xflparlh_[binq][3]*qfl3+xflparlh_[binq][4]*qfl4+xflparlh_[binq][5]*qfl5))
              + yxratio_*((1.f-xxratio_)*(xflparhl_[binq][0]+xflparhl_[binq][1]*qfl+xflparhl_[binq][2]*qfl2+xflparhl_[binq][3]*qfl3+xflparhl_[binq][4]*qfl4+xflparhl_[binq][5]*qfl5)
                  + xxratio_*(xflparhh_[binq][0]+xflparhh_[binq][1]*qfl+xflparhh_[binq][2]*qfl2+xflparhh_[binq][3]*qfl3+xflparhh_[binq][4]*qfl4+xflparhh_[binq][5]*qfl5));
        
        return dx;
        
} // End xflcorr
float SiStripTemplate::xgsig ( int  i) [inline]

average sigma_x from Gaussian fit binned in 4 charge bins

Definition at line 225 of file SiStripTemplate.h.

References Exception, i, and xgsig_.

float SiStripTemplate::xgsigbcn ( int  i) [inline]

1st pass chi2 min search: average sigma_x from Gaussian fit binned in 4 charge bins

Definition at line 309 of file SiStripTemplate.h.

References Exception, i, and xgsigbcn_.

float SiStripTemplate::xgsigc2m ( int  i) [inline]

1st pass chi2 min search: average sigma_x from Gaussian fit binned in 4 charge bins

Definition at line 267 of file SiStripTemplate.h.

References Exception, i, and xgsigc2m_.

float SiStripTemplate::xgx0 ( int  i) [inline]

average x0 from Gaussian fit binned in 4 charge bins

Definition at line 218 of file SiStripTemplate.h.

References Exception, i, and xgx0_.

float SiStripTemplate::xgx0bcn ( int  i) [inline]

1st pass chi2 min search: average x0 from Gaussian fit binned in 4 charge bins

Definition at line 302 of file SiStripTemplate.h.

References Exception, i, and xgx0bcn_.

float SiStripTemplate::xgx0c2m ( int  i) [inline]

1st pass chi2 min search: average x0 from Gaussian fit binned in 4 charge bins

Definition at line 260 of file SiStripTemplate.h.

References Exception, i, and xgx0c2m_.

float SiStripTemplate::xrms ( int  i) [inline]

average x-rms of reconstruction binned in 4 charge bins

Definition at line 211 of file SiStripTemplate.h.

References Exception, i, and xrms_.

Referenced by SiStripTemplateReco::StripTempReco1D().

float SiStripTemplate::xrmsbcn ( int  i) [inline]

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

Definition at line 295 of file SiStripTemplate.h.

References Exception, i, and xrmsbcn_.

Referenced by SiStripTemplateReco::StripTempReco1D().

float SiStripTemplate::xrmsc2m ( int  i) [inline]

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

Definition at line 253 of file SiStripTemplate.h.

References Exception, i, and xrmsc2m_.

Referenced by SiStripTemplateSplit::StripTempSplit().

void SiStripTemplate::xsigma2 ( int  fxstrp,
int  lxstrp,
float  sxthr,
float  xsum[BSXSIZE],
float  xsig2[BSXSIZE] 
)

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 1460 of file SiPixelTemplate.cc.

References BHX, BXM2, ENDL, Exception, f, i, and LOGERROR.

Referenced by SiStripTemplateReco::StripTempReco1D(), and SiStripTemplateSplit::StripTempSplit().

{
    // Interpolate using quantities already stored in the private variables
    
    // Local variables 
    int i;
        float sigi, sigi2, sigi3, sigi4, yint, sxmax, x0, qscale;
        
    // Make sure that input is OK
    
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
                  if(fxpix < 2 || fxpix >= BXM2) {
                         throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xsigma2 called with fxpix = " << fxpix << std::endl;
                   }
#else
                   assert(fxpix > 1 && fxpix < BXM2);
#endif
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
                         if(lxpix < fxpix || lxpix >= BXM2) {
                                throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xsigma2 called with lxpix/fxpix = " << lxpix << "/" << fxpix << std::endl;
                         }
#else
                         assert(lxpix >= fxpix && lxpix < BXM2);
#endif
                     
// Define the maximum signal to use in the parameterization 

       sxmax = sxmax_;
           if(sxmax_ > sxparmax_) {sxmax = sxparmax_;}
           
// Evaluate pixel-by-pixel uncertainties (weights) for the templ analysis 

           for(i=fxpix-2; i<=lxpix+2; ++i) {
                  if(i < fxpix || i > lxpix) {
           
// Nearest pseudopixels have uncertainties of 50% of threshold, next-nearest have 10% of threshold

                         xsig2[i] = s50_*s50_;
                  } else {
                         if(xsum[i] < sxmax) {
                                sigi = xsum[i];
                                qscale = 1.f;
                         } else {
                                sigi = sxmax;
                                qscale = xsum[i]/sxmax;
                         }
                         sigi2 = sigi*sigi; sigi3 = sigi2*sigi; sigi4 = sigi3*sigi;
                         
// First, do the cotbeta interpolation                   
                         
                         if(i <= BHX) {
                                yint = (1.f-yratio_)*
                                (xparly0_[0][0]+xparly0_[0][1]*sigi+xparly0_[0][2]*sigi2+xparly0_[0][3]*sigi3+xparly0_[0][4]*sigi4)
                                + yratio_*
                                (xparhy0_[0][0]+xparhy0_[0][1]*sigi+xparhy0_[0][2]*sigi2+xparhy0_[0][3]*sigi3+xparhy0_[0][4]*sigi4);
                         } else {
                                yint = (1.f-yratio_)*
                                (xparly0_[1][0]+xparly0_[1][1]*sigi+xparly0_[1][2]*sigi2+xparly0_[1][3]*sigi3+xparly0_[1][4]*sigi4)
                                + yratio_*
                            (xparhy0_[1][0]+xparhy0_[1][1]*sigi+xparhy0_[1][2]*sigi2+xparhy0_[1][3]*sigi3+xparhy0_[1][4]*sigi4);
                         }
                         
// Next, do the cotalpha interpolation                   
                         
                         if(i <= BHX) {
                                xsig2[i] = (1.f-xxratio_)*
                                (xparl_[0][0]+xparl_[0][1]*sigi+xparl_[0][2]*sigi2+xparl_[0][3]*sigi3+xparl_[0][4]*sigi4)
                                + xxratio_*
                                (xparh_[0][0]+xparh_[0][1]*sigi+xparh_[0][2]*sigi2+xparh_[0][3]*sigi3+xparh_[0][4]*sigi4);
                         } else {
                                xsig2[i] = (1.f-xxratio_)*
                                (xparl_[1][0]+xparl_[1][1]*sigi+xparl_[1][2]*sigi2+xparl_[1][3]*sigi3+xparl_[1][4]*sigi4)
                                + xxratio_*
                            (xparh_[1][0]+xparh_[1][1]*sigi+xparh_[1][2]*sigi2+xparh_[1][3]*sigi3+xparh_[1][4]*sigi4);
                         }
                         
// Finally, get the mid-point value of the cotalpha function                     
                         
                         if(i <= BHX) {
                                x0 = xpar0_[0][0]+xpar0_[0][1]*sigi+xpar0_[0][2]*sigi2+xpar0_[0][3]*sigi3+xpar0_[0][4]*sigi4;
                         } else {
                                x0 = xpar0_[1][0]+xpar0_[1][1]*sigi+xpar0_[1][2]*sigi2+xpar0_[1][3]*sigi3+xpar0_[1][4]*sigi4;
                         }
                         
// Finally, rescale the yint value for cotalpha variation                        
                         
                         if(x0 != 0.f) {xsig2[i] = xsig2[i]/x0 * yint;}
                         xsig2[i] *=qscale;
                     if(xsum[i] > sxthr) {xsig2[i] = 1.e8;}
                         if(xsig2[i] <= 0.f) {LOGERROR("SiPixelTemplate") << "neg x-error-squared, id = " << id_current_ << ", index = " << index_id_ << 
                         ", cot(alpha) = " << cota_current_ << ", cot(beta) = " << cotb_current_  << ", sigi = " << sigi << ENDL;}
              }
           }
        
        return;
        
} // End xsigma2
float SiStripTemplate::xsize ( ) [inline]
void SiStripTemplate::xtemp ( int  fxbin,
int  lxbin,
float  xtemplate[41][BSXSIZE] 
)

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 1183 of file SiStripTemplate.cc.

References BSXM1, BSXM2, BSXSIZE, Exception, i, and j.

Referenced by SiStripTemplateReco::StripTempReco1D().

{
    // Retrieve already interpolated quantities
    
    // Local variables 
    int i, j;

   // Verify that input parameters are in valid range

#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(fxbin < 0 || fxbin > 40) {
                throw cms::Exception("DataCorrupt") << "SiStripTemplate::xtemp called with fxbin = " << fxbin << std::endl;
        }
#else
        assert(fxbin >= 0 && fxbin < 41);
#endif
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(lxbin < 0 || lxbin > 40) {
                throw cms::Exception("DataCorrupt") << "SiStripTemplate::xtemp called with lxbin = " << lxbin << std::endl;
        }
#else
        assert(lxbin >= 0 && lxbin < 41);
#endif

// Build the x-template, the central 25 bins are here in all cases
        
        for(i=0; i<9; ++i) {
           for(j=0; j<BSXSIZE; ++j) {
              xtemplate[i+16][j]=xtemp_[i][j];
           }
        }
        for(i=0; i<8; ++i) {
           xtemplate[i+8][BSXM1] = 0.f;
           for(j=0; j<BSXM1; ++j) {
              xtemplate[i+8][j]=xtemp_[i][j+1];
           }
        }
        for(i=1; i<9; ++i) {
           xtemplate[i+24][0] = 0.f;
           for(j=0; j<BSXM1; ++j) {
              xtemplate[i+24][j+1]=xtemp_[i][j];
           }
        }
        
//  Add more bins if needed     
        
        if(fxbin < 8) {
           for(i=0; i<8; ++i) {
          xtemplate[i][BSXM2] = 0.f;
              xtemplate[i][BSXM1] = 0.f;
              for(j=0; j<BSXM2; ++j) {
                xtemplate[i][j]=xtemp_[i][j+2];
              }
           }
        }
        if(lxbin > 32) {
           for(i=1; i<9; ++i) {
          xtemplate[i+32][0] = 0.f;
              xtemplate[i+32][1] = 0.f;
              for(j=0; j<BSXM2; ++j) {
                xtemplate[i+32][j+2]=xtemp_[i][j];
              }
           }
        }
        
        return;
        
} // End xtemp
void SiStripTemplate::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 1441 of file SiStripTemplate.cc.

References BSXSIZE, i, j, and gen::k.

Referenced by SiStripTemplateSplit::StripTempSplit().

{       
    // Sum two 2-d templates to make the 3-d template
        if(i >= 0 && i < nxbins_ && j <= i) {
        for(int k=0; k<BSXSIZE; ++k) {
            xtemplate[k]=temp2dx_[i][k]+temp2dx_[j][k]; 
        }
    } else {
        for(int k=0; k<BSXSIZE; ++k) {
            xtemplate[k]=0.;    
        } 
    }
        
        return;
        
} // End xtemp3d
void SiStripTemplate::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 1362 of file SiStripTemplate.cc.

References BSXM1, BSXM3, BSXSIZE, diffTreeTool::diff, Exception, i, j, and gen::k.

Referenced by SiStripTemplateSplit::StripTempSplit().

{       
    // Retrieve already interpolated quantities
    
    // Local variables 
    int i, j, k;
        int ioff0, ioffp, ioffm;
    
    // Verify that input parameters are in valid range
    
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
        if(nxpix < 1 || nxpix >= BSXM3) {
        throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xtemp3d called with nxpix = " << nxpix << std::endl;
        }
#else
        assert(nxpix > 0 && nxpix < BSXM3);
#endif
        
    // Calculate the size of the shift in pixels needed to span the entire cluster
    
    float diff = fabsf(nxpix - clslenx_)/2. + 1.f;
        int nshift = (int)diff;
        if((diff - nshift) > 0.5f) {++nshift;}
    
    // Calculate the number of bins needed to specify each hit range
    
    nxbins_ = 9 + 16*nshift;
        
    // Create a 2-d working template with the correct size
    
        temp2dx_.resize(boost::extents[nxbins_][BSXSIZE]);
        
    //  The 9 central bins are copied from the interpolated private store
    
        ioff0 = 8*nshift;
        
        for(i=0; i<9; ++i) {
        for(j=0; j<BSXSIZE; ++j) {
            temp2dx_[i+ioff0][j]=xtemp_[i][j];
        }
        }
        
    // Add the +- shifted templates     
    
        for(k=1; k<=nshift; ++k) {
        ioffm=ioff0-k*8;
        for(i=0; i<8; ++i) {
            for(j=0; j<k; ++j) {
                temp2dx_[i+ioffm][BSXM1-j] = 0.f;
            }
            for(j=0; j<BSXSIZE-k; ++j) {
                temp2dx_[i+ioffm][j]=xtemp_[i][j+k];
            }
        }
        ioffp=ioff0+k*8;
        for(i=1; i<9; ++i) {
            for(j=0; j<k; ++j) {
                temp2dx_[i+ioffp][j] = 0.f;
            }
            for(j=0; j<BSXSIZE-k; ++j) {
                temp2dx_[i+ioffp][j+k]=xtemp_[i][j];
            }
        }
        }
    
    nxbins = nxbins_;                                   
        
        return;
        
} // End xtemp3d_int
float SiStripTemplate::xxratio ( ) [inline]

fractional distance in x between cotalpha templates

Definition at line 203 of file SiStripTemplate.h.

References xxratio_.

float SiStripTemplate::yratio ( ) [inline]

fractional distance in y between cotbeta templates

Definition at line 201 of file SiStripTemplate.h.

References yratio_.

float SiStripTemplate::ysize ( ) [inline]

strip y-size (microns)

Definition at line 323 of file SiStripTemplate.h.

References ysize_.

float SiStripTemplate::yxratio ( ) [inline]

fractional distance in y between cotalpha templates slices

Definition at line 202 of file SiStripTemplate.h.

References yxratio_.

float SiStripTemplate::zsize ( ) [inline]

strip z-size or thickness (microns)

Definition at line 324 of file SiStripTemplate.h.

References zsize_.


Member Data Documentation

float SiStripTemplate::abs_cotb_ [private]

absolute value of cot beta

Definition at line 337 of file SiStripTemplate.h.

float SiStripTemplate::chi2xavg_[4] [private]

average x chi^2 in 4 charge bins

Definition at line 377 of file SiStripTemplate.h.

Referenced by chi2xavg().

float SiStripTemplate::chi2xavgc2m_[4] [private]

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

Definition at line 379 of file SiStripTemplate.h.

Referenced by chi2xavgc2m().

average x chi^2 for 1 strip clusters

Definition at line 385 of file SiStripTemplate.h.

Referenced by chi2xavgone().

float SiStripTemplate::chi2xmin_[4] [private]

minimum of x chi^2 in 4 charge bins

Definition at line 378 of file SiStripTemplate.h.

Referenced by chi2xmin().

float SiStripTemplate::chi2xminc2m_[4] [private]

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

Definition at line 380 of file SiStripTemplate.h.

Referenced by chi2xminc2m().

minimum of x chi^2 for 1 strip clusters

Definition at line 386 of file SiStripTemplate.h.

Referenced by chi2xminone().

float SiStripTemplate::clslenx_ [private]

x-cluster length of smaller interpolated template in strips

Definition at line 355 of file SiStripTemplate.h.

Referenced by clslenx().

current cot alpha

Definition at line 335 of file SiStripTemplate.h.

Referenced by SiStripTemplate().

current cot beta

Definition at line 336 of file SiStripTemplate.h.

Referenced by SiStripTemplate().

float SiStripTemplate::dxone_ [private]

mean offset/correction for one strip x-clusters

Definition at line 350 of file SiStripTemplate.h.

Referenced by dxone().

float SiStripTemplate::dxtwo_ [private]

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

Definition at line 352 of file SiStripTemplate.h.

current id

Definition at line 333 of file SiStripTemplate.h.

Referenced by SiStripTemplate().

current index

Definition at line 334 of file SiStripTemplate.h.

Referenced by SiStripTemplate().

float SiStripTemplate::kappavav2_ [private]

kappa parameter for 2-cluster Vavilov distribution

Definition at line 393 of file SiStripTemplate.h.

float SiStripTemplate::kappavav_ [private]

kappa parameter for Vavilov distribution

Definition at line 390 of file SiStripTemplate.h.

Referenced by kappavav().

float SiStripTemplate::lorxwidth_ [private]

Lorentz x-width.

Definition at line 394 of file SiStripTemplate.h.

Referenced by lorxwidth().

float SiStripTemplate::mpvvav2_ [private]

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

Definition at line 391 of file SiStripTemplate.h.

float SiStripTemplate::mpvvav_ [private]

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

Definition at line 388 of file SiStripTemplate.h.

Referenced by mpvvav().

float SiStripTemplate::nxbins_ [private]

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

Definition at line 399 of file SiStripTemplate.h.

float SiStripTemplate::pixmax_ [private]

maximum strip charge

Definition at line 344 of file SiStripTemplate.h.

float SiStripTemplate::qavg_ [private]

average cluster charge for this set of track angles

Definition at line 343 of file SiStripTemplate.h.

Referenced by qavg().

float SiStripTemplate::qavg_avg_ [private]

average of cluster charge less than qavg

Definition at line 398 of file SiStripTemplate.h.

float SiStripTemplate::qmin2_ [private]

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

Definition at line 387 of file SiStripTemplate.h.

Referenced by qmin().

float SiStripTemplate::qmin_ [private]

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

Definition at line 354 of file SiStripTemplate.h.

Referenced by qmin().

float SiStripTemplate::qscale_ [private]

charge scaling factor

Definition at line 345 of file SiStripTemplate.h.

Referenced by qscale().

float SiStripTemplate::s50_ [private]

1/2 of the strip threshold signal in adc units

Definition at line 346 of file SiStripTemplate.h.

Referenced by s50().

float SiStripTemplate::sigmavav2_ [private]

"sigma" scale fctor for 2-cluster Vavilov distribution

Definition at line 392 of file SiStripTemplate.h.

float SiStripTemplate::sigmavav_ [private]

"sigma" scale fctor for Vavilov distribution

Definition at line 389 of file SiStripTemplate.h.

Referenced by sigmavav().

bool SiStripTemplate::success_ [private]

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

Definition at line 338 of file SiStripTemplate.h.

float SiStripTemplate::sxmax_ [private]

average strip signal for x-projection of cluster

Definition at line 347 of file SiStripTemplate.h.

Referenced by sxmax().

float SiStripTemplate::sxone_ [private]

rms for one strip x-clusters

Definition at line 351 of file SiStripTemplate.h.

Referenced by sxone().

float SiStripTemplate::sxparmax_ [private]

maximum strip signal for parameterization of x uncertainties

Definition at line 348 of file SiStripTemplate.h.

float SiStripTemplate::sxtwo_ [private]

rms for one double-strip x-clusters

Definition at line 353 of file SiStripTemplate.h.

float SiStripTemplate::syparmax_ [private]

maximum strip signal for parameterization of y-slice x uncertainties

Definition at line 349 of file SiStripTemplate.h.

boost::multi_array<float,2> SiStripTemplate::temp2dx_ [private]

2d-primitive for spltting 3-d template

Definition at line 400 of file SiStripTemplate.h.

Definition at line 405 of file SiStripTemplate.h.

float SiStripTemplate::xavg_[4] [private]

average x-bias of reconstruction binned in 4 charge bins

Definition at line 365 of file SiStripTemplate.h.

Referenced by xavg().

float SiStripTemplate::xavgbcn_[4] [private]

barycenter: average x-bias of reconstruction binned in 4 charge bins

Definition at line 381 of file SiStripTemplate.h.

Referenced by xavgbcn().

float SiStripTemplate::xavgc2m_[4] [private]

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

Definition at line 373 of file SiStripTemplate.h.

Referenced by xavgc2m().

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

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

Definition at line 372 of file SiStripTemplate.h.

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

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

Definition at line 371 of file SiStripTemplate.h.

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

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

Definition at line 370 of file SiStripTemplate.h.

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

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

Definition at line 369 of file SiStripTemplate.h.

float SiStripTemplate::xgsig_[4] [private]

sigma from Gaussian fit binned in 4 charge bins

Definition at line 368 of file SiStripTemplate.h.

Referenced by xgsig().

float SiStripTemplate::xgsigbcn_[4] [private]

barycenter: average x-rms of reconstruction binned in 4 charge bins

Definition at line 384 of file SiStripTemplate.h.

Referenced by xgsigbcn().

float SiStripTemplate::xgsigc2m_[4] [private]

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

Definition at line 376 of file SiStripTemplate.h.

Referenced by xgsigc2m().

float SiStripTemplate::xgx0_[4] [private]

average x0 from Gaussian fit binned in 4 charge bins

Definition at line 367 of file SiStripTemplate.h.

Referenced by xgx0().

float SiStripTemplate::xgx0bcn_[4] [private]

barycenter: average x-bias of reconstruction binned in 4 charge bins

Definition at line 383 of file SiStripTemplate.h.

Referenced by xgx0bcn().

float SiStripTemplate::xgx0c2m_[4] [private]

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

Definition at line 375 of file SiStripTemplate.h.

Referenced by xgx0c2m().

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

projected x-strip uncertainty parameterization for central cotalpha

Definition at line 361 of file SiStripTemplate.h.

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

projected x-strip uncertainty parameterization for larger cotalpha

Definition at line 363 of file SiStripTemplate.h.

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

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

Definition at line 357 of file SiStripTemplate.h.

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

projected x-strip uncertainty parameterization for smaller cotalpha

Definition at line 362 of file SiStripTemplate.h.

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

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

Definition at line 356 of file SiStripTemplate.h.

float SiStripTemplate::xrms_[4] [private]

average x-rms of reconstruction binned in 4 charge bins

Definition at line 366 of file SiStripTemplate.h.

Referenced by xrms().

float SiStripTemplate::xrmsbcn_[4] [private]

barycenter: average x-rms of reconstruction binned in 4 charge bins

Definition at line 382 of file SiStripTemplate.h.

Referenced by xrmsbcn().

float SiStripTemplate::xrmsc2m_[4] [private]

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

Definition at line 374 of file SiStripTemplate.h.

Referenced by xrmsc2m().

float SiStripTemplate::xsize_ [private]

Pixel x-size.

Definition at line 395 of file SiStripTemplate.h.

Referenced by xsize().

float SiStripTemplate::xtemp_[9][BSXSIZE] [private]

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

Definition at line 364 of file SiStripTemplate.h.

float SiStripTemplate::xxratio_ [private]

fractional distance in x between cotalpha templates

Definition at line 360 of file SiStripTemplate.h.

Referenced by xxratio().

float SiStripTemplate::yratio_ [private]

fractional distance in y between y-slices of cotbeta templates

Definition at line 358 of file SiStripTemplate.h.

Referenced by yratio().

float SiStripTemplate::ysize_ [private]

Pixel y-size.

Definition at line 396 of file SiStripTemplate.h.

Referenced by ysize().

float SiStripTemplate::yxratio_ [private]

fractional distance in y between x-slices of cotalpha templates

Definition at line 359 of file SiStripTemplate.h.

Referenced by yxratio().

float SiStripTemplate::zsize_ [private]

Pixel z-size (thickness)

Definition at line 397 of file SiStripTemplate.h.

Referenced by zsize().