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

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

#include <operations.h>

+ Inheritance diagram for cass::pp65:
+ Collaboration diagram for cass::pp65:

Public Member Functions

 pp65 (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::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 xin, result_t::const_iterator xlast, result_t::const_iterator yin, result_t &result)
 histogam with weights from another processor More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
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 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 _xInput
 processor containing X axis value More...
 
shared_pointer _yInput
 processor containing Y-axis value More...
 
result_t::value_t _weight
 the constant weight More...
 
shared_pointer _weightInput
 processor containing the weights More...
 
result_t::axe_t _origYAxis
 y-axis object of the original size (without the nbr fills part) More...
 
func_t _histogram
 the function to histogram the values 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, and 2D to 2D histogramming.

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

histograms two 0D, 1D or 2D values into one 2D result. The result contains only the information from the current event. To get an average or sum use Processor 61 or 62.

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 twice as many bins in y. the first n entries in y contain the (weighted) histogram whereas the y-entries is n..2*n contain the info about how many times the corresponding bin has been filled. Use pp70 to extract the two informations.

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

Processor/%name%/{XName|YName}
processor names containing the values to histogram. Both need to be of the same shape.

Processor/%name%/{XNbrBins|XLow|XUp|XTitle|YNbrBins|YLow|YUp|YTitle}
properties of the 2d 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 1354 of file operations.h.

Member Typedef Documentation

define the function for histogramming

Definition at line 1372 of file operations.h.

Constructor & Destructor Documentation

pp65::pp65 ( const name_t name)

constructor

Definition at line 1801 of file operations.cpp.

References loadSettings().

Member Function Documentation

void pp65::histogramAndBinCountWithConstant ( CASSEvent::id_t  unused,
result_t::const_iterator  xin,
result_t::const_iterator  xlast,
result_t::const_iterator  yin,
result_t result 
)
protected

histogam with constant weight

In addition remember the number of counts in a bin

Parameters
idthe event id to get the right weight from the processor
xiniterator to the beginning of the x input
xlastiterator to the end of the x data input
yiniterator to the begining of the y input
resultreference to the result that does the histograming

Definition at line 1978 of file operations.cpp.

References _origYAxis, _weight, cass::Result< T >::axis(), cass::histogramming::bin(), cass::Axis< T >::nBins, and cass::Result< float >::xAxis.

Referenced by loadSettings().

void pp65::histogramAndBinCountWithWeightFrom0DInput ( CASSEvent::id_t  id,
result_t::const_iterator  xin,
result_t::const_iterator  xlast,
result_t::const_iterator  yin,
result_t result 
)
protected

histogam with constant weight from input

In addition remember the number of counts in a bin

Parameters
idthe event id to get the right weight from the processor
xiniterator to the beginning of the x input
xlastiterator to the end of the x data input
yiniterator to the begining of the y input
resultreference to the result that does the histograming

Definition at line 1958 of file operations.cpp.

References _origYAxis, _weightInput, cass::Result< T >::axis(), cass::histogramming::bin(), cass::Axis< T >::nBins, and cass::Result< float >::xAxis.

Referenced by loadSettings().

void pp65::histogramAndBinCountWithWeights ( CASSEvent::id_t  id,
result_t::const_iterator  xin,
result_t::const_iterator  xlast,
result_t::const_iterator  yin,
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
xiniterator to the beginning of the x input
xlastiterator to the end of the x data input
yiniterator to the begining of the y input
resultreference to the result that does the histograming

Definition at line 1938 of file operations.cpp.

References _origYAxis, _weightInput, cass::Result< T >::axis(), cass::histogramming::bin(), cass::Axis< T >::nBins, and cass::Result< float >::xAxis.

Referenced by loadSettings().

void pp65::histogramWithConstant ( CASSEvent::id_t  unused,
result_t::const_iterator  xin,
result_t::const_iterator  xlast,
result_t::const_iterator  yin,
result_t result 
)
protected

histogam with constant weight

Parameters
unusedan unused paramter
xiniterator to the beginning of the x input
xlastiterator to the end of the x data input
yiniterator to the begining of the y input
resultreference to the result that does the histograming

Definition at line 1928 of file operations.cpp.

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

Referenced by loadSettings().

void pp65::histogramWithWeightFrom0DInput ( CASSEvent::id_t  id,
result_t::const_iterator  xin,
result_t::const_iterator  xlast,
result_t::const_iterator  yin,
result_t result 
)
protected

histogam with constant weight from input

Parameters
idthe event id to get the right weight from the processor
xiniterator to the beginning of the x input
xlastiterator to the end of the x data input
yiniterator to the begining of the y input
resultreference to the result that does the histograming

Definition at line 1914 of file operations.cpp.

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

Referenced by loadSettings().

void pp65::histogramWithWeights ( CASSEvent::id_t  id,
result_t::const_iterator  xin,
result_t::const_iterator  xlast,
result_t::const_iterator  yin,
result_t result 
)
protected

histogam with weights from another processor

Parameters
idthe event id to get the right weight from the processor
xiniterator to the beginning of the x input
xlastiterator to the end of the x data input
yiniterator to the begining of the y input
resultreference to the result that does the histograming

Definition at line 1900 of file operations.cpp.

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

Referenced by loadSettings().

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

Member Data Documentation

func_t cass::pp65::_histogram
protected

the function to histogram the values

Definition at line 1481 of file operations.h.

Referenced by loadSettings(), and process().

result_t::axe_t cass::pp65::_origYAxis
protected

y-axis object of the original size (without the nbr fills part)

Definition at line 1478 of file operations.h.

Referenced by histogramAndBinCountWithConstant(), histogramAndBinCountWithWeightFrom0DInput(), histogramAndBinCountWithWeights(), and loadSettings().

result_t::value_t cass::pp65::_weight
protected

the constant weight

Definition at line 1472 of file operations.h.

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

shared_pointer cass::pp65::_weightInput
protected
shared_pointer cass::pp65::_xInput
protected

processor containing X axis value

Definition at line 1466 of file operations.h.

Referenced by loadSettings(), and process().

shared_pointer cass::pp65::_yInput
protected

processor containing Y-axis value

Definition at line 1469 of file operations.h.

Referenced by loadSettings(), and process().


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