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

converts histograms to (c)rystal (b)inary (f)ormat files. More...

#include <cbf_output.h>

+ Inheritance diagram for cass::pp1500:
+ Collaboration diagram for cass::pp1500:

Public Member Functions

 pp1500 (const name_t &)
 constructor More...
 
virtual void processEvent (const CASSEvent &)
 overwrite process event More...
 
virtual void aboutToQuit ()
 dump dark to cbf just before quitting More...
 
virtual void loadSettings (size_t)
 load the settings of this pp More...
 
virtual const result_tresult (const CASSEvent::id_t eventid=0)
 overwrite the retrieval of an histogram More...
 
virtual void releaseEvent (const CASSEvent &)
 overwrite the release More...
 
- Public Member Functions inherited from cass::Processor
 Processor (const name_t &name)
 constructor More...
 
virtual ~Processor ()
 virtual destructor More...
 
result_t::shared_pointer resultCopy (const uint64_t eventid)
 retrieve histogram for id More...
 
virtual void load ()
 load the general settings 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 Attributes

std::string _basefilename
 the filename that the data will be written to More...
 
shared_pointer _pHist
 pp containing histogram to dump to cbf More...
 
shared_pointer _summaryHist
 pp containing histogram that will be written as summary to dump to cbf More...
 
int _maxFilePerSubDir
 the number of files in each subdir More...
 
int _filecounter
 counter to count how many files have been written 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...
 

Private Attributes

QMutex _lock
 a lock to make the process reentrant 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...
 
- Protected Member Functions inherited from cass::Processor
virtual void process (const CASSEvent &event, result_t &result)
 process the event More...
 
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...
 

Detailed Description

converts histograms to (c)rystal (b)inary (f)ormat files.

Available PostProcessors:
"pp1500": converts histograms to (c)rystal (b)inary (f)ormat files.
User definable Parameters:

Processor/%name%/{Name}
processor name containing the histogram that write to cbf. If not set then no cbf file will be written when condition is true

Processor/%name%/{SummaryName}
processor name containing Histogram to be written as summary to cbf. If not set then no summary will be written

Processor/%name%/{FileBaseName}
Default name given by program parameter

Processor/%name%/{MaximumNbrFilesPerDir}
Distribute the files over subdirectories where each subdir contains this amount of files. If -1 it will not distribute the files. Default is -1.

Author
Stephan Kassemeyer
Lutz Foucar

Definition at line 38 of file cbf_output.h.

Constructor & Destructor Documentation

pp1500::pp1500 ( const name_t name)

constructor

Definition at line 28 of file cbf_output.cpp.

References loadSettings().

Member Function Documentation

void pp1500::aboutToQuit ( )
virtual

dump dark to cbf just before quitting

return if there is no summary to be written

create filename from base filename, but first remove subdir from filename when they should be distributed

Reimplemented from cass::Processor.

Definition at line 130 of file cbf_output.cpp.

References _basefilename, _lock, _maxFilePerSubDir, _summaryHist, cass::AlphaCounter::removeAlphaSubdir(), and cass::CBF::write().

void pp1500::loadSettings ( size_t  )
virtual
void pp1500::processEvent ( const CASSEvent evt)
virtual

overwrite process event

return if there is no histogram to be written

return if the condition for this pp is false

increment subdir in filename when they should be distributed and the counter exeeded the maximum amount of files per subdir

create filename from base filename + event id

Reimplemented from cass::Processor.

Definition at line 99 of file cbf_output.cpp.

References _basefilename, cass::Processor::_condition, _filecounter, _lock, _maxFilePerSubDir, _pHist, cass::Result< T >::begin(), cass::CASSEvent::id(), cass::AlphaCounter::increaseDirCounter(), cass::Result< T >::lock, cass::Result< T >::shape(), cass::toString(), and cass::CBF::write().

virtual void cass::pp1500::releaseEvent ( const CASSEvent )
inlinevirtual

overwrite the release

Reimplemented from cass::Processor.

Definition at line 57 of file cbf_output.h.

const Processor::result_t & pp1500::result ( const CASSEvent::id_t  eventid = 0)
virtual

overwrite the retrieval of an histogram

Reimplemented from cass::Processor.

Definition at line 94 of file cbf_output.cpp.

References cass::Processor::name().

Member Data Documentation

std::string cass::pp1500::_basefilename
protected

the filename that the data will be written to

Definition at line 61 of file cbf_output.h.

Referenced by aboutToQuit(), loadSettings(), and processEvent().

int cass::pp1500::_filecounter
protected

counter to count how many files have been written

Definition at line 73 of file cbf_output.h.

Referenced by loadSettings(), and processEvent().

QMutex cass::pp1500::_lock
private

a lock to make the process reentrant

Definition at line 77 of file cbf_output.h.

Referenced by aboutToQuit(), and processEvent().

int cass::pp1500::_maxFilePerSubDir
protected

the number of files in each subdir

Definition at line 70 of file cbf_output.h.

Referenced by aboutToQuit(), loadSettings(), and processEvent().

shared_pointer cass::pp1500::_pHist
protected

pp containing histogram to dump to cbf

Definition at line 64 of file cbf_output.h.

Referenced by loadSettings(), and processEvent().

shared_pointer cass::pp1500::_summaryHist
protected

pp containing histogram that will be written as summary to dump to cbf

Definition at line 67 of file cbf_output.h.

Referenced by aboutToQuit(), and loadSettings().


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