Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

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

The base class of all Processor's. More...

#include <Processor.hpp>

Inheritance diagram for cafe::Processor:

caf_util::EventQuality caf_util::FindDuplicateEvents caf_util::METSelector caf_util::ReComputeMET caf_util::ResSelector caf_util::TopologicalSelector cafe::BadLBNs cafe::ConfigDumper cafe::Controller cafe::EventFlags cafe::EventList cafe::Friend cafe::Function cafe::GoodRuns cafe::Hist1D cafe::Hist2D cafe::Hist3D cafe::Select cafe::SelectObjects cafe::SelectUserObjects< T > cafe::SelectUserObjects< TMBEMCluster > cafe::SelectUserObjects< TMBJet > cafe::SelectUserObjects< TMBMuon > cafe::SelectUserObjects< TMBPrimaryVertex > cafe::SelectUserObjects< TMBTau > cafe::Stat cafe::StatGWeight cafe::Trigger cafe::Write List of all members.

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

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.


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, cafe::Stat, caf_util::ResSelector, and caf_util::VertexSelector.

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(), caf_util::VertexSelector::begin(), caf_util::ElectronSelector::finish(), caf_util::ResSelector::processEvent(), caf_util::METSelector::processEvent(), caf_util::JetSelector::processEvent(), caf_util::FindDuplicateEvents::processEvent(), caf_util::ElectronSelector::processEvent(), caf_util::VertexSelector::selectObject(), caf_util::JetSelector::selectObject(), and caf_util::ElectronSelector::selectObject().

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::Controller::begin(), cafe::Write::copy_file(), caf_util::ElectronSelector::ElectronSelector(), caf_util::EventQuality::EventQuality(), cafe::ConfigDumper::finish(), caf_util::ResSelector::GetElectron(), caf_util::ResSelector::GetMuon(), cafe::Hist1D::Hist1D(), cafe::Hist2D::Hist2D(), cafe::Hist3D::Hist3D(), cafe::If::If(), cafe::Write::inputFileOpened(), cafe::SelectUserObjects< T >::inputFileOpened(), cafe::SelectObjects::inputFileOpened(), caf_util::ReComputeMET::inputFileOpened(), caf_util::ResSelector::mass(), caf_util::METSelector::METSelector(), caf_util::MuonSelector::MuonSelector(), cafe::Stat::processEvent(), caf_util::ResSelector::processEvent(), caf_util::METSelector::processEvent(), cafe::Function::processEvent(), caf_util::FindDuplicateEvents::processEvent(), caf_util::ReComputeMET::ReComputeMET(), caf_util::ResSelector::ResSelector(), cafe::RunController::Run(), caf_util::VertexSelector::selectObject(), caf_util::JetSelector::selectObject(), and caf_util::JetSelector::SetJESType().

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::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::Write, caf_util::ElectronSelector, and caf_util::FindDuplicateEvents.

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(), caf_util::ReComputeMET::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 caf_util::ResSelector::begin(), 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::SelectObjects, cafe::SelectUserObjects< T >, caf_util::ReComputeMET, cafe::SelectUserObjects< TMBJet >, cafe::SelectUserObjects< TMBTau >, cafe::SelectUserObjects< TMBMuon >, cafe::SelectUserObjects< TMBPrimaryVertex >, and cafe::SelectUserObjects< TMBEMCluster >.

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::Select, cafe::SelectObjects, cafe::SelectUserObjects< T >, cafe::Write, caf_util::ReComputeMET, cafe::SelectUserObjects< TMBJet >, cafe::SelectUserObjects< TMBTau >, cafe::SelectUserObjects< TMBMuon >, cafe::SelectUserObjects< TMBPrimaryVertex >, and cafe::SelectUserObjects< TMBEMCluster >.

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(), caf_util::ApplyJES::ApplyJES(), cafe::BadLBNs::BadLBNs(), cafe::Stat::begin(), caf_util::ResSelector::begin(), cafe::Hist3D::begin(), cafe::Hist2D::begin(), cafe::Hist1D::begin(), cafe::Controller::begin(), cafe::ConfigDumper::begin(), caf_util::BTagJetSelector::BTagJetSelector(), cafe::ConfigDumper::ConfigDumper(), cafe::Controller::Controller(), cafe::Write::copy_file(), caf_util::ElectronSelector::ElectronSelector(), caf_util::EMJetMatching::EMJetMatching(), cafe::EventFlags::EventFlags(), cafe::EventList::EventList(), cafe::EventMultiSplitter::EventMultiSplitter(), caf_util::EventQuality::EventQuality(), caf_util::FindDuplicateEvents::FindDuplicateEvents(), caf_util::ElectronSelector::FindFile(), cafe::Stat::finish(), caf_util::FindDuplicateEvents::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(), incEventCount(), cafe::Write::inputFileOpened(), cafe::SelectUserObjects< T >::inputFileOpened(), cafe::SelectObjects::inputFileOpened(), caf_util::ReComputeMET::inputFileOpened(), cafe::Friend::inputFileOpened(), cafe::Formula::inputFileOpened(), caf_util::JetSelector::JetSelector(), caf_util::ResSelector::mass(), caf_util::METSelector::METSelector(), caf_util::MuonSelector::MuonSelector(), cafe::Permute::Permute(), cafe::Stat::processEvent(), caf_util::ResSelector::processEvent(), cafe::Function::processEvent(), caf_util::FindDuplicateEvents::processEvent(), cafe::EventMultiSplitter::processPermutation(), caf_util::ReComputeMET::ReComputeMET(), resolve(), caf_util::ResSelector::ResSelector(), cafe::RunController::Run(), cafe::RunController::RunController(), cafe::Select::Select(), caf_util::VertexSelector::selectObject(), caf_util::JetSelector::selectObject(), caf_util::ElectronSelector::selectObject(), cafe::SelectObjects::SelectObjects(), cafe::SelectUserObjects< T >::SelectUserObjects(), caf_util::MuonSelector::SetStdCuts(), caf_util::JetSelector::Smear(), cafe::Stat::Stat(), caf_util::TauSelector::TauSelector(), caf_util::TopologicalSelector::TopologicalSelector(), cafe::Trigger::Trigger(), caf_util::VertexSelector::VertexSelector(), cafe::Write::Write(), 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::BadLBNs::BadLBNs(), caf_util::MuonSelector::before(), cafe::Hist3D::begin(), cafe::Hist2D::begin(), cafe::Hist1D::begin(), cafe::Controller::begin(), cafe::ConfigDumper::begin(), cafe::Write::copy_file(), caf_util::MuonSelector::DCAfromBeamSpot(), caf_util::MuonSelector::DisplayMuonIsolationQualityCuts(), caf_util::MuonSelector::DisplayMuonQualityCuts(), caf_util::MuonSelector::DisplayMuonTrackQualityCuts(), caf_util::ElectronSelector::ElectronSelector(), cafe::EventFlags::EventFlags(), cafe::EventList::EventList(), caf_util::ElectronSelector::FindFile(), caf_util::FindDuplicateEvents::finish(), cafe::Controller::finish(), cafe::ConfigDumper::finish(), cafe::GoodRuns::GoodRuns(), cafe::Hist2D::Hist2D(), cafe::Hist3D::Hist3D(), cafe::Write::inputFileOpened(), cafe::Friend::inputFileOpened(), caf_util::METSelector::METSelector(), caf_util::MuonSelector::MuonSelector(), caf_util::TopologicalSelector::processEvent(), caf_util::ResSelector::processEvent(), caf_util::METSelector::processEvent(), caf_util::JetSelector::processEvent(), caf_util::FindDuplicateEvents::processEvent(), caf_util::ElectronSelector::processEvent(), cafe::RunController::processTree(), caf_util::ReComputeMET::ReComputeMET(), cafe::RunController::Run(), cafe::Select::Select(), caf_util::VertexSelector::selectObject(), caf_util::MuonSelector::selectObject(), caf_util::JetSelector::selectObject(), cafe::SelectObjects::SelectObjects(), cafe::SelectUserObjects< T >::SelectUserObjects(), caf_util::MuonSelector::SetStdCuts(), cafe::Trigger::Trigger(), and cafe::Timer::~Timer().

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

