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) : thePixelTemp_(thePixelTemp) {
116  id_current_ = -1;
117  index_id_ = -1;
118  }
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  // load the private store with info from db
126  static bool pushfile(const SiPixelGenErrorDBObject& dbobject, std::vector<SiPixelGenErrorStore>& pixelTemp);
127 #endif
128 
129  // initialize the binary search information;
130  static void postInit(std::vector<SiPixelGenErrorStore>& thePixelTemp_);
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,
134  float cotalpha,
135  float cotbeta,
136  float locBz,
137  float locBx,
138  float qclus,
139  bool irradiationCorrections,
140  int& pixmx,
141  float& sigmay,
142  float& deltay,
143  float& sigmax,
144  float& deltax,
145  float& sy1,
146  float& dy1,
147  float& sy2,
148  float& dy2,
149  float& sx1,
150  float& dx1,
151  float& sx2,
152  float& dx2);
153 
154  // Overload to provide backward compatibility
155 
156  int qbin(int id,
157  float cotalpha,
158  float cotbeta,
159  float locBz,
160  float locBx,
161  float qclus,
162  float& pixmx,
163  float& sigmay,
164  float& deltay,
165  float& sigmax,
166  float& deltax,
167  float& sy1,
168  float& dy1,
169  float& sy2,
170  float& dy2,
171  float& sx1,
172  float& dx1,
173  float& sx2,
174  float& dx2);
175  // Overloaded method to provide only the LA parameters
176  int qbin(int id);
177 
178  float lorywidth() { return lorywidth_; }
179  float lorxwidth() { return lorxwidth_; }
180  float lorybias() { return lorybias_; }
181  float lorxbias() { return lorxbias_; }
182 
183  float fbin(int i) {
184 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
185  if (i < 0 || i > 2) {
186  throw cms::Exception("DataCorrupt")
187  << "SiPixelTemplate::chi2xminc2m called with illegal index = " << i << std::endl;
188  }
189 #else
190  assert(i >= 0 && i < 3);
191 #endif
192  return fbin_[i];
193  }
194  float xsize() { return xsize_; }
195  float ysize() { return ysize_; }
196  float zsize() { return zsize_; }
197 
198 private:
199  // Keep current template interpolaion parameters
200 
202  int index_id_;
203 
204  // Keep results of last interpolation to return through member functions
205 
206  float lorxwidth_;
207  float lorywidth_;
208  float lorxbias_;
209  float lorybias_;
210  float fbin_[3];
211  float xsize_;
212  float ysize_;
213  float zsize_;
214 
215  // The actual template store is a std::vector container
216 
217  const std::vector<SiPixelGenErrorStore>& thePixelTemp_;
218 };
219 
220 #endif
SiPixelGenError::zsize_
float zsize_
Pixel z-size (thickness)
Definition: SiPixelGenError.h:213
SiPixelGenError::lorxbias
float lorxbias()
signed lorentz x-bias (microns)
Definition: SiPixelGenError.h:181
SiPixelTemplateDefs.h
SiPixelGenErrorStore::cotbetaX
float cotbetaX[60]
Definition: SiPixelGenError.h:82
mps_fire.i
i
Definition: mps_fire.py:355
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:195
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:179
SiPixelGenError::fbin
float fbin(int i)
Return lower bound of Qbin definition.
Definition: SiPixelGenError.h:183
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:180
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:209
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:208
SiPixelGenError::xsize
float xsize()
pixel x-size (microns)
Definition: SiPixelGenError.h:194
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
SiPixelGenErrorStore::entx
SiPixelGenErrorEntry entx[60][60]
Definition: SiPixelGenError.h:87
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:202
SiPixelGenErrorStore::enty
SiPixelGenErrorEntry enty[60]
60 x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 60 slice...
Definition: SiPixelGenError.h:85
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:207
SiPixelGenErrorHeader::NTyx
int NTyx
number of Template y-slices of x entries
Definition: SiPixelGenError.h:56
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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[60]
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:206
SiPixelGenError::id_current_
int id_current_
current id
Definition: SiPixelGenError.h:201
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:196
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:210
SiPixelGenError::pushfile
static bool pushfile(int filenum, std::vector< SiPixelGenErrorStore > &pixelTemp, std::string dir="")
Definition: SiPixelGenError.cc:55
SiPixelGenErrorStore::cotalphaX
float cotalphaX[60]
60 y templates spanning cluster lengths from 0px to +18px
Definition: SiPixelGenError.h:83
SiPixelGenErrorHeader::Bfield
float Bfield
Bfield in Tesla.
Definition: SiPixelGenError.h:71
SiPixelGenErrorDBObject.h
SiPixelGenError::xsize_
float xsize_
Pixel x-size.
Definition: SiPixelGenError.h:211
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
SiPixelGenError::lorywidth
float lorywidth()
signed lorentz y-width (microns)
Definition: SiPixelGenError.h:178
Exception
Definition: hltDiff.cc:246
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:217
SiPixelGenError::ysize_
float ysize_
Pixel y-size.
Definition: SiPixelGenError.h:212
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