CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/RecoLocalTracker/SiPixelRecHits/interface/SiPixelTemplateSplit.h

Go to the documentation of this file.
00001 //
00002 //  SiPixelTemplateSplit.cc (Version 2.30)
00003 //
00004 //  Procedure to fit two templates (same angle hypotheses) to a single cluster
00005 //  Return two x- and two y-coordinates for the cluster
00006 //
00007 //  Created by Morris Swartz on 04/10/08.
00008 //
00009 //  Incorporate "cluster repair" to handle dead pixels
00010 //  Take truncation size from new pixmax information
00011 //  Change to allow template sizes to be changed at compile time
00012 //  Move interpolation range error to LogDebug
00013 //  Add q2bin = 5 and change 1-pixel probability to use new template info
00014 //  Add floor for probabilities (no exact zeros)
00015 //  Add ambiguity resolution with crude 2-D templates (v2.00)
00016 //  Pass all containers by alias to prevent excessive cpu-usage (v2.01)
00017 //  Add ambiguity resolution with fancy 2-D templates (v2.10)
00018 //  Make small change to indices for ambiguity resolution (v2.11)
00019 //  Tune x and y errors separately (v2.12)
00020 //  Use template cytemp/cxtemp methods to center the data cluster in the right place when the templates become asymmetric after irradiation (v2.20)
00021 //  Add charge probability to the splitter [tests consistency with a two-hit merged cluster hypothesis]  (v2.20)
00022 //  Improve likelihood normalization slightly (v2.21)
00023 //  Replace hardwired pixel size derived errors with ones from templated pixel sizes (v2.22)
00024 //  Add shape and charge probabilities for the merged cluster hypothesis (v2.23)
00025 //  Incorporate VI-like speed improvements (v2.25)
00026 //  Improve speed by eliminating the triple index boost::multiarray objects and add speed switch to optimize the algorithm (v2.30)
00027 //
00028  
00029 #ifndef SiPixelTemplateSplit_h
00030 #define SiPixelTemplateSplit_h 1
00031 
00032 #include "SiPixelTemplateDefs.h"
00033 
00034 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
00035 #include "RecoLocalTracker/SiPixelRecHits/interface/SiPixelTemplate.h"
00036 #include "RecoLocalTracker/SiPixelRecHits/interface/SiPixelTemplate2D.h"
00037 #else
00038 #include "SiPixelTemplate.h"
00039 #include "SiPixelTemplate2D.h"
00040 #endif
00041 
00042 #include <vector>
00043 #include "boost/multi_array.hpp"
00044 
00045 
00046 
00047 namespace SiPixelTemplateSplit
00048  {
00049  
00050     typedef boost::multi_array<float, 2> array_2d;
00051     typedef boost::multi_array<bool, 2> array_2d_bool;
00052     typedef boost::multi_array<float, 3> array_3d;
00053          
00054                  
00055          
00056         int PixelTempSplit(int id, float cotalpha, float cotbeta, array_2d& cluster, 
00057                                 std::vector<bool>& ydouble, std::vector<bool>& xdouble, 
00058                                 SiPixelTemplate& templ, 
00059                                 float& yrec1, float& yrec2, float& sigmay, float& prob2y, 
00060                                                          float& xrec1, float& xrec2, float& sigmax, float& prob2x, int& q2bin, float& prob2Q, bool resolve, int speed, float& dchisq, bool deadpix, 
00061                                                          std::vector<std::pair<int, int> >& zeropix, SiPixelTemplate2D& templ2D);
00062          
00063          int PixelTempSplit(int id, float cotalpha, float cotbeta, array_2d& cluster, 
00064                                                           std::vector<bool>& ydouble, std::vector<bool>& xdouble, 
00065                                                           SiPixelTemplate& templ, 
00066                                                           float& yrec1, float& yrec2, float& sigmay, float& prob2y, 
00067                                                           float& xrec1, float& xrec2, float& sigmax, float& prob2x, int& q2bin, float& prob2Q, bool resolve, int speed, float& dchisq, SiPixelTemplate2D& templ2D);
00068          
00069         int PixelTempSplit(int id, float cotalpha, float cotbeta, array_2d& cluster, 
00070                                 std::vector<bool>& ydouble, std::vector<bool>& xdouble, 
00071                                 SiPixelTemplate& templ, 
00072                                 float& yrec1, float& yrec2, float& sigmay, float& prob2y, 
00073                                 float& xrec1, float& xrec2, float& sigmax, float& prob2x, int& q2bin, float& prob2Q, bool resolve, float& dchisq, SiPixelTemplate2D& templ2D);
00074          
00075          int PixelTempSplit(int id, float cotalpha, float cotbeta, array_2d& cluster, 
00076                                                 std::vector<bool>& ydouble, std::vector<bool>& xdouble, 
00077                                                 SiPixelTemplate& templ, 
00078                                                 float& yrec1, float& yrec2, float& sigmay, float& prob2y, 
00079                                                 float& xrec1, float& xrec2, float& sigmax, float& prob2x, int& q2bin, float& prob2Q, SiPixelTemplate2D& templ2D);
00080 
00081          int PixelTempSplit(int id, float cotalpha, float cotbeta, array_2d& cluster, 
00082                                                           std::vector<bool>& ydouble, std::vector<bool>& xdouble, 
00083                                                           SiPixelTemplate& templ, 
00084                                                           float& yrec1, float& yrec2, float& sigmay, float& prob2y, 
00085                                                           float& xrec1, float& xrec2, float& sigmax, float& prob2x, int& q2bin, SiPixelTemplate2D& templ2D);
00086          
00087 }
00088                                 
00089 #endif