HighLAND
|
#include <InputConverter.hxx>
Public Member Functions | |
InputConverter (const std::string &name) | |
Constrctor provided a name. | |
virtual | ~InputConverter () |
Everyone should have a destructor... | |
const std::string & | GetTreeName () |
returns the name of the tree to convert | |
const std::string & | Name () const |
Return the name of this converter. | |
void | SetName (const std::string &name) |
Set the name of this converter, which is used internally by the InputManager. | |
virtual void | Reset () |
Reset the trees in the TChain and the number of entries. Also the header (POT, etc) | |
virtual bool | Initialize ()=0 |
virtual Int_t | GetSpill (Long64_t &entry, AnaSpillC *&spill)=0 |
virtual Int_t | GetEvent (Long64_t &entry, AnaEventC *&event)=0 |
virtual void | IncrementPOTBySpill ()=0 |
virtual bool | AddFileToTChain (const std::string &inputString)=0 |
Add the file specified to fChain, and any friend chains that were set up. | |
virtual Long64_t | LoadTree (Long64_t entry) |
Handle loading the correct entry from fChain. | |
virtual Long64_t | GetEntries () |
Return the total number of entries in the chain. | |
virtual Int_t | GetNEvents (Int_t entries=-1) |
Return the total number of events for a given number of entries in the tree. | |
virtual bool | IsCorrectType (const std::string &inputString) |
Whether the implementation can handle the specified file. | |
virtual void | SetCosmicMode (const bool cosmic) |
bool | HasChain (const std::string &name) |
void | AddChain (const std::string &name, const std::string &name_path="") |
TChain * | GetChain (const std::string &name="") |
Header & | header () |
Returns the Header manager. | |
Protected Attributes | |
std::string | _name |
The name of the converter. | |
std::string | _treeName |
The name of the tree to convert. | |
int | _nentries |
The number of entries in the chain. To be set by the implementation. | |
TChain * | fChain |
The main TChain used to read events from the input file. | |
Int_t | fCurrent |
current Tree number in a TChain | |
Int_t | _currentFileIndex |
std::string | _currentFileName |
std::map< std::string, TChain * > | _chain_map |
Header | _header |
The header manager. | |
This base class specifies the interface that all input converters should implement.
An input converter takes an input file and converts the information into the AnaSpillB format used in the framework. For example, the oaAnalysisTreeConverter class converts an oaAnalysis file to the AnaSpillB format.
The converters themselves are found in the highLevelAnalysisIO package.
Definition at line 24 of file InputConverter.hxx.
|
inline |
Add a chain with the given name to the map of chains the converter uses. When two names are given the first is the one we will use in the map, while the second is the actual path in the root file. If only one name is given, the path is used as name in the map
Definition at line 99 of file InputConverter.hxx.
|
inline |
Get the chain with the given name, if it has been added to the map of chains the converter uses. If no name is specified, the 'main' chain fChain is returned. If no chain with the given name is in the map of chains, then NULL is returned.
Definition at line 114 of file InputConverter.hxx.
|
pure virtual |
Read the specified entry from the file, and fill the event. The entry number must be incremented inside this function 0 should be returned on error.
Implemented in oaAnalysisTreeConverter, RedoTreeConverter, and MiniTreeConverter.
|
pure virtual |
Read the specified entry from the file, and fill the spill. The entry number must be incremented as part of this function, and the new entry number returned. 0 should be returned on error.
Implemented in oaAnalysisTreeConverter, RedoTreeConverter, FlatTreeConverter, and MiniTreeConverter.
|
inline |
Whether the converter has added a chain with the given name to its map of chains.
Definition at line 91 of file InputConverter.hxx.
|
pure virtual |
Record the POT for the current spill, based on information in the AnaBeam member of the current AnaSpillB.
Implemented in oaAnalysisTreeConverter, RedoTreeConverter, and MiniTreeConverter.
|
pure virtual |
Any initialization that must be done. Called before the input file is read.
Implemented in oaAnalysisTreeConverter, FlatTreeConverter, RedoTreeConverter, and MiniTreeConverter.
|
inlinevirtual |
Specify whether we're running in "cosmic" mode or not. Some converters don't care about this, but others do and can override this function.
Reimplemented in oaAnalysisTreeConverter.
Definition at line 87 of file InputConverter.hxx.
|
protected |
Map of all the chains the converter uses. Access with AddChain(), HasChain() and GetChain() functions.
Definition at line 152 of file InputConverter.hxx.