CFEL - ASG Software Suite  2.5.0
CASS
pixel_finder_base.h
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file pixel_finder_base.h contains base class for all pixel finders.
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _PIXELFINDERBASE_H_
10 #define _PIXELFINDERBASE_H_
11 
12 #include <tr1/memory>
13 #include <vector>
14 #include <stdint.h>
15 
16 namespace cass
17 {
18 class CASSSettings;
19 
20 namespace pixeldetector
21 {
22 //forward declaration//
23 struct Frame;
24 
25 /** Pixel definition
26  *
27  * Defines a pixel within a pixel detector.
28  *
29  * @author Lutz Foucar
30  */
31 struct Pixel
32 {
33  /** constructor
34  *
35  * @param X the x coordinate of the pixel
36  * @param Y the y coordinate of the pixel
37  * @param Z the value of the pixel
38  */
39  Pixel(uint16_t X, uint16_t Y, double Z)
40  :x(X),y(Y),z(Z),used(false)
41  {}
42 
43  /** default constructor.*/
45  :x(0),y(0),z(0),used(0)
46  {}
47 
48  /** x coordinate of the pixel */
49  uint16_t x;
50 
51  /** y coordinate of the pixel */
52  uint16_t y;
53 
54  /** the value of the pixel */
55  double z;
56 
57  /** value to mark pixel any analysis of the pixels */
58  uint32_t used;
59 };
60 
61 /** base class for pixel finders
62  *
63  * a pixel finder should identifiy the pixels of interest within a frame
64  *
65  * @author Lutz Foucar
66  */
68 {
69 public:
70  /** typedef the shared pointer of this */
71  typedef std::tr1::shared_ptr<PixelFinderBase> shared_pointer;
72 
73  /** the list of pixels */
74  typedef std::vector<Pixel> pixels_t;
75 
76  /** virtual destructor */
77  virtual ~PixelFinderBase() {}
78 
79  /** create an instance of the requested functor
80  *
81  * @return a shared pointer to the requested type
82  * @param type the reqested type
83  */
84  static shared_pointer instance(const std::string &type);
85 
86  /** find the pixels
87  *
88  * take the input frame and search it for pixels which are put into the
89  * list of pixels.
90  *
91  * @return reference to the coalesced pixel list
92  * @param frame the frame containing the pixels of interest
93  * @param pixels the list of pixels that should be found
94  */
95  virtual pixels_t& operator() (const Frame &frame, pixels_t &pixels)=0;
96 
97  /** load the settings of this
98  *
99  * @param s the CASSSettings object to read the information from
100  */
101  virtual void loadSettings(CASSSettings &s)=0;
102 };
103 
104 } //end namespace pixeldetector
105 } //end namespace cass
106 #endif
std::tr1::shared_ptr< PixelFinderBase > shared_pointer
typedef the shared pointer of this
Pixel(uint16_t X, uint16_t Y, double Z)
constructor
Settings for CASS.
Definition: cass_settings.h:30
uint16_t y
y coordinate of the pixel
static shared_pointer instance(const std::string &type)
create an instance of the requested functor
std::vector< Pixel > pixels_t
the list of pixels
double z
the value of the pixel
virtual pixels_t & operator()(const Frame &frame, pixels_t &pixels)=0
find the pixels
uint32_t used
value to mark pixel any analysis of the pixels
A Frame of an advance Pixel Detector.
uint16_t x
x coordinate of the pixel
base class for pixel finders
Pixel()
default constructor.
virtual ~PixelFinderBase()
virtual destructor
virtual void loadSettings(CASSSettings &s)=0
load the settings of this