HighLAND
HLClonesArray.hxx
1 #ifndef HLClonesArray_h
2 #define HLClonesArray_h
3 
4 #include <TClonesArray.h>
5 #include <TChain.h>
6 
8  public :
9 
10  HLClonesArray(const std::string& tree_name, const std::string& tcarray_name, const std::string& class_name, const UInt_t size);
11  virtual ~HLClonesArray();
12 
13  // Read the clones array of a given name from a file
14  void ReadClonesArray(const std::string& file);
15 
16  // Write the clones array of a given name into a tree
17  void WriteClonesArray(TTree& tree);
18 
19  /// Return the number of steps that have been added.
20  Int_t& GetNObjects(){return _NObjects;}
21 
22  /// Return a TClonesArray
23  /// This is used when saving the objects to the output file, so we can access
24  /// them in the DrawingTools.
25  TClonesArray* GetClonesArray(){return _objects;}
26 
27  /// Return the name of the TClonesArray.
28  const std::string& GetClonesArrayName() const{return _tcArrayName;}
29 
30  /// Return the name of the tree
31  const std::string& GetTreeName() const{return _treeName;}
32 
33 
34 protected:
35 
36  /// TChain used to read the "config" tree from the output file.
37  TChain* _chain;
38 
39  /// The number of steps that were added.
40  Int_t _NObjects;
41 
42  /// A TClonesArray with the top level steps, for reading/writing to the
43  /// "config" tree in the output file.
44  TClonesArray* _objects;
45 
46  /// Name of the TClonesArray in the tree
47  std::string _tcArrayName;
48 
49  /// Name of the Tree
50  std::string _treeName;
51 
52  /// Name of the last file read
53  std::string _fileName;
54 
55 };
56 
57 #endif
std::string _fileName
Name of the last file read.
std::string _treeName
Name of the Tree.
const std::string & GetTreeName() const
Return the name of the tree.
TChain * _chain
TChain used to read the "config" tree from the output file.
Int_t & GetNObjects()
Return the number of steps that have been added.
TClonesArray * GetClonesArray()
Int_t _NObjects
The number of steps that were added.
TClonesArray * _objects
std::string _tcArrayName
Name of the TClonesArray in the tree.
const std::string & GetClonesArrayName() const
Return the name of the TClonesArray.