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

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

Write selected branches for each event into a new output file. More...

#include <Write.hpp>

Inheritance diagram for cafe::Write:

cafe::Processor List of all members.

Public Member Functions

 Write (const char *name)
 ~Write ()
void finish ()
 Called at end of processing.

bool processEvent (Event &event)
 Called for every event.

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

 ClassDef (Write, 0)

Private Member Functions

void copy_file ()
bool containsUpdatedClass (TBranch *br)
 Returns true if the branch references a class of some sort that has a class version different from the one we currently have loaded in memory.

void updateBranch (TTree *input_tree, const std::string &branch_name)
 Update the current output tree with a new version of this branch.


Private Attributes

std::string _treeName
std::vector< std::string > _branches
std::vector< std::string > _disable
TFile * _file
TTree * _tree
FilePattern _pattern
Long64_t _autosave
bool _fileOwner
std::string _destination
unsigned int _filesPerOutput
unsigned int _filesPerOutputDone
bool _updateObjectVersion
 Should we re-write branches that contain new versions of objects.

std::vector< std::string > _updatedBranches
 List of top level branch names that need updating.


Detailed Description

Write selected branches for each event into a new output file.

Configuration options:

Definition at line 37 of file Write.hpp.


Constructor & Destructor Documentation

cafe::Write::Write const char *  name  ) 
 

Definition at line 49 of file Write.cpp.

References _autosave, _branches, _destination, _disable, _filesPerOutput, _filesPerOutputDone, _pattern, _treeName, _updateObjectVersion, cafe::Config::get(), cafe::Config::getVString(), cafe::Processor::name(), and cafe::FilePattern::set().

cafe::Write::~Write  ) 
 

Definition at line 69 of file Write.cpp.


Member Function Documentation

cafe::Write::ClassDef Write  ,
 

bool cafe::Write::containsUpdatedClass TBranch *  br  )  [private]
 

Returns true if the branch references a class of some sort that has a class version different from the one we currently have loaded in memory.

Definition at line 261 of file Write.cpp.

Referenced by inputFileOpened().

void cafe::Write::copy_file  )  [private]
 

Definition at line 300 of file Write.cpp.

References _destination, _file, cafe::Processor::err(), cafe::Processor::name(), and cafe::Processor::out().

Referenced by finish(), and inputFileOpened().

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

Called at end of processing.

Reimplemented from cafe::Processor.

Definition at line 74 of file Write.cpp.

References _destination, _file, _fileOwner, and copy_file().

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

Called for every new input file that was opened.

Reimplemented from cafe::Processor.

Definition at line 114 of file Write.cpp.

References _branches, _destination, _disable, _file, _fileOwner, _filesPerOutput, _filesPerOutputDone, _pattern, _tree, _treeName, _updatedBranches, _updateObjectVersion, containsUpdatedClass(), copy_file(), disableBranch(), enableBranch(), cafe::Processor::err(), cafe::Processor::getDirectory(), cafe::Processor::name(), cafe::Processor::out(), cafe::FilePattern::replace(), and updateBranch().

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

Called for every event.

Reimplemented from cafe::Processor.

Definition at line 87 of file Write.cpp.

References _autosave, _tree, cafe::Processor::eventCount(), cafe::EventBase::getTree(), and cafe::EventBase::readBranch().

void cafe::Write::updateBranch TTree *  input_tree,
const std::string &  branch_name
[private]
 

Update the current output tree with a new version of this branch.

Get the address and use that

Definition at line 280 of file Write.cpp.

References _tree.

Referenced by inputFileOpened().


Member Data Documentation

Long64_t cafe::Write::_autosave [private]
 

Definition at line 55 of file Write.hpp.

Referenced by processEvent(), and Write().

std::vector<std::string> cafe::Write::_branches [private]
 

Definition at line 50 of file Write.hpp.

Referenced by inputFileOpened(), and Write().

std::string cafe::Write::_destination [private]
 

Definition at line 57 of file Write.hpp.

Referenced by copy_file(), finish(), inputFileOpened(), and Write().

std::vector<std::string> cafe::Write::_disable [private]
 

Definition at line 51 of file Write.hpp.

Referenced by inputFileOpened(), and Write().

TFile* cafe::Write::_file [private]
 

Definition at line 52 of file Write.hpp.

Referenced by copy_file(), finish(), and inputFileOpened().

bool cafe::Write::_fileOwner [private]
 

Definition at line 56 of file Write.hpp.

Referenced by finish(), and inputFileOpened().

unsigned int cafe::Write::_filesPerOutput [private]
 

Definition at line 58 of file Write.hpp.

Referenced by inputFileOpened(), and Write().

unsigned int cafe::Write::_filesPerOutputDone [private]
 

Definition at line 59 of file Write.hpp.

Referenced by inputFileOpened(), and Write().

FilePattern cafe::Write::_pattern [private]
 

Definition at line 54 of file Write.hpp.

Referenced by inputFileOpened(), and Write().

TTree* cafe::Write::_tree [private]
 

Definition at line 53 of file Write.hpp.

Referenced by inputFileOpened(), processEvent(), and updateBranch().

std::string cafe::Write::_treeName [private]
 

Definition at line 49 of file Write.hpp.

Referenced by inputFileOpened(), and Write().

std::vector<std::string> cafe::Write::_updatedBranches [private]
 

List of top level branch names that need updating.

Definition at line 65 of file Write.hpp.

Referenced by inputFileOpened().

bool cafe::Write::_updateObjectVersion [private]
 

Should we re-write branches that contain new versions of objects.

Definition at line 62 of file Write.hpp.

Referenced by inputFileOpened(), and Write().


The documentation for this class was generated from the following files:
Generated on Tue Mar 28 10:13:11 2006 for CAF by doxygen 1.3.4