Called for every event.

Reimplemented in 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::Permute, cafe::Select, cafe::SelectObjects, cafe::SelectUserObjects< T >, cafe::Stat, cafe::StatGWeight, cafe::Timer, cafe::Trigger, cafe::Write, caf_util::ApplyJES, caf_util::BTagJetSelector, caf_util::ElectronSelector, caf_util::EMJetMatching, caf_util::EventQuality, caf_util::FindDuplicateEvents, caf_util::JetSelector, caf_util::METSelector, caf_util::MuonSelector, caf_util::ReComputeMET, caf_util::ResSelector, caf_util::TauSelector, caf_util::TopologicalSelector, caf_util::VertexSelector, cafe::SelectUserObjects< TMBJet >, cafe::SelectUserObjects< TMBTau >, cafe::SelectUserObjects< TMBMuon >, cafe::SelectUserObjects< TMBPrimaryVertex >, and cafe::SelectUserObjects< TMBEMCluster >.

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 caf_util::ResSelector::GetElectron(), caf_util::ResSelector::GetMuon(), caf_util::ResSelector::mass(), and 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]
 

Reimplemented in caf_util::ApplyJES, caf_util::EMJetMatching, and caf_util::ReComputeMET.

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 Tue Mar 28 10:13:10 2006 for CAF by doxygen 1.3.4