CFEL - ASG Software Suite  2.5.0
CASS
table_operations.h
Go to the documentation of this file.
1 // Copyright (C) 2013 Lutz Foucar
2 
3 /**
4  * @file table_operations.h contains processors that will operate
5  * on table like histograms of other processors.
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef _TABLE_OPERATIONS_H_
11 #define _TABLE_OPERATIONS_H_
12 
13 #include <tr1/functional>
14 
15 #include "processor.h"
16 #include "result.hpp"
17 
18 namespace cass
19 {
20 
21 /** get specific column from table like histogram
22  *
23  * @PPList "72": get specific column from table like histogram
24  *
25  * Will copy all contents of the input tables user specified column into a
26  * 1d histogram.
27  *
28  * @see Processor for a list of all commonly available cass.ini
29  * settings.
30  *
31  * @cassttng Processor/\%name\%/{TableName} \n
32  * name of processor that contains the table like histogram
33  * subset from. Default is "".
34  * @cassttng Processor/\%name\%/{ColumnIndex} \n
35  * The index of the column in the table that one wants to have
36  * extracted. Please refer to the Processor description of the
37  * Processor that contains the table to find out what column
38  * indizes are available.
39  * Default is "0".
40  *
41  * @author Lutz Foucar
42  */
43 class pp72 : public Processor
44 {
45 public:
46  /** constructor */
47  pp72(const name_t&);
48 
49  /** process event */
50  virtual void process(const CASSEvent&, result_t&);
51 
52  /** load the settings of the pp */
53  virtual void loadSettings(size_t);
54 
55 protected:
56  /** pp containing input table */
58 
59  /** index of the column that needs to be extracted */
60  size_t _colIdx;
61 };
62 
63 
64 
65 
66 /** get all rows with condition on a column
67  *
68  * @PPList "73": get all rows with condition on a column
69  *
70  * Will copy all rows of the input table where a user specified column value
71  * satisfies the set condition. Therefore the value has to be greater or equal
72  * to the lower bound and smaller than the upper bound.
73  *
74  * @see Processor for a list of all commonly available cass.ini
75  * settings.
76  *
77  * @cassttng Processor/\%name\%/{TableName} \n
78  * name of processor that contains the table like histogram
79  * subset from. Default is "".
80  * @cassttng Processor/\%name\%/{ColumnIndex} \n
81  * The index of the column in the table that one wants to use the
82  * condition on. Please refer to the Processor description of the
83  * Processor that contains the table to find out what column
84  * indizes are available.
85  * Default is "0".
86  * @cassttng Processor/\%name\%/{UpperBound|LowerBound} \n
87  * Upper- and Lower Bound of the boundaries that the column value will
88  * be checked for.
89  *
90  * @author Lutz Foucar
91  */
92 class pp73 : public Processor
93 {
94 public:
95  /** constructor */
96  pp73(const name_t&);
97 
98  /** process event */
99  virtual void process(const CASSEvent&, result_t&);
100 
101  /** load the settings of the pp */
102  virtual void loadSettings(size_t);
103 
104 protected:
105  /** pp containing input table */
107 
108  /** index of the column that will be checked for */
109  size_t _colIdx;
110 
111  /** the boundaries for the condition */
112  std::pair<float,float> _bounds;
113 };
114 
115 
116 
117 
118 
119 
120 /** retrieve a specific value of a specific row
121  *
122  * @PPList "74": retrieve a specific value of a specific row
123  *
124  *
125  * @see Processor for a list of all commonly available cass.ini
126  * settings.
127  *
128  * @cassttng Processor/\%name\%/{TableName} \n
129  * name of processor that contains the table like histogram
130  * subset from. Default is "".
131  * @cassttng Processor/\%name\%/{RowIndex} \n
132  * The index of the row in the table that contains the requested value.
133  * Default is "0"
134  * @cassttng Processor/\%name\%/{ColumnIndex} \n
135  * The index of the column in the table that contains the requested
136  * value. Please refer to the Processor description of the
137  * Processor that contains the table to find out what column
138  * indizes are available.
139  * Default is "0".
140  *
141  * @author Lutz Foucar
142  */
143 class pp74 : public Processor
144 {
145 public:
146  /** constructor */
147  pp74(const name_t&);
148 
149  /** process event */
150  virtual void process(const CASSEvent&, result_t&);
151 
152  /** load the settings of the pp */
153  virtual void loadSettings(size_t);
154 
155 protected:
156  /** pp containing input table */
158 
159  /** index of the column */
160  size_t _colIdx;
161 
162  /** the index of the row */
163  size_t _rowIdx;
164 };
165 
166 
167 
168 
169 /** generate a 2d Histogram from values of 2 columns of a table
170  *
171  * @PPList "79": generate a 2d Histogram from values of 2 columns of a table
172  *
173  * @see Processor for a list of all commonly available cass.ini
174  * settings.
175  *
176  * @cassttng Processor/\%name\%/{TableName} \n
177  * name of processor that contains the table like histogram
178  * subset from. Default is "".
179  * @cassttng Processor/\%name\%/{XColumnIndex|YColumnIndex} \n
180  * The index of the column in the table that one wants to have
181  * extracted and put on the x- and y-axis. Please refer to the
182  * Processor description of the Processor that contains the
183  * table to find out what column indizes are available.
184  * Default is "0".
185  * @cassttng Processor/\%name\%/{WeightColumnIndex} \n
186  * Optional index of the column that will be used for the weights
187  * when histogramming the x and y values. If negative number is given
188  * the absolute value of it will be used as weight. Default is -1
189  * @cassttng Processor/\%name\%/{XNbrBins|XLow|XUp|YNbrBins|YLow|YUp}\n
190  * properties of the 2d result
191  *
192  * @author Lutz Foucar
193  */
194 class pp79 : public Processor
195 {
196 public:
197  /** constructor */
198  pp79(const name_t&);
199 
200  /** process event */
201  virtual void process(const CASSEvent&, result_t&);
202 
203  /** load the settings of the pp */
204  virtual void loadSettings(size_t);
205 
206 protected:
207  /** define the function to return the weight value */
208  typedef std::tr1::function<result_t::value_t(result_t::const_iterator)> func_t;
209 
210  /** returns the weight value from a table
211  *
212  * @param the weight
213  * @param tableIt the iterator that points to the row of the table to exract
214  * the weight from
215  */
216  func_t::result_type weightFromTable(func_t::argument_type tableIt);
217 
218  /** returns a 1
219  *
220  * @param 1
221  * @param unused unused parameter
222  */
223  func_t::result_type constantWeight(func_t::argument_type unused);
224 
225 
226 protected:
227  /** pp containing input table */
229 
230  /** index of the column with the x-values that needs to be extracted */
231  size_t _xcolIdx;
232 
233  /** index of the column with the y-values that needs to be extracted */
234  size_t _ycolIdx;
235 
236  /** index of the column with the weights that needs to be exracted */
238 
239  /** the function to return the weight */
240  func_t _getWeight;
241 };
242 
243 
244 
245 
246 
247 
248 
249 
250 /** add a new column where the contents are taken from another results based on
251  * the index provided in this table
252  *
253  * @PPList "500": add new table column to table
254  *
255  * @see Processor for a list of all commonly available cass.ini
256  * settings.
257  *
258  * @cassttng Processor/\%name\%/{TableName} \n
259  * name of processor that contains the table like histogram
260  * subset from. Default is "".
261  * @cassttng Processor/\%name\%/{IndexColumn} \n
262  * The index of the column in the table that provides which point of
263  * the input result will be put into the new column
264  * Default is "0".
265  *
266  * @author Lutz Foucar
267  */
268 class pp500 : public Processor
269 {
270 public:
271  /** constructor */
272  pp500(const name_t&);
273 
274  /** process event */
275  virtual void process(const CASSEvent&, result_t&);
276 
277  /** load the settings of the pp */
278  virtual void loadSettings(size_t);
279 
280 protected:
281  /** pp containing input table */
283 
284  /** pp containing input table */
286 
287  /** index of the column with the x-values that needs to be extracted */
288  size_t _colIdx;
289 };
290 
291 
292 
293 
294 }//end namespace cass
295 #endif
generate a 2d Histogram from values of 2 columns of a table
size_t _xcolIdx
index of the column with the x-values that needs to be extracted
virtual void loadSettings(size_t)
load the settings of the pp
Event to store all LCLS Data.
Definition: cass_event.h:32
virtual void loadSettings(size_t)
load the settings of the pp
size_t _rowIdx
the index of the row
retrieve a specific value of a specific row
pp500(const name_t &)
constructor
std::pair< float, float > _bounds
the boundaries for the condition
func_t _getWeight
the function to return the weight
add a new column where the contents are taken from another results based on the index provided in thi...
virtual void loadSettings(size_t)
load the settings of the pp
virtual void loadSettings(size_t)
load the settings of the pp
virtual void process(const CASSEvent &, result_t &)
process event
pp74(const name_t &)
constructor
shared_pointer _table
pp containing input table
shared_pointer _table
pp containing input table
result classes
get all rows with condition on a column
int _weightcolIdx
index of the column with the weights that needs to be exracted
size_t _colIdx
index of the column
virtual void loadSettings(size_t)
load the settings of the pp
func_t::result_type constantWeight(func_t::argument_type unused)
returns a 1
base class for processors.
Definition: processor.h:39
pp73(const name_t &)
constructor
virtual void process(const CASSEvent &, result_t &)
process event
virtual void process(const CASSEvent &, result_t &)
process event
func_t::result_type weightFromTable(func_t::argument_type tableIt)
returns the weight value from a table
size_t _colIdx
index of the column with the x-values that needs to be extracted
virtual void process(const CASSEvent &, result_t &)
process event
get specific column from table like histogram
std::tr1::function< result_t::value_t(result_t::const_iterator)> func_t
define the function to return the weight value
pp72(const name_t &)
constructor
shared_pointer _table
pp containing input table
file contains processors baseclass declaration
shared_pointer _inResult
pp containing input table
pp79(const name_t &)
constructor
size_t _ycolIdx
index of the column with the y-values that needs to be extracted
shared_pointer _table
pp containing input table
size_t _colIdx
index of the column that will be checked for
virtual void process(const CASSEvent &, result_t &)
process event
std::string name_t
define the name type
Definition: processor.h:46
std::tr1::shared_ptr< Processor > shared_pointer
a shared pointer of this
Definition: processor.h:43
size_t _colIdx
index of the column that needs to be extracted
shared_pointer _table
pp containing input table