CFEL - ASG Software Suite  2.5.0
CASS
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
cass::pp60 Class Reference

0D,1D or 2D to 1D histogramming. More...

#include <operations.h>

+ Inheritance diagram for cass::pp60:
+ Collaboration diagram for cass::pp60:

Public Member Functions

 pp60 (const name_t &name)
 constructor More...
 
virtual void process (const CASSEvent &, result_t &)
 process event More...
 
virtual void loadSettings (size_t)
 load the settings More...
 
- Public Member Functions inherited from cass::Processor
 Processor (const name_t &name)
 constructor More...
 
virtual ~Processor ()
 virtual destructor More...
 
virtual void processEvent (const CASSEvent &event)
 process the event More...
 
virtual const result_tresult (const CASSEvent::id_t eventid=0)
 retrieve a result for a given id. More...
 
virtual void releaseEvent (const CASSEvent &event)
 tell the list that the result for event can be overwritten More...
 
result_t::shared_pointer resultCopy (const uint64_t eventid)
 retrieve histogram for id More...
 
virtual void load ()
 load the general settings More...
 
virtual void aboutToQuit ()
 function that will be called when the processor is about to be deleted More...
 
const names_tdependencies ()
 Define all processors keys a processor depends on. More...
 
void clearDependencies ()
 clear the dependenies More...
 
void clearHistograms ()
 clear the histograms More...
 
virtual void processCommand (std::string command)
 process command in pp More...
 
const name_t name () const
 retrieve the name of this processor More...
 
bool hide () const
 retrieve the hide flag of this processor More...
 
const std::string & comment () const
 retrieve the comment of this processor More...
 

Protected Types

typedef std::tr1::function< void(CASSEvent::id_t, result_t::const_iterator, result_t::const_iterator, result_t &)> func_t
 define the function for histogramming More...
 

Protected Member Functions

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 More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
- Protected Member Functions inherited from cass::Processor
virtual void createHistList (result_t::shared_pointer result)
 create result list. More...
 
void setupGeneral ()
 general setup of the processor More...
 
bool setupCondition (bool defaultConditionType=true)
 setup the condition. More...
 
shared_pointer setupDependency (const std::string &depVarName, const name_t &name="")
 setup the dependecy. More...
 

Protected Attributes

shared_pointer _input
 processor containing result to histogram More...
 
result_t::value_t _weight
 the weight in case it is a constant More...
 
shared_pointer _weightProc
 processor containing the weight More...
 
func_t _histogram
 function used for histogramming More...
 
- Protected Attributes inherited from cass::Processor
const name_t _name
 the processors name More...
 
bool _hide
 flag to tell whether this pp should be hidden in the dropdown list More...
 
std::string _comment
 optional comment that one can add to a processor. More...
 
CachedList _resultList
 the list of results More...
 
names_t _dependencies
 the list of dependencies More...
 
shared_pointer _condition
 pointer to the processor that will contain the condition More...
 

Additional Inherited Members

- Public Types inherited from cass::Processor
typedef std::tr1::shared_ptr< Processorshared_pointer
 a shared pointer of this More...
 
typedef std::string name_t
 define the name type More...
 
typedef std::list< name_tnames_t
 define the list of names More...
 
typedef CachedList::item_type result_t
 define the results More...
 
typedef CachedList::item_sp resultsp_t
 define the shared pointer to the result More...
 

Detailed Description

0D,1D or 2D to 1D histogramming.

Available PostProcessors:
"60": Histogram 0D, 1D or 2D values to a 1D result

histograms all values of 0D, 1D or 2D into a 1D result. This result holds only the histogrammed values of one event. Use Processors 61 or 62 to average or sum up this result, respectively.

It has the capability to histogram the values with user provided weights, which can either be a provided constant or taken from another processor. In case the weight processor contains a 0D value, the value will be taked as a constant. Othwerwise the processor containing the weights has to have the same shape as the input values.

In case the option that allows remembering how many times a bin has been filled the result is a 2D result with 2 bins in y. The 0th bin contains the weighted Histogram and the 1st bin contains the number of entries in the corresponding bin.

See also
Processor for a list of all commonly available cass.ini settings.
User definable Parameters:

Processor/%name%/{XName}
processor name containing the values to histogram

Processor/%name%/{XNbrBins|XLow|XUp|XTitle}
properties of the resulting 1D histogram

