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 "SiPixelTemplateDefs.h"
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 
54  int ID;
55  int NTy;
56  int NTyx;
57  int NTxx;
58  int Dtype;
59  float qscale;
60  float lorywidth;
61  float lorxwidth;
62  float lorybias;
63  float lorxbias;
64  float Vbias;
65  float temperature;
66  float fluence;
67  float s50;
68  float ss50;
69  char title[80];
71  float Bfield;
72  float fbin[3];
73  float xsize;
74  float ysize;
75  float zsize;
76 };
77 
80 #ifndef SI_PIXEL_TEMPLATE_USE_BOOST
88 #else
89  float* cotbetaY;
90  float* cotbetaX;
91  float* cotalphaX;
92  boost::multi_array<SiPixelGenErrorEntry, 1> enty;
93  boost::multi_array<SiPixelGenErrorEntry, 2> entx;
95 #endif
96 };
97 
98 // ******************************************************************************************
112 // ******************************************************************************************
114 public:
115  SiPixelGenError(const std::vector<SiPixelGenErrorStore>& thePixelTemp)
116  : id_current_(-1),
117  index_id_(-1),
118  lorxwidth_(0),
119  lorywidth_(0),
120  lorxbias_(0),
121  lorybias_(0),
122  fbin_{0, 0, 0},
123  xsize_(0),
124  ysize_(0),
125  zsize_(0),
126  thePixelTemp_(thePixelTemp) {}
127 
128  // Load the private store with info from the file with the index (int) filenum from directory dir:
129  // ${dir}generror_summary_zp${filenum}.out
130  static bool pushfile(int filenum, std::vector<SiPixelGenErrorStore>& pixelTemp, std::string dir = "");
131 
132 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
133  // load the private store with info from db
134  static bool pushfile(const SiPixelGenErrorDBObject& dbobject, std::vector<SiPixelGenErrorStore>& pixelTemp);
135 #endif
136 
137  // initialize the binary search information;
138  static void postInit(std::vector<SiPixelGenErrorStore>& thePixelTemp_);
139 
140  // 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.
141  int qbin(int id,
142  float cotalpha,
143  float cotbeta,
144  float locBz,
145  float locBx,
146  float qclus,
147  bool irradiationCorrections,
148  int& pixmx,
149  float& sigmay,
150  float& deltay,
151  float& sigmax,
152  float& deltax,
153  float& sy1,
154  float& dy1,
155  float& sy2,
156  float& dy2,
157  float& sx1,
158  float& dx1,
159  float& sx2,
160  float& dx2);
161 
162  // Overload to provide backward compatibility
163 
164  int qbin(int id,
165  float cotalpha,
166  float cotbeta,
167  float locBz,
168  float locBx,
169  float qclus,
170  float& pixmx,
171  float& sigmay,
172  float& deltay,
173  float& sigmax,
174  float& deltax,
175  float& sy1,
176  float& dy1,
177  float& sy2,
178  float& dy2,
179  float& sx1,
180  float& dx1,
181  float& sx2,
182  float& dx2);
183  // Overloaded method to provide only the LA parameters
184  int qbin(int id);
185 
186  float lorywidth() { return lorywidth_; }
187  float lorxwidth() { return lorxwidth_; }
188  float lorybias() { return lorybias_; }
189  float lorxbias() { return lorxbias_; }
190 
191  float fbin(int i) {
192 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
193  if (i < 0 || i > 2) {
194  throw cms::Exception("DataCorrupt")
195  << "SiPixelTemplate::chi2xminc2m called with illegal index = " << i << std::endl;
196  }
197 #else
198  assert(i >= 0 && i < 3);
199 #endif
200  return fbin_[i];
201  }
202  float xsize() { return xsize_; }
203  float ysize() { return ysize_; }
204  float zsize() { return zsize_; }
205 
206 private:
207  // Keep current template interpolaion parameters
208 
210  int index_id_;
211 
212  // Keep results of last interpolation to return through member functions
213 
214  float lorxwidth_;
215  float lorywidth_;
216  float lorxbias_;
217  float lorybias_;
218  float fbin_[3];
219  float xsize_;
220  float ysize_;
221  float zsize_;
222 
223  // The actual template store is a std::vector container
224 
225  const std::vector<SiPixelGenErrorStore>& thePixelTemp_;
226 };
227 
228 #endif
SiPixelGenError::zsize_
float zsize_
Pixel z-size (thickness)
Definition: SiPixelGenError.h:221
SiPixelGenError::lorxbias
float lorxbias()
signed lorentz x-bias (microns)
Definition: SiPixelGenError.h:189
SiPixelTemplateDefs.h
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelGenErrorHeader::ID
int ID
< template header structure
Definition: SiPixelGenError.h:54
SiPixelGenErrorHeader::fluence
float fluence
radiation fluence in n_eq/cm^2
Definition: SiPixelGenError.h:66
SiPixelGenErrorHeader::ysize
float ysize
pixel size (for future use in upgraded geometry)
Definition: SiPixelGenError.h:74
SiPixelGenErrorHeader::title
char title[80]
template title
Definition: SiPixelGenError.h:69
SiPixelGenErrorEntry
Definition: SiPixelGenError.h:31
SiPixelGenError::ysize
float ysize()
pixel y-size (microns)
Definition: SiPixelGenError.h:203
SiPixelGenErrorHeader::NTy
int NTy
number of Template y entries
Definition: SiPixelGenError.h:55
SiPixelGenErrorHeader
Definition: SiPixelGenError.h:53
SiPixelGenError::SiPixelGenError
SiPixelGenError(const std::vector< SiPixelGenErrorStore > &thePixelTemp)
Constructor for cases in which template store already exists.
Definition: SiPixelGenError.h:115
SiPixelGenError::lorxwidth
float lorxwidth()
signed lorentz x-width (microns)
Definition: SiPixelGenError.h:187
SiPixelGenError::fbin
float fbin(int i)
Return lower bound of Qbin definition.
Definition: SiPixelGenError.h:191
SiPixelGenError::postInit
static void postInit(std::vector< SiPixelGenErrorStore > &thePixelTemp_)
Definition: SiPixelGenError.cc:473
SiPixelGenError::lorybias
float lorybias()
signed lorentz y-bias (microns)
Definition: SiPixelGenError.h:188
cms::cuda::assert
assert(be >=bs)
SiPixelGenError::qbin
int qbin(int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, bool irradiationCorrections, int &pixmx, float &sigmay, float &deltay, float &sigmax, float &deltax, float &sy1, float &dy1, float &sy2, float &dy2, float &sx1, float &dx1, float &sx2, float &dx2)
Definition: SiPixelGenError.cc:538
SiPixelGenErrorHeader::qscale
float qscale
Charge scaling to match cmssw and pixelav.
Definition: SiPixelGenError.h:59
SiPixelGenError::lorybias_
float lorybias_
Lorentz y-width (sign corrected for fpix frame)
Definition: SiPixelGenError.h:217
SiPixelGenErrorStore::cotbetaX
float cotbetaX[80]
Definition: SiPixelGenError.h:82
TEMP_ENTRY_SIZEX_B
#define TEMP_ENTRY_SIZEX_B
Definition: SiPixelTemplateDefs.h:44
SiPixelGenErrorEntry::yavggen
float yavggen[4]
generic algorithm: average y-bias of reconstruction binned in 4 charge bins
Definition: SiPixelGenError.h:47
SiPixelGenErrorHeader::lorywidth
float lorywidth
estimate of y-lorentz width for optimal resolution
Definition: SiPixelGenError.h:60
SiPixelGenError::lorxbias_
float lorxbias_
Lorentz x-width.
Definition: SiPixelGenError.h:216
SiPixelGenError::xsize
float xsize()
pixel x-size (microns)
Definition: SiPixelGenError.h:202
SiPixelGenErrorEntry::sytwo
float sytwo
rms for one double-pixel y-clusters
Definition: SiPixelGenError.h:42
SiPixelGenErrorEntry::runnum
int runnum
< Basic template entry corresponding to a single set of track angles
Definition: SiPixelGenError.h:32
TEMP_ENTRY_SIZEY
#define TEMP_ENTRY_SIZEY
Definition: SiPixelTemplateDefs.h:45
SiPixelGenErrorEntry::dxone
float dxone
mean offset/correction for one pixel x-clusters
Definition: SiPixelGenError.h:39
SiPixelGenErrorEntry::dxtwo
float dxtwo
mean offset/correction for one double-pixel x-clusters
Definition: SiPixelGenError.h:43
SiPixelGenError::index_id_
int index_id_
current index
Definition: SiPixelGenError.h:210
SiPixelGenErrorHeader::Dtype
int Dtype
detector type (0=BPix, 1=FPix)
Definition: SiPixelGenError.h:58
SiPixelGenErrorStore
Definition: SiPixelGenError.h:78
SiPixelGenErrorEntry::syone
float syone
rms for one pixel y-clusters
Definition: SiPixelGenError.h:38
SiPixelGenError::lorywidth_
float lorywidth_
Lorentz y-width (sign corrected for fpix frame)
Definition: SiPixelGenError.h:215
SiPixelGenErrorHeader::NTyx
int NTyx
number of Template y-slices of x entries
Definition: SiPixelGenError.h:56
SiPixelGenErrorStore::entx
SiPixelGenErrorEntry entx[80][80]
Definition: SiPixelGenError.h:87
SiPixelGenErrorHeader::lorxwidth
float lorxwidth
estimate of x-lorentz width for optimal resolution
Definition: SiPixelGenError.h:61
SiPixelGenErrorHeader::lorybias
float lorybias
estimate of y-lorentz bias
Definition: SiPixelGenError.h:62
SiPixelGenError
Definition: SiPixelGenError.h:113
SiPixelGenErrorEntry::sxtwo
float sxtwo
rms for one double-pixel x-clusters
Definition: SiPixelGenError.h:44
SiPixelGenErrorHeader::fbin
float fbin[3]
The QBin definitions in Q_clus/Q_avg.
Definition: SiPixelGenError.h:72
SiPixelGenErrorStore::cotbetaY
float cotbetaY[100]
Definition: SiPixelGenError.h:81
SiPixelGenErrorHeader::ss50
float ss50
1/2 of the single hit dcol threshold in electrons
Definition: SiPixelGenError.h:68
SiPixelGenErrorEntry::xavggen
float xavggen[4]
generic algorithm: average x-bias of reconstruction binned in 4 charge bins
Definition: SiPixelGenError.h:49
SiPixelGenErrorHeader::Vbias
float Vbias
detector bias potential in Volts
Definition: SiPixelGenError.h:64
SiPixelGenError::lorxwidth_
float lorxwidth_
Lorentz x-width.
Definition: SiPixelGenError.h:214
SiPixelGenError::id_current_
int id_current_
current id
Definition: SiPixelGenError.h:209
SiPixelGenErrorEntry::pixmax
float pixmax
maximum charge for individual pixels in cluster
Definition: SiPixelGenError.h:36
SiPixelGenError::zsize
float zsize()
pixel z-size or thickness (microns)
Definition: SiPixelGenError.h:204
SiPixelGenErrorStore::enty
SiPixelGenErrorEntry enty[100]
60 x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 60 slice...
Definition: SiPixelGenError.h:85
SiPixelGenErrorEntry::dyone
float dyone
mean offset/correction for one pixel y-clusters
Definition: SiPixelGenError.h:37
SiPixelGenErrorStore::head
SiPixelGenErrorHeader head
< template storage structure
Definition: SiPixelGenError.h:79
SiPixelGenErrorEntry::dytwo
float dytwo
mean offset/correction for one double-pixel y-clusters
Definition: SiPixelGenError.h:41
SiPixelGenError::fbin_
float fbin_[3]
The QBin definitions in Q_clus/Q_avg.
Definition: SiPixelGenError.h:218
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelGenError::pushfile
static bool pushfile(int filenum, std::vector< SiPixelGenErrorStore > &pixelTemp, std::string dir="")
Definition: SiPixelGenError.cc:55
SiPixelGenErrorHeader::Bfield
float Bfield
Bfield in Tesla.
Definition: SiPixelGenError.h:71
SiPixelGenErrorDBObject.h
SiPixelGenError::xsize_
float xsize_
Pixel x-size.
Definition: SiPixelGenError.h:219
SiPixelGenErrorHeader::xsize
float xsize
pixel size (for future use in upgraded geometry)
Definition: SiPixelGenError.h:73
SiPixelGenErrorHeader::s50
float s50
1/2 of the multihit dcol threshold in electrons
Definition: SiPixelGenError.h:67
TEMP_ENTRY_SIZEX_A
#define TEMP_ENTRY_SIZEX_A
Definition: SiPixelTemplateDefs.h:43
SiPixelGenErrorStore::cotalphaX
float cotalphaX[80]
60 y templates spanning cluster lengths from 0px to +18px
Definition: SiPixelGenError.h:83
SiPixelGenError::lorywidth
float lorywidth()
signed lorentz y-width (microns)
Definition: SiPixelGenError.h:186
Exception
Definition: hltDiff.cc:245
SiPixelGenErrorEntry::cotalpha
float cotalpha
cot(alpha) is proportional to cluster length in x and is basis of interpolation
Definition: SiPixelGenError.h:33
SiPixelGenErrorHeader::templ_version
int templ_version
Version number of the template to ensure code compatibility.
Definition: SiPixelGenError.h:70
SiPixelGenErrorEntry::xrmsgen
float xrmsgen[4]
generic algorithm: average x-rms of reconstruction binned in 4 charge bins
Definition: SiPixelGenError.h:50
SiPixelGenError::thePixelTemp_
const std::vector< SiPixelGenErrorStore > & thePixelTemp_
Definition: SiPixelGenError.h:225
SiPixelGenError::ysize_
float ysize_
Pixel y-size.
Definition: SiPixelGenError.h:220
Exception.h
SiPixelGenErrorHeader::NTxx
int NTxx
number of Template x-entries in each slice
Definition: SiPixelGenError.h:57
SiPixelGenErrorDBObject
Definition: SiPixelGenErrorDBObject.h:16
SiPixelGenErrorEntry::sxone
float sxone
rms for one pixel x-clusters
Definition: SiPixelGenError.h:40
SiPixelGenErrorHeader::zsize
float zsize
pixel size (for future use in upgraded geometry)
Definition: SiPixelGenError.h:75
SiPixelGenErrorHeader::lorxbias
float lorxbias
estimate of x-lorentz bias
Definition: SiPixelGenError.h:63
SiPixelGenErrorHeader::temperature
float temperature
detector temperature in deg K
Definition: SiPixelGenError.h:65
SiPixelGenErrorEntry::qavg
float qavg
average cluster charge for this set of track angles (now includes threshold effects)
Definition: SiPixelGenError.h:35
SiPixelGenErrorEntry::qmin2
float qmin2
Definition: SiPixelGenError.h:46
SiPixelGenErrorEntry::cotbeta
float cotbeta
cot(beta) is proportional to cluster length in y and is basis of interpolation
Definition: SiPixelGenError.h:34
SiPixelGenErrorEntry::yrmsgen
float yrmsgen[4]
generic algorithm: average y-rms of reconstruction binned in 4 charge bins
Definition: SiPixelGenError.h:48
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
SiPixelGenErrorEntry::qmin
float qmin
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
Definition: SiPixelGenError.h:45