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