Processor/%name%/{Weight}
The weight, Can either be a constant value or a processor name containing the weights. The processor needs to be either of the same shape as the input, in which case the individual entires are the weights of the corresponding bins in the input, or contain a 0D value, in which case this will be used as weight for all the input values. Please see details for details about this option. Default 1

Processor/%name%/{RememberCounts}
This flag allows to enable the option of remembering the number of times a given bin has been filled. See detailed description for more info about this option. Default is false

Author
Lutz Foucar

Definition at line 959 of file operations.h.

Member Typedef Documentation

define the function for histogramming

Definition at line 976 of file operations.h.

Constructor & Destructor Documentation

pp60::pp60 ( const name_t name)

constructor

Definition at line 1295 of file operations.cpp.

References loadSettings().

Member Function Documentation

void pp60::histogramAndBinCountWithConstant ( CASSEvent::id_t  unused,
result_t::const_iterator  in,
result_t::const_iterator  last,
result_t result 
)
protected

histogam with user provided constant weight

In addition remember the number of counts in a bin

Parameters
unusedan unused paramter
initerator to the beginning of the input
lastiterator to the end of the data input
resultreference to the result that does the histograming

Definition at line 1445 of file operations.cpp.

References _weight, and cass::Result< T >::histogram().

Referenced by loadSettings().

void pp60::histogramAndBinCountWithWeightFrom0D ( CASSEvent::id_t  id,
result_t::const_iterator  in,
result_t::const_iterator  last,
result_t result 
)
protected

histogam with weights from 0D processor

In addition remember the number of counts in a bin

Parameters
idthe event id to get the right weight from the processor
initerator to the beginning of the input
lastiterator to the end of the data input
resultreference to the result that does the histograming

Definition at line 1429 of file operations.cpp.

References _weightProc, and cass::Result< T >::histogram().

Referenced by loadSettings().

void pp60::histogramAndBinCountWithWeights ( CASSEvent::id_t  id,
result_t::const_iterator  in,
result_t::const_iterator  last,
result_t result 
)
protected

histogam with weights from another processor

In addition remember the number of counts in a bin

Parameters
idthe event id to get the right weight from the processor
initerator to the beginning of the input
lastiterator to the end of the data input
resultreference to the result that does the histograming

Definition at line 1413 of file operations.cpp.

References _weightProc, and cass::Result< T >::histogram().

Referenced by loadSettings().

void pp60::histogramWithConstant ( CASSEvent::id_t  unused,
result_t::const_iterator  in,
result_t::const_iterator  last,
result_t result 
)
protected

histogam with user provided constant weight

Parameters
unusedan unused paramter
initerator to the beginning of the input
lastiterator to the end of the data input
resultreference to the result that does the histograming

Definition at line 1404 of file operations.cpp.

References _weight, and cass::Result< T >::histogram().

Referenced by loadSettings().

void pp60::histogramWithWeightFrom0D ( CASSEvent::id_t  id,
result_t::const_iterator  in,
result_t::const_iterator  last,
result_t result 
)
protected

histogam with weight from 0D processor

Parameters
idthe event id to get the right weight from the processor
initerator to the beginning of the input
lastiterator to the end of the data input
resultreference to the result that does the histograming

Definition at line 1391 of file operations.cpp.

References _weightProc, and cass::Result< T >::histogram().

Referenced by loadSettings().

void pp60::histogramWithWeights ( CASSEvent::id_t  id,
result_t::const_iterator  in,
result_t::const_iterator  last,
result_t result 
)
protected

histogam with weights from another processor

Parameters
idthe event id to get the right weight from the processor
initerator to the beginning of the input
lastiterator to the end of the data input
resultreference to the result that does the histograming

Definition at line 1378 of file operations.cpp.

References _weightProc, and cass::Result< T >::histogram().

Referenced by loadSettings().

void pp60::loadSettings ( size_t  )
virtual
void pp60::process ( const CASSEvent evt,
result_t result 
)
virtual

Member Data Documentation

func_t cass::pp60::_histogram
protected

function used for histogramming

Definition at line 1067 of file operations.h.

Referenced by loadSettings(), and process().

shared_pointer cass::pp60::_input
protected

processor containing result to histogram

Definition at line 1058 of file operations.h.

Referenced by loadSettings(), and process().

result_t::value_t cass::pp60::_weight
protected

the weight in case it is a constant

Definition at line 1061 of file operations.h.

Referenced by histogramAndBinCountWithConstant(), histogramWithConstant(), and loadSettings().

shared_pointer cass::pp60::_weightProc
protected

The documentation for this class was generated from the following files: