CFEL - ASG Software Suite  2.5.0
CASS
commonmode_calculators.h
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file commonmode_calculators.h contains all available common mode calculators.
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _COMMONMODECALCULATORS_H_
10 #define _COMMONMODECALCULATORS_H_
11 
12 #include <tr1/memory>
13 #include <vector>
14 
16 
17 namespace cass
18 {
19 namespace pixeldetector
20 {
21 
22 namespace commonmode
23 {
24 typedef std::vector<Detector::pixel_t> pixels_t;
25 
26 /** Calculate the common mode by taking mean of pixel values
27  *
28  * This functor calculates the mean value of the pixels. To create the list
29  * of pixels it will check whether the pixel might contain an event such as an
30  * photon. If so it will not be included in the mean. There must be a minimum
31  * number of pixels without an event before the common mode is calculated.
32  *
33  * To calculate the mean a simple accumulating average is done.
34  *
35  * @cassttng PixelDetectors/\%name\%/HLLProcessing/SimpleMeanCommonMode/{MinNbrPixels}\n
36  * The minimal number of Pixels that should be found in the range
37  * before the common mode value will be calculated. Default is 8
38  *
39  * @author Lutz Foucar
40  */
42 {
43 public:
44  /** constructor */
46 
47  /** the operation
48  *
49  * determine the common mode level and return it.
50  *
51  * @return the common mode level
52  * @param pixel the start pixel within the frame to start the common mode
53  * calculation
54  * @param idx index of the first pixel.
55  */
56  Detector::pixel_t operator ()(Detector::frame_t::const_iterator pixel, size_t idx)const;
57 
58  /** load the settings of this calculator
59  *
60  * @param s the CASSSettings object to read the information from
61  */
62  void loadSettings(CASSSettings &s);
63 
64 private:
65  /** mininmal number of pixels that should be present when calculating the mean */
66  size_t _minNbrPixels;
67 };
68 
69 
70 /** Calculate the common mode by taking mean of pixel values
71  *
72  * This functor calculates the mean value of the pixels. To create the list
73  * of pixels it will check whether the pixel might contain an event such as an
74  * photon. If so it will not be included in the mean. There must be a minimum
75  * number of pixels without an event before the common mode is calculated.
76  *
77  * The user has the option to not include a number of highest and lowest pixel
78  * values when calculating the mean. This helps to get rid of possible extremes.
79  *
80  * @cassttng PixelDetectors/\%name\%/HLLProcessing/MeanCommonMode/{NbrMinDisregardedValues}\n
81  * The number of lowest values that should be disreagarded when
82  * calculating the mean value. Default is 5.
83  * @cassttng PixelDetectors/\%name\%/HLLProcessing/MeanCommonMode/{NbrMaxDisregardedValues}\n
84  * The number of highest values that should be disreagarded when
85  * calculating the mean value. Default is 0.
86  * @cassttng PixelDetectors/\%name\%/HLLProcessing/MeanCommonMode/{MinNbrPixels}\n
87  * The minimal number of Pixels that should be found in the range
88  * before the common mode value will be calculated. Default is 8
89  *
90  * @author Lutz Foucar
91  */
93 {
94 public:
95  /** constructor */
97 
98  /** the operation
99  *
100  * determine the common mode level and return it.
101  *
102  * @return the common mode level
103  * @param pixel the start pixel within the frame to start the common mode
104  * calculation
105  * @param idx index of the first pixel.
106  */
107  Detector::pixel_t operator ()(Detector::frame_t::const_iterator pixel, size_t idx)const;
108 
109  /** load the settings of this calculator
110  *
111  * @param s the CASSSettings object to read the information from
112  */
113  void loadSettings(CASSSettings &s);
114 
115 private:
116  /** number of maximum elements to remove */
118 
119  /** number of minimum elements to remove */
121 
122  /** mininmal number of pixels that should be present when calculating the mean */
124 };
125 
126 
127 /** Calculate the common mode by taking the median of pixel values
128  *
129  * This functor retrieves the median value of the pixels. To create the list
130  * of pixels it will check whether the pixel might contain an event such as an
131  * photon. If so it will not be included in the mean. There must be a minimum
132  * number of pixels without an event before the common mode is calculated.
133  *
134  * The user has the option to not include a number of highest and lowest pixel
135  * values when getting the median of the distribution. This helps to get rid of
136  * possible extremes.
137  *
138  * @cassttng PixelDetectors/\%name\%/HLLProcessing/MedianCommonMode/{NbrMinDisregardedValues}\n
139  * The number of lowest values that should be disreagarded when
140  * getting the median value. Default is 5.
141  * @cassttng PixelDetectors/\%name\%/HLLProcessing/MedianCommonMode/{NbrMinDisregardedValues}\n
142  * The number of highest values that should be disreagarded when
143  * getting the median value. Default is 0.
144  * @cassttng PixelDetectors/\%name\%/HLLProcessing/MedianCommonMode/{MinNbrPixels}\n
145  * The minimal number of Pixels that should be found in the range
146  * before the common mode value will be calculated. Default is 8.
147  *
148  * @author Lutz Foucar
149  */
151 {
152 public:
153  /** constructor */
155 
156  /** the operation
157  *
158  * determine the common mode level and return it.
159  *
160  * @return the common mode level
161  * @param pixel the start pixel within the frame to start the common mode
162  * calculation
163  * @param idx index of the first pixel.
164  */
165  Detector::pixel_t operator ()(Detector::frame_t::const_iterator pixel, size_t idx)const;
166 
167  /** load the settings of this calculator
168  *
169  * @param s the CASSSettings object to read the information from
170  */
171  void loadSettings(CASSSettings &s);
172 
173 private:
174  /** number of maximum elements to remove */
176 
177  /** number of minimum elements to remove */
179 
180  /** mininmal number of pixels that should be present when calculating the mean */
182 };
183 }//end namespace commonmode
184 }//end namespace pixeldetector
185 }//end namespace cass
186 
187 #endif
int _minNbrPixels
mininmal number of pixels that should be present when calculating the mean
int _minNbrPixels
mininmal number of pixels that should be present when calculating the mean
contains base class for all common mode calculators.
Settings for CASS.
Definition: cass_settings.h:30
Detector::pixel_t operator()(Detector::frame_t::const_iterator pixel, size_t idx) const
the operation
Calculate the common mode by taking the median of pixel values.
void loadSettings(CASSSettings &s)
load the settings of this calculator
Calculate the common mode by taking mean of pixel values.
void loadSettings(CASSSettings &s)
load the settings of this calculator
float pixel_t
define a pixel of the pixel detector
size_t _nbrDisregardedMaximumElements
number of maximum elements to remove
size_t _nbrMaximumElementsToRemove
number of maximum elements to remove
std::vector< Detector::pixel_t > pixels_t
Detector::pixel_t operator()(Detector::frame_t::const_iterator pixel, size_t idx) const
the operation
size_t _nbrDisregardedMinimumElements
number of minimum elements to remove
void loadSettings(CASSSettings &s)
load the settings of this calculator
size_t _nbrMinimumElementsToRemove
number of minimum elements to remove
size_t _minNbrPixels
mininmal number of pixels that should be present when calculating the mean
Calculate the common mode by taking mean of pixel values.
int16_t pixel
define a pixel
Definition: hlltypes.hpp:27
base class for all common mode calculators
Detector::pixel_t operator()(Detector::frame_t::const_iterator pixel, size_t idx) const
the operation