CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelTemplate2D.h
Go to the documentation of this file.
1 //
2 // SiPixelTemplate2D.h (v1.03)
3 //
4 // Full 2-D templates for cluster splitting, simulated cluster reweighting, and improved cluster probability
5 //
6 // Created by Morris Swartz on 12/01/09.
7 // Copyright 2009 __TheJohnsHopkinsUniversity__. All rights reserved.
8 // V1.01 - fix qavg_ filling
9 // V1.02 - Add locBz to test if FPix use is out of range
10 // V1.03 - Fix edge checking on final template to increase template size and to properly truncate cluster
11 //
12 //
13 
14 // Build the template storage structure from several pieces
15 
16 #ifndef SiPixelTemplate2D_h
17 #define SiPixelTemplate2D_h 1
18 
20 
21 #include<vector>
22 #include<cassert>
23 #include "boost/multi_array.hpp"
24 
25 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
28 #endif
29 
31  int runnum;
32  float cotalpha;
33  float cotbeta;
34  float costrk[3];
35  float qavg;
36  float pixmax;
37  float sxymax;
38  int iymin;
39  int iymax;
40  int jxmin;
41  int jxmax;
42  float xypar[2][5];
43  float lanpar[2][5];
44  float xytemp[7][7][T2YSIZE][T2XSIZE];
45  float chi2avg[4];
46  float chi2min[4];
47  float chi2avgone;
48  float chi2minone;
49  float spare[20];
50 } ;
51 
52 
53 
54 
56  char title[80];
57  int ID;
59  float Bfield;
60  int NTy;
61  int NTyx;
62  int NTxx;
63  int Dtype;
64  float Vbias;
65  float temperature;
66  float fluence;
67  float qscale;
68  float s50;
69  float lorywidth;
70  float lorxwidth;
71  float xsize;
72  float ysize;
73  float zsize;
74 } ;
75 
76 
77 
80  boost::multi_array<SiPixelTemplateEntry2D,2> entry;
81 } ;
82 
83 
84 
85 
86 
87 // ******************************************************************************************
105 // ******************************************************************************************
107  public:
109  bool pushfile(int filenum); // load the private store with info from the
110  // file with the index (int) filenum
111 
112 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
113  bool pushfile(const SiPixelTemplateDBObject& dbobject); // load the private store with info from db
114 #endif
115 
116 
117 // Interpolate input alpha and beta angles to produce a working template for each individual hit.
118 
119  bool xytemp(int id, float cotalpha, float cotbeta, float locBz, float xhit, float yhit, std::vector<bool>& ydouble, std::vector<bool>& xdouble, float template2d[BXM2][BYM2]);
120 
121 // Overload to allow user to avoid the locBz information
122 
123  bool xytemp(int id, float cotalpha, float cotbeta, float xhit, float yhit, std::vector<bool>& ydouble, std::vector<bool>& xdouble, float template2d[BXM2][BYM2]);
124 
125 // Get pixel signal uncertainties
126 
127  void xysigma2(float qpixel, int index, float& xysig2);
128 
129 // Get the interpolated Landau distribution parameters
130 
131  void landau_par(float lanpar[2][5]);
132 
133  float qavg() {return qavg_;}
134  float pixmax() {return pixmax_;}
135  float qscale() {return qscale_;}
136  float s50() {return s50_;}
137  float sxymax() {return sxymax_;}
138  float xytemp(int j, int i) {
139 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
140  if(j < 0 || j > BXM3 || i < 0 || i > BYM3) {throw cms::Exception("DataCorrupt") << "SiPixelTemplate2D::xytemp called with illegal indices = " << j << "," << i << std::endl;}
141 #else
142  assert((j>=0 && j<BYM2) && (i>=0 && i<BYM2));
143 #endif
144  return xytemp_[j][i];}
145  float chi2avg(int i) {
146 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
147  if(i < 0 || i > 3) {throw cms::Exception("DataCorrupt") << "SiPixelTemplate2D::chi2yavg called with illegal index = " << i << std::endl;}
148 #else
149  assert(i>=0 && i<4);
150 #endif
151  return chi2avg_[i];}
152  float chi2min(int i) {
153 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
154  if(i < 0 || i > 3) {throw cms::Exception("DataCorrupt") << "SiPixelTemplate2D::chi2ymin called with illegal index = " << i << std::endl;}
155 #else
156  assert(i>=0 && i<4);
157 #endif
158  return chi2min_[i];}
159  float chi2avgone() {return chi2avgone_;}
160  float chi2minone() {return chi2minone_;}
161  float lorywidth() {return lorywidth_;}
162  float lorxwidth() {return lorxwidth_;}
163  float xsize() {return xsize_;}
164  float ysize() {return ysize_;}
165  float zsize() {return zsize_;}
166  int storesize() {return (int)thePixelTemp_.size();}
167 
168  private:
169 
170  // Keep current template interpolaion parameters
171 
173  int index_id_;
176  int Nyx_;
177  int Nxx_;
178  int Dtype_;
179  float cotbeta0_;
180  float cotbeta1_;
181  float deltacotb_;
182  float cotalpha0_;
183  float cotalpha1_;
184  float deltacota_;
185  int iy0_;
186  int iy1_;
187  float adcotb_;
188  int jx0_;
189  int jx1_;
190  float adcota_;
191  bool success_;
192 
193 
194  // Keep results of last interpolation to return through member functions
195 
196  float qavg_;
197  float pixmax_;
198  float qscale_;
199  float s50_;
200  float sxymax_;
201  float xytemp_[BXM2][BYM2];
202  float xypary0x0_[2][5];
203  float xypary1x0_[2][5];
204  float xypary0x1_[2][5];
205  float lanpar_[2][5];
206  float chi2avg_[4];
207  float chi2min_[4];
208  float chi2avgone_;
209  float chi2minone_;
210  float lorywidth_;
211  float lorxwidth_;
212  float xsize_;
213  float ysize_;
214  float zsize_;
215 
216  // The actual template store is a std::vector container
217 
218  std::vector< SiPixelTemplateStore2D > thePixelTemp_;
219 } ;
220 
221 
222 #endif
float pixmax
maximum charge for individual pixels in cluster
float chi2avg[4]
average chi^2 in 4 charge bins
float adcotb_
fractional pixel distance of cot(beta) from iy0_
float deltacota_
cot(alpha) bin size
float qscale
Charge scaling to match cmssw and pixelav.
int i
Definition: DBlmapReader.cc:9
float xsize()
pixel x-size (microns)
int jx1_
index of next-nearest cot(alpha) bin
float chi2avgone
average y chi^2 for 1 pixel clusters
float qavg
average cluster charge for this set of track angles
float Vbias
detector bias potential in Volts
float lorxwidth
estimate of x-lorentz width from single pixel offset
int runnum
&lt; Basic template entry corresponding to a single set of track angles
int jx0_
index of nearest cot(alpha) bin
float ysize
pixel size (for future use in upgraded geometry)
float deltacotb_
cot(beta) bin size
SiPixelTemplateHeader2D head
&lt; template storage structure
float qavg_
average cluster charge for this set of track angles
float cotalpha1_
maximum cot(alpha) covered
float xsize_
Pixel x-size.
int Dtype_
flags BPix (=0) or FPix (=1)
void xysigma2(float qpixel, int index, float &xysig2)
float xytemp(int j, int i)
current 2-d template
float sxymax
average pixel signal for use of the error parameterization
#define BXM3
float xypar[2][5]
pixel uncertainty parameterization
float chi2avgone_
average chi^2 for 1 pixel clusters
float chi2min_[4]
minimum of chi^2 in 4 charge bins
float chi2minone
minimum of y chi^2 for 1 pixel clusters
float xypary0x1_[2][5]
Polynomial error parameterization at ix1,iy0.
float sxymax_
average pixel signal for y-projection of cluster
int Nxx_
number of cot(alpha)-entries (rows) in template
int index_id_
current index
std::vector< SiPixelTemplateStore2D > thePixelTemp_
float s50()
1/2 of the pixel threshold signal in adc units
boost::multi_array< SiPixelTemplateEntry2D, 2 > entry
use 2d entry to store [47][5] barrel entries or [5][9] fpix entries
float xytemp[7][7][13][7]
templates for y-reconstruction (binned over 1 central pixel)
float cotbeta
cot(beta) is proportional to cluster length in y and is basis of interpolation
#define BXM2
int iymax
the maximum nonzero pixel yindex in template (saves time during interpolation)
float adcota_
fractional pixel distance of cot(alpha) from jx0_
float xytemp_[13+2][21+2]
templates for y-reconstruction (binned over 5 central pixels)
#define T2XSIZE
float chi2min(int i)
minimum chi^2 in 4 charge bins
int storesize()
return the size of the template store (the number of stored IDs
int iymin
the minimum nonzero pixel yindex in template (saves time during interpolation)
float chi2avgone()
//!&lt; average y chi^2 for 1 pixel clusters
int ID
template ID number
int NTxx
number of Template x-entries in each slice
float s50_
1/2 of the pixel threshold signal in adc units
float cotbeta0_
minimum cot(beta) covered
int jxmax
the maximum nonzero pixel xindex in template (saves time during interpolation)
float lanpar[2][5]
pixel landau distribution parameters
float xsize
pixel size (for future use in upgraded geometry)
int j
Definition: DBlmapReader.cc:9
float costrk[3]
direction cosines of tracks used to generate this entry
float chi2minone_
minimum of chi^2 for 1 pixel clusters
#define BYM2
int jxmin
the minimum nonzero pixel xindex in template (saves time during interpolation)
float chi2minone()
//!&lt; minimum of y chi^2 for 1 pixel clusters
float cotalpha0_
minimum cot(alpha) covered
#define BYM3
float cotalpha
cot(alpha) is proportional to cluster length in x and is basis of interpolation
float lorywidth()
signed lorentz y-width (microns)
char title[80]
&lt; template header structure
SiPixelTemplate2D()
Default constructor.
bool xytemp(int id, float cotalpha, float cotbeta, float locBz, float xhit, float yhit, std::vector< bool > &ydouble, std::vector< bool > &xdouble, float template2d[13+2][21+2])
int iy1_
index of next-nearest cot(beta) bin
float zsize
pixel size (for future use in upgraded geometry)
float zsize_
Pixel z-size (thickness)
int Nyx_
number of cot(beta)-entries (columns) in template
float lorywidth
estimate of y-lorentz width from single pixel offset
float lanpar_[2][5]
Interpolated Landau parameters.
float chi2avg_[4]
average chi^2 in 4 charge bins
float cota_current_
current cot alpha
float pixmax()
maximum pixel charge
float lorxwidth_
Lorentz x-width.
float chi2avg(int i)
average chi^2 in 4 charge bins
float lorxwidth()
signed lorentz x-width (microns)
int NTy
number of Template y entries (= 0 for 2-D templates)
float sxymax()
max pixel signal for pixel error calculation
float pixmax_
maximum pixel charge
float cotbeta1_
maximum cot(beta) covered
int Dtype
detector type (0=BPix, 1=FPix)
float ysize()
pixel y-size (microns)
float qscale()
charge scaling factor
float xypary1x0_[2][5]
Polynomial error parameterization at ix0,iy1.
float qavg()
average cluster charge for this set of track angles
float chi2min[4]
minimum of chi^2 in 4 charge bins
bool success_
true if cotalpha, cotbeta are inside of the acceptance (dynamically loaded)
float ysize_
Pixel y-size.
void landau_par(float lanpar[2][5])
Return the Landau probability parameters for this set of cot(alpha, cot(beta)
float xypary0x0_[2][5]
Polynomial error parameterization at ix0,iy0.
float cotb_current_
current cot beta
bool pushfile(int filenum)
int templ_version
Version number of the template to ensure code compatibility.
float zsize()
pixel z-size or thickness (microns)
float s50
1/2 of the readout threshold in ADC units
float temperature
detector temperature in deg K
float Bfield
Bfield in Tesla.
float lorywidth_
Lorentz y-width (sign corrected for fpix frame)
float qscale_
charge scaling factor
#define T2YSIZE
int iy0_
index of nearest cot(beta) bin
float fluence
radiation fluence in n_eq/cm^2
int NTyx
number of Template y-slices of x entries
int id_current_
current id