HighLAND
highland2
highlandCore
v2r10
src
HighlandInputManager.hxx
1
#ifndef HighlandInputManager_h
2
#define HighlandInputManager_h
3
4
#include "InputManager.hxx"
5
//#include "BaseDataClasses.hxx"
6
7
/// class to handle correctly any input file and convert it into the
8
/// analysis structure. It contains a collection of InputConverters, and
9
/// automatically selects the correct converter based on the file type.
10
///
11
/// The manager
12
/// keeps track of the current active spill, and provides three copies:
13
/// - RawSpill: the spill as read in from the input file.
14
/// - CorrectedSpill: for applying corrections to.
15
/// - Spill: for applying corrections and systematics to.
16
17
class
HighlandInputManager
:
public
InputManager
{
18
public
:
19
20
/// Constructor
21
HighlandInputManager
();
22
23
/// Destructor, which cleans up the spills.
24
virtual
~HighlandInputManager
(){}
25
26
/// Reset the converters and the UniqueID
27
void
Reset
();
28
29
/// clean up the remaining pointers to the spills.
30
void
DeleteSpill
();
31
32
/// Read one or several entries in the input tree(s) to fill a raw AnaSpill, and
33
/// sets the CorrectedSpill and Spill as copies of it (to be manipulated
34
/// later).
35
/// The argument entry (the entry number in the input tree)
36
/// will be modified inside the method by the specific converter (hence the non-cont reference).
37
/// The way entry is modified will depend on whether the input file is SPILL based
38
/// (every call to this method will increment by one the argument entry) or
39
/// EVENT based (entry number will be incremented in several units to account for
40
/// several events -- bunches -- in the same spill). At the moment oaAnalysis and MiniTree are SPILL based
41
/// while FlatTree is EVENT based.
42
///
43
/// Examples on how to use this method are available in highland2/highlandTools/vXrY/src/AnalysisLoop.cxx,
44
/// and highland2/highlandTools/vXrY/src/SimpleLoopBase.cxx. Just search for LoadSpill in those files.
45
///
46
/// This method Returns whether the event was successfully filled.
47
bool
LoadSpill
(Long64_t& entry);
48
49
/// Whether an OriginalTree converter has been selected.
50
bool
InputIsOriginalTree
() {
return
(
_selected
->
Name
() ==
"OriginalTree"
||
_selected
->
Name
() ==
"oaAnalysisTree"
); }
51
52
//-------------------------------
53
54
/// Get the current spill (constant, as read in from the input file).
55
const
AnaSpillC
&
GetRawSpill
(){
return
*_RawSpill;}
56
57
/// Set the current spill (constant, as read in from the input file).
58
void
SetRawSpill
(
AnaSpillC
* RawSpill){_RawSpill = RawSpill;}
59
60
/// Get the current bunch (constant, as read in from the input file).
61
const
AnaBunchC
&
GetRawBunch
(){
return
*_RawSpill->
Bunches
[_currentBunch];}
62
63
/// Get the current bunch (to have corrections applied to it).
64
AnaBunchC
&
GetCorrectedBunch
(){
return
*
_CorrectedSpill
->
Bunches
[_currentBunch];}
65
66
/// Get the current bunch (to have corrections and systematics applied to it).
67
AnaBunchC
&
GetBunch
(){
return
*
_Spill
->
Bunches
[_currentBunch];}
68
69
/// Set the current bunch index.
70
void
SetCurrentBunch
(
int
ibunch){_currentBunch = ibunch;}
71
72
/// Create the event
73
// AnaEventC* MakeEvent();
74
75
/// Reset the main spill to the raw spill. This removes all the variations
76
/// applied by the systematics.
77
void
ResetSpillToRaw
();
78
79
private
:
80
81
/// The current raw spill.
82
AnaSpillC
* _RawSpill;
83
84
/// The current active bunch in the current spill.
85
int
_currentBunch;
86
87
};
88
89
#endif
90
91
AnaSpillC
Definition:
CoreDataClasses.hxx:187
HighlandInputManager::Reset
void Reset()
Reset the converters and the UniqueID.
Definition:
HighlandInputManager.cxx:13
HighlandInputManager::GetCorrectedBunch
AnaBunchC & GetCorrectedBunch()
Get the current bunch (to have corrections applied to it).
Definition:
HighlandInputManager.hxx:64
InputManager::_Spill
AnaSpillC * _Spill
The current spill with corrections and systematics.
Definition:
InputManager.hxx:183
AnaSpillC::Bunches
std::vector< AnaBunchC * > Bunches
The reconstructed objects, split into timing bunches.
Definition:
CoreDataClasses.hxx:222
HighlandInputManager::~HighlandInputManager
virtual ~HighlandInputManager()
Destructor, which cleans up the spills.
Definition:
HighlandInputManager.hxx:24
InputManager
Definition:
InputManager.hxx:17
HighlandInputManager::SetCurrentBunch
void SetCurrentBunch(int ibunch)
Set the current bunch index.
Definition:
HighlandInputManager.hxx:70
HighlandInputManager::DeleteSpill
void DeleteSpill()
clean up the remaining pointers to the spills.
Definition:
HighlandInputManager.cxx:21
InputConverter::Name
const std::string & Name() const
Return the name of this converter.
Definition:
InputConverter.hxx:38
AnaBunchC
Definition:
CoreDataClasses.hxx:158
HighlandInputManager::HighlandInputManager
HighlandInputManager()
Constructor.
Definition:
HighlandInputManager.cxx:5
HighlandInputManager::GetBunch
AnaBunchC & GetBunch()
Get the current bunch (to have corrections and systematics applied to it).
Definition:
HighlandInputManager.hxx:67
HighlandInputManager::ResetSpillToRaw
void ResetSpillToRaw()
Create the event.
Definition:
HighlandInputManager.cxx:49
HighlandInputManager
Definition:
HighlandInputManager.hxx:17
HighlandInputManager::GetRawBunch
const AnaBunchC & GetRawBunch()
Get the current bunch (constant, as read in from the input file).
Definition:
HighlandInputManager.hxx:61
HighlandInputManager::GetRawSpill
const AnaSpillC & GetRawSpill()
Get the current spill (constant, as read in from the input file).
Definition:
HighlandInputManager.hxx:55
InputManager::_selected
InputConverter * _selected
Selected converter.
Definition:
InputManager.hxx:177
InputManager::_CorrectedSpill
AnaSpillC * _CorrectedSpill
The current corrected spill.
Definition:
InputManager.hxx:180
HighlandInputManager::LoadSpill
bool LoadSpill(Long64_t &entry)
Definition:
HighlandInputManager.cxx:33
HighlandInputManager::InputIsOriginalTree
bool InputIsOriginalTree()
Whether an OriginalTree converter has been selected.
Definition:
HighlandInputManager.hxx:50
HighlandInputManager::SetRawSpill
void SetRawSpill(AnaSpillC *RawSpill)
Set the current spill (constant, as read in from the input file).
Definition:
HighlandInputManager.hxx:58
Generated by
1.8.13