cafe::Processor Class Reference
[CAF Environment (Cafe)]

#include <Processor.hpp>

Inheritance diagram for cafe::Processor:

cafe::AssociatedTracks cafe::BadLBNs cafe::ConfigDumper cafe::Controller cafe::EventFlags cafe::EventList cafe::Friend cafe::Function cafe::GoodRuns cafe::Hist1D cafe::Hist2D cafe::Hist3D cafe::RandomProcessor cafe::RemoveObjects cafe::Select cafe::SelectObjects cafe::SelectUserObjects< T > cafe::Stat cafe::Trigger cafe::Write List of all members.

Detailed Description

The base class of all Processor's.

Defines the interface and provides default implementations for all of them.

A user should derive from this class and override the methods she is interested in. Typically this is at least processEvent().

The derived class _must_ have a constructor that takes a 'const char *' as an argument.

Definition at line 32 of file Processor.hpp.

Public Member Functions

 Processor (const char *name)
virtual ~Processor ()
 ClassDef (Processor, 0)
virtual void begin ()
 Called at beginning of processing.

virtual void finish ()
 Called at end of processing.

virtual void inputFileOpened (TFile *file)
 Called for every new input file that was opened.

virtual void inputFileClosing (TFile *file)
 Called for every input file that is about to be closed.

virtual bool processEvent (cafe::Event &event)
 Called for every event.

void incEventCount ()
 Increment the internal event counter (used by Controller only).

int eventCount () const
 Number of events this Processor has seen.

std::string name () const
 The name of the Processor as passed to the constructor.

std::string fullName () const
 The full name with all parents included.

std::ostream & out ()
 Return a stream to print normal output messages to (cout by default).

std::ostream & info ()
 Return a stream to print informational messages to (cout by default).

std::ostream & warn ()
 Return a stream to print warning messages to (cout by default).

std::ostream & err ()
 Return a stream to print error messages (cerr by default).

unsigned int debug () const
 Return debug level, 0 = no debug output, the higher the more verbose...

virtual void setDebug (unsigned int level)
 Set the debug level. Usually done by controller.

TDirectory * getDirectory () const
 Get the current directory.

ProcessorgetParent () const
 Get the parent processor or NULL if top level Processor.

std::string resolve (const std::string &name, bool recurse=true) const
 Try to Resolve 'name' in all configurations starting from this Processor.

std::string replace (const std::string &input, bool recurse=true) const
 Replace every occurence in 'input' of the form {name} by the result of calling resolve(name).


Static Public Member Functions

ProcessorCreate (const std::string &className, const std::string &instance="")
 Create a new Processor from the class name.


Protected Member Functions

 Processor ()
void setDirectory (TDirectory *dir)
void setParent (Processor *parent)

Private Attributes

unsigned int _eventCount
unsigned int _debug
std::string _name
TDirectory * _directory
Processor_parent

Friends

class Controller


Constructor & Destructor Documentation

cafe::Processor::Processor const char *  name  ) 
 

Definition at line 23 of file Processor.cpp.

cafe::Processor::~Processor  )  [virtual]
 

Definition at line 39 of file Processor.cpp.

cafe::Processor::Processor  )  [protected]
 

Definition at line 31 of file Processor.cpp.


Member Function Documentation

void cafe::Processor::begin  )  [virtual]
 

Called at beginning of processing.

Reimplemented in cafe::ConfigDumper, cafe::Controller, cafe::Hist1D, cafe::Hist2D, cafe::Hist3D, and cafe::Stat.

Definition at line 43 of file Processor.cpp.

cafe::Processor::ClassDef Processor  ,
 

Processor * cafe::Processor::Create const std::string &  className,
const std::string &  instance = ""
[static]
 

Create a new Processor from the class name.

Pass 'instance' as the new name of the object.

Definition at line 187 of file Processor.cpp.

References cafe::Plugins::load().

unsigned int cafe::Processor::debug  )  const
 

