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 
16 // Build the template storage structure from several pieces
17 
18 #ifndef SiPixelGenError_h
19 #define SiPixelGenError_h 1
20 
21 
22 #include<vector>
23 #include<cassert>
24 #include "boost/multi_array.hpp"
25 
26 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
29 #endif
30 
32  int runnum;
33  float cotalpha;
34  float cotbeta;
35  float qavg;
36  float pixmax;
37  float dyone;
38  float syone;
39  float dxone;
40  float sxone;
41  float dytwo;
42  float sytwo;
43  float dxtwo;
44  float sxtwo;
45  float qmin;
46  float qmin2;
47  float yavggen[4];
48  float yrmsgen[4];
49  float xavggen[4];
50  float xrmsgen[4];
51 } ;
52 
53 
54 
55 
56 
58  int ID;
59  int NTy;
60  int NTyx;
61  int NTxx;
62  int Dtype;
63  float qscale;
64  float lorywidth;
65  float lorxwidth;
66  float lorybias;
67  float lorxbias;
68  float Vbias;
69  float temperature;
70  float fluence;
71  float s50;
72  float ss50;
73  char title[80];
75  float Bfield;
76  float fbin[3];
77  float xsize;
78  float ysize;
79  float zsize;
80 } ;
81 
82 
83 
86 #ifndef SI_PIXEL_TEMPLATE_USE_BOOST
87  float cotbetaY[60];
88  float cotbetaX[5];
89  float cotalphaX[29];
91  SiPixelGenErrorEntry entx[5][29];
92 #else
93  float* cotbetaY;
94  float* cotbetaX;
95  float* cotalphaX;
96  boost::multi_array<SiPixelGenErrorEntry,1> enty;
97  boost::multi_array<SiPixelGenErrorEntry,2> entx;
98 #endif
99 } ;
100 
101 
102 // ******************************************************************************************
116 // ******************************************************************************************
118 public:
119  SiPixelGenError(const std::vector< SiPixelGenErrorStore > & thePixelTemp) : thePixelTemp_(thePixelTemp) { id_current_ = -1; index_id_ = -1;}
120 
121 // Load the private store with info from the file with the index (int) filenum from directory dir:
122 // ${dir}generror_summary_zp${filenum}.out
123  static bool pushfile(int filenum, std::vector< SiPixelGenErrorStore > & pixelTemp , std::string dir = "");
124 
125 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
126  static bool pushfile(const SiPixelGenErrorDBObject& dbobject, std::vector< SiPixelGenErrorStore > & pixelTemp); // load the private store with info from db
127 #endif
128 
129  // initialize the binary search information;
130  static void postInit(std::vector< SiPixelGenErrorStore > & thePixelTemp_);
131 
132 
133  // 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.
134  int qbin(int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, bool irradiationCorrections,
135  int& pixmx, float& sigmay, float& deltay, float& sigmax, float& deltax,
136  float& sy1, float& dy1, float& sy2, float& dy2, float& sx1, float& dx1, float& sx2, float& dx2);
137 
138 // Overload to provide backward compatibility
139 
140  int qbin(int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, float& pixmx, float& sigmay, float& deltay, float& sigmax, float& deltax,
141  float& sy1, float& dy1, float& sy2, float& dy2, float& sx1, float& dx1, float& sx2, float& dx2);
142  // Overloaded method to provide only the LA parameters
143  int qbin(int id);
144 
145  float lorywidth() {return lorywidth_;}
146  float lorxwidth() {return lorxwidth_;}
147  float lorybias() {return lorybias_;}
148  float lorxbias() {return lorxbias_;}
149 
150  float fbin(int i) {
151 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
152  if(i < 0 || i > 2) {throw cms::Exception("DataCorrupt") << "SiPixelTemplate::chi2xminc2m called with illegal index = " << i << std::endl;}
153 #else
154  assert(i>=0 && i<3);
155 #endif
156  return fbin_[i];}
157  float xsize() {return xsize_;}
158  float ysize() {return ysize_;}
159  float zsize() {return zsize_;}
160 
161 private:
162 
163  // Keep current template interpolaion parameters
164 
166  int index_id_;
167 
168 
169  // Keep results of last interpolation to return through member functions
170 
171  float lorxwidth_;
172  float lorywidth_;
173  float lorxbias_;
174  float lorybias_;
175  float fbin_[3];
176  float xsize_;
177  float ysize_;
178  float zsize_;
179 
180 
181  // The actual template store is a std::vector container
182 
183  const std::vector< SiPixelGenErrorStore > & thePixelTemp_;
184 } ;
185 
186 
187 #endif
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
const std::vector< SiPixelGenErrorStore > & thePixelTemp_
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)
dbl *** dir
Definition: mlp_gen.cc:35
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