CMS 3D CMS Logo

SiPixelGenError.h
Go to the documentation of this file.
1 //
2 // SiPixelGenError.h (v2.20)
3 //
4 // Object to contain Lorentz drift and error information for the Generic Algorithm
5 //
6 // Created by Morris Swartz on 1/10/2014.
7 //
8 // Update for Phase 1 FPix, M.S. 1/15/17
9 // V2.01 - Allow subdetector ID=5 for FPix R2P2, Fix error message
10 // V2.10 - Update the variable size [SI_PIXEL_TEMPLATE_USE_BOOST] option so that it works with VI's enhancements
11 // V2.20 - Add directory path selection to the ascii pushfile method
12 // V2.21 - Move templateStore to the heap, fix variable name in pushfile()
13 // V2.30 - Fix interpolation of IrradiationBias corrections
14 
15 // Build the template storage structure from several pieces
16 
17 #ifndef SiPixelGenError_h
18 #define SiPixelGenError_h 1
19 
20 #include <vector>
21 #include <cassert>
22 #include "boost/multi_array.hpp"
23 
24 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
27 #endif
28 
30  int runnum;
31  float cotalpha;
32  float cotbeta;
33  float qavg;
34  float pixmax;
35  float dyone;
36  float syone;
37  float dxone;
38  float sxone;
39  float dytwo;
40  float sytwo;
41  float dxtwo;
42  float sxtwo;
43  float qmin;
44  float qmin2;
45  float yavggen[4];
46  float yrmsgen[4];
47  float xavggen[4];
48  float xrmsgen[4];
49 };
50 
52  int ID;
53  int NTy;
54  int NTyx;
55  int NTxx;
56  int Dtype;
57  float qscale;
58  float lorywidth;
59  float lorxwidth;
60  float lorybias;
61  float lorxbias;
62  float Vbias;
63  float temperature;
64  float fluence;
65  float s50;
66  float ss50;
67  char title[80];
69  float Bfield;
70  float fbin[3];
71  float xsize;
72  float ysize;
73  float zsize;
74 };
75 
78 #ifndef SI_PIXEL_TEMPLATE_USE_BOOST
79  float cotbetaY[60];
80  float cotbetaX[5];
81  float cotalphaX[29];
85  SiPixelGenErrorEntry entx[5][29];
86 #else
87  float* cotbetaY;
88  float* cotbetaX;
89  float* cotalphaX;
90  boost::multi_array<SiPixelGenErrorEntry, 1> enty;
91  boost::multi_array<SiPixelGenErrorEntry, 2> entx;
93 #endif
94 };
95 
96 // ******************************************************************************************
110 // ******************************************************************************************
112 public:
113  SiPixelGenError(const std::vector<SiPixelGenErrorStore>& thePixelTemp) : thePixelTemp_(thePixelTemp) {
114  id_current_ = -1;
115  index_id_ = -1;
116  }
117 
118  // Load the private store with info from the file with the index (int) filenum from directory dir:
119  // ${dir}generror_summary_zp${filenum}.out
120  static bool pushfile(int filenum, std::vector<SiPixelGenErrorStore>& pixelTemp, std::string dir = "");
121 
122 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
123  // load the private store with info from db
124  static bool pushfile(const SiPixelGenErrorDBObject& dbobject, std::vector<SiPixelGenErrorStore>& pixelTemp);
125 #endif
126 
127  // initialize the binary search information;
128  static void postInit(std::vector<SiPixelGenErrorStore>& thePixelTemp_);
129 
130  // Interpolate input beta angle to estimate the average charge. return qbin flag for input cluster charge, and estimate y/x errors and biases for the Generic Algorithm.
131  int qbin(int id,
132  float cotalpha,
133  float cotbeta,
134  float locBz,
135  float locBx,
136  float qclus,
137  bool irradiationCorrections,
138  int& pixmx,
139  float& sigmay,
140  float& deltay,
141  float& sigmax,
142  float& deltax,
143  float& sy1,
144  float& dy1,
145  float& sy2,
146  float& dy2,
147  float& sx1,
148  float& dx1,
149  float& sx2,
150  float& dx2);
151 
152  // Overload to provide backward compatibility
153 
154  int qbin(int id,
155  float cotalpha,
156  float cotbeta,
157  float locBz,
158  float locBx,
159  float qclus,
160  float& pixmx,
161  float& sigmay,
162  float& deltay,
163  float& sigmax,
164  float& deltax,
165  float& sy1,
166  float& dy1,
167  float& sy2,
168  float& dy2,
169  float& sx1,
170  float& dx1,
171  float& sx2,
172  float& dx2);
173  // Overloaded method to provide only the LA parameters
174  int qbin(int id);
175 
176  float lorywidth() { return lorywidth_; }
177  float lorxwidth() { return lorxwidth_; }
178  float lorybias() { return lorybias_; }
179  float lorxbias() { return lorxbias_; }
180 
181  float fbin(int i) {
182 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
183  if (i < 0 || i > 2) {
184  throw cms::Exception("DataCorrupt")
185  << "SiPixelTemplate::chi2xminc2m called with illegal index = " << i << std::endl;
186  }
187 #else
188  assert(i >= 0 && i < 3);
189 #endif
190  return fbin_[i];
191  }
192  float xsize() { return xsize_; }
193  float ysize() { return ysize_; }
194  float zsize() { return zsize_; }
195 
196 private:
197  // Keep current template interpolaion parameters
198 
200  int index_id_;
201 
202  // Keep results of last interpolation to return through member functions
203 
204  float lorxwidth_;
205  float lorywidth_;
206  float lorxbias_;
207  float lorybias_;
208  float fbin_[3];
209  float xsize_;
210  float ysize_;
211  float zsize_;
212 
213  // The actual template store is a std::vector container
214 
215  const std::vector<SiPixelGenErrorStore>& thePixelTemp_;
216 };
217 
218 #endif
const std::vector< SiPixelGenErrorStore > & thePixelTemp_
float xsize_
Pixel x-size.
float qavg
average cluster charge for this set of track angles (now includes threshold effects) ...
float ss50
1/2 of the single hit dcol threshold in electrons
float qmin
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float lorxbias_
Lorentz x-width.
float Bfield
Bfield in Tesla.
float lorywidth_
Lorentz y-width (sign corrected for fpix frame)
int runnum
< Basic template entry corresponding to a single set of track angles
float yrmsgen[4]
generic algorithm: average y-rms of reconstruction binned in 4 charge bins
float dxone
mean offset/correction for one pixel x-clusters
float Vbias
detector bias potential in Volts
float xrmsgen[4]
generic algorithm: average x-rms of reconstruction binned in 4 charge bins
int NTxx
number of Template x-entries in each slice
float syone
rms for one pixel y-clusters
float ysize_
Pixel y-size.
float zsize
pixel size (for future use in upgraded geometry)
float s50
1/2 of the multihit dcol threshold in electrons
float cotalpha
cot(alpha) is proportional to cluster length in x and is basis of interpolation
float ysize()
pixel y-size (microns)
float lorxbias
estimate of x-lorentz bias
float fbin(int i)
Return lower bound of Qbin definition.
float temperature
detector temperature in deg K
float xsize
pixel size (for future use in upgraded geometry)
int templ_version
Version number of the template to ensure code compatibility.
float cotbeta
cot(beta) is proportional to cluster length in y and is basis of interpolation
int ID
< template header structure
float sxone
rms for one pixel x-clusters
float fluence
radiation fluence in n_eq/cm^2
float dytwo
mean offset/correction for one double-pixel y-clusters
float zsize_
Pixel z-size (thickness)
float lorxwidth()
signed lorentz x-width (microns)
float xsize()
pixel x-size (microns)
int NTy
number of Template y entries
float qscale
Charge scaling to match cmssw and pixelav.
float dxtwo
mean offset/correction for one double-pixel x-clusters
SiPixelGenErrorHeader head
< template storage structure
float lorxwidth_
Lorentz x-width.
float ysize
pixel size (for future use in upgraded geometry)
float sytwo
rms for one double-pixel y-clusters
float lorywidth
estimate of y-lorentz width for optimal resolution
float yavggen[4]
generic algorithm: average y-bias of reconstruction binned in 4 charge bins
float dyone
mean offset/correction for one pixel y-clusters
int id_current_
current id
float lorywidth()
signed lorentz y-width (microns)
SiPixelGenError(const std::vector< SiPixelGenErrorStore > &thePixelTemp)
Constructor for cases in which template store already exists.
float lorxbias()
signed lorentz x-bias (microns)
float zsize()
pixel z-size or thickness (microns)
int Dtype
detector type (0=BPix, 1=FPix)
int NTyx
number of Template y-slices of x entries
float lorybias_
Lorentz y-width (sign corrected for fpix frame)
float xavggen[4]
generic algorithm: average x-bias of reconstruction binned in 4 charge bins
float pixmax
maximum charge for individual pixels in cluster
float sxtwo
rms for one double-pixel x-clusters
int index_id_
current index
float lorybias()
signed lorentz y-bias (microns)
float lorybias
estimate of y-lorentz bias
float lorxwidth
estimate of x-lorentz width for optimal resolution