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

root file converter More...

#include <root_converter.h>

+ Inheritance diagram for cass::pp2000:
+ Collaboration diagram for cass::pp2000:

Classes

struct  entry_t
 struct bundleing info for writing an entry to file More...
 

Public Member Functions

 pp2000 (const name_t &name)
 Construct processor for converting histograms to root histograms. More...
 
virtual void processEvent (const CASSEvent &)
 only a stub does nothing, but needs to be there because its pure virtual in base class More...
 
virtual void loadSettings (size_t)
 load the settings of this pp More...
 
virtual void aboutToQuit ()
 dump all histogram to a root file just before quitting 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 _rootfilename
 the root filename where we store the data in More...
 
std::list< entry_t_ppList
 container with all pps that contain the histograms to dump to hdf5 More...
 
std::list< entry_t_ppSummaryList
 container for all pps that should be written when program quits More...
 
TFile * _rootfile
 the root file 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

root file converter

Available PostProcessors:
"2000": Writes histograms to root file

will convert all histograms defined in cass to root histograms and write them to a root file. Filename can be chosen with the -o parameter at program start.

User definable Parameters:

Processor/%name%/{FileName}
The name of the output root file. Default is "output.root"

Processor/%name%/Processor/{size}
How many Processors should be written to the root file.

Processor/%name%/Processor/%id%/{Name}
Name of the Processor that should be written into the root file. Default is "unknown"

Processor/%name%/Processor/%id%/{GroupName}
Name of the group in the h5 file into which the Processor should be written into. Default is "/". Note that the eventid will be prepended to the Name given here.

Processor/%name%/Processor/%id%/{ValName}
Name that the data should have in the root file. Default is the name of the Processor.

Processor/%name%/ProcessorSummary/size
How many Processors should be written to the root file.

Processor/%name%/ProcessorSummary/%id%/{Name}
Name of the Processor that should be written into the root file. Default is "unknown"

Processor/%name%/ProcessorSummary/%id%/{GroupName}
Name of the group in the root file into which the Processor should be written into. Default is "/"

Processor/%name%/ProcessorSummary/%id%/{ValName}
Name that the data should have in the root file. Default is the name of the Processor.

Author
Lutz Foucar

Definition at line 56 of file root_converter.h.

Constructor & Destructor Documentation

pp2000::pp2000 ( const name_t name)

Construct processor for converting histograms to root histograms.

Definition at line 202 of file root_converter.cpp.

References loadSettings().

Member Function Documentation

void pp2000::aboutToQuit ( )
virtual

dump all histogram to a root file just before quitting

check if something to be written

write all entries to file

create and change into dir given by user then write hist with given name into the file

go back to original directory and save file

Reimplemented from cass::Processor.

Definition at line 270 of file root_converter.cpp.

References _ppSummaryList, _rootfile, cass::Log::add(), cass::ROOT::changeDir(), cass::ROOTFileHelper::close(), cass::ROOT::copyHistToRootFile(), cass::Processor::name(), and cass::Log::VERBOSEINFO.

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

only a stub does nothing, but needs to be there because its pure virtual in base class

check if there is something to be written

create the directory name from eventId

write all entries to file

create and change into dir given by user then write hist with given name into the file

go back to original directory and save file

Reimplemented from cass::Processor.

Definition at line 298 of file root_converter.cpp.

References cass::Processor::_condition, _lock, _ppList, _rootfile, cass::ROOT::changeDir(), cass::ROOT::copyHistToRootFile(), cass::ROOT::eventIdToDirectoryName(), and cass::CASSEvent::id().

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

overwrite the release

Reimplemented from cass::Processor.

Definition at line 103 of file root_converter.h.

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

overwrite the retrieval of an histogram

Reimplemented from cass::Processor.

Definition at line 208 of file root_converter.cpp.

References cass::Processor::name().

Member Data Documentation

QMutex cass::pp2000::_lock
private

a lock to make the process reentrant

Definition at line 120 of file root_converter.h.

Referenced by processEvent().

std::list<entry_t> cass::pp2000::_ppList
protected

container with all pps that contain the histograms to dump to hdf5

Definition at line 110 of file root_converter.h.

Referenced by loadSettings(), and processEvent().

std::list<entry_t> cass::pp2000::_ppSummaryList
protected

container for all pps that should be written when program quits

Definition at line 113 of file root_converter.h.

Referenced by aboutToQuit(), and loadSettings().

TFile* cass::pp2000::_rootfile
protected

the root file

Definition at line 116 of file root_converter.h.

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

std::string cass::pp2000::_rootfilename
protected

the root filename where we store the data in

Definition at line 107 of file root_converter.h.


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