Return debug level, 0 = no debug output, the higher the more verbose...

Definition at line 64 of file Processor.cpp.

References _debug.

Referenced by cafe::Controller::add(), cafe::RandomProcessor::inputFileOpened(), cafe::RandomProcessor::processEvent(), and cafe::RandomProcessor::RandomProcessor().

std::ostream & cafe::Processor::err  ) 
 

Return a stream to print error messages (cerr by default).

Definition at line 180 of file Processor.cpp.

Referenced by cafe::Hist3D::begin(), cafe::Hist2D::begin(), cafe::Hist1D::begin(), cafe::Write::check_file(), cafe::Write::copy_file(), cafe::ConfigDumper::finish(), cafe::Hist1D::Hist1D(), cafe::Hist2D::Hist2D(), cafe::Hist3D::Hist3D(), cafe::If::If(), cafe::IfPr::IfPr(), cafe::Write::inputFileOpened(), cafe::SelectUserObjects< T >::inputFileOpened(), cafe::SelectObjects::inputFileOpened(), cafe::RandomSelectUserObjects< T >::inputFileOpened(), cafe::Stat::processEvent(), cafe::RemoveObjects::processEvent(), cafe::Function::processEvent(), cafe::RunController::Run(), cafe::Stat::syst_neg(), and cafe::Stat::syst_pos().

int cafe::Processor::eventCount  )  const
 

Number of events this Processor has seen.

Definition at line 80 of file Processor.cpp.

References _eventCount.

Referenced by cafe::Write::processEvent(), cafe::Stat::processEvent(), cafe::RunController::Run(), and cafe::Timer::~Timer().

void cafe::Processor::finish  )  [virtual]
 

Called at end of processing.

Reimplemented in cafe::ConfigDumper, cafe::Controller, cafe::EventList, cafe::EventMultiSplitter, cafe::Stat, cafe::Trigger, and cafe::Write.

Definition at line 47 of file Processor.cpp.

std::string cafe::Processor::fullName  )  const
 

The full name with all parents included.

This is only valid once the whole Processor chain has been constructed.

Definition at line 148 of file Processor.cpp.

References _name, and _parent.

Referenced by cafe::Controller::add(), cafe::Hist3D::begin(), cafe::Hist2D::begin(), cafe::Hist1D::begin(), cafe::ConfigDumper::finish(), cafe::SelectUserObjects< T >::inputFileOpened(), cafe::SelectObjects::inputFileOpened(), cafe::RandomSelectUserObjects< T >::inputFileOpened(), and cafe::RunController::Run().

TDirectory * cafe::Processor::getDirectory  )  const
 

Get the current directory.

Definition at line 95 of file Processor.cpp.

References _directory, and _parent.

Referenced by cafe::Hist3D::begin(), cafe::Hist2D::begin(), cafe::Hist1D::begin(), cafe::Controller::begin(), cafe::ConfigDumper::finish(), and cafe::Write::inputFileOpened().

Processor * cafe::Processor::getParent  )  const
 

Get the parent processor or NULL if top level Processor.

Definition at line 107 of file Processor.cpp.

References _parent.

Referenced by resolve().

void cafe::Processor::incEventCount  ) 
 

Increment the internal event counter (used by Controller only).

Definition at line 74 of file Processor.cpp.

References _eventCount, cafe::Stat::EventSelected(), name(), and STAT.

Referenced by cafe::RunController::processTree().

std::ostream & cafe::Processor::info  ) 
 

Return a stream to print informational messages to (cout by default).

Definition at line 169 of file Processor.cpp.

void cafe::Processor::inputFileClosing TFile *  file  )  [virtual]
 

Called for every input file that is about to be closed.

Reimplemented in cafe::Controller, cafe::EventList, cafe::RandomSelectUserObjects< T >, cafe::SelectObjects, and cafe::SelectUserObjects< T >.

