Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:23

0001 //
0002 //  SiPixelTemplateSplit.cc (Version 2.30)
0003 //
0004 //  Procedure to fit two templates (same angle hypotheses) to a single cluster
0005 //  Return two x- and two y-coordinates for the cluster
0006 //
0007 //  Created by Morris Swartz on 04/10/08.
0008 //
0009 //  Incorporate "cluster repair" to handle dead pixels
0010 //  Take truncation size from new pixmax information
0011 //  Change to allow template sizes to be changed at compile time
0012 //  Move interpolation range error to LogDebug
0013 //  Add q2bin = 5 and change 1-pixel probability to use new template info
0014 //  Add floor for probabilities (no exact zeros)
0015 //  Add ambiguity resolution with crude 2-D templates (v2.00)
0016 //  Pass all containers by alias to prevent excessive cpu-usage (v2.01)
0017 //  Add ambiguity resolution with fancy 2-D templates (v2.10)
0018 //  Make small change to indices for ambiguity resolution (v2.11)
0019 //  Tune x and y errors separately (v2.12)
0020 //  Use template cytemp/cxtemp methods to center the data cluster in the right place when the templates become asymmetric after irradiation (v2.20)
0021 //  Add charge probability to the splitter [tests consistency with a two-hit merged cluster hypothesis]  (v2.20)
0022 //  Improve likelihood normalization slightly (v2.21)
0023 //  Replace hardwired pixel size derived errors with ones from templated pixel sizes (v2.22)
0024 //  Add shape and charge probabilities for the merged cluster hypothesis (v2.23)
0025 //  Incorporate VI-like speed improvements (v2.25)
0026 //  Improve speed by eliminating the triple index boost::multiarray objects and add speed switch to optimize the algorithm (v2.30)
0027 //
0028 
0029 #ifndef SiPixelTemplateSplit_h
0030 #define SiPixelTemplateSplit_h 1
0031 
0032 #include "CondFormats/SiPixelTransient/interface/SiPixelTemplateDefs.h"
0033 
0034 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
0035 #include "CondFormats/SiPixelTransient/interface/SiPixelTemplate.h"
0036 #include "CondFormats/SiPixelTransient/interface/SiPixelTemplate2D.h"
0037 #else
0038 #include "SiPixelTemplate.h"
0039 #include "SiPixelTemplate2D.h"
0040 #endif
0041 
0042 #include <vector>
0043 #include "boost/multi_array.hpp"
0044 
0045 namespace SiPixelTemplateSplit {
0046 
0047   typedef boost::multi_array<float, 2> array_2d;
0048   typedef boost::multi_array<bool, 2> array_2d_bool;
0049   typedef boost::multi_array<float, 3> array_3d;
0050 
0051   int PixelTempSplit(int id,
0052                      float cotalpha,
0053                      float cotbeta,
0054                      array_2d& cluster,
0055                      std::vector<bool>& ydouble,
0056                      std::vector<bool>& xdouble,
0057                      SiPixelTemplate& templ,
0058                      float& yrec1,
0059                      float& yrec2,
0060                      float& sigmay,
0061                      float& prob2y,
0062                      float& xrec1,
0063                      float& xrec2,
0064                      float& sigmax,
0065                      float& prob2x,
0066                      int& q2bin,
0067                      float& prob2Q,
0068                      bool resolve,
0069                      int speed,
0070                      float& dchisq,
0071                      bool deadpix,
0072                      std::vector<std::pair<int, int> >& zeropix,
0073                      SiPixelTemplate2D& templ2D);
0074 
0075   int PixelTempSplit(int id,
0076                      float cotalpha,
0077                      float cotbeta,
0078                      array_2d& cluster,
0079                      std::vector<bool>& ydouble,
0080                      std::vector<bool>& xdouble,
0081                      SiPixelTemplate& templ,
0082                      float& yrec1,
0083                      float& yrec2,
0084                      float& sigmay,
0085                      float& prob2y,
0086                      float& xrec1,
0087                      float& xrec2,
0088                      float& sigmax,
0089                      float& prob2x,
0090                      int& q2bin,
0091                      float& prob2Q,
0092                      bool resolve,
0093                      int speed,
0094                      float& dchisq,
0095                      SiPixelTemplate2D& templ2D);
0096 
0097   int PixelTempSplit(int id,
0098                      float cotalpha,
0099                      float cotbeta,
0100                      array_2d& cluster,
0101                      std::vector<bool>& ydouble,
0102                      std::vector<bool>& xdouble,
0103                      SiPixelTemplate& templ,
0104                      float& yrec1,
0105                      float& yrec2,
0106                      float& sigmay,
0107                      float& prob2y,
0108                      float& xrec1,
0109                      float& xrec2,
0110                      float& sigmax,
0111                      float& prob2x,
0112                      int& q2bin,
0113                      float& prob2Q,
0114                      bool resolve,
0115                      float& dchisq,
0116                      SiPixelTemplate2D& templ2D);
0117 
0118   int PixelTempSplit(int id,
0119                      float cotalpha,
0120                      float cotbeta,
0121                      array_2d& cluster,
0122                      std::vector<bool>& ydouble,
0123                      std::vector<bool>& xdouble,
0124                      SiPixelTemplate& templ,
0125                      float& yrec1,
0126                      float& yrec2,
0127                      float& sigmay,
0128                      float& prob2y,
0129                      float& xrec1,
0130                      float& xrec2,
0131                      float& sigmax,
0132                      float& prob2x,
0133                      int& q2bin,
0134                      float& prob2Q,
0135                      SiPixelTemplate2D& templ2D);
0136 
0137   int PixelTempSplit(int id,
0138                      float cotalpha,
0139                      float cotbeta,
0140                      array_2d& cluster,
0141                      std::vector<bool>& ydouble,
0142                      std::vector<bool>& xdouble,
0143                      SiPixelTemplate& templ,
0144                      float& yrec1,
0145                      float& yrec2,
0146                      float& sigmay,
0147                      float& prob2y,
0148                      float& xrec1,
0149                      float& xrec2,
0150                      float& sigmax,
0151                      float& prob2x,
0152                      int& q2bin,
0153                      SiPixelTemplate2D& templ2D);
0154 
0155 }  // namespace SiPixelTemplateSplit
0156 
0157 #endif