CMS 3D CMS Logo

SiPixelTemplateSplit.h
Go to the documentation of this file.
1 //
2 // SiPixelTemplateSplit.cc (Version 2.30)
3 //
4 // Procedure to fit two templates (same angle hypotheses) to a single cluster
5 // Return two x- and two y-coordinates for the cluster
6 //
7 // Created by Morris Swartz on 04/10/08.
8 //
9 // Incorporate "cluster repair" to handle dead pixels
10 // Take truncation size from new pixmax information
11 // Change to allow template sizes to be changed at compile time
12 // Move interpolation range error to LogDebug
13 // Add q2bin = 5 and change 1-pixel probability to use new template info
14 // Add floor for probabilities (no exact zeros)
15 // Add ambiguity resolution with crude 2-D templates (v2.00)
16 // Pass all containers by alias to prevent excessive cpu-usage (v2.01)
17 // Add ambiguity resolution with fancy 2-D templates (v2.10)
18 // Make small change to indices for ambiguity resolution (v2.11)
19 // Tune x and y errors separately (v2.12)
20 // Use template cytemp/cxtemp methods to center the data cluster in the right place when the templates become asymmetric after irradiation (v2.20)
21 // Add charge probability to the splitter [tests consistency with a two-hit merged cluster hypothesis] (v2.20)
22 // Improve likelihood normalization slightly (v2.21)
23 // Replace hardwired pixel size derived errors with ones from templated pixel sizes (v2.22)
24 // Add shape and charge probabilities for the merged cluster hypothesis (v2.23)
25 // Incorporate VI-like speed improvements (v2.25)
26 // Improve speed by eliminating the triple index boost::multiarray objects and add speed switch to optimize the algorithm (v2.30)
27 //
28 
29 #ifndef SiPixelTemplateSplit_h
30 #define SiPixelTemplateSplit_h 1
31 
33 
34 #ifndef SI_PIXEL_TEMPLATE_STANDALONE
37 #else
38 #include "SiPixelTemplate.h"
39 #include "SiPixelTemplate2D.h"
40 #endif
41 
42 #include <vector>
43 #include "boost/multi_array.hpp"
44 
46 
47  typedef boost::multi_array<float, 2> array_2d;
48  typedef boost::multi_array<bool, 2> array_2d_bool;
49  typedef boost::multi_array<float, 3> array_3d;
50 
51  int PixelTempSplit(int id,
52  float cotalpha,
53  float cotbeta,
54  array_2d& cluster,
55  std::vector<bool>& ydouble,
56  std::vector<bool>& xdouble,
57  SiPixelTemplate& templ,
58  float& yrec1,
59  float& yrec2,
60  float& sigmay,
61  float& prob2y,
62  float& xrec1,
63  float& xrec2,
64  float& sigmax,
65  float& prob2x,
66  int& q2bin,
67  float& prob2Q,
68  bool resolve,
69  int speed,
70  float& dchisq,
71  bool deadpix,
72  std::vector<std::pair<int, int> >& zeropix,
73  SiPixelTemplate2D& templ2D);
74 
75  int PixelTempSplit(int id,
76  float cotalpha,
77  float cotbeta,
78  array_2d& cluster,
79  std::vector<bool>& ydouble,
80  std::vector<bool>& xdouble,
81  SiPixelTemplate& templ,
82  float& yrec1,
83  float& yrec2,
84  float& sigmay,
85  float& prob2y,
86  float& xrec1,
87  float& xrec2,
88  float& sigmax,
89  float& prob2x,
90  int& q2bin,
91  float& prob2Q,
92  bool resolve,
93  int speed,
94  float& dchisq,
95  SiPixelTemplate2D& templ2D);
96 
97  int PixelTempSplit(int id,
98  float cotalpha,
99  float cotbeta,
100  array_2d& cluster,
101  std::vector<bool>& ydouble,
102  std::vector<bool>& xdouble,
103  SiPixelTemplate& templ,
104  float& yrec1,
105  float& yrec2,
106  float& sigmay,
107  float& prob2y,
108  float& xrec1,
109  float& xrec2,
110  float& sigmax,
111  float& prob2x,
112  int& q2bin,
113  float& prob2Q,
114  bool resolve,
115  float& dchisq,
116  SiPixelTemplate2D& templ2D);
117 
118  int PixelTempSplit(int id,
119  float cotalpha,
120  float cotbeta,
121  array_2d& cluster,
122  std::vector<bool>& ydouble,
123  std::vector<bool>& xdouble,
124  SiPixelTemplate& templ,
125  float& yrec1,
126  float& yrec2,
127  float& sigmay,
128  float& prob2y,
129  float& xrec1,
130  float& xrec2,
131  float& sigmax,
132  float& prob2x,
133  int& q2bin,
134  float& prob2Q,
135  SiPixelTemplate2D& templ2D);
136 
137  int PixelTempSplit(int id,
138  float cotalpha,
139  float cotbeta,
140  array_2d& cluster,
141  std::vector<bool>& ydouble,
142  std::vector<bool>& xdouble,
143  SiPixelTemplate& templ,
144  float& yrec1,
145  float& yrec2,
146  float& sigmay,
147  float& prob2y,
148  float& xrec1,
149  float& xrec2,
150  float& sigmax,
151  float& prob2x,
152  int& q2bin,
153  SiPixelTemplate2D& templ2D);
154 
155 } // namespace SiPixelTemplateSplit
156 
157 #endif
boost::multi_array< float, 3 > array_3d
int PixelTempSplit(int id, float cotalpha, float cotbeta, array_2d &cluster, std::vector< bool > &ydouble, std::vector< bool > &xdouble, SiPixelTemplate &templ, float &yrec1, float &yrec2, float &sigmay, float &prob2y, float &xrec1, float &xrec2, float &sigmax, float &prob2x, int &q2bin, float &prob2Q, bool resolve, int speed, float &dchisq, bool deadpix, std::vector< std::pair< int, int > > &zeropix, SiPixelTemplate2D &templ2D)
boost::multi_array< bool, 2 > array_2d_bool
boost::multi_array< float, 2 > array_2d