HighLAND
Public Member Functions | List of all members
HighlandInputManager Class Reference

#include <HighlandInputManager.hxx>

Inheritance diagram for HighlandInputManager:
InputManager

Public Member Functions

 HighlandInputManager ()
 Constructor.
 
virtual ~HighlandInputManager ()
 Destructor, which cleans up the spills.
 
void Reset ()
 Reset the converters and the UniqueID.
 
void DeleteSpill ()
 clean up the remaining pointers to the spills.
 
bool LoadSpill (Long64_t &entry)
 
bool InputIsOriginalTree ()
 Whether an OriginalTree converter has been selected.
 
const AnaSpillCGetRawSpill ()
 Get the current spill (constant, as read in from the input file).
 
void SetRawSpill (AnaSpillC *RawSpill)
 Set the current spill (constant, as read in from the input file).
 
const AnaBunchCGetRawBunch ()
 Get the current bunch (constant, as read in from the input file).
 
AnaBunchCGetCorrectedBunch ()
 Get the current bunch (to have corrections applied to it).
 
AnaBunchCGetBunch ()
 Get the current bunch (to have corrections and systematics applied to it).
 
void SetCurrentBunch (int ibunch)
 Set the current bunch index.
 
void ResetSpillToRaw ()
 Create the event. More...
 
- Public Member Functions inherited from InputManager
 InputManager ()
 Constructor.
 
virtual ~InputManager ()
 Destructor, which cleans up the spills.
 
bool Initialize (const std::string &infile_name, const std::string &conv, const bool isCosmic=false)
 
bool ReadFile (const std::string &infile_name, bool isROOTFile)
 
bool LoadEvent (Long64_t &entry, bool delPrevious=true)
 
Long64_t LoadTree (Long64_t entry)
 Call InputConverter::LoadTree() for the selected converter.
 
Long64_t GetEntries ()
 Return the number of entries in the input file tree(s).
 
Int_t GetNEvents (Int_t entries=-1)
 Return the number of events for a given number of entries in the input file tree(s).
 
TChain * GetChain (const std::string &name)
 Get a TChain with a specific name from the selected converter.
 
std::string FindFirstFile (const std::string &infile_name, bool isROOTFile)
 
bool IsROOTFile (const std::string &infile_name)
 Is this a ROOT file ?
 
InputConverterGetConverter ()
 Get the current selected converter.
 
void SelectConverter (InputConverter *sel)
 Set this converter as the selected one.
 
void SelectConverter (const std::string &conv)
 Set the converter with name as the selected one.
 
void AddConverter (const std::string &name, InputConverter *conv)
 Add this converter to the vector of recognised converters.
 
void ReplaceConverter (const std::string &name, InputConverter *conv)
 Replace an existing converter.
 
bool HasConverter (const std::string &conv, bool err_message=true)
 Whether the vector of converters contains one registered with this name.
 
void IncrementPOTBySpill ()
 
bool InputIsFlatTree ()
 Whether a FlatTree converter has been selected.
 
bool InputIsMiniTree ()
 Whether a FlatTree converter has been selected.
 
void RemoveConverters ()
 Delete all the converters that have been added.
 
void MakeFinalSpill ()
 Creates a clone of the corrected Spill. This must be done after applying corrections.
 
AnaSpillCGetCorrectedSpill ()
 Get the current spill (to have corrections applied to it).
 
AnaSpillCGetSpill ()
 Get the current spill (to have corrections and systematics applied to it).
 
void SetCorrectedSpill (AnaSpillC *Spill)
 Set the current spill (to have corrections applied to it).
 
AnaSuperEventBGetSuperEvent ()
 Create the event. More...
 
void ResetSpillToCorrected ()
 
bool AddDataFileToConverter (const std::string &infile_name, const std::string &conv, const bool isCosmic=false, bool reset=false)
 
bool GetIsMC ()
 
const std::string & GetSoftwareVersion ()
 Returns the software version from the header.
 
Headerheader ()
 

Additional Inherited Members

- Protected Attributes inherited from InputManager
std::vector< InputConverter * > _converters
 Vector of converters.
 
InputConverter_selected
 Selected converter.
 
AnaSpillC_CorrectedSpill
 The current corrected spill.
 
AnaSpillC_Spill
 The current spill with corrections and systematics.
 
AnaSuperEventB_sevent
 The super event.
 
AnaSuperEventB_prevSEvent
 The previous Super Event for deleting if necessary.
 
bool _IsMC
 Data/MC status.
 
Int_t _uniqueID
 The current Event UniqueID.
 

Detailed Description

class to handle correctly any input file and convert it into the analysis structure. It contains a collection of InputConverters, and automatically selects the correct converter based on the file type.

The manager keeps track of the current active spill, and provides three copies:

Definition at line 17 of file HighlandInputManager.hxx.

Member Function Documentation

§ LoadSpill()

bool HighlandInputManager::LoadSpill ( Long64_t &  entry)
virtual

Read one or several entries in the input tree(s) to fill a raw AnaSpill, and sets the CorrectedSpill and Spill as copies of it (to be manipulated later). The argument entry (the entry number in the input tree) will be modified inside the method by the specific converter (hence the non-cont reference). The way entry is modified will depend on whether the input file is SPILL based (every call to this method will increment by one the argument entry) or EVENT based (entry number will be incremented in several units to account for several events – bunches – in the same spill). At the moment oaAnalysis and MiniTree are SPILL based while FlatTree is EVENT based.

Examples on how to use this method are available in highland2/highlandTools/vXrY/src/AnalysisLoop.cxx, and highland2/highlandTools/vXrY/src/SimpleLoopBase.cxx. Just search for LoadSpill in those files.

This method Returns whether the event was successfully filled.

Reimplemented from InputManager.

Definition at line 33 of file HighlandInputManager.cxx.

33  {
34 //*****************************************************************************
35 
36  // Read the RawSpill
37  if (!InputManager::LoadSpill(entry)) return false;
38 
39  // We can now associate the spill just read with the _RawSpill
40  _RawSpill = _CorrectedSpill;
41 
42  // Make a copy of the spill
43  _CorrectedSpill = _RawSpill->Clone();
44 
45  return true;
46 }
virtual bool LoadSpill(Long64_t &entry)
virtual AnaSpillC * Clone()=0
Clone this object.
AnaSpillC * _CorrectedSpill
The current corrected spill.

§ ResetSpillToRaw()

void HighlandInputManager::ResetSpillToRaw ( )

Create the event.

Reset the main spill to the raw spill. This removes all the variations applied by the systematics.

Definition at line 49 of file HighlandInputManager.cxx.

49  {
50 //*****************************************************************************
51  if (_Spill) {
52  delete _Spill;
53  _Spill = _RawSpill->Clone();
54  }
55 }
AnaSpillC * _Spill
The current spill with corrections and systematics.
virtual AnaSpillC * Clone()=0
Clone this object.

The documentation for this class was generated from the following files: