CFEL - ASG Software Suite  2.5.0
CASS
operations.h
Go to the documentation of this file.
1 // Copyright (C) 2010 -2015 Lutz Foucar
2 
3 /**
4  * @file operations.h file contains processors that will operate
5  * on results of other processors
6  *
7  * @todo add pp creating a running/moving standart deviation (just lke average)
8  *
9  * @author Lutz Foucar
10  */
11 
12 #ifndef _OPERATIONS_H_
13 #define _OPERATIONS_H_
14 
15 #include <tr1/functional>
16 #include <time.h>
17 
18 #include "processor.h"
19 #include "cass_event.h"
21 
22 namespace cass
23 {
24 
25 
26 
27 /** Operation on 2 results
28  *
29  * @PPList "1":Operation on 2 results value by value
30  *
31  * @see Processor for a list of all commonly available cass.ini
32  * settings.
33  *
34  * @cassttng Processor/\%name\%/{InputOne} \n
35  * the processor name that contain the first result.
36  * Needs to be of the same dimension and size as the second.
37  * @cassttng Processor/\%name\%/{InputTwo} \n
38  * the processor name that contain the second result.
39  * Needs to be of the same dimension and size as the first
40  * @cassttng Processor/\%name\%/{Operation} \n
41  * Default is "+". Possible values are:
42  * - "+": Use add as operation
43  * - "-": Use minus as operation
44  * - "/": Use divide as operation
45  * - "*": Use multiply as operation
46  * - "AND": Use logical AND as operation
47  * - "OR": Use logical OR as operation
48  * - ">": Use greater as operation
49  * - ">=": Use greater or equal as operation
50  * - "<": Use less than as operation
51  * - "<=": Use less or equal as operation
52  * - "==": Use equal to as operation
53  * - "!=": Use not equal to as operation
54  *
55  * @author Lutz Foucar
56  */
57 class pp1 : public Processor
58 {
59 public:
60  /** constructor */
61  pp1(const name_t & name);
62 
63  /** load the settings of this pp */
64  virtual void loadSettings(size_t);
65 
66  /** process event */
67  virtual void process(const CASSEvent& evt, result_t&);
68 
69 protected:
70  /** processor containing the first result */
72 
73  /** processor containing the second result */
75 
76  /** the operand */
77  std::tr1::function<result_t::value_t(result_t::value_t, result_t::value_t)> _op;
78 };
79 
80 
81 
82 
83 
84 
85 /** Operation on result with value
86  *
87  * @PPList "2":Operation on result with value
88  *
89  * @see Processor for a list of all commonly available cass.ini
90  * settings.
91  *
92  * @cassttng Processor/\%name\%/{InputName} \n
93  * the processor name that contains the result to operate on. Needs to
94  * be implemented, because default is "Unknown", which is invalid.
95  * @cassttng Processor/\%name\%/{Value} \n
96  * Either the constant value for the operation or a 0D Processor
97  * containing the value for the operation. Default is 1
98  * @cassttng Processor/\%name\%/{Operation} \n
99  * Default is "+". Possible values are:
100  * - "+": Use add as operation
101  * - "-": Use minus as operation
102  * - "/": Use divide as operation
103  * - "*": Use multiply as operation
104  * - "AND": Use logical AND as operation
105  * - "OR": Use logical OR as operation
106  * - ">": Use greater as operation
107  * - ">=": Use greater or equal as operation
108  * - "<": Use less than as operation
109  * - "<=": Use less or equal as operation
110  * - "==": Use equal to as operation
111  * - "!=": Use not equal to as operation
112  * @cassttng Processor/\%name\%/{ValuePos} \n
113  * Chooses where in the operation the Value or the value taken from
114  * the 0D Processor will be. Default is "first". Possible values
115  * are:
116  * - first: Value will be first operand
117  * - second: Value will be second operand
118  *
119  * @author Lutz Foucar
120  */
121 class pp2 : public Processor
122 {
123 
124 public:
125  /** constructor */
126  pp2(const name_t &name);
127 
128  /** load the settings of this pp */
129  virtual void loadSettings(size_t);
130 
131  /** process event */
132  virtual void process(const CASSEvent& evt, result_t&);
133 
134 protected:
135  /** define the unary operation */
136  typedef std::tr1::function<result_t::value_t(result_t::value_t)> unaryoperation_t;
137 
138  /** define the binary operation */
139  typedef std::tr1::function<result_t::value_t(result_t::value_t,result_t::value_t)> binaryoperation_t;
140 
141  /** define how to get the value */
142  typedef std::tr1::function<result_t::value_t(const CASSEvent::id_t &)> valueRetrieval_t;
143 
144  /** define how to get the right parameter position */
145  typedef std::tr1::function<unaryoperation_t(result_t::value_t)> setParamPos_t;
146 
147  /** bind the value to the first parameter of the binaryoperation
148  *
149  * @return function call where value is bound to the fist parameter
150  */
151  unaryoperation_t ValAtFirst(result_t::value_t val);
152 
153  /** bind the value to the second parameter of the binaryoperation
154  *
155  * @return function call where value is bound to the second parameter
156  */
157  unaryoperation_t ValAtSecond(result_t::value_t val);
158 
159  /** retrieve value from Processor
160  *
161  * @returns value stored in _valuePP
162  * @param id id of the event for which the value should be returned
163  */
165 
166  /** retrieve value constant
167  *
168  * @returns _value
169  * @param evt ignored
170  */
172 
173 protected:
174  /** processor containing input result */
176 
177  /** processor containing 0D value for the unary operation */
179 
180  /** the value for the unary operation */
182 
183  /** the operand */
184  binaryoperation_t _op;
185 
186  /** function to set the value to the requested parameter position */
187  setParamPos_t _setParamPos;
188 
189  /** function to retrieve the value for the unary operation */
190  valueRetrieval_t _retrieveValue;
191 };
192 
193 
194 
195 
196 
197 
198 
199 /** Apply boolean NOT to 0D result
200  *
201  * @PPList "4": Apply boolean NOT to 0D result
202  *
203  * @see Processor for a list of all commonly available cass.ini
204  * settings.
205  *
206  * @cassttng Processor/\%name\%/{InputName} \n
207  * the processor name that contains the result to invert
208  *
209  * @author Lutz Foucar
210  */
211 class pp4 : public Processor
212 {
213 public:
214  /** constructor */
215  pp4(const name_t &name);
216 
217  /** process event */
218  virtual void process(const CASSEvent&, result_t&);
219 
220  /** load the settings of this pp */
221  virtual void loadSettings(size_t);
222 
223 protected:
224  /** processor containing result */
226 };
227 
228 
229 
230 
231 
232 
233 
234 
235 /** Check whether result is in range.
236  *
237  * @PPList "9": Check whether sum value of result is in range
238  *
239  * In case the input is not a 0D result, the contents of all bins will be
240  * summed and the sum is then checked whether it is within the limits.
241  *
242  * @see Processor for a list of all commonly available cass.ini
243  * settings.
244  *
245  * @cassttng Processor/\%name\%/{InputName} \n
246  * the processor name that contain the result for checking the value
247  * @cassttng Processor/\%name\%/{UpperLimit|LowerLimit} \n
248  * Upper and Lower limit of the range to check. Default is 0,0.
249  * The following check will be done
250  * \f$ LowerLimit < value < UpperLimit \f$ Thus, both enpoints are
251  * exclusive.
252  *
253  * @author Lutz Foucar
254  */
255 class pp9 : public Processor
256 {
257 public:
258  /** constructor */
259  pp9(const name_t &name);
260 
261  /** process event */
262  virtual void process(const CASSEvent&, result_t&);
263 
264  /** load the settings of this pp */
265  virtual void loadSettings(size_t);
266 
267 protected:
268  /** processor containing first result */
270 
271  /** the requested range that the value should be in */
272  std::pair<result_t::value_t,result_t::value_t> _range;
273 };
274 
275 
276 
277 
278 
279 
280 
281 
282 
283 
284 /** Constant Value processor.
285  *
286  * @PPList "12": Constant Value
287  *
288  * @cassttng Processor/\%name\%/{Value} \n
289  * The value of the processors 0d result Default is 0.
290  * @cassttng Processor/\%name\%/{ValueType} \n
291  * The type of constant that will we returned. Default is '0D'.
292  * Possible values are:
293  * - '0D': A 0d result will be returned
294  * - '1D': A 1d array result will be returned
295  * - '2D': A 2d image result will be returned
296  * @cassttng Processor/\%name\%/{XNbrBins|XLow|XUp|YNbrBins|YLow|YUp}\n
297  * Optional settings, needed when selected 1D or 2D as type
298  *
299  * @author Lutz Foucar
300  */
301 class pp12 : public Processor
302 {
303 public:
304  /** constructor */
305  pp12(const name_t &);
306 
307  /** overwrite default behaviour and just return the constant */
308  virtual const result_t& result(const CASSEvent::id_t)
309  {
310  return *_res;
311  }
312 
313  /** overwrite default behaviour don't do anything */
314  virtual void processEvent(const CASSEvent&){}
315 
316  /** overwrite default behaviour don't do anything */
317  virtual void releaseEvent(const CASSEvent &){}
318 
319  /** load the settings of this pp */
320  virtual void loadSettings(size_t);
321 
322 private:
323  /** the constant result */
325 };
326 
327 
328 
329 
330 
331 
332 
333 
334 
335 
336 
337 /** return the input
338  *
339  * @PPList "13": return the input (identiy operation)
340  *
341  * @see Processor for a list of all commonly available cass.ini
342  * settings.
343  *
344  * @cassttng Processor/\%name\%/{InputName} \n
345  * the processor name that contain the input result to be copied
346  *
347  * @author Lutz Foucar
348  */
349 class pp13 : public Processor
350 {
351 public:
352  /** constructor */
353  pp13(const name_t &name);
354 
355  /** process event */
356  virtual void process(const CASSEvent&, result_t&);
357 
358  /** load the settings of this pp */
359  virtual void loadSettings(size_t);
360 
361 protected:
362  /** processor containing result */
364 };
365 
366 
367 
368 
369 
370 
371 
372 
373 
374 
375 /** clear result
376  *
377  * @PPList "14": ?: operator
378  *
379  * Will return input one when condition input is true and input two otherwise
380  *
381  * @see Processor for a list of all commonly available cass.ini
382  * settings.
383  *
384  * @cassttng Processor/\%name\%/{InputOne} \n
385  * Name of the result that should be returned when condition is true.
386  * Needs to have the same dimension as InputTwo.
387  * @cassttng Processor/\%name\%/{InputTwo} \n
388  * Name of the result that should be returned when condition is false.
389  * Needs to have the same dimension as InputOne.
390  *
391  * @author Lutz Foucar
392  */
393 class pp14 : public Processor
394 {
395 public:
396  /** constructor */
397  pp14(const name_t &name);
398 
399  /** overwrite process event */
400  virtual void processEvent(const CASSEvent&);
401 
402  /** load the settings of the pp */
403  virtual void loadSettings(size_t);
404 
405 protected:
406  /** processor containing input when true result */
408 
409  /** processor containing input when false result */
411 };
412 
413 
414 
415 
416 
417 
418 
419 /** Check whether value has changed.
420  *
421  * @PPList "15": Check whether value of 0d result has changed
422  *
423  * check whether a value has changed with respekt to the previous event.
424  *
425  * @cassttng Processor/\%name\%/{InputName} \n
426  * The Processor name that contain the 0D result that should be
427  * monitored.
428  * @cassttng Processor/\%name\%/{Difference} \n
429  * The maximum allowed difference between the previous and the current
430  * value of the 0D result. Default is 0 which results in a value
431  * given by std::numeric_limits<float>::epsilon().
432  *
433  * @author Lutz Foucar
434  */
436 {
437 public:
438  /** constructor */
439  pp15(const name_t &name);
440 
441  /** process event */
442  virtual void process(const CASSEvent&, result_t&);
443 
444  /** load the settings of this pp */
445  virtual void loadSettings(size_t);
446 
447 protected:
448  /** pp containing the value to check */
450 
451  /** the value of the previous event */
453 
454  /** the maximum difference to previous val that is accepted */
456 };
457 
458 
459 
460 
461 
462 
463 
464 /** Threshold result.
465  *
466  * @PPList "40": Threshold result
467  *
468  * @see Processor for a list of all commonly available cass.ini
469  * settings.
470  *
471  * @cassttng Processor/\%name\%/{InputName} \n
472  * processor name with result that should be thresholded. Default is 0.
473  * @cassttng Processor/\%name\%/{Threshold} \n
474  * Either an result or a constant value with which the input result
475  * will be thresholded.
476  * @cassttng Processor/\%name\%/{UserVal} \n
477  * The value that will be set when the input value is below the
478  * threshold. Default is 0.
479  *
480  * @author Thomas White
481  * @author Lutz Foucar
482  */
483 class pp40 : public Processor
484 {
485 public:
486  /** constructor */
487  pp40(const name_t &name);
488 
489  /** process event */
490  virtual void process(const CASSEvent&, result_t&);
491 
492  /** load the settings of this pp */
493  virtual void loadSettings(size_t);
494 
495 protected:
496  /** the funtion that applies the threshold to the input */
497  std::tr1::function<void(const result_t&, result_t&,
499 
500  /** the thresholding function
501  *
502  * will check whether the input is bigger than the threshold and return the
503  * input if so, otherwise it will retrun the user value.
504  *
505  * @param value the value to check for
506  * @param thresh the threshold for the value
507  */
509  const result_t::value_t &thres);
510  /** apply a constant threshold
511  *
512  * @param in the input result that should be thresholded
513  * @param out the result where the thresholded values will be written to
514  * @param id the event id of the current event
515  */
516  void applyConstantThreshold(const result_t &in, result_t &out,
517  const CASSEvent::id_t &id);
518 
519  /** apply a indexwise threshold
520  *
521  * @param in the input result that should be thresholded
522  * @param out the result where the thresholded values will be written to
523  * @param id the event id of the current event
524  */
525  void applyIdxwiseThreshold(const result_t &in, result_t &out,
526  const CASSEvent::id_t &id);
527 
528  /** pp containing the indexwise threshold */
530 
531  /** pp containing input result */
533 
534  /** the user value that will be set when the threshold is applied */
536 
537  /** the threshold */
539 };
540 
541 
542 
543 
544 
545 
546 
547 
548 
549 
550 
551 
552 /** Threshold result based upon information from another result
553  *
554  * @PPList "41": Threshold result based upon information from another result
555  *
556  * set the bin of a result to a user requested value when the corresponding
557  * value of the threshold is within a user requested range.
558  *
559  * @see Processor for a list of all commonly available cass.ini
560  * settings.
561  *
562  * @cassttng Processor/\%name\%/{InputName} \n
563  * processor name with result that should be thresholded.
564  * Default is Unknown.
565  * @cassttng Processor/\%name\%/{ThresholdName} \n
566  * Processor that will be used to threshold the Input
567  * Default is Unknown.
568  * @cassttng Processor/\%name\%/{UserVal} \n
569  * The value that will be set when the value of the corresponding bin
570  * is within the boundaries. Default is 0
571  * @cassttng Processor/\%name\%/{LowerLimit|UpperLimit} \n
572  * The boundaries within which the value of the ThresholdName has to
573  * be in order to set the value of the result to UserVal.
574  * Default is 0.5|1.5. Both Limits are exclusive.
575  *
576  * @author Lutz Foucar
577  */
578 class pp41 : public Processor
579 {
580 public:
581  /** constructor */
582  pp41(const name_t &name);
583 
584  /** process event */
585  virtual void process(const CASSEvent&, result_t&);
586 
587  /** load the settings of this pp */
588  virtual void loadSettings(size_t);
589 
590 protected:
591  /** check if value is in range and return another value
592  *
593  * @return user set value if value is in range
594  * @param val the value that will be returned if checkval is not in range
595  * @param checkval the value to check if it is in range
596  */
598 
599 protected:
600  /** pp containing input result */
602 
603  /** pp containing threshold result */
605 
606  /** the value that will be set */
608 
609  /** the lower boundary of the range */
611 
612  /** the upper boundary of the range */
614 };
615 
616 
617 
618 
619 
620 
621 
622 /** Projection of 2d result
623  *
624  * @PPList "50": Project 2D result onto a axis
625  *
626  * Project a user defined range of a 2d result onto a user defined axis.
627  *
628  * @see Processor for a list of all commonly available cass.ini
629  * settings.
630  *
631  * @cassttng Processor/\%name\%/{InputName} \n
632  * Name of the processor containing the 2D result that will be
633  * projected
634  * @cassttng Processor/\%name\%/{Low|Up} \n
635  * Upper and lower bound of the area to project. The endpoints are
636  * defined like \f$ [Low,Up[ \f$. Default is -1e6|1e6
637  * @cassttng Processor/\%name\%/{Axis} \n
638  * The axis we want to project to. Default is "xAxis".
639  * Possible choises are:
640  * - "xAxis": projects the selected range in y to the x-Axis
641  * - "yAxis": projects the selected range in x to the y-Axis
642  *
643  * @author Lutz Foucar
644  */
645 class pp50 : public Processor
646 {
647 public:
648  /** constructor */
649  pp50(const name_t &name);
650 
651  /** process event */
652  virtual void process(const CASSEvent&, result_t&);
653 
654  /** load the settings of the pp */
655  virtual void loadSettings(size_t);
656 
657 private:
658  /** project 2d result to x axis
659  *
660  * @param src iterator to the begining of the 2d result that one wants to
661  * project
662  * @param dest iterator to the beginning of the resulting projection
663  */
665  result_t::iterator dest);
666 
667  /** project 2d result to y axis
668  *
669  * @param src iterator to the beginning of the 2d result that one wants to
670  * project
671  * @param dest iterator to the beginning of the resulting projection
672  */
674  result_t::iterator dest);
675 
676 private:
677  /** processor containing the 2d result we want to project */
679 
680  /** range we want to project */
681  std::pair<int,int> _xRange;
682 
683  /** range we want to project */
684  std::pair<int,int> _yRange;
685 
686  /** the nbr of bins in the original image */
687  size_t _nX;
688 
689  /** function that will do the projection */
690  std::tr1::function<void(result_t::const_iterator,
692 };
693 
694 
695 
696 
697 
698 
699 
700 
701 
702 
703 /** Integral of 1D result.
704  *
705  * @PPList "51": Integral of 1D result
706  *
707  * integrate the values of a 1d result within a user set range
708  *
709  * @see Processor for a list of all commonly available cass.ini
710  * settings.
711  *
712  * @cassttng Processor/\%name\%/{InputName} \n
713  * processor name with 1D-result that we create the intgral from.
714  * Default is Unknown.
715  * @cassttng Processor/\%name\%/{XLow|XUp} \n
716  * Upper and lower bound of the area to integrate. The endpoints are
717  * defined like \f$ [XLow,Xup[ \f$. Default is -1e6 ... 1e6
718  * @cassttng Processor/\%name\%/{BaselineXLow|BaselineXUp} \n
719  * Upper and lower bound of the area that determines the baseline for
720  * the integration. If these values are not set, then a baseline of 0
721  * is taken. The endpoints are
722  * defined like \f$ [XLow,Xup[ \f$. Default is -1e6 ... 1e6
723  *
724  * @author Lutz Foucar
725  */
726 class pp51 : public Processor
727 {
728 public:
729  /** constructor */
730  pp51(const name_t &name);
731 
732  /** process event */
733  virtual void process(const CASSEvent&, result_t&);
734 
735  /** load the settings of the pp */
736  virtual void loadSettings(size_t);
737 
738 private:
739  /** processor containing the 1d result we want to integrate */
741 
742  /** range we want to have the integral over in result bins */
743  std::pair<int,int> _range;
744 
745  /** range we want to have the baseline for the integral over in result bins */
746  std::pair<int,int> _baselineRange;
747 
748  /** get the baseline for the integration
749  *
750  * @return the baseline value
751  * @param input the input trace from which the baseline will be determined
752  */
753  float baselineFromInput(const result_t &input);
754 
755  /** get constant baseline
756  *
757  * @return the constant baseline value
758  * @param input unused
759  */
760  float constantBaseline(const result_t &/*input*/) {return 0.f;}
761 
762  /** the function that will return the baseline */
763  std::tr1::function<float(const result_t&)> _baseline;
764 };
765 
766 
767 
768 
769 
770 
771 
772 
773 
774 
775 /** store previous result of other Processor
776  *
777  * @PPList "56": Contains the result of the previous event
778  *
779  * Stores a previous version of another result.
780  *
781  * @see Processor for a list of all commonly available cass.ini
782  * settings.
783  *
784  * @cassttng Processor/\%name\%/{InputName} \n
785  * processor name containing the result that will be stored
786  *
787  * @author Lutz Foucar
788  */
789 class pp56 : public Processor
790 {
791 public:
792  /** constructor */
793  pp56(const name_t &name);
794 
795  /** process event */
796  virtual void process(const CASSEvent&, result_t&);
797 
798  /** load the settings */
799  virtual void loadSettings(size_t);
800 
801 protected:
802  /** the previous result */
804 
805  /** processor containing result to store */
807 };
808 
809 
810 
811 
812 
813 
814 
815 
816 
817 
818 
819 
820 
821 
822 
823 /** Weighted Projection of 2D result.
824  *
825  * @PPList "57": Weighted Project 2D result onto a axis
826  *
827  * devides each bin by the number of values that have been added in
828  * this bin. Exclusion values will not be added to the bin.
829  *
830  * @see Processor for a list of all commonly available cass.ini
831  * settings.
832  *
833  * @cassttng Processor/\%name\%/{InputName} \n
834  * Name of the processor containing the 2D result that will be
835  * projected
836  * @cassttng Processor/\%name\%/{Low|Up} \n
837  * Upper and lower bound of the area to project. Default is
838  * -1e6 ... 1e6
839  * @cassttng Processor/\%name\%/{Axis} \n
840  * The axis we want to project to. Default is "xAxis".
841  * Possible choises are:
842  * - "xAxis": projects the selected range in y to the x-Axis
843  * - "yAxis": projects the selected range in x to the y-Axis
844  * @cassttng Processor/\%name\%/{ExclusionValue} \n
845  * The value that will be excluded when doing the projection. The
846  * result will be normilzed by the amount of bins that have been
847  * summed. Default is 0.
848  *
849  * @author Lutz Foucar
850  */
851 class pp57 : public Processor
852 {
853 public:
854  /** constructor */
855  pp57(const name_t &name);
856 
857  /** process event */
858  virtual void process(const CASSEvent&, result_t&);
859 
860  /** load the settings of the pp */
861  virtual void loadSettings(size_t);
862 
863 private:
864  /** integrate the rows
865  *
866  * @param src 2d image that will be projected
867  * @param result vector were the projection will be written to
868  * @param norm vector where the normalization values will be added to
869  */
872  result_t::iterator norm);
873 
874  /** integrate the columns
875  *
876  * @param src 2d image that will be projected
877  * @param result vector were the projection will be written to
878  * @param norm vector where the normalization values will be added to
879  */
881  result_t::iterator result,
882  result_t::iterator norm);
883 
884 private:
885  /** processor containing the 2d result we want to project */
887 
888  /** range in X we want to project */
889  std::pair<int,int> _Xrange;
890 
891  /** range in Y we want to project */
892  std::pair<int,int> _Yrange;
893 
894  /** the size of the original image in X */
895  size_t _nX;
896 
897  /** the value that should be excluded in the summation */
898  float _excludeVal;
899 
900  /** the function used to project the image */
901  std::tr1::function<void(result_t::const_iterator,
904 };
905 
906 
907 
908 
909 
910 
911 
912 
913 
914 
915 
916 
917 
918 /** 0D,1D or 2D to 1D histogramming.
919  *
920  * @PPList "60": Histogram 0D, 1D or 2D values to a 1D result
921  *
922  * histograms all values of 0D, 1D or 2D into a 1D result. This result holds
923  * only the histogrammed values of one event. Use Processors 61 or 62 to
924  * average or sum up this result, respectively.
925  *
926  * It has the capability to histogram the values with user provided weights,
927  * which can either be a provided constant or taken from another processor. In
928  * case the weight processor contains a 0D value, the value will be taked as a
929  * constant. Othwerwise the processor containing the weights has to have the
930  * same shape as the input values.
931  *
932  * In case the option that allows remembering how many times a bin has been
933  * filled the result is a 2D result with 2 bins in y. The 0th bin contains the
934  * weighted Histogram and the 1st bin contains the number of entries in the
935  * corresponding bin.
936  *
937  * @see Processor for a list of all commonly available cass.ini
938  * settings.
939  *
940  * @cassttng Processor/\%name\%/{XName} \n
941  * processor name containing the values to histogram
942  * @cassttng Processor/\%name\%/{XNbrBins|XLow|XUp|XTitle}\n
943  * properties of the resulting 1D histogram
944  * @cassttng Processor/\%name\%/{Weight} \n
945  * The weight, Can either be a constant value or a processor name
946  * containing the weights. The processor needs to be either of the
947  * same shape as the input, in which case the individual entires are
948  * the weights of the corresponding bins in the input, or contain a
949  * 0D value, in which case this will be used as weight for all the
950  * input values. Please see details for details about this option.
951  * Default 1
952  * @cassttng Processor/\%name\%/{RememberCounts}\n
953  * This flag allows to enable the option of remembering the number of
954  * times a given bin has been filled. See detailed description for
955  * more info about this option. Default is false
956  *
957  * @author Lutz Foucar
958  */
959 class pp60 : public Processor
960 {
961 public:
962  /** constructor */
963  pp60(const name_t &name);
964 
965  /** process event */
966  virtual void process(const CASSEvent&, result_t&);
967 
968  /** load the settings */
969  virtual void loadSettings(size_t);
970 
971 protected:
972  /** define the function for histogramming */
973  typedef std::tr1::function<void(CASSEvent::id_t,
977 
978  /** histogam with weights from another processor
979  *
980  * @param id the event id to get the right weight from the processor
981  * @param in iterator to the beginning of the input
982  * @param last iterator to the end of the data input
983  * @param result reference to the result that does the histograming
984  */
988  result_t & result);
989 
990  /** histogam with user provided constant weight
991  *
992  * @param unused an unused paramter
993  * @param in iterator to the beginning of the input
994  * @param last iterator to the end of the data input
995  * @param result reference to the result that does the histograming
996  */
1000  result_t & result);
1001 
1002  /** histogam with weight from 0D processor
1003  *
1004  * @param id the event id to get the right weight from the processor
1005  * @param in iterator to the beginning of the input
1006  * @param last iterator to the end of the data input
1007  * @param result reference to the result that does the histograming
1008  */
1012  result_t & result);
1013 
1014  /** histogam with weights from another processor
1015  *
1016  * In addition remember the number of counts in a bin
1017  *
1018  * @param id the event id to get the right weight from the processor
1019  * @param in iterator to the beginning of the input
1020  * @param last iterator to the end of the data input
1021  * @param result reference to the result that does the histograming
1022  */
1026  result_t & result);
1027 
1028  /** histogam with user provided constant weight
1029  *
1030  * In addition remember the number of counts in a bin
1031  *
1032  * @param unused an unused paramter
1033  * @param in iterator to the beginning of the input
1034  * @param last iterator to the end of the data input
1035  * @param result reference to the result that does the histograming
1036  */
1040  result_t & result);
1041 
1042  /** histogam with weights from 0D processor
1043  *
1044  * In addition remember the number of counts in a bin
1045  *
1046  * @param id the event id to get the right weight from the processor
1047  * @param in iterator to the beginning of the input
1048  * @param last iterator to the end of the data input
1049  * @param result reference to the result that does the histograming
1050  */
1054  result_t & result);
1055 
1056 protected:
1057  /** processor containing result to histogram */
1059 
1060  /** the weight in case it is a constant */
1062 
1063  /** processor containing the weight */
1065 
1066  /** function used for histogramming */
1068 };
1069 
1070 
1071 
1072 
1073 
1074 
1075 /** result averaging.
1076  *
1077  * @PPList "61": Average of a result
1078  *
1079  * Running or cummulative average of a result. Could also be a squared average.
1080  *
1081  * @see Processor for a list of all commonly available cass.ini
1082  * settings.
1083  *
1084  * @cassttng Processor/\%name\%/{AveragingType}\n
1085  * The type of averaging that should be performed. Default is "Normal"
1086  * - "Normal": a normal average will be used
1087  * - "Square"; a square averaging will be performed
1088  * @cassttng Processor/\%name\%/{NbrOfAverages}\n
1089  * how many images should be averaged. When value is 0 its a
1090  * cummulative average. Default is 1.
1091  * @cassttng Processor/\%name\%/{InputName} \n
1092  * processor name containing the result that we average.
1093  *
1094  * @author Lutz Foucar
1095  */
1097 {
1098 public:
1099  /** constructor */
1100  pp61(const name_t &name);
1101 
1102  /** process event */
1103  virtual void process(const CASSEvent&, result_t&);
1104 
1105  /** load the settings */
1106  virtual void loadSettings(size_t);
1107 
1108 protected:
1109  /** function for normal averaging.
1110  *
1111  * this operator is capable of performing a cumulative moving average and
1112  * a Exponential moving average.
1113  * @see http://en.wikipedia.org/wiki/Moving_average
1114  *
1115  * the operator calculates the average using the function
1116  * \f$ave_{new} = ave_{old} + \scale(val-ave_{old})\f$
1117  * where when \f$\scale\f$ is equal to N it is a cumulative moving average,
1118  * otherwise it will be a exponential moving average.
1119  *
1120  * @return the new average
1121  * @param val the current value to be added to the average
1122  * @param aveOld the old average
1123  * @param scale the scale with which the new value will be weighted
1124  */
1126  result_t::value_t aveOld,
1127  result_t::value_t scale);
1128 
1129  /** function that will calculate the square average
1130  *
1131  * the operator calculates the square average using the function
1132  * \f$ave_{new} = ave_{old} + \scale(val*val-ave_{old})\f$
1133  * where when \f$\scale\f$ is equal to N it is a cumulative moving average.
1134  *
1135  * @return the new average
1136  * @param val the current value to be added to the average
1137  * @param aveOld the old average
1138  * @param scale the scale with which the new value will be weighted
1139  */
1141  result_t::value_t aveOld,
1142  result_t::value_t scale);
1143 
1144  /** retrieve the cumulative scale for the current datum */
1146  {
1147  return 1./(static_cast<result_t::value_t>(_nbrEventsAccumulated));
1148  }
1149 
1150  /** retrieve the moving average scale after the initialization of the "first"
1151  * point
1152  */
1154 
1155  /** retrieve the moving average scale during the initialization */
1157 
1158 protected:
1159  /** alpha for the running average */
1161 
1162  /** function that will do the averagin */
1163  std::tr1::function<result_t::value_t(result_t::value_t,result_t::value_t,result_t::value_t)> _func;
1164 
1165  /** function that will return the scale that should be used for the average */
1166  std::tr1::function<result_t::value_t()> _scale;
1167 
1168  /** processor containing result to average */
1170 };
1171 
1172 
1173 
1174 
1175 
1176 /** result summing.
1177  *
1178  * @PPList "62": Summing up of results
1179  *
1180  * Sums up results.
1181  *
1182  * @see Processor for a list of all commonly available cass.ini
1183  * settings.
1184  *
1185  * @cassttng Processor/\%name\%/{InputName} \n
1186  * processor name containing the result that we sum up.
1187  *
1188  * @author Lutz Foucar
1189  */
1191 {
1192 public:
1193  /** constructor */
1194  pp62(const name_t&);
1195 
1196  /** process event */
1197  virtual void process(const CASSEvent&, result_t&);
1198 
1199  /** load the settings */
1200  virtual void loadSettings(size_t);
1201 
1202 protected:
1203  /** processor containing result to sum */
1205 };
1206 
1207 
1208 
1209 
1210 
1211 
1212 /** time average of 0d result.
1213  *
1214  * @PPList "63": Time Average of a result over given time-intervals
1215  *
1216  * Makes an running average of a given result over a given time period.
1217  *
1218  * @see Processor for a list of all commonly available cass.ini
1219  * settings.
1220  *
1221  * @cassttng Processor/\%name\%/{InputName} \n
1222  * @cassttng Processor/\%name\%/{MinTime|MaxTime} \n
1223  * Minimum and Maximum Time to plot in the result. Default
1224  * is 0 ... 300 (WARNING: for the moment this setting is not active)
1225  * @cassttng Processor/\%name\%/{NbrSamples} \n
1226  * Number of values that are used per second to calculate the average.
1227  * Default is 5
1228  *
1229  * @author Nicola Coppola
1230  */
1232 {
1233 public:
1234  /** constructor */
1235  pp63(const name_t&);
1236 
1237  /** process event */
1238  virtual void process(const CASSEvent&, result_t&);
1239 
1240  /** load the settings of the pp */
1241  virtual void loadSettings(size_t);
1242 
1243 protected:
1244  /** processor containing result to work on */
1246 
1247  /** range of time that we use for the angular distribution */
1248  std::pair<size_t,size_t> _timerange;
1249 
1250  /** the number of bins in the result, range is fixed */
1251  size_t _nbrSamples;
1252 
1253  /** the number of samples seen up to now and used in the point */
1255 
1256  //@{
1257  /** time when the first samples was used in the point in time */
1260  //@}
1261 };
1262 
1263 
1264 
1265 
1266 
1267 /** record 0d result into 1d result.
1268  *
1269  * @PPList "64": 0d into 1d (append on right end, shifting old values to the left)
1270  *
1271  * appends values from results at end of this result and shifts the old values
1272  * to the left.
1273  *
1274  * @see Processor for a list of all commonly available cass.ini
1275  * settings.
1276  *
1277  * @cassttng Processor/\%name\%/{InputName} \n
1278  * Name of the processor that conatins the result whos values will
1279  * be appended to this.
1280  * @cassttng Processor/\%name\%/{Size} \n
1281  * Number of values that are stored
1282  * Default is 10000
1283  *
1284  * @author Stephan Kassemeyer
1285  */
1287 {
1288 public:
1289  /** constructor */
1290  pp64(const name_t&);
1291 
1292  /** process event */
1293  virtual void process(const CASSEvent&, result_t&);
1294 
1295  /** load the settings of the pp */
1296  virtual void loadSettings(size_t);
1297 
1298 protected:
1299  /** processor containing input result */
1301 
1302  /** the number of bins in the result, range is fixed */
1303  size_t _size;
1304 };
1305 
1306 
1307 
1308 
1309 
1310 
1311 /** 0D, 1D, and 2D to 2D histogramming.
1312  *
1313  * @PPList "65": Histogram two 0D, 1D or 2D values to a 2D result
1314  *
1315  * histograms two 0D, 1D or 2D values into one 2D result. The result contains
1316  * only the information from the current event. To get an average or sum use
1317  * Processor 61 or 62.
1318  *
1319  * It has the capability to histogram the values with user provided weights,
1320  * which can either be a provided constant or taken from another processor. In
1321  * case the weight processor contains a 0D value, the value will be taked as a
1322  * constant. Othwerwise the processor containing the weights has to have the
1323  * same shape as the input values.
1324  *
1325  * In case the option that allows remembering how many times a bin has been
1326  * filled the result is a 2D result with twice as many bins in y. the first n
1327  * entries in y contain the (weighted) histogram whereas the y-entries is
1328  * n..2*n contain the info about how many times the corresponding bin has been
1329  * filled. Use pp70 to extract the two informations.
1330  *
1331  * @see Processor for a list of all commonly available cass.ini
1332  * settings.
1333  *
1334  * @cassttng Processor/\%name\%/{XName|YName} \n
1335  * processor names containing the values to histogram. Both need to
1336  * be of the same shape.
1337  * @cassttng Processor/\%name\%/{XNbrBins|XLow|XUp|XTitle|YNbrBins|YLow|YUp|YTitle}\n
1338  * properties of the 2d histogram
1339  * @cassttng Processor/\%name\%/{Weight} \n
1340  * The weight, Can either be a constant value or a processor name
1341  * containing the weights. The processor needs to be either of the
1342  * same shape as the input, in which case the individual entires are
1343  * the weights of the corresponding bins in the input, or contain a
1344  * 0D value, in which case this will be used as weight for all the
1345  * input values. Please see details for details about this option.
1346  * Default 1
1347  * @cassttng Processor/\%name\%/{RememberCounts}\n
1348  * This flag allows to enable the option of remembering the number of
1349  * times a given bin has been filled. See detailed description for
1350  * more info about this option. Default is false
1351  *
1352  * @author Lutz Foucar
1353  */
1354 class pp65 : public Processor
1355 {
1356 public:
1357  /** constructor */
1358  pp65(const name_t &name);
1359 
1360  /** process event */
1361  virtual void process(const CASSEvent&, result_t&);
1362 
1363  /** load the settings */
1364  virtual void loadSettings(size_t);
1365 
1366 protected:
1367  /** define the function for histogramming */
1368  typedef std::tr1::function<void(CASSEvent::id_t,
1373 
1374  /** histogam with weights from another processor
1375  *
1376  * @param id the event id to get the right weight from the processor
1377  * @param xin iterator to the beginning of the x input
1378  * @param xlast iterator to the end of the x data input
1379  * @param yin iterator to the begining of the y input
1380  * @param result reference to the result that does the histograming
1381  */
1386  result_t & result);
1387 
1388  /** histogam with constant weight
1389  *
1390  * @param unused an unused paramter
1391  * @param xin iterator to the beginning of the x input
1392  * @param xlast iterator to the end of the x data input
1393  * @param yin iterator to the begining of the y input
1394  * @param result reference to the result that does the histograming
1395  */
1400  result_t & result);
1401 
1402  /** histogam with constant weight from input
1403  *
1404  * @param id the event id to get the right weight from the processor
1405  * @param xin iterator to the beginning of the x input
1406  * @param xlast iterator to the end of the x data input
1407  * @param yin iterator to the begining of the y input
1408  * @param result reference to the result that does the histograming
1409  */
1414  result_t & result);
1415 
1416  /** histogam with weights from another processor
1417  *
1418  * In addition remember the number of counts in a bin
1419  *
1420  * @param id the event id to get the right weight from the processor
1421  * @param xin iterator to the beginning of the x input
1422  * @param xlast iterator to the end of the x data input
1423  * @param yin iterator to the begining of the y input
1424  * @param result reference to the result that does the histograming
1425  */
1430  result_t & result);
1431 
1432  /** histogam with constant weight
1433  *
1434  * In addition remember the number of counts in a bin
1435  *
1436  * @param id the event id to get the right weight from the processor
1437  * @param xin iterator to the beginning of the x input
1438  * @param xlast iterator to the end of the x data input
1439  * @param yin iterator to the begining of the y input
1440  * @param result reference to the result that does the histograming
1441  */
1446  result_t & result);
1447 
1448  /** histogam with constant weight from input
1449  *
1450  * In addition remember the number of counts in a bin
1451  *
1452  * @param id the event id to get the right weight from the processor
1453  * @param xin iterator to the beginning of the x input
1454  * @param xlast iterator to the end of the x data input
1455  * @param yin iterator to the begining of the y input
1456  * @param result reference to the result that does the histograming
1457  */
1462  result_t & result);
1463 
1464 protected:
1465  /** processor containing X axis value */
1467 
1468  /** processor containing Y-axis value */
1470 
1471  /** the constant weight */
1473 
1474  /** processor containing the weights */
1476 
1477  /** y-axis object of the original size (without the nbr fills part) */
1479 
1480  /** the function to histogram the values */
1482 };
1483 
1484 
1485 
1486 
1487 
1488 
1489 
1490 
1491 /** 1D to 2D combining
1492  *
1493  * @PPList "66": combines two 1D traces to a 2D result
1494  *
1495  * combines two 1d results into one 2D result
1496  * The 2d result will be computed as follows
1497  * \f$ result_{i,j} = X_{i} * Y_{j} \f$, where \f$ 0 \leq i < X_{max}\f$ and
1498  * \f$ 0 \leq j < Y_{max} \f$
1499  *
1500  * This processor relies on the fact the the input shapes are fixed for all
1501  * events.
1502  *
1503  * @see Processor for a list of all commonly available cass.ini
1504  * settings.
1505  *
1506  * @cassttng Processor/\%name\%/{XName|YName} \n
1507  * processor names containing the 1D results for the x an y values.
1508  *
1509  * @author Lutz Foucar
1510  */
1511 class pp66 : public Processor
1512 {
1513 public:
1514  /** constructor */
1515  pp66(const name_t &name);
1516 
1517  /** process event */
1518  virtual void process(const CASSEvent&, result_t&);
1519 
1520  /** load the settings */
1521  virtual void loadSettings(size_t);
1522 
1523 protected:
1524  /** pp containing X-axis 1D result to combine */
1526 
1527  /** pp containing Y-axis 1D result to combine */
1529 };
1530 
1531 
1532 
1533 
1534 
1535 
1536 
1537 
1538 /** 0D and 1D to 2D combining.
1539  *
1540  * @PPList "68": Combines 0D and 1D result to 2D result
1541  *
1542  * combines a 0D and 1D result to a 2d result where the 1d
1543  * result defines the x axis and the second 0d result defines the bin on the y
1544  * axis where the 1D result will be written to.
1545  * One only has to define the y axis since the x axis will be taken from the
1546  * 1D result
1547  *
1548  * @see Processor for a list of all commonly available cass.ini
1549  * settings.
1550  *
1551  * @cassttng Processor/\%name\%/{YNbrBins|YLow|YUp}\n
1552  * properties of the y axis of the 2D result
1553  * @cassttng Processor/\%name\%/{XName}\n
1554  * processr containing the 1D result.
1555  * @cassttng Processor/\%name\%/{YName} \n
1556  * processor containing the 0D values to define the bin on the y-axis
1557  *
1558  * @author Lutz Foucar
1559  */
1560 class pp68 : public Processor
1561 {
1562 public:
1563  /** constructor */
1564  pp68(const name_t &name);
1565 
1566  /** process event */
1567  virtual void process(const CASSEvent&, result_t&);
1568 
1569  /** load the settings */
1570  virtual void loadSettings(size_t);
1571 
1572 protected:
1573  /** processor containing the 1D result */
1575 
1576  /** processor containing 0D result */
1578 };
1579 
1580 
1581 
1582 
1583 
1584 
1585 /** 0D to 1D scatter plot.
1586  *
1587  * @PPList "69": Use two 0D values for a scatter plot
1588  *
1589  * sets two 0d values into one 1D result where the first 0D result
1590  * defines the x axis bin and the second defines the value of that bin.
1591  * Unlike in a histogram the weight will not be added but it will be set to the
1592  * weight value. As this is an accumulating processor the values will be kept
1593  * until they are overwritten.
1594  *
1595  * @see Processor for a list of all commonly available cass.ini
1596  * settings.
1597  *
1598  * @cassttng Processor/\%name\%/{XNbrBins|XLow|XUp}\n
1599  * properties of the 1D result.
1600  * @cassttng Processor/\%name\%/{XName|YName} \n
1601  * processor names containing the 0D values for the scatter plot
1602  *
1603  * @author Lutz Foucar
1604  */
1606 {
1607 public:
1608  /** constructor */
1609  pp69(const name_t &name);
1610 
1611  /** process event */
1612  virtual void process(const CASSEvent&, result_t&);
1613 
1614  /** load the settings */
1615  virtual void loadSettings(size_t);
1616 
1617 protected:
1618  /** processor containing x-axis 0D result */
1620 
1621  /** processor containing y-axis 0D result */
1623 };
1624 
1625 
1626 
1627 
1628 
1629 
1630 
1631 /** Subset result
1632  *
1633  * @PPList "70": Subset a result
1634  *
1635  * Will copy a subset of another result and return it in a new result.
1636  *
1637  * @see Processor for a list of all commonly available cass.ini
1638  * settings.
1639  *
1640  * @cassttng Processor/\%name\%/{InputName} \n
1641  * name of processor that contains the result you want a
1642  * subset from.
1643  * @cassttng Processor/\%name\%/{XLow|XUp} \n
1644  * For 1d and 2d result the lower and upper range on the x-axis that
1645  * one wants to include in the subset result.
1646  * These endpoints are defined like \f$ [XLow,XUp[ \f$
1647  * Default is 0|1
1648  * @cassttng Processor/\%name\%/{YLow|YUp} \n
1649  * In case you want to subset a 2d result these are the lower and
1650  * upper range on the y-axis that one wants to include in the
1651  * subset result.
1652  * These endpoints are defined like \f$ [YLow,YUp[ \f$
1653  * Default is 0|1
1654  *
1655  * @author Lutz Foucar
1656  */
1657 class pp70 : public Processor
1658 {
1659 public:
1660  /** constructor */
1661  pp70(const name_t &name);
1662 
1663  /** process event */
1664  virtual void process(const CASSEvent&, result_t&);
1665 
1666  /** load the settings of the pp */
1667  virtual void loadSettings(size_t);
1668 
1669 protected:
1670  /** processor containing input result */
1672 
1673  /** offset in x and y to the first bin of the input */
1674  std::pair<int,int> _offset;
1675 };
1676 
1677 
1678 
1679 
1680 
1681 
1682 
1683 
1684 
1685 
1686 /** Returns a the min or max value of a result
1687  *
1688  * @PPList "71": Returns the min or max value of a result
1689  *
1690  * @see Processor for a list of all commonly available cass.ini
1691  * settings.
1692  *
1693  * @cassttng Processor/\%name\%/{RetrieveType} \n
1694  * Type of function used to retrieve the requested value in the
1695  * result. Default is "max". Possible values are:
1696  * - "max": return the maximum value in the result
1697  * - "min": return the minimum value in the result
1698  * @cassttng Processor/\%name\%/{InputName} \n
1699  * Name of the processor that contains the result to find the
1700  * requested value in.
1701  *
1702  * @author Lutz Foucar
1703  */
1704 class pp71 : public Processor
1705 {
1706 public:
1707  /** constructor */
1708  pp71(const name_t &name);
1709 
1710  /** process event */
1711  virtual void process(const CASSEvent&, result_t&);
1712 
1713  /** load the settings of the pp */
1714  virtual void loadSettings(size_t);
1715 
1716 protected:
1717  /** processor containing the input result */
1719 
1720  /** the type of function used to retrive the wanted element */
1721  std::tr1::function<result_t::const_iterator(result_t::const_iterator,result_t::const_iterator)> _func;
1722 };
1723 
1724 
1725 
1726 
1727 
1728 
1729 
1730 
1731 
1732 
1733 
1734 /** clear result
1735  *
1736  * @PPList "75": Clear a result
1737  *
1738  * Will clear the result of a different processor when the condition is true.
1739  *
1740  * @see Processor for a list of all commonly available cass.ini
1741  * settings.
1742  *
1743  * @cassttng Processor/\%name\%/{InputName} \n
1744  * name of processor that contains the result to clear
1745  *
1746  * @author Lutz Foucar
1747  */
1748 class pp75 : public Processor
1749 {
1750 public:
1751  /** constructor */
1752  pp75(const name_t &name);
1753 
1754  /** overwrite process event */
1755  virtual void processEvent(const CASSEvent&);
1756 
1757  /** load the settings of the pp */
1758  virtual void loadSettings(size_t);
1759 
1760  /** overwrite the retrieval of an result */
1761  virtual const result_t& result(const CASSEvent::id_t eventid=0);
1762 
1763  /** overwrite the release */
1764  virtual void releaseEvent(const CASSEvent &){}
1765 
1766 protected:
1767  /** processor containing input result */
1769 };
1770 
1771 
1772 
1773 
1774 
1775 
1776 
1777 
1778 
1779 
1780 /** Quit Program
1781  *
1782  * @PPList "76": Quit CASS when Condition is met
1783  *
1784  * Will quit the program, when called. Make sure that it is only called when
1785  * you want it to be called by setting the "ConditionName" to something
1786  * meaningful. Defaultly "ConditionName" is set to "DefaultTrueHist" which
1787  * will let the program quit immediately
1788  *
1789  * @see Processor for a list of all commonly available cass.ini
1790  * settings.
1791  *
1792  * @author Lutz Foucar
1793  */
1794 class pp76 : public Processor
1795 {
1796 public:
1797  /** constructor */
1798  pp76(const name_t &name);
1799 
1800  /** process event */
1801  virtual void processEvent(const CASSEvent&);
1802 
1803  /** overwrite the retrieval of an result */
1804  virtual const result_t& result(const CASSEvent::id_t eventid=0);
1805 
1806  /** overwrite the release */
1807  virtual void releaseEvent(const CASSEvent &){}
1808 
1809  /** load the settings of the pp */
1810  virtual void loadSettings(size_t);
1811 };
1812 
1813 
1814 
1815 
1816 
1817 
1818 
1819 /** Checks for id on list
1820  *
1821  * @PPList "77": Checks if eventid is on a user provided list
1822  *
1823  * Checks if the id of the current event is on a user provided list. The
1824  * user provided list of id should be an ascii file where the ids are in lines.
1825  *
1826  * @see Processor for a list of all commonly available cass.ini
1827  * settings.
1828  *
1829  * @cassttng Processor/\%name\%/{List} \n
1830  * Path and name of the file containing the list of id that should
1831  * be checked. Default is "".
1832  *
1833  * @author Lutz Foucar
1834  */
1835 class pp77 : public Processor
1836 {
1837 public:
1838  /** constructor */
1839  pp77(const name_t &name);
1840 
1841  /** process event */
1842  virtual void process(const CASSEvent&, result_t&);
1843 
1844  /** load the settings of the pp */
1845  virtual void loadSettings(size_t);
1846 
1847 protected:
1848  /** the list of ids */
1849  std::vector<uint64_t> _list;
1850 };
1851 
1852 
1853 
1854 
1855 
1856 
1857 
1858 
1859 
1860 
1861 
1862 
1863 /** Counter
1864  *
1865  * @PPList "78": Count how many times it has been called (Counter)
1866  *
1867  * Increases the value by one everytime its process function is called
1868  *
1869  * @PPList "78": Counter
1870  *
1871  * @see Processor for a list of all commonly available cass.ini
1872  * settings.
1873  *
1874  * @author Lutz Foucar
1875  */
1877 {
1878 public:
1879  /** constructor */
1880  pp78(const name_t &name);
1881 
1882  /** process event */
1883  virtual void process(const CASSEvent&, result_t&);
1884 
1885  /** load the settings of the pp */
1886  virtual void loadSettings(size_t);
1887 };
1888 
1889 
1890 
1891 
1892 
1893 
1894 
1895 
1896 
1897 
1898 
1899 
1900 
1901 /** retrieve user choosable type of bin of 1D result
1902  *
1903  * @PPList "81": retrieve user choosable type of bin of 1D result
1904  *
1905  * @see Processor for a list of all commonly available cass.ini
1906  * settings.
1907  *
1908  * @cassttng Processor/\%name\%/{InputName} \n
1909  * Name of the Processor that contains the result where the requested
1910  * bin is retrieved from.
1911  * @cassttng Processor/\%name\%/{RetrieveType} \n
1912  * The type of bin to retrieve. Default is "max". Options are:
1913  * - max: the bin containing the maximum value
1914  * - min: the bin containing the minimum value
1915  *
1916  * @author Stephan Kassemeyer
1917  * @author Lutz Foucar
1918  */
1919 class pp81 : public Processor
1920 {
1921 public:
1922  /** constructor */
1923  pp81(const name_t &name);
1924 
1925  /** process event */
1926  virtual void process(const CASSEvent&, result_t&);
1927 
1928  /** load the settings of the pp */
1929  virtual void loadSettings(size_t);
1930 
1931 protected:
1932  /** processor containing input result */
1934 
1935  /** the type of function used to retrive the wanted bin */
1936  std::tr1::function<result_t::const_iterator(result_t::const_iterator,result_t::const_iterator)> _func;
1937 };
1938 
1939 
1940 
1941 
1942 
1943 
1944 
1945 
1946 
1947 
1948 
1949 
1950 
1951 
1952 
1953 
1954 /** return the statistic values of all bins of a result
1955  *
1956  * @PPList "82": user choosable statistics value of all bins of a result
1957  *
1958  * @see Processor for a list of all commonly available cass.ini
1959  * settings.
1960  *
1961  * @cassttng Processor/\%name\%/{InputName} \n
1962  * Processor containing the result for which the requested statistical
1963  * value is calculated.
1964  * @cassttng Processor/\%name\%/{Statistics} \n
1965  * Type of statistic that one wants to retrieve. Default is "sum".
1966  * Possible values are:
1967  * - sum: Sum of values of all bins
1968  * - mean: Mean value of values of all bins
1969  * - stdv: Standart deviation of values of all bins
1970  * - variance: Variance of values of all bins
1971  * - median: Median value of all bins
1972  *
1973  * @author Lutz Foucar
1974  */
1975 class pp82 : public Processor
1976 {
1977 public:
1978  /** constructor */
1979  pp82(const name_t &name);
1980 
1981  /** process event */
1982  virtual void process(const CASSEvent&, result_t&);
1983 
1984  /** load the settings of the pp */
1985  virtual void loadSettings(size_t);
1986 
1987 protected:
1988 
1989  /** retrieve the statistics value from the cummulative statistics calculator
1990  *
1991  * @return the statistical value
1992  * @param res The result from which the statistical value should
1993  * be calculated.
1994  */
1996 
1997  /** retrieve the statistics value from the median statistics calculator
1998  *
1999  * @return the statistical value
2000  * @param res The result from which the statistical value should
2001  * be calculated.
2002  */
2003  result_t::value_t medianCalc(const result_t & res);
2004 
2005 
2006 protected:
2007  /** processor containing input result */
2009 
2010  /** define the type of cummulative statistics used */
2012 
2013  /** define the median calculator used */
2015 
2016  /** the type of function used to retrive the wanted element */
2017  std::tr1::function<cumstat_t::value_type(const cumstat_t&)> _val;
2018 
2019  /** function to retrieve the statistics type */
2020  std::tr1::function<result_t::value_t(const result_t&)> _value;
2021 };
2022 
2023 
2024 
2025 
2026 
2027 
2028 
2029 
2030 
2031 
2032 
2033 
2034 
2035 
2036 
2037 
2038 
2039 /** return full width at half maximum in given range of 1D result
2040  *
2041  * @PPList "85": full width at half maximum for a peak in given range
2042  *
2043  * @see Processor for a list of all commonly available cass.ini
2044  * settings.
2045  *
2046  * @cassttng Processor/\%name\%/{InputName} \n
2047  * Name of Processor that contains the result that the FWHM should be
2048  * extracted for.
2049  * @cassttng Processor/\%name\%/{XLow|XUp} \n
2050  * Lower and upper endpoints of the range that the FWHM will be
2051  * calculated for.
2052  * The endpoints define the range as \f$ [XLow,XUp[ \f$
2053  * Default is 0|1.
2054  * @cassttng Processor/\%name\%/{Fraction} \n
2055  * At which fraction of the height the width should be taken. Default
2056  * is 0.5
2057  *
2058  * @author Lutz Foucar
2059  */
2060 class pp85 : public Processor
2061 {
2062 public:
2063  /** constructor */
2064  pp85(const name_t &name);
2065 
2066  /** process event */
2067  virtual void process(const CASSEvent&, result_t&);
2068 
2069  /** load the settings of the pp */
2070  virtual void loadSettings(size_t);
2071 
2072 protected:
2073  /** processor containing input result */
2075 
2076  /** the requested x-axis limits in bins */
2077  std::pair<int,int> _xRange;
2078 
2079  /** the fraction of the range */
2080  float _fraction;
2081 };
2082 
2083 
2084 
2085 
2086 
2087 
2088 
2089 
2090 
2091 /** find step in 1d result
2092  *
2093  * @PPList "86": find step in a given range of 1d result
2094  *
2095  * finds the x-position of a step in a 1d result. It does this by defining a
2096  * baseline from the user selected range. It then searches for the highest
2097  * point in the range that should contain the step. Now it looks for the first
2098  * x position where the y value is \f$ Fraction * (highestPoint + baseline) \f$.
2099  *
2100  * @see Processor for a list of all commonly available cass.ini
2101  * settings.
2102  *
2103  * @cassttng Processor/\%name\%/{InputName} \n
2104  * Name of the processor that contains the 1D result that
2105  * we look for the step in.
2106  * @cassttng Processor/\%name\%/{XLow|XUp} \n
2107  * Lower and upper endpoints of the range that we look for the step in.
2108  * The endpoints define the range as \f$ [XLow,XUp[ \f$
2109  * Default is 0|1.
2110  * @cassttng Processor/\%name\%/{BaselineLow|BaselineUp} \n
2111  * Lower and upper endpoints of the range that we use to calculate the
2112  * Baseline.
2113  * The endpoints define the range as \f$ [BaselineLow,BaselineUp[ \f$
2114  * Default is 0|1.
2115  * @cassttng Processor/\%name\%/{Fraction} \n
2116  * The Fraction between the baseline and the highest value that
2117  * should be taken when searching for the right point. Default is
2118  * 0.5
2119  *
2120  * @author Lutz Foucar
2121  */
2122 class pp86 : public Processor
2123 {
2124 public:
2125  /** constructor */
2126  pp86(const name_t &name);
2127 
2128  /** process event */
2129  virtual void process(const CASSEvent&, result_t&);
2130 
2131  /** load the settings of the pp */
2132  virtual void loadSettings(size_t);
2133 
2134 protected:
2135  /** processor containing input result */
2137 
2138  /** the requested x-axis limits for find the step in bins */
2139  std::pair<int,int> _xRangeStep;
2140 
2141  /** the requested x-axis limits for find the baseline in bins */
2142  std::pair<int,int> _xRangeBaseline;
2143 
2144  /** user fraction of the height between low and up */
2146 };
2147 
2148 
2149 
2150 
2151 
2152 
2153 /** find center of Mass of 1D result in a user given range
2154  *
2155  * @PPList "87": find center of mass in given range of 1D result
2156  *
2157  * calculates the center of Mass in the user given range.
2158  *
2159  * @see Processor for a list of all commonly available cass.ini
2160  * settings.
2161  *
2162  * @cassttng Processor/\%name\%/{InputName} \n
2163  * Name of the processor that conatins the 1D resault that we look
2164  * for the step in.
2165  * @cassttng Processor/\%name\%/{XLow|XUp} \n
2166  * Lower and upper limit of the range that we look for the step.
2167  * The endpoints define the range as \f$ [XLow,XUp[ \f$
2168  * Default is 0|1.
2169  *
2170  * @author Lutz Foucar
2171  */
2172 class pp87 : public Processor
2173 {
2174 public:
2175  /** constructor */
2176  pp87(const name_t &name);
2177 
2178  /** process event */
2179  virtual void process(const CASSEvent&, result_t&);
2180 
2181  /** load the settings of the pp */
2182  virtual void loadSettings(size_t);
2183 
2184 protected:
2185  /** processor containing input result */
2187 
2188  /** the requested x-axis limits in bins */
2189  std::pair<int,int> _xRange;
2190 };
2191 
2192 
2193 
2194 
2195 
2196 /** return axis parameter of a result
2197  *
2198  * @PPList "88": retrieve an axis parameter of a result
2199  *
2200  * @see Processor for a list of all commonly available cass.ini
2201  * settings.
2202  *
2203  * @cassttng Processor/\%name\%/{InputName} \n
2204  * Name of the processor that conatains the result from which the
2205  * requested axis parameter is retrieved.
2206  * @cassttng Processor/\%name\%/{AxisParameter} \n
2207  * The parameter of the axis one is interested in.
2208  * Default is "XNbrBins". Possible values are:
2209  * - "XNbrBins": The number of Bins in X
2210  * - "XLow": The lower bound of the x-axis
2211  * - "XUp": The upper bound of the x-axis
2212  * - "YNbrBins": The number of Bins in Y
2213  * - "YLow": The lower bound of the y-axis
2214  * - "YUp": The upper bound of the y-axis
2215  *
2216  * @author Lutz Foucar
2217  */
2218 class pp88 : public Processor
2219 {
2220 public:
2221  /** constructor */
2222  pp88(const name_t &name);
2223 
2224  /** process event */
2225  virtual void process(const CASSEvent&, result_t&);
2226 
2227  /** load the settings of the pp */
2228  virtual void loadSettings(size_t);
2229 
2230 protected:
2231  /** processor containing input result */
2233 
2234  /** the id of the axis */
2236 
2237  /** function to retrieve the parameter from the axis */
2238  std::tr1::function<result_t::value_t(const result_t::axe_t&)> _func;
2239 };
2240 
2241 
2242 
2243 
2244 
2245 
2246 
2247 
2248 
2249 
2250 /** low / high pass filter of 1D result
2251  *
2252  * @PPList "89":high or low pass filter on 1D result
2253  *
2254  * inspired by code found at
2255  * http://stackoverflow.com/questions/13882038/implementing-simple-high-and-low-pass-filters-in-c
2256  * copright Slater Tyrus
2257  *
2258  * HighPass function:
2259 @verbatim
2260 float RC = 1.0/(CUTOFF*2*3.14);
2261 float dt = 1.0/SAMPLE_RATE;
2262 float alpha = RC/(RC + dt);
2263 float filteredArray[numSamples];
2264 filteredArray[0] = data.recordedSamples[0];
2265 for (i = 1; i<numSamples; i++){
2266  filteredArray[i] = alpha * (filteredArray[i-1] + data.recordedSamples[i] - data.recordedSamples[i-1]);
2267 }
2268 data.recordedSamples = filteredArray;
2269 @endverbatim
2270  *
2271  * LowPass function:
2272 @verbatim
2273 float RC = 1.0/(CUTOFF*2*3.14);
2274 float dt = 1.0/SAMPLE_RATE;
2275 float alpha = dt/(RC+dt);
2276 float filteredArray[numSamples];
2277 filteredArray[0] = data.recordedSamples[0];
2278 for(i=1; i<numSamples; i++){
2279  filteredArray[i] = filteredArray[i-1] + (alpha*(data.recordedSamples[i] - filteredArray[i-1]));
2280 }
2281 data.recordedSamples = filteredArray;
2282 @endverbatim
2283  *
2284  * @see Processor for a list of all commonly available cass.ini
2285  * settings.
2286  *
2287  * @cassttng Processor/\%name\%/{InputName} \n
2288  * Name of the processor that contains the 1D result to filter
2289  * @cassttng Processor/\%name\%/{FilterType} \n
2290  * The filter type to use. Default is "LowPass". Possible values are:
2291  * - "LowPass": a low pass filter
2292  * - "HighPass": a high pass filter
2293  * @cassttng Processor/\%name\%/{Cutoff} \n
2294  * The cutoff of the filter.
2295  * @cassttng Processor/\%name\%/{SampleRate} \n
2296  * The sampling rate of the filter
2297  *
2298  * @author Lutz Foucar
2299  */
2300 class pp89 : public Processor
2301 {
2302 public:
2303  /** constructor */
2304  pp89(const name_t &name);
2305 
2306  /** process event */
2307  virtual void process(const CASSEvent&, result_t&);
2308 
2309  /** load the settings of the pp */
2310  virtual void loadSettings(size_t);
2311 
2312 protected:
2313  /** high pass filtering function
2314  *
2315  * @param orig iterator to the original value
2316  * @param filtered iterator to the filtered value
2317  */
2319  result_t::iterator filtered);
2320 
2321  /** low pass filtering function
2322  *
2323  * @param orig iterator to the original value
2324  * @param filtered iterator to the filtered value
2325  */
2327  result_t::iterator filtered);
2328 
2329  /** processor containing input result */
2331 
2332  /** factor used for filtering */
2333  float _alpha;
2334 
2335  /** function to retrieve the parameter from the axis */
2336  std::tr1::function<void(result_t::const_iterator,
2338 };
2339 
2340 
2341 
2342 
2343 
2344 /** returns a list of local extreme points in a 1D result
2345  *
2346  * @PPList "91": returns a list of local extreme points in a 1D result
2347  *
2348  * It will look for a maximum or minimum value that is a user
2349  * defined range. If data is the 1D array the range is as follows:
2350  * \f$ range \leq i < size-range \f$, where i is the index of the array and size
2351  * is the size of the array.
2352  * The local extreme point has to be the highest (in case of maxima) or the
2353  * lowest (in case of minima) value within the range:
2354  * \f$ i-range \leq j < i+range \f$ where i is the index of the value to check
2355  * whether it is a extreme point and j the index of the values to compare to.
2356  * One can choose whether one want to find the local minima or the local maxima
2357  *
2358  * All found extreme points will be added to a table like result
2359  *
2360  * @see Processor for a list of all commonly available cass.ini
2361  * settings.
2362  *
2363  * @cassttng Processor/\%name\%/{InputName} \n
2364  * Name of the Processor that contains the 1D result where the local
2365  * extreme points will be retrieved from
2366  * @cassttng Processor/\%name\%/{Range} \n
2367  * The range to check for the local extreme points. Default is 10
2368  * @cassttng Processor/\%name\%/{ExtremePointType} \n
2369  * The type of extreme points that should be extracted from input.
2370  * Default is "minima". Possible values are:
2371  * - "minima": extracts the local minima from the 1D result
2372  * - "maxima": extracts the local maxima from the 1D result
2373  *
2374  * @author Lutz Foucar
2375  */
2376 class pp91 : public Processor
2377 {
2378 public:
2379  /** constructor */
2380  pp91(const name_t &name);
2381 
2382  /** process event */
2383  virtual void process(const CASSEvent&, result_t&);
2384 
2385  /** load the settings of the pp */
2386  virtual void loadSettings(size_t);
2387 
2388 protected:
2389  /** definition of the table */
2391 
2392  /** enum describing the contents of the resulting table */
2394  {
2395  Index = 0,
2397  Value = 2,
2399  };
2400 
2401  /** pp containing input histogram */
2403 
2404  /** the requested x-axis limits in histogram coordinates */
2405  size_t _range;
2406 
2407  /** operation to find the extreme point */
2408  std::tr1::function<bool(const result_t::value_t&, const result_t::value_t&)> _op;
2409 };
2410 
2411 
2412 
2413 
2414 }//end namspace cass
2415 
2416 #endif
virtual void releaseEvent(const CASSEvent &)
overwrite the release
Definition: operations.h:1764
std::tr1::function< result_t::value_t()> _scale
function that will return the scale that should be used for the average
Definition: operations.h:1166
virtual void process(const CASSEvent &, result_t &)
process event
1D to 2D combining
Definition: operations.h:1511
CachedList::item_type result_t
define the results
Definition: processor.h:52
result_t::value_t cumulativeScale()
retrieve the cumulative scale for the current datum
Definition: operations.h:1145
shared_pointer _two
processor containing 0D result
Definition: operations.h:1577
result_t::value_t _weight
the constant weight
Definition: operations.h:1472
storage_t::const_iterator const_iterator
a const iterator on the storage
Definition: result.hpp:338
axis_name
which axis one wants to have
Definition: result.hpp:359
virtual void process(const CASSEvent &, result_t &)
process event
func_t _histogram
function used for histogramming
Definition: operations.h:1067
result_t::value_t movingScale()
retrieve the moving average scale after the initialization of the "first" point
Definition: operations.h:1153
ColumnNames
enum describing the contents of the resulting table
Definition: operations.h:2393
std::pair< int, int > _baselineRange
range we want to have the baseline for the integral over in result bins
Definition: operations.h:746
shared_pointer _pHist
processor containing the 2d result we want to project
Definition: operations.h:678
Event to store all LCLS Data.
Definition: cass_event.h:32
result_t::value_t _alpha
alpha for the running average
Definition: operations.h:1160
std::tr1::function< result_t::value_t(const result_t::axe_t &)> _func
function to retrieve the parameter from the axis
Definition: operations.h:2238
void applyConstantThreshold(const result_t &in, result_t &out, const CASSEvent::id_t &id)
apply a constant threshold
Definition: operations.cpp:660
shared_pointer _pHist
processor containing result to store
Definition: operations.h:806
virtual void process(const CASSEvent &, result_t &)
process event
virtual void process(const CASSEvent &, result_t &)
process event
virtual void loadSettings(size_t)
load the settings of the pp
pp57(const name_t &name)
constructor
pp64(const name_t &)
constructor
float baselineFromInput(const result_t &input)
get the baseline for the integration
shared_pointer _weightInput
processor containing the weights
Definition: operations.h:1475
result averaging.
Definition: operations.h:1096
std::vector< value_t > storage_t
the storage of this container
Definition: result.hpp:332
binaryoperation_t _op
the operand
Definition: operations.h:184
std::pair< int, int > _xRangeStep
the requested x-axis limits for find the step in bins
Definition: operations.h:2139
find step in 1d result
Definition: operations.h:2122
pp65(const name_t &name)
constructor
virtual void loadSettings(size_t)
load the settings
virtual void process(const CASSEvent &evt, result_t &)
process event
Definition: operations.cpp:158
const name_t name() const
retrieve the name of this processor
Definition: processor.h:167
virtual void process(const CASSEvent &, result_t &)
process event
Definition: operations.cpp:591
pp86(const name_t &name)
constructor
void histogramAndBinCountWithWeights(CASSEvent::id_t id, result_t::const_iterator in, result_t::const_iterator last, result_t &result)
histogam with weights from another processor
pp40(const name_t &name)
constructor
Definition: operations.cpp:613
check if FEL is off by checking for bykick which is eventid
result_t::value_t _userVal
the value that will be set
Definition: operations.h:607
file contains declaration of the CASSEvent
float value_t
the values of this container
Definition: result.hpp:326
std::tr1::function< void(result_t::const_iterator, result_t::iterator)> _func
function to retrieve the parameter from the axis
Definition: operations.h:2337
void highPass(result_t::const_iterator orig, result_t::iterator filtered)
high pass filtering function
virtual void loadSettings(size_t)
load the settings
result_t::value_t cummulativeStatistics(const result_t &res)
retrieve the statistics value from the cummulative statistics calculator
std::tr1::shared_ptr< self_type > shared_pointer
a shared pointer of this class
Definition: result.hpp:323
std::tr1::function< cumstat_t::value_type(const cumstat_t &)> _val
the type of function used to retrive the wanted element
Definition: operations.h:2017
result_t::axe_t _origYAxis
y-axis object of the original size (without the nbr fills part)
Definition: operations.h:1478
std::vector< uint64_t > _list
the list of ids
Definition: operations.h:1849
float constantBaseline(const result_t &)
get constant baseline
Definition: operations.h:760
retrieve user choosable type of bin of 1D result
Definition: operations.h:1919
result_t _previous
the previous result
Definition: operations.h:803
std::tr1::function< void(CASSEvent::id_t, result_t::const_iterator, result_t::const_iterator, result_t::const_iterator, result_t &)> func_t
define the function for histogramming
Definition: operations.h:1372
shared_pointer _input
processor containing input result
Definition: operations.h:1671
std::tr1::function< result_t::value_t(const result_t &)> _value
function to retrieve the statistics type
Definition: operations.h:2020
pp69(const name_t &name)
constructor
shared_pointer _hist
processor containing input result
Definition: operations.h:175
virtual void loadSettings(size_t)
load the settings of the pp
void histogramWithWeightFrom0D(CASSEvent::id_t id, result_t::const_iterator in, result_t::const_iterator last, result_t &result)
histogam with weight from 0D processor
virtual void loadSettings(size_t)
load the settings of the pp
pp78(const name_t &name)
constructor
void lowPass(result_t::const_iterator orig, result_t::iterator filtered)
low pass filtering function
shared_pointer _one
pp containing input result
Definition: operations.h:601
Counter.
Definition: operations.h:1876
result_t::value_t _difference
the maximum difference to previous val that is accepted
Definition: operations.h:455
0D, 1D, and 2D to 2D histogramming.
Definition: operations.h:1354
void histogramAndBinCountWithConstant(CASSEvent::id_t unused, result_t::const_iterator in, result_t::const_iterator last, result_t &result)
histogam with user provided constant weight
result_t::value_t _threshold
the threshold
Definition: operations.h:538
pp66(const name_t &name)
constructor
shared_pointer _one
processor containing result
Definition: operations.h:363
uint64_t id_t
define the id type
Definition: cass_event.h:52
virtual void loadSettings(size_t)
load the settings of the pp
Definition: operations.cpp:773
shared_pointer _yInput
processor containing Y-axis value
Definition: operations.h:1469
shared_pointer _pHist
processor containing input result
Definition: operations.h:2074
virtual void loadSettings(size_t)
load the settings of the pp
statistics calculator for a cummulative statistic
virtual void loadSettings(size_t)
load the settings
virtual void process(const CASSEvent &, result_t &)
process event
virtual void process(const CASSEvent &, result_t &)
process event
result_t::value_t _previousVal
the value of the previous event
Definition: operations.h:452
Operation on 2 results.
Definition: operations.h:57
virtual void process(const CASSEvent &, result_t &)
process event
float _excludeVal
the value that should be excluded in the summation
Definition: operations.h:898
virtual void process(const CASSEvent &, result_t &)
process event
Definition: operations.cpp:742
void histogramAndBinCountWithConstant(CASSEvent::id_t unused, result_t::const_iterator xin, result_t::const_iterator xlast, result_t::const_iterator yin, result_t &result)
histogam with constant weight
unaryoperation_t ValAtFirst(result_t::value_t val)
bind the value to the first parameter of the binaryoperation
Definition: operations.cpp:260
void histogramAndBinCountWithWeightFrom0D(CASSEvent::id_t id, result_t::const_iterator in, result_t::const_iterator last, result_t &result)
histogam with weights from 0D processor
shared_pointer _two
processor containing input when false result
Definition: operations.h:410
size_t _nX
the size of the original image in X
Definition: operations.h:895
shared_pointer _one
processor containing x-axis 0D result
Definition: operations.h:1619
virtual void process(const CASSEvent &, result_t &)
process event
shared_pointer _two
processor containing y-axis 0D result
Definition: operations.h:1622
size_t _nbrEventsAccumulated
the number of events the processor has accumulated
Definition: processor.h:359
shared_pointer _hist
processor containing input result
Definition: operations.h:1768
shared_pointer _input
pp containing input histogram
Definition: operations.h:2402
void projectToY(result_t::const_iterator src, result_t::iterator result, result_t::iterator norm)
integrate the columns
void histogramAndBinCountWithWeights(CASSEvent::id_t id, result_t::const_iterator xin, result_t::const_iterator xlast, result_t::const_iterator yin, result_t &result)
histogam with weights from another processor
std::tr1::function< result_t::value_t(result_t::value_t, result_t::value_t)> binaryoperation_t
define the binary operation
Definition: operations.h:139
statistics calculator for a median
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:565
result_t::value_t _weight
the weight in case it is a constant
Definition: operations.h:1061
pp50(const name_t &name)
constructor
Definition: operations.cpp:767
virtual void process(const CASSEvent &, result_t &)
process event
0D,1D or 2D to 1D histogramming.
Definition: operations.h:959
pp1(const name_t &name)
constructor
Definition: operations.cpp:88
std::tr1::function< bool(const result_t::value_t &, const result_t::value_t &)> _op
operation to find the extreme point
Definition: operations.h:2408
virtual void loadSettings(size_t)
load the settings of the pp
virtual void process(const CASSEvent &, result_t &)
process event
pp68(const name_t &name)
constructor
return full width at half maximum in given range of 1D result
Definition: operations.h:2060
virtual void process(const CASSEvent &, result_t &)
process event
Definition: operations.cpp:898
std::pair< int, int > _range
range we want to have the integral over in result bins
Definition: operations.h:743
Axis< double > axe_t
the axis descriptions of this container
Definition: result.hpp:353
result_t::value_t checkrange(result_t::value_t val, result_t::value_t checkval)
check if value is in range and return another value
Definition: operations.cpp:737
std::tr1::function< result_t::const_iterator(result_t::const_iterator, result_t::const_iterator)> _func
the type of function used to retrive the wanted bin
Definition: operations.h:1936
Weighted Projection of 2D result.
Definition: operations.h:851
pp89(const name_t &name)
constructor
void histogramWithConstant(CASSEvent::id_t unused, result_t::const_iterator in, result_t::const_iterator last, result_t &result)
histogam with user provided constant weight
shared_pointer _threshold
pp containing threshold result
Definition: operations.h:604
pp63(const name_t &)
constructor
virtual void loadSettings(size_t)
load the settings of the pp
Check whether value has changed.
Definition: operations.h:435
shared_pointer _hist
pp containing the value to check
Definition: operations.h:449
uint32_t _first_fiducials
time when the first samples was used in the point in time
Definition: operations.h:1259
virtual void process(const CASSEvent &, result_t &)
process event
0D to 1D scatter plot.
Definition: operations.h:1605
virtual void loadSettings(size_t)
load the settings of the pp
void applyIdxwiseThreshold(const result_t &in, result_t &out, const CASSEvent::id_t &id)
apply a indexwise threshold
Definition: operations.cpp:669
shared_pointer _one
pp containing X-axis 1D result to combine
Definition: operations.h:1525
MedianCalculator< result_t::value_t > med_t
define the median calculator used
Definition: operations.h:2014
result_t::value_t _value
the value for the unary operation
Definition: operations.h:181
pp75(const name_t &name)
constructor
virtual void loadSettings(size_t)
load the settings
std::pair< int, int > _xRange
the requested x-axis limits in bins
Definition: operations.h:2189
result_t::value_t medianCalc(const result_t &res)
retrieve the statistics value from the median statistics calculator
size_t _range
the requested x-axis limits in histogram coordinates
Definition: operations.h:2405
pp76(const name_t &name)
constructor
std::tr1::function< void(result_t::const_iterator, result_t::iterator, result_t::iterator)> _project
the function used to project the image
Definition: operations.h:903
void histogramWithConstant(CASSEvent::id_t unused, result_t::const_iterator xin, result_t::const_iterator xlast, result_t::const_iterator yin, result_t &result)
histogam with constant weight
std::pair< int, int > _offset
offset in x and y to the first bin of the input
Definition: operations.h:1674
shared_pointer _pHist
processor containing input result
Definition: operations.h:2008
result_t::storage_t table_t
definition of the table
Definition: operations.h:2390
shared_pointer _pHist
processor containing input result
Definition: operations.h:2232
void projectToY(result_t::const_iterator src, result_t::iterator dest)
project 2d result to y axis
Definition: operations.cpp:891
shared_pointer _pHist
processor containing input result
Definition: operations.h:1933
Checks for id on list.
Definition: operations.h:1835
virtual void process(const CASSEvent &, result_t &)
process event
record 0d result into 1d result.
Definition: operations.h:1286
base class for processors.
Definition: processor.h:39
virtual void processEvent(const CASSEvent &)
overwrite default behaviour don't do anything
Definition: operations.h:314
low / high pass filter of 1D result
Definition: operations.h:2300
size_t _num_seen_evt
the number of samples seen up to now and used in the point
Definition: operations.h:1254
virtual void releaseEvent(const CASSEvent &)
overwrite default behaviour don't do anything
Definition: operations.h:317
std::tr1::function< void(result_t::const_iterator, result_t::iterator)> _project
function that will do the projection
Definition: operations.h:691
Operation on result with value.
Definition: operations.h:121
pp85(const name_t &name)
constructor
time_t _when_first_evt
time when the first samples was used in the point in time
Definition: operations.h:1258
Apply boolean NOT to 0D result.
Definition: operations.h:211
virtual void loadSettings(size_t)
load the settings of the pp
pp82(const name_t &name)
constructor
shared_pointer _hist
processor containing input result
Definition: operations.h:1300
std::tr1::function< result_t::value_t(result_t::value_t)> unaryoperation_t
define the unary operation
Definition: operations.h:136
void histogramWithWeights(CASSEvent::id_t id, result_t::const_iterator in, result_t::const_iterator last, result_t &result)
histogam with weights from another processor
virtual void loadSettings(size_t)
load the settings of the pp
Definition: operations.cpp:503
result_t::axis_name _axisId
the id of the axis
Definition: operations.h:2235
std::pair< int, int > _xRange
the requested x-axis limits in bins
Definition: operations.h:2077
shared_pointer _pHist
processor containing input result
Definition: operations.h:2186
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:397
pp41(const name_t &name)
constructor
Definition: operations.cpp:699
virtual void process(const CASSEvent &, result_t &)
process event
Definition: operations.cpp:373
virtual void process(const CASSEvent &, result_t &)
process event
shared_pointer _one
pp containing input result
Definition: operations.h:532
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:94
std::tr1::function< result_t::value_t(result_t::value_t, result_t::value_t)> _op
the operand
Definition: operations.h:77
virtual void process(const CASSEvent &, result_t &)
process event
float _userFraction
user fraction of the height between low and up
Definition: operations.h:2145
setParamPos_t _setParamPos
function to set the value to the requested parameter position
Definition: operations.h:187
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:311
store previous result of other Processor
Definition: operations.h:789
pp77(const name_t &name)
constructor
std::tr1::function< result_t::value_t(const CASSEvent::id_t &)> valueRetrieval_t
define how to get the value
Definition: operations.h:142
virtual void loadSettings(size_t)
load the settings of the pp
clear result
Definition: operations.h:393
virtual const result_t & result(const CASSEvent::id_t eventid=0)
overwrite the retrieval of an result
result_t::value_t _userVal
the user value that will be set when the threshold is applied
Definition: operations.h:535
shared_pointer _pHist
processor containing input result
Definition: operations.h:2136
0D and 1D to 2D combining.
Definition: operations.h:1560
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:465
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:705
virtual void loadSettings(size_t)
load the settings of the pp
pp61(const name_t &name)
constructor
virtual void loadSettings(size_t)
load the settings
shared_pointer _pHist
processor containing the 2d result we want to project
Definition: operations.h:886
pp71(const name_t &name)
constructor
pp91(const name_t &name)
constructor
shared_pointer _one
processor containing first result
Definition: operations.h:269
result_t::value_t valueFromPP(const CASSEvent::id_t &id)
retrieve value from Processor
Definition: operations.cpp:275
shared_pointer _pHist
processor containing result to sum
Definition: operations.h:1204
virtual void process(const CASSEvent &, result_t &)
process event
Definition: operations.cpp:326
size_t _size
the number of bins in the result, range is fixed
Definition: operations.h:1303
pp70(const name_t &name)
constructor
virtual void process(const CASSEvent &, result_t &)
process event
shared_pointer _pHist
processor containing input result
Definition: operations.h:2330
Integral of 1D result.
Definition: operations.h:726
std::tr1::function< unaryoperation_t(result_t::value_t)> setParamPos_t
define how to get the right parameter position
Definition: operations.h:145
result_t::value_t squareAverage(result_t::value_t val, result_t::value_t aveOld, result_t::value_t scale)
function that will calculate the square average
shared_pointer _valuePP
processor containing 0D value for the unary operation
Definition: operations.h:178
file contains processors baseclass declaration
shared_pointer _two
processor containing the second result
Definition: operations.h:74
Quit Program.
Definition: operations.h:1794
time average of 0d result.
Definition: operations.h:1231
shared_pointer _pHist
processor containing result to average
Definition: operations.h:1169
pp87(const name_t &name)
constructor
valueRetrieval_t _retrieveValue
function to retrieve the value for the unary operation
Definition: operations.h:190
std::pair< result_t::value_t, result_t::value_t > _range
the requested range that the value should be in
Definition: operations.h:272
return axis parameter of a result
Definition: operations.h:2218
shared_pointer _xInput
processor containing X axis value
Definition: operations.h:1466
result_t::value_t threshold(const result_t::value_t &value, const result_t::value_t &thres)
the thresholding function
Definition: operations.cpp:654
result_t::shared_pointer _res
the constant result
Definition: operations.h:324
pp51(const name_t &name)
constructor
Definition: operations.cpp:920
std::pair< int, int > _xRange
range we want to project
Definition: operations.h:681
shared_pointer _one
processor containing result
Definition: operations.h:225
pp2(const name_t &name)
constructor
Definition: operations.cpp:178
shared_pointer _one
processor containing the first result
Definition: operations.h:71
virtual void processEvent(const CASSEvent &)
process event
shared_pointer _weightProc
processor containing the weight
Definition: operations.h:1064
storage_t::iterator iterator
a iterator on the storage
Definition: result.hpp:335
contains declarations of statistic calculators
virtual void process(const CASSEvent &evt, result_t &)
process event
Definition: operations.cpp:282
Returns a the min or max value of a result.
Definition: operations.h:1704
std::pair< size_t, size_t > _timerange
range of time that we use for the angular distribution
Definition: operations.h:1248
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:184
std::pair< int, int > _xRangeBaseline
the requested x-axis limits for find the baseline in bins
Definition: operations.h:2142
virtual void process(const CASSEvent &, result_t &)
process event
shared_pointer _pHist
processor containing result to work on
Definition: operations.h:1245
virtual const result_t & result(const CASSEvent::id_t)
overwrite default behaviour and just return the constant
Definition: operations.h:308
void histogramWithWeightFrom0DInput(CASSEvent::id_t id, result_t::const_iterator xin, result_t::const_iterator xlast, result_t::const_iterator yin, result_t &result)
histogam with constant weight from input
std::tr1::function< result_t::const_iterator(result_t::const_iterator, result_t::const_iterator)> _func
the type of function used to retrive the wanted element
Definition: operations.h:1721
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:352
Threshold result based upon information from another result.
Definition: operations.h:578
result_t::value_t _upperBound
the upper boundary of the range
Definition: operations.h:613
float _fraction
the fraction of the range
Definition: operations.h:2080
pp13(const name_t &name)
constructor
Definition: operations.cpp:459
std::tr1::function< void(const result_t &, result_t &, const CASSEvent::id_t &)> _applyThresh
the funtion that applies the threshold to the input
Definition: operations.h:498
virtual void loadSettings(size_t)
load the settings
return the input
Definition: operations.h:349
virtual const result_t & result(const CASSEvent::id_t eventid=0)
overwrite the retrieval of an result
std::tr1::function< void(CASSEvent::id_t, result_t::const_iterator, result_t::const_iterator, result_t &)> func_t
define the function for histogramming
Definition: operations.h:976
pp4(const name_t &name)
constructor
Definition: operations.cpp:305
result_t::value_t movingInitializationScale()
retrieve the moving average scale during the initialization
result_t::value_t valueFromConst(const CASSEvent::id_t &evt)
retrieve value constant
Definition: operations.cpp:270
shared_pointer _input
processor containing the 1d result we want to integrate
Definition: operations.h:740
Example of how to use the sacla online input
Definition: SACLA-online.ini:2
virtual void loadSettings(size_t)
load the settings of the pp
pp12(const name_t &)
constructor
Definition: operations.cpp:391
void projectToX(result_t::const_iterator src, result_t::iterator result, result_t::iterator norm)
integrate the rows
pp81(const name_t &name)
constructor
std::tr1::function< result_t::value_t(result_t::value_t, result_t::value_t, result_t::value_t)> _func
function that will do the averagin
Definition: operations.h:1163
virtual void process(const CASSEvent &, result_t &)
process event
virtual void processEvent(const CASSEvent &)
overwrite process event
an accumulating processor
Definition: processor.h:289
pp14(const name_t &name)
constructor
Definition: operations.cpp:497
returns a list of local extreme points in a 1D result
Definition: operations.h:2376
void projectToX(result_t::const_iterator src, result_t::iterator dest)
project 2d result to x axis
Definition: operations.cpp:884
virtual void process(const CASSEvent &, result_t &)
process event
virtual void loadSettings(size_t)
load the settings
Projection of 2d result.
Definition: operations.h:645
void histogramWithWeights(CASSEvent::id_t id, result_t::const_iterator xin, result_t::const_iterator xlast, result_t::const_iterator yin, result_t &result)
histogam with weights from another processor
std::pair< int, int > _Xrange
range in X we want to project
Definition: operations.h:889
pp56(const name_t &name)
constructor
shared_pointer _two
pp containing Y-axis 1D result to combine
Definition: operations.h:1528
virtual void process(const CASSEvent &, result_t &)
process event
clear result
Definition: operations.h:1748
shared_pointer _input
processor containing result to histogram
Definition: operations.h:1058
result summing.
Definition: operations.h:1190
size_t _nX
the nbr of bins in the original image
Definition: operations.h:687
unaryoperation_t ValAtSecond(result_t::value_t val)
bind the value to the second parameter of the binaryoperation
Definition: operations.cpp:265
virtual void loadSettings(size_t)
load the settings of the pp
virtual void processEvent(const CASSEvent &)
overwrite process event
Definition: operations.cpp:534
find center of Mass of 1D result in a user given range
Definition: operations.h:2172
std::string name_t
define the name type
Definition: processor.h:46
virtual void process(const CASSEvent &, result_t &)
process event
float _alpha
factor used for filtering
Definition: operations.h:2333
std::tr1::function< float(const result_t &)> _baseline
the function that will return the baseline
Definition: operations.h:763
pp88(const name_t &name)
constructor
pp60(const name_t &name)
constructor
std::tr1::shared_ptr< Processor > shared_pointer
a shared pointer of this
Definition: processor.h:43
pp9(const name_t &name)
constructor
Definition: operations.cpp:346
virtual void process(const CASSEvent &, result_t &)
process event
std::pair< int, int > _yRange
range we want to project
Definition: operations.h:684
virtual void loadSettings(size_t)
load the settings of the pp
Definition: operations.cpp:926
pp62(const name_t &)
constructor
virtual void process(const CASSEvent &, result_t &)
process event
result_t::value_t average(result_t::value_t val, result_t::value_t aveOld, result_t::value_t scale)
function for normal averaging.
virtual void process(const CASSEvent &, result_t &)
process event
Definition: operations.cpp:681
check if there is some light in the chamber based upon the GMD value
size_t _nbrSamples
the number of bins in the result, range is fixed
Definition: operations.h:1251
virtual void process(const CASSEvent &, result_t &)
process event
Definition: operations.cpp:479
virtual void process(const CASSEvent &, result_t &)
process event
Subset result.
Definition: operations.h:1657
shared_pointer _threshPP
pp containing the indexwise threshold
Definition: operations.h:529
virtual void loadSettings(size_t)
load the settings of the pp
std::pair< int, int > _Yrange
range in Y we want to project
Definition: operations.h:892
void histogramAndBinCountWithWeightFrom0DInput(CASSEvent::id_t id, result_t::const_iterator xin, result_t::const_iterator xlast, result_t::const_iterator yin, result_t &result)
histogam with constant weight from input
shared_pointer _one
processor containing the 1D result
Definition: operations.h:1574
virtual void loadSettings(size_t)
load the settings
CummulativeStatisticsCalculator< result_t::value_t > cumstat_t
define the type of cummulative statistics used
Definition: operations.h:2011
return the statistic values of all bins of a result
Definition: operations.h:1975
virtual void loadSettings(size_t)
load the settings of this pp
Definition: operations.cpp:619
shared_pointer _one
processor containing input when true result
Definition: operations.h:407
Threshold result.
Definition: operations.h:483
pp15(const name_t &name)
constructor
Definition: operations.cpp:559
func_t _histogram
the function to histogram the values
Definition: operations.h:1481
Check whether result is in range.
Definition: operations.h:255
virtual void releaseEvent(const CASSEvent &)
overwrite the release
Definition: operations.h:1807
result_t::value_t _lowerBound
the lower boundary of the range
Definition: operations.h:610
virtual void process(const CASSEvent &, result_t &)
process event
virtual void loadSettings(size_t)
load the settings of the pp
virtual void loadSettings(size_t)
load the settings of the pp
virtual const result_t & result(const CASSEvent::id_t eventid=0)
retrieve a result for a given id.
Definition: processor.cpp:54
virtual void loadSettings(size_t)
load the settings of the pp
shared_pointer _pHist
processor containing the input result
Definition: operations.h:1718
Constant Value processor.
Definition: operations.h:301
virtual void loadSettings(size_t)
load the settings of the pp