#include <Processor.hpp>
Inheritance diagram for cafe::Processor:

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. | |
| Processor * | getParent () 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 | |
| Processor * | Create (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 |
|
|
Definition at line 23 of file Processor.cpp. |
|
|
Definition at line 39 of file Processor.cpp. |
|
|
Definition at line 31 of file Processor.cpp. |
|
|
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. |
|
||||||||||||
|
|
|
||||||||||||
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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. |
|
|
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(). |
|
|
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(). |
|
|
Get the parent processor or NULL if top level Processor.
Definition at line 107 of file Processor.cpp. References _parent. Referenced by resolve(). |
|
|
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(). |
|
|
Return a stream to print informational messages to (cout by default).
Definition at line 169 of file Processor.cpp. |
|
|
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. |
|
|
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. |
|
|
|
|
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. |
|
||||||||||||
|
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(). |
|
||||||||||||
|
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(). |
|
|
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(). |
|
|
Definition at line 90 of file Processor.cpp. References _directory. Referenced by cafe::Controller::begin(). |
|
|
Definition at line 101 of file Processor.cpp. References _parent. Referenced by cafe::Controller::add(). |
|
|
Return a stream to print warning messages to (cout by default).
Definition at line 174 of file Processor.cpp. Referenced by cafe::Trigger::Trigger(). |
|
|
Definition at line 125 of file Processor.hpp. |
|
|
Definition at line 132 of file Processor.hpp. Referenced by debug(), and setDebug(). |
|
|
Definition at line 134 of file Processor.hpp. Referenced by getDirectory(), and setDirectory(). |
|
|
Definition at line 131 of file Processor.hpp. Referenced by eventCount(), and incEventCount(). |
|
|
Definition at line 133 of file Processor.hpp. Referenced by fullName(), and name(). |
|
|
Definition at line 135 of file Processor.hpp. Referenced by fullName(), getDirectory(), getParent(), and setParent(). |
1.3.4