CMS 3D CMS Logo

SiPixelTemplate.h
Go to the documentation of this file.
1 //
2 // SiPixelTemplate.h (v10.20)
3 //
4 // Add goodness-of-fit info and spare entries to templates, version number in template header, more error checking
5 // Add correction for (Q_F-Q_L)/(Q_F+Q_L) bias
6 // Add cot(beta) reflection to reduce y-entries and more sophisticated x-interpolation
7 // Fix small index searching bug in interpolate method
8 // Change interpolation indexing to avoid complier complaining about possible un-initialized variables
9 // Replace containers with static arrays in calls to ysigma2 and xsigma2
10 // Add external threshold to calls to ysigma2 and xsigma2, fix parameter signal max for xsigma2
11 // Return to 5 pixel spanning but adjust boundaries to use only when needed
12 // Implement improved (faster) chi2min search that depends on pixel types
13 // Fill template arrays in single calls to this object
14 // Add qmin to the template
15 // Add qscale to match charge scales
16 // Small improvement to x-chisquare interpolation
17 // Enlarge SiPixelTemplateStore to accommodate larger templates and increased alpha acceptance (reduce PT threshold to ~200 MeV)
18 // Store x and y cluster sizes in fractional pixels to facilitate cluster splitting
19 // Keep interpolated central 9 template bins in private storage and expand/shift in the getter functions (faster for speed=2/3) and easier to build 3d templates
20 // Store error and bias information for the simple chi^2 min position analysis (no interpolation or Q_{FB} corrections) to use in cluster splitting
21 // To save time, the gaussian centers and sigma are not interpolated right now (they aren't currently used). They can be restored by un-commenting lines in the interpolate method.
22 // Add a new method to calculate qbin for input cotbeta and cluster charge. To be used for error estimation of merged clusters in PixelCPEGeneric.
23 // Add bias info for Barrel and FPix separately in the header
24 // Improve the charge estimation for larger cot(alpha) tracks
25 // Change interpolate method to return false boolean if track angles are outside of range
26 // Add template info and method for truncation information
27 // Change to allow template sizes to be changed at compile time
28 // Fix bug in track angle checking
29 // Accommodate Dave's new DB pushfile which overloads the old method (file input)
30 // Add CPEGeneric error information and expand qbin method to access useful info for PixelCPEGeneric
31 // Fix large cot(alpha) bug in qmin interpolation
32 // Add second qmin to allow a qbin=5 state
33 // Use interpolated chi^2 info for one-pixel clusters
34 // Separate BPix and FPix charge scales and thresholds
35 // Fix DB pushfile version number checking bug.
36 // Remove assert from qbin method
37 // Replace asserts with exceptions in CMSSW
38 // Change calling sequence to interpolate method to handle cot(beta)<0 for FPix cosmics
39 // Add getter for pixelav Lorentz width estimates to qbin method
40 // Add check on template size to interpolate and qbin methods
41 // Add qbin population information, charge distribution information
42 //
43 // V7.00 - Decouple BPix and FPix information into separate templates
44 // Add methods to facilitate improved cluster splitting
45 // Fix small charge scaling bug (affects FPix only)
46 // Change y-slice used for the x-template to be closer to the actual cotalpha-cotbeta point
47 // (there is some weak breakdown of x-y factorization in the FPix after irradiation)
48 //
49 // V8.00 - Add method to calculate a simple 2D template
50 // Reorganize the interpolate method to extract header info only once per ID
51 // V8.01 - Improve simple template normalization
52 // V8.05 - Change qbin normalization to work better after irradiation
53 // V8.10 - Add Vavilov distribution interpolation
54 // V8.11 - Renormalize the x-templates for Guofan's cluster size calculation
55 // V8.12 - Technical fix to qavg issue.
56 // V8.13 - Fix qbin and fastsim interpolaters to avoid changing class variables
57 // V8.20 - Add methods to identify the central pixels in the x- and y-templates (to help align templates with clusters in radiation damaged detectors)
58 // Rename class variables from pxxxx (private xxxx) to xxxx_ to follow standard convention.
59 // Add compiler option to store the template entries in BOOST multiarrays of structs instead of simple c arrays
60 // (allows dynamic resizing template storage and has bounds checking but costs ~10% in execution time).
61 // V8.21 - Add new qbin method to use in cluster splitting
62 // V8.23 - Replace chi-min position errors with merged cluster chi2 probability info
63 // V8.25 - Incorporate VI's speed changes into the current version
64 // V8.26 - Modify the Vavilov lookups to work better with the FPix (offset y-templates)
65 // V8.30 - Change the splitting template generation and access to improve speed and eliminate triple index boost::multiarray
66 // V8.31 - Add correction factor: measured/true charge
67 // V8.31 - Fix version number bug in db object I/O (pushfile)
68 // V8.32 - Check for illegal qmin during loading
69 // V8.33 - Fix small type conversion warnings
70 // V8.40 - Incorporate V.I. optimizations
71 // V9.00 - Expand header to include multi and single dcol thresholds, LA biases, and (variable) Qbin definitions
72 // V9.01 - Protect against negative error squared
73 // V10.00 - Update to work with Phase 1 FPix. Fix some code problems introduced by other maintainers.
74 // V10.01 - Fix initialization style as suggested by S. Krutelyov
75 // V10.10 - Add class variables and methods to correctly calculate the probabilities of single pixel clusters
76 // V10.11 - Allow subdetector ID=5 for FPix R2P2 [allows better internal labeling of templates]
77 // V10.12 - Enforce minimum signal size in pixel charge uncertainty calculation
78 // V10.13 - Update the variable size [SI_PIXEL_TEMPLATE_USE_BOOST] option so that it works with VI's enhancements
79 // V10.20 - Add directory path selection to the ascii pushfile method
80 // V10.21 - Address runtime issues in pushfile() for gcc 7.X due to using tempfile as char string + misc. cleanup [Petar]
81 // V10.22 - Move templateStore to the heap, fix variable name in pushfile() [Petar]
82 
83 // Created by Morris Swartz on 10/27/06.
84 //
85 //
86 
87 // Build the template storage structure from several pieces
88 
89 #ifndef SiPixelTemplate_h
90 #define SiPixelTemplate_h 1
91 
92 #include "SiPixelTemplateDefs.h"
93 
94 #include <vector>
95 #include <cassert>
96 #include "boost/multi_array.hpp"
97 
98 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
101 #endif
102 
104  int runnum;
105  float alpha;
106  float cotalpha;
107  float beta;
108  float cotbeta;
109  float costrk[3];
110  float qavg;
111  float pixmax;
112  float symax;
113  float dyone;
114  float syone;
115  float sxmax;
116  float dxone;
117  float sxone;
118  float dytwo;
119  float sytwo;
120  float dxtwo;
121  float sxtwo;
122  float qmin;
123  float qmin2;
124  float yavggen[4];
125  float yrmsgen[4];
126  float xavggen[4];
127  float xrmsgen[4];
128 
129  float clsleny;
130  float clslenx;
131  float mpvvav;
132  float sigmavav;
133  float kappavav;
134  float mpvvav2;
135  float sigmavav2;
136  float kappavav2;
137  float ypar[2][5];
138  float ytemp[9][TYSIZE];
139  float xpar[2][5];
140  float xtemp[9][TXSIZE];
141  float yavg[4];
142  float yrms[4];
143  float ygx0[4];
144  float ygsig[4];
145  float yflpar[4][6];
146  float xavg[4];
147  float xrms[4];
148  float xgx0[4];
149  float xgsig[4];
150  float xflpar[4][6];
151  float chi2yavg[4];
152  float chi2ymin[4];
153  float chi2xavg[4];
154  float chi2xmin[4];
155  float chi2yavgone;
156  float chi2yminone;
157  float chi2xavgone;
158  float chi2xminone;
159  float yavgc2m[4];
160  float yrmsc2m[4];
161  float chi2yavgc2m[4];
162  float chi2yminc2m[4];
163  float xavgc2m[4];
164  float xrmsc2m[4];
165  float chi2xavgc2m[4];
166  float chi2xminc2m[4];
167  float ygx0gen[4];
168  float ygsiggen[4];
169  float xgx0gen[4];
170  float xgsiggen[4];
171  float qbfrac[3];
172  float fracyone;
173  float fracxone;
174  float fracytwo;
175  float fracxtwo;
176  float qavg_avg;
178  float spare[1];
179 };
180 
182  int ID;
183  int NTy;
184  int NTyx;
185  int NTxx;
186  int Dtype;
187  float qscale;
188  float lorywidth;
189  float lorxwidth;
190  float lorybias;
191  float lorxbias;
192  float Vbias;
193  float temperature;
194  float fluence;
195  float s50;
196  float ss50;
197  char title[80];
199  float Bfield;
200  float fbin[3];
201  float xsize;
202  float ysize;
203  float zsize;
204 };
205 
208 #ifndef SI_PIXEL_TEMPLATE_USE_BOOST
209  float cotbetaY[60];
210  float cotbetaX[5];
211  float cotalphaX[29];
215  SiPixelTemplateEntry entx[5][29];
216  void destroy(){};
217 #else
218  float* cotbetaY = nullptr;
219  float* cotbetaX = nullptr;
220  float* cotalphaX = nullptr;
221  boost::multi_array<SiPixelTemplateEntry, 1> enty;
222  boost::multi_array<SiPixelTemplateEntry, 2> entx;
224  void destroy() { // deletes arrays created by pushfile method of SiPixelTemplate
225  if (cotbetaY != nullptr)
226  delete[] cotbetaY;
227  if (cotbetaX != nullptr)
228  delete[] cotbetaX;
229  if (cotalphaX != nullptr)
230  delete[] cotalphaX;
231  }
232 #endif
233 };
234 
235 // ******************************************************************************************
253 // ******************************************************************************************
255 public:
256  SiPixelTemplate(const std::vector<SiPixelTemplateStore>& thePixelTemp) : thePixelTemp_(thePixelTemp) {
257  id_current_ = -1;
258  index_id_ = -1;
259  cota_current_ = 0.;
260  cotb_current_ = 0.;
261  }
262 
263 // Load the private store with info from the file with the index (int) filenum from directory dir:
264 // ${dir}template_summary_zp${filenum}.out
265 #ifdef SI_PIXEL_TEMPLATE_STANDALONE
266  static bool pushfile(int filenum, std::vector<SiPixelTemplateStore>& pixelTemp, std::string dir = "");
267 #else
268  static bool pushfile(int filenum,
269  std::vector<SiPixelTemplateStore>& pixelTemp,
270  // *&^%$#@! Different default dir -- remove once FastSim is updated.
271  std::string dir = "CalibTracker/SiPixelESProducers/data/");
272  static bool pushfile(const SiPixelTemplateDBObject& dbobject,
273  std::vector<SiPixelTemplateStore>& pixelTemp); // load the private store with info from db
274 #endif
275 
276  // initialize the rest;
277  static void postInit(std::vector<SiPixelTemplateStore>& thePixelTemp_);
278 
279  // Interpolate input alpha and beta angles to produce a working template for each individual hit.
280  bool interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx);
281 
282  // Interpolate input alpha and beta angles to produce a working template for each individual hit.
283  bool interpolate(int id, float cotalpha, float cotbeta, float locBz);
284 
285  // overload for compatibility.
286  bool interpolate(int id, float cotalpha, float cotbeta);
287 
288  // retreive interpolated templates.
289  void ytemp(int fybin, int lybin, float ytemplate[41][BYSIZE]);
290 
291  void xtemp(int fxbin, int lxbin, float xtemplate[41][BXSIZE]);
292 
293  //Method to estimate the central pixel of the interpolated y-template
294  int cytemp();
295 
296  //Method to estimate the central pixel of the interpolated x-template
297  int cxtemp();
298 
299  // new methods to build templates from two interpolated clusters (for splitting)
300  void ytemp3d_int(int nypix, int& nybins);
301 
302  void ytemp3d(int j, int k, std::vector<float>& ytemplate);
303 
304  void xtemp3d_int(int nxpix, int& nxbins);
305 
306  void xtemp3d(int j, int k, std::vector<float>& xtemplate);
307 
308  // Convert vector of projected signals into uncertainties for fitting.
309  void ysigma2(int fypix, int lypix, float sythr, float ysum[BYSIZE], float ysig2[BYSIZE]);
310 
311  void ysigma2(float qpixel, int index, float& ysig2);
312 
313  void xsigma2(int fxpix, int lxpix, float sxthr, float xsum[BXSIZE], float xsig2[BXSIZE]);
314 
315  // Interpolate qfl correction in y.
316  float yflcorr(int binq, float qfly);
317 
318  // Interpolate qfl correction in x.
319  float xflcorr(int binq, float qflx);
320 
321  int qbin(int id,
322  float cotalpha,
323  float cotbeta,
324  float locBz,
325  float locBx,
326  float qclus,
327  float& pixmx,
328  float& sigmay,
329  float& deltay,
330  float& sigmax,
331  float& deltax,
332  float& sy1,
333  float& dy1,
334  float& sy2,
335  float& dy2,
336  float& sx1,
337  float& dx1,
338  float& sx2,
339  float& dx2);
340 
341  int qbin(int id,
342  float cotalpha,
343  float cotbeta,
344  float locBz,
345  float qclus,
346  float& pixmx,
347  float& sigmay,
348  float& deltay,
349  float& sigmax,
350  float& deltax,
351  float& sy1,
352  float& dy1,
353  float& sy2,
354  float& dy2,
355  float& sx1,
356  float& dx1,
357  float& sx2,
358  float& dx2);
359 
360  // Overload to use for cluster splitting
361  int qbin(int id, float cotalpha, float cotbeta, float qclus);
362 
363  // Overload to keep legacy interface
364  int qbin(int id, float cotbeta, float qclus);
365 
366  // Method to return template errors for fastsim
367  void temperrors(int id,
368  float cotalpha,
369  float cotbeta,
370  int qBin,
371  float& sigmay,
372  float& sigmax,
373  float& sy1,
374  float& sy2,
375  float& sx1,
376  float& sx2);
377 
378  //Method to return qbin and size probabilities for fastsim
379  void qbin_dist(int id,
380  float cotalpha,
381  float cotbeta,
382  float qbin_frac[4],
383  float& ny1_frac,
384  float& ny2_frac,
385  float& nx1_frac,
386  float& nx2_frac);
387 
388  //Method to calculate simple 2D templates
389  bool simpletemplate2D(
390  float xhitp, float yhitp, std::vector<bool>& ydouble, std::vector<bool>& xdouble, float template2d[BXM2][BYM2]);
391 
392  //Method to interpolate Vavilov distribution parameters
393  void vavilov_pars(double& mpv, double& sigma, double& kappa);
394 
395  //Method to interpolate 2-cluster Vavilov distribution parameters
396  void vavilov2_pars(double& mpv, double& sigma, double& kappa);
397 
398  float qavg() { return qavg_; }
399  float pixmax() { return pixmax_; }
400  float qscale() { return qscale_; }
401  float s50() { return s50_; }
402  float ss50() { return ss50_; }
403  float symax() { return symax_; }
404  float dyone() { return dyone_; }
405  float syone() { return syone_; }
406  float dytwo() { return dytwo_; }
407  float sytwo() { return sytwo_; }
408  float sxmax() { return sxmax_; }
409  float dxone() { return dxone_; }
410  float sxone() { return sxone_; }
411  float dxtwo() { return dxtwo_; }
412  float sxtwo() { return sxtwo_; }
413  float qmin() { return qmin_; }
414  float qmin(int i) {
415 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
416  if (i < 0 || i > 1) {
417  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::qmin called with illegal index = " << i << std::endl;
418  }
419 #else
420  assert(i >= 0 && i < 2);
421 #endif
422  if (i == 0) {
423  return qmin_;
424  } else {
425  return qmin2_;
426  }
427  }
428  float clsleny() { return clsleny_; }
429  float clslenx() { return clslenx_; }
430  float yratio() { return yratio_; }
431  float yxratio() { return yxratio_; }
432  float xxratio() { return xxratio_; }
433  float yavg(int i) {
434 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
435  if (i < 0 || i > 3) {
436  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::yavg called with illegal index = " << i << std::endl;
437  }
438 #else
439  assert(i >= 0 && i < 4);
440 #endif
441  return yavg_[i];
442  }
443  float yrms(int i) {
444 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
445  if (i < 0 || i > 3) {
446  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::yrms called with illegal index = " << i << std::endl;
447  }
448 #else
449  assert(i >= 0 && i < 4);
450 #endif
451  return yrms_[i];
452  }
453  float ygx0(int i) {
454 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
455  if (i < 0 || i > 3) {
456  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::ygx0 called with illegal index = " << i << std::endl;
457  }
458 #else
459  assert(i >= 0 && i < 4);
460 #endif
461  return ygx0_[i];
462  }
463  float ygsig(int i) {
464 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
465  if (i < 0 || i > 3) {
466  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::ygsig called with illegal index = " << i << std::endl;
467  }
468 #else
469  assert(i >= 0 && i < 4);
470 #endif
471  return ygsig_[i];
472  }
473  float xavg(int i) {
474 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
475  if (i < 0 || i > 3) {
476  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xavg called with illegal index = " << i << std::endl;
477  }
478 #else
479  assert(i >= 0 && i < 4);
480 #endif
481  return xavg_[i];
482  }
483  float xrms(int i) {
484 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
485  if (i < 0 || i > 3) {
486  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xrms called with illegal index = " << i << std::endl;
487  }
488 #else
489  assert(i >= 0 && i < 4);
490 #endif
491  return xrms_[i];
492  }
493  float xgx0(int i) {
494 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
495  if (i < 0 || i > 3) {
496  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xgx0 called with illegal index = " << i << std::endl;
497  }
498 #else
499  assert(i >= 0 && i < 4);
500 #endif
501  return xgx0_[i];
502  }
503  float xgsig(int i) {
504 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
505  if (i < 0 || i > 3) {
506  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xgsig called with illegal index = " << i << std::endl;
507  }
508 #else
509  assert(i >= 0 && i < 4);
510 #endif
511  return xgsig_[i];
512  }
513  float chi2yavg(int i) {
514 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
515  if (i < 0 || i > 3) {
516  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::chi2yavg called with illegal index = " << i << std::endl;
517  }
518 #else
519  assert(i >= 0 && i < 4);
520 #endif
521  return chi2yavg_[i];
522  }
523  float chi2ymin(int i) {
524 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
525  if (i < 0 || i > 3) {
526  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::chi2ymin called with illegal index = " << i << std::endl;
527  }
528 #else
529  assert(i >= 0 && i < 4);
530 #endif
531  return chi2ymin_[i];
532  }
533  float chi2xavg(int i) {
534 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
535  if (i < 0 || i > 3) {
536  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::chi2xavg called with illegal index = " << i << std::endl;
537  }
538 #else
539  assert(i >= 0 && i < 4);
540 #endif
541  return chi2xavg_[i];
542  }
543  float chi2xmin(int i) {
544 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
545  if (i < 0 || i > 3) {
546  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::chi2xmin called with illegal index = " << i << std::endl;
547  }
548 #else
549  assert(i >= 0 && i < 4);
550 #endif
551  return chi2xmin_[i];
552  }
553  float yavgc2m(int i) {
554 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
555  if (i < 0 || i > 3) {
556  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::yavgc2m called with illegal index = " << i << std::endl;
557  }
558 #else
559  assert(i >= 0 && i < 4);
560 #endif
561  return yavgc2m_[i];
562  }
563  float yrmsc2m(int i) {
564 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
565  if (i < 0 || i > 3) {
566  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::yrmsc2m called with illegal index = " << i << std::endl;
567  }
568 #else
569  assert(i >= 0 && i < 4);
570 #endif
571  return yrmsc2m_[i];
572  }
573  float chi2yavgc2m(int i) {
574 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
575  if (i < 0 || i > 3) {
576  throw cms::Exception("DataCorrupt")
577  << "SiPixelTemplate::chi2yavgc2m called with illegal index = " << i << std::endl;
578  }
579 #else
580  assert(i >= 0 && i < 4);
581 #endif
582  return chi2yavgc2m_[i];
583  }
584  float chi2yminc2m(int i) {
585 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
586  if (i < 0 || i > 3) {
587  throw cms::Exception("DataCorrupt")
588  << "SiPixelTemplate::chi2yminc2m called with illegal index = " << i << std::endl;
589  }
590 #else
591  assert(i >= 0 && i < 4);
592 #endif
593  return chi2yminc2m_[i];
594  }
595  float xavgc2m(int i) {
596 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
597  if (i < 0 || i > 3) {
598  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xavgc2m called with illegal index = " << i << std::endl;
599  }
600 #else
601  assert(i >= 0 && i < 4);
602 #endif
603  return xavgc2m_[i];
604  }
605  float xrmsc2m(int i) {
606 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
607  if (i < 0 || i > 3) {
608  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::xrmsc2m called with illegal index = " << i << std::endl;
609  }
610 #else
611  assert(i >= 0 && i < 4);
612 #endif
613  return xrmsc2m_[i];
614  }
615  float chi2xavgc2m(int i) {
616 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
617  if (i < 0 || i > 3) {
618  throw cms::Exception("DataCorrupt")
619  << "SiPixelTemplate::chi2xavgc2m called with illegal index = " << i << std::endl;
620  }
621 #else
622  assert(i >= 0 && i < 4);
623 #endif
624  return chi2xavgc2m_[i];
625  }
626  float chi2xminc2m(int i) {
627 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
628  if (i < 0 || i > 3) {
629  throw cms::Exception("DataCorrupt")
630  << "SiPixelTemplate::chi2xminc2m called with illegal index = " << i << std::endl;
631  }
632 #else
633  assert(i >= 0 && i < 4);
634 #endif
635  return chi2xminc2m_[i];
636  }
637  float fbin(int i) {
638 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
639  if (i < 0 || i > 2) {
640  throw cms::Exception("DataCorrupt") << "SiPixelTemplate::fbin called with illegal index = " << i << std::endl;
641  }
642 #else
643  assert(i >= 0 && i < 3);
644 #endif
645  return fbin_[i];
646  }
647 
648  float chi2yavgone() { return chi2yavgone_; }
649  float chi2yminone() { return chi2yminone_; }
650  float chi2xavgone() { return chi2xavgone_; }
651  float chi2xminone() { return chi2xminone_; }
652  float lorywidth() { return lorywidth_; }
653  float lorxwidth() { return lorxwidth_; }
654  //float lorybias() {return lorywidth_;} //!< signed lorentz y-width (microns)
655  //float lorxbias() {return lorxwidth_;} //!< signed lorentz x-width (microns)
656  float lorybias() { return lorybias_; }
657  float lorxbias() { return lorxbias_; }
658  float mpvvav() { return mpvvav_; }
659  float sigmavav() { return sigmavav_; }
660  float kappavav() { return kappavav_; }
661  float mpvvav2() {
662  return mpvvav2_;
663  }
664  float sigmavav2() { return sigmavav2_; }
665  float kappavav2() { return kappavav2_; }
666  float xsize() { return xsize_; }
667  float ysize() { return ysize_; }
668  float zsize() { return zsize_; }
669  float r_qMeas_qTrue() { return r_qMeas_qTrue_; }
670  float fracyone() { return fracyone_; }
671  float fracxone() { return fracxone_; }
672  float fracytwo() { return fracytwo_; }
673  float fracxtwo() { return fracxtwo_; }
674  // float yspare(int i) {assert(i>=0 && i<5); return pyspare[i];} //!< vector of 5 spares interpolated in beta only
675  // float xspare(int i) {assert(i>=0 && i<10); return pxspare[i];} //!< vector of 10 spares interpolated in alpha and beta
676 
677 private:
678  // Keep current template interpolaion parameters
679 
681  int index_id_;
684  float abs_cotb_;
685  bool success_;
686 
687  // Keep results of last interpolation to return through member functions
688 
689  float qavg_;
690  float pixmax_;
691  float qscale_;
692  float s50_;
693  float ss50_;
694  float symax_;
695  float syparmax_;
696  float dyone_;
697  float syone_;
698  float dytwo_;
699  float sytwo_;
700  float sxmax_;
701  float sxparmax_;
702  float dxone_;
703  float sxone_;
704  float dxtwo_;
705  float sxtwo_;
706  float qmin_;
707  float clsleny_;
708  float clslenx_;
709  float yratio_;
710  float yparl_[2][5];
711  float yparh_[2][5];
712  float xparly0_[2][5];
713  float xparhy0_[2][5];
714  float ytemp_[9][BYSIZE];
715  float yxratio_;
716  float xxratio_;
717  float xpar0_[2][5];
718  float xparl_[2][5];
719  float xparh_[2][5];
720  float xtemp_[9][BXSIZE];
721  float yavg_[4];
722  float yrms_[4];
723  float ygx0_[4];
724  float ygsig_[4];
725  float yflparl_[4][6];
726  float yflparh_[4][6];
727  float xavg_[4];
728  float xrms_[4];
729  float xgx0_[4];
730  float xgsig_[4];
731  float xflparll_[4][6];
732  float xflparlh_[4][6];
733  float xflparhl_[4][6];
734  float xflparhh_[4][6];
735  float chi2yavg_[4];
736  float chi2ymin_[4];
737  float chi2xavg_[4];
738  float chi2xmin_[4];
739  float yavgc2m_[4];
740  float yrmsc2m_[4];
741  float chi2yavgc2m_[4];
742  float chi2yminc2m_[4];
743  float xavgc2m_[4];
744  float xrmsc2m_[4];
745  float chi2xavgc2m_[4];
746  float chi2xminc2m_[4];
747  float chi2yavgone_;
748  float chi2yminone_;
749  float chi2xavgone_;
750  float chi2xminone_;
751  float qmin2_;
752  float mpvvav_;
753  float sigmavav_;
754  float kappavav_;
755  float mpvvav2_;
756  float sigmavav2_;
757  float kappavav2_;
758  float lorywidth_;
759  float lorxwidth_;
760  float lorybias_;
761  float lorxbias_;
762  float xsize_;
763  float ysize_;
764  float zsize_;
765  float qavg_avg_;
766  float nybins_;
767  float nxbins_;
769  float fbin_[3];
770  float fracyone_;
771  float fracxone_;
772  float fracytwo_;
773  float fracxtwo_;
774  boost::multi_array<float, 2> temp2dy_;
775  boost::multi_array<float, 2> temp2dx_;
776 
777  // The actual template store is a std::vector container
778 
779  const std::vector<SiPixelTemplateStore>& thePixelTemp_;
780 };
781 
782 #endif
float fracxone()
The simulated fraction of single pixel x-clusters.
float yrmsc2m(int i)
1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins ...
SiPixelTemplate(const std::vector< SiPixelTemplateStore > &thePixelTemp)
Constructor for cases in which template store already exists.
float cota_current_
current cot alpha
float qavg_avg
average cluster charge of clusters that are less than qavg (normalize 2-D simple templates) ...
float mpvvav_
most probable charge in Vavilov distribution (not actually for larger kappa)
int runnum
< Basic template entry corresponding to a single set of track angles
float xflpar[4][6]
Aqfl-parameterized x-correction in 4 charge bins.
float fbin(int i)
Return lower bound of Qbin definition.
float xrms[4]
average x-rms of reconstruction binned in 4 charge bins
#define BXSIZE
float clslenx
cluster x-length in pixels at signal height sxmax/2
float chi2xminone()
//!< minimum of x chi^2 for 1 pixel clusters
float clsleny_
y-cluster length of smaller interpolated template in pixels
float qavg
average cluster charge for this set of track angles (now includes threshold effects) ...
float pixmax_
maximum pixel charge
float chi2yavgc2m(int i)
1st pass chi2 min search: average y-chisq for merged clusters
float syone
rms for one pixel y-clusters
float chi2yavgone
average y chi^2 for 1 pixel clusters
float symax()
average pixel signal for y-projection of cluster
float kappavav2()
kappa parameter for 2-cluster Vavilov distribution
float lorybias_
Lorentz y-bias.
float yavg(int i)
average y-bias of reconstruction binned in 4 charge bins
float abs_cotb_
absolute value of cot beta
float dyone
mean offset/correction for one pixel y-clusters
#define BYSIZE
float sigmavav
"sigma" scale fctor for Vavilov distribution
float fracxtwo
fraction of double pixel sample with xsize = 1
float yavggen[4]
generic algorithm: average y-bias of reconstruction binned in 4 charge bins
float sxmax
average pixel signal for x-projection of cluster
float chi2yminc2m[4]
1st pass chi2 min search: minimum of y chi^2 in 4 charge bins (merged clusters)
float xavgc2m[4]
1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins ...
#define TXSIZE
float chi2xavgone
average x chi^2 for 1 pixel clusters
float fracytwo
fraction of double pixel sample with ysize = 1
float yrms[4]
average y-rms of reconstruction binned in 4 charge bins
float ss50()
1/2 of the single pixel per double column threshold in electrons
float chi2xmin(int i)
minimum y chi^2 in 4 charge bins
int NTxx
number of Template x-entries in each slice
float ss50_
1/2 of the pixel double col threshold signal in electrons
float mpvvav()
most probable charge in Vavilov distribution (not actually for larger kappa)
float mpvvav2
most probable charge in Vavilov distribution for 2 merged clusters (not actually for larger kappa) ...
float clslenx()
x-size of smaller interpolated template in pixels
float sxmax_
average pixel signal for x-projection of cluster
float ygx0gen[4]
generic algorithm: average y0 from Gaussian fit binned in 4 charge bins
float xavg[4]
average x-bias of reconstruction binned in 4 charge bins
float chi2yminone_
minimum of y chi^2 for 1 pixel clusters
float chi2ymin(int i)
minimum y chi^2 in 4 charge bins
float lorybias
estimate of y-lorentz bias
float yratio()
fractional distance in y between cotbeta templates
float fluence
radiation fluence in n_eq/cm^2
float fracxone_
The simulated fraction of single pixel x-clusters.
float ss50
1/2 of the single hit dcol threshold in electrons
float dytwo
mean offset/correction for one double-pixel y-clusters
float xrms(int i)
average x-rms of reconstruction binned in 4 charge bins
float ysize
pixel size (for future use in upgraded geometry)
float dxone
mean offset/correction for one pixel x-clusters
float chi2xavgone_
average x chi^2 for 1 pixel clusters
float qmin()
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float pixmax
maximum charge for individual pixels in cluster
float zsize()
pixel z-size or thickness (microns)
float xavgc2m(int i)
1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins ...
float qscale
Charge scaling to match cmssw and pixelav.
float chi2yavgc2m[4]
1st pass chi2 min search: average y chi^2 in 4 charge bins (merged clusters)
float qmin
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float chi2xavgc2m[4]
1st pass chi2 min search: average x chi^2 in 4 charge bins (merged clusters)
float mpvvav2()
most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa) ...
float r_qMeas_qTrue()
ratio of measured to true cluster charge
float sytwo()
rms for one double-pixel y-clusters
float xgsiggen[4]
generic algorithm: average sigma_x from Gaussian fit binned in 4 charge bins
float cotb_current_
current cot beta
float s50_
1/2 of the pixel single col threshold signal in electrons
float chi2xminc2m[4]
1st pass chi2 min search: minimum of x chi^2 in 4 charge bins (merged clusters)
int ID
< template header structure
float Bfield
Bfield in Tesla.
float cotalpha
cot(alpha) is proportional to cluster length in x and is basis of interpolation
float temperature
detector temperature in deg K
float chi2yminone()
//!< minimum of y chi^2 for 1 pixel clusters
float ytemp[9][21]
templates for y-reconstruction (binned over 1 central pixel)
float sxone()
rms for one pixel x-clusters
float yrmsc2m[4]
1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins ...
float qavg_
average cluster charge for this set of track angles
float lorywidth
estimate of y-lorentz width for optimal resolution
float r_qMeas_qTrue_
ratio of measured to true cluster charges
#define BXM2
float lorxbias_
Lorentz x-bias.
int templ_version
Version number of the template to ensure code compatibility.
float qscale()
charge scaling factor
float xpar[2][5]
projected x-pixel uncertainty parameterization
float chi2xavgc2m(int i)
1st pass chi2 min search: average x-chisq for merged clusters
float ygx0[4]
average y0 from Gaussian fit binned in 4 charge bins
float xgx0gen[4]
generic algorithm: average x0 from Gaussian fit binned in 4 charge bins
float dxone()
mean offset/correction for one pixel x-clusters
float sxparmax_
maximum pixel signal for parameterization of x uncertainties
float kappavav2_
kappa parameter for 2-cluster Vavilov distribution
float symax
average pixel signal for y-projection of cluster
float sigmavav_
"sigma" scale fctor for Vavilov distribution
float kappavav2
kappa parameter for Vavilov distribution for 2 merged clusters
float xgsig[4]
average sigma_x from Gaussian fit binned in 4 charge bins
float kappavav()
kappa parameter for Vavilov distribution
float cotbeta
cot(beta) is proportional to cluster length in y and is basis of interpolation
float chi2yavg(int i)
average y chi^2 in 4 charge bins
float beta
beta track angle (defined in CMS CMS IN 2004/014)
float fracytwo()
The simulated fraction of single double-size pixel y-clusters.
float lorxwidth()
signed lorentz x-width (microns)
float lorywidth()
signed lorentz y-width (microns)
float ygsig(int i)
average sigma_y from Gaussian fit binned in 4 charge bins
float yrms(int i)
average y-rms of reconstruction binned in 4 charge bins
float lorywidth_
Lorentz y-width (sign corrected for fpix frame)
float clsleny()
y-size of smaller interpolated template in pixels
float fracxtwo()
The simulated fraction of single double-size pixel x-clusters.
float xrmsc2m[4]
1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins ...
float lorxwidth
estimate of x-lorentz width for optimal resolution
float xgx0[4]
average x0 from Gaussian fit binned in 4 charge bins
float xsize()
pixel x-size (microns)
boost::multi_array< float, 2 > temp2dx_
2d-primitive for spltting 3-d template
float sigmavav2_
"sigma" scale fctor for 2-cluster Vavilov distribution
#define BYM2
float sigmavav2()
"sigma" scale fctor for 2-cluster Vavilov distribution
float ygsiggen[4]
generic algorithm: average sigma_y from Gaussian fit binned in 4 charge bins
float fracxone
fraction of sample with xsize = 1
float sxtwo()
rms for one double-pixel x-clusters
float mpvvav
most probable charge in Vavilov distribution (not actually for larger kappa)
float ysize_
Pixel y-size.
float xsize_
Pixel x-size.
float dytwo()
mean offset/correction for one double-pixel y-clusters
float kappavav_
kappa parameter for Vavilov distribution
float sxtwo
rms for one double-pixel x-clusters
bool success_
true if cotalpha, cotbeta are inside of the acceptance (dynamically loaded)
float r_qMeas_qTrue
ratio of measured to true cluster charge
float syone_
rms for one pixel y-clusters
int Dtype
detector type (0=BPix, 1=FPix)
float chi2yavg[4]
average y chi^2 in 4 charge bins
float alpha
alpha track angle (defined in CMS CMS IN 2004/014)
float xtemp[9][13]
templates for x-reconstruction (binned over 1 central pixel)
float chi2yminc2m(int i)
1st pass chi2 min search: minimum y-chisq for merged clusters
SiPixelTemplateHeader head
< template storage structure
float s50()
1/2 of the pixel threshold signal in electrons
float chi2xminone
minimum of x chi^2 for 1 pixel clusters
float ypar[2][5]
projected y-pixel uncertainty parameterization
float chi2yavgone_
average y chi^2 for 1 pixel clusters
float dyone_
mean offset/correction for one pixel y-clusters
float yavgc2m(int i)
1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins ...
const std::vector< SiPixelTemplateStore > & thePixelTemp_
float sxone_
rms for one pixel x-clusters
float dxtwo_
mean offset/correction for one double-pixel x-clusters
float chi2xminc2m(int i)
1st pass chi2 min search: minimum x-chisq for merged clusters
float ygx0(int i)
average y0 from Gaussian fit binned in 4 charge bins
float s50
1/2 of the multihit dcol threshold in electrons
#define TYSIZE
float qscale_
charge scaling factor
float qmin(int i)
minimum cluster charge for valid hit (keeps 99.9% or 99.8% of simulated hits)
float lorybias()
signed lorentz y-width (microns)
float zsize
pixel size (for future use in upgraded geometry)
float Vbias
detector bias potential in Volts
float qmin2_
tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)
float qbfrac[3]
fraction of sample in qbin = 0-2 (>=3 is the complement)
float syone()
rms for one pixel y-clusters
float sytwo_
rms for one double-pixel y-clusters
float xsize
pixel size (for future use in upgraded geometry)
float qavg_avg_
average of cluster charge less than qavg
float fracyone
fraction of sample with ysize = 1
float fracyone()
The simulated fraction of single pixel y-clusters.
float chi2yavgone()
//!< average y chi^2 for 1 pixel clusters
float qmin2
tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)
float yxratio()
fractional distance in y between cotalpha templates slices
float chi2xminone_
minimum of x chi^2 for 1 pixel clusters
float yavg[4]
average y-bias of reconstruction binned in 4 charge bins
float qavg()
average cluster charge for this set of track angles
float sxtwo_
rms for one double-pixel x-clusters
float sxmax()
average pixel signal for x-projection of cluster
float clslenx_
x-cluster length of smaller interpolated template in pixels
boost::multi_array< float, 2 > temp2dy_
2d-primitive for spltting 3-d template
float chi2ymin[4]
minimum of y chi^2 in 4 charge bins
float fracyone_
The simulated fraction of single pixel y-clusters.
float yavgc2m[4]
1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins ...
int NTy
number of Template y entries
float fracxtwo_
The simulated fraction of single double-size pixel x-clusters.
float symax_
average pixel signal for y-projection of cluster
float dxtwo
mean offset/correction for one double-pixel x-clusters
float lorxbias
estimate of x-lorentz bias
float chi2xavgone()
//!< average x chi^2 for 1 pixel clusters
float lorxbias()
signed lorentz x-width (microns)
float pixmax()
maximum pixel charge
float xxratio_
fractional distance in x between cotalpha templates
float sigmavav()
"sigma" scale fctor for Vavilov distribution
int NTyx
number of Template y-slices of x entries
float yflpar[4][6]
Aqfl-parameterized y-correction in 4 charge bins.
float yxratio_
fractional distance in y between x-slices of cotalpha templates
float sxone
rms for one pixel x-clusters
float xgx0(int i)
average x0 from Gaussian fit binned in 4 charge bins
float qmin_
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float dxone_
mean offset/correction for one pixel x-clusters
float chi2xmin[4]
minimum of x chi^2 in 4 charge bins
static const G4double kappa
float lorxwidth_
Lorentz x-width.
float chi2xavg(int i)
averaage x chi^2 in 4 charge bins
int index_id_
current index
float chi2yminone
minimum of y chi^2 for 1 pixel clusters
float xgsig(int i)
average sigma_x from Gaussian fit binned in 4 charge bins
float costrk[3]
direction cosines of tracks used to generate this entry
float mpvvav2_
most probable charge in 2-cluster Vavilov distribution (not actually for larger kappa) ...
float syparmax_
maximum pixel signal for parameterization of y uncertainties
float ygsig[4]
average sigma_y from Gaussian fit binned in 4 charge bins
float nxbins_
number of bins in each dimension of the x-splitting template
float fracytwo_
The simulated fraction of single double-size pixel y-clusters.
float sigmavav2
"sigma" scale fctor for Vavilov distribution for 2 merged clusters
float sytwo
rms for one double-pixel y-clusters
float dyone()
mean offset/correction for one pixel y-clusters
float xavg(int i)
average x-bias of reconstruction binned in 4 charge bins
float xrmsgen[4]
generic algorithm: average x-rms of reconstruction binned in 4 charge bins
float dytwo_
mean offset/correction for one double-pixel y-clusters
float dxtwo()
mean offset/correction for one double-pixel x-clusters
int id_current_
current id
float ysize()
pixel y-size (microns)
float zsize_
Pixel z-size (thickness)
float chi2xavg[4]
average x chi^2 in 4 charge bins
float xrmsc2m(int i)
1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins ...
float yratio_
fractional distance in y between cotbeta templates
float xxratio()
fractional distance in x between cotalpha templates
float kappavav
kappa parameter for Vavilov distribution
float xavggen[4]
generic algorithm: average x-bias of reconstruction binned in 4 charge bins
float yrmsgen[4]
generic algorithm: average y-rms of reconstruction binned in 4 charge bins
float nybins_
number of bins in each dimension of the y-splitting template
float clsleny
cluster y-length in pixels at signal height symax/2