Definition at line 55 of file Processor.cpp.

void cafe::Processor::inputFileOpened TFile *  file  )  [virtual]
 

Called for every new input file that was opened.

Reimplemented in cafe::Controller, cafe::EventList, cafe::Friend, cafe::Hist1D, cafe::Hist2D, cafe::Hist3D, cafe::If, cafe::RandomProcessor, cafe::RandomSelectUserObjects< T >, cafe::Select, cafe::SelectObjects, cafe::SelectUserObjects< T >, and cafe::Write.

Definition at line 51 of file Processor.cpp.

std::string cafe::Processor::name  )  const
 

The name of the Processor as passed to the constructor.

Definition at line 85 of file Processor.cpp.

References _name.

Referenced by cafe::Controller::add(), cafe::AssociatedTracks::AssociatedTracks(), cafe::BadLBNs::BadLBNs(), cafe::Stat::begin(), cafe::Hist3D::begin(), cafe::Hist2D::begin(), cafe::Hist1D::begin(), cafe::Controller::begin(), cafe::ConfigDumper::begin(), cafe::Write::check_file(), cafe::ConfigDumper::ConfigDumper(), cafe::Controller::Controller(), cafe::Write::copy_file(), cafe::EventFlags::EventFlags(), cafe::EventList::EventList(), cafe::EventMultiSplitter::EventMultiSplitter(), cafe::Trigger::finish(), cafe::Controller::finish(), cafe::ConfigDumper::finish(), cafe::Friend::Friend(), cafe::Function::Function(), cafe::GoodRuns::GoodRuns(), cafe::Hist1D::Hist1D(), cafe::Hist2D::Hist2D(), cafe::Hist3D::Hist3D(), cafe::If::If(), cafe::IfPr::IfPr(), incEventCount(), cafe::Write::inputFileOpened(), cafe::SelectUserObjects< T >::inputFileOpened(), cafe::SelectObjects::inputFileOpened(), cafe::RandomSelectUserObjects< T >::inputFileOpened(), cafe::RandomProcessor::inputFileOpened(), cafe::Friend::inputFileOpened(), cafe::Formula::inputFileOpened(), cafe::Permute::Permute(), cafe::Stat::print_html(), cafe::Trigger::processEvent(), cafe::Stat::processEvent(), cafe::RemoveObjects::processEvent(), cafe::Function::processEvent(), cafe::EventMultiSplitter::processPermutation(), cafe::RandomProcessor::RandomProcessor(), cafe::RandomSelectUserObjects< T >::RandomSelectUserObjects(), cafe::RemoveObjects::RemoveObjects(), resolve(), cafe::RunController::Run(), cafe::RunController::RunController(), cafe::Select::Select(), cafe::SelectObjects::SelectObjects(), cafe::SelectUserObjects< T >::SelectUserObjects(), cafe::Stat::Stat(), cafe::Trigger::Trigger(), cafe::Write::Write(), cafe::Write::writeMetaData(), and cafe::Timer::~Timer().

std::ostream & cafe::Processor::out  ) 
 

Return a stream to print normal output messages to (cout by default).

Definition at line 164 of file Processor.cpp.

Referenced by cafe::Controller::add(), cafe::AssociatedTracks::AssociatedTracks(), cafe::BadLBNs::BadLBNs(), cafe::Hist3D::begin(), cafe::Hist2D::begin(), cafe::Hist1D::begin(), cafe::Controller::begin(), cafe::ConfigDumper::begin(), cafe::Write::copy_file(), cafe::EventFlags::EventFlags(), cafe::EventList::EventList(), cafe::Trigger::finish(), cafe::Controller::finish(), cafe::ConfigDumper::finish(), cafe::GoodRuns::GoodRuns(), cafe::Hist2D::Hist2D(), cafe::Hist3D::Hist3D(), cafe::Write::inputFileOpened(), cafe::RandomProcessor::inputFileOpened(), cafe::Friend::inputFileOpened(), cafe::RandomProcessor::processEvent(), cafe::RunController::processTree(), cafe::RandomProcessor::RandomProcessor(), cafe::RandomSelectUserObjects< T >::RandomSelectUserObjects(), cafe::RunController::Run(), cafe::Select::Select(), cafe::SelectObjects::SelectObjects(), cafe::SelectUserObjects< T >::SelectUserObjects(), cafe::Trigger::Trigger(), cafe::Write::writeMetaData(), and cafe::Timer::~Timer().

bool cafe::Processor::processEvent cafe::Event event  )  [virtual]
 

Called for every event.

Reimplemented in cafe::AssociatedTracks, cafe::BadLBNs, cafe::Controller, cafe::EventFlags, cafe::EventList, cafe::EventMultiSplitter, cafe::Fork, cafe::Function, cafe::GoodRuns, cafe::Hist1D, cafe::Hist2D, cafe::Hist3D, cafe::If, cafe::IfPr, cafe::OR, cafe::Permute, cafe::RandomProcessor, cafe::RandomSelectUserObjects< T >, cafe::RemoveObjects, cafe::Select, cafe::SelectObjects, cafe::SelectUserObjects< T >, cafe::Stat, cafe::Timer, cafe::Trigger, and cafe::Write.

Definition at line 59 of file Processor.cpp.

std::string cafe::Processor::replace const std::string &  input,
bool  recurse = true
const
 

Replace every occurence in 'input' of the form {name} by the result of calling resolve(name).

Definition at line 128 of file Processor.cpp.

References resolve().

Referenced by cafe::Hist1D::begin(), cafe::Hist2D::Hist2D(), and cafe::Hist3D::Hist3D().

std::string cafe::Processor::resolve const std::string &  name,
bool  recurse = true
const
 

Try to Resolve 'name' in all configurations starting from this Processor.

Try parent if 'recurse' is true.

Definition at line 112 of file Processor.cpp.

References cafe::Config::get(), getParent(), and name().

Referenced by replace().

void cafe::Processor::setDebug unsigned int  level  )  [virtual]
 

Set the debug level. Usually done by controller.

Reimplemented in cafe::Controller.

Definition at line 69 of file Processor.cpp.

References _debug.

Referenced by cafe::Controller::add().

void cafe::Processor::setDirectory TDirectory *  dir  )  [protected]
 

Definition at line 90 of file Processor.cpp.

References _directory.

Referenced by cafe::Controller::begin().

void cafe::Processor::setParent Processor parent  )  [protected]
 

Definition at line 101 of file Processor.cpp.

References _parent.

Referenced by cafe::Controller::add().

std::ostream & cafe::Processor::warn  ) 
 

Return a stream to print warning messages to (cout by default).

Definition at line 174 of file Processor.cpp.

Referenced by cafe::Trigger::Trigger().


Friends And Related Function Documentation

friend class Controller [friend]
 

Definition at line 125 of file Processor.hpp.


Member Data Documentation

unsigned int cafe::Processor::_debug [private]
 

Definition at line 132 of file Processor.hpp.

Referenced by debug(), and setDebug().

TDirectory* cafe::Processor::_directory [mutable, private]
 

Definition at line 134 of file Processor.hpp.

Referenced by getDirectory(), and setDirectory().

unsigned int cafe::Processor::_eventCount [private]
 

Definition at line 131 of file Processor.hpp.

Referenced by eventCount(), and incEventCount().

std::string cafe::Processor::_name [private]
 

Definition at line 133 of file Processor.hpp.

Referenced by fullName(), and name().

Processor* cafe::Processor::_parent [private]
 

Definition at line 135 of file Processor.hpp.

Referenced by fullName(), getDirectory(), getParent(), and setParent().


The documentation for this class was generated from the following files:
Generated on Thu Apr 3 04:14:27 2008 for CAF by doxygen 1.3.4