HighLAND
ConfigTreeTools.hxx
1 #ifndef ConfigTreeTools_h
2 #define ConfigTreeTools_h
3 
4 #include <stdio.h>
5 #include <iostream>
6 #include "SystematicManager.hxx"
7 #include "ConfigurationManager.hxx"
8 
10  public :
11 
12  ConfigTreeTools(){_fromFile=false;}
13  ConfigTreeTools(const std::string& fileName);
15 
16  // Some features need those managers
17  void Initialize(const std::string& fileName);
18  void Initialize(SystematicManager& syst, ConfigurationManager& conf);
19 
20  virtual ~ConfigTreeTools(){if (_fromFile){ delete _syst; delete _conf;}}
21 
22  /// Get the Index of a given weight for a given configuration in the micro-trees.
23  /// To compute that it uses the config tree
24  Int_t GetWeightIndex(const std::string& conf, const std::string& name) const;
25  Int_t GetWeightIndex(Int_t conf, Int_t weight) const;
26 
27 
28  /// Get the value of a Float variable stored in the tree
29  Float_t GetVarValueF(const std::string& name) const;
30 
31  /// Get the value of a Double variable stored in the tree
32  Double_t GetVarValueD(const std::string& name) const;
33 
34  /// Get the value of a Int variable stored in the tree
35  Int_t GetVarValueI(const std::string& name) const;
36 
37  /// Get the value of a Char variable stored in the tree
38  std::string GetVarValueC(const std::string& name) const;
39 
40 protected:
41 
42  SystematicManager* _syst;
43  ConfigurationManager* _conf;
44 
45  std::string _fileName;
46 
47  bool _fromFile;
48 };
49 
50 
51 
52 #endif
53 
54 
Double_t GetVarValueD(const std::string &name) const
Get the value of a Double variable stored in the tree.
Float_t GetVarValueF(const std::string &name) const
Get the value of a Float variable stored in the tree.
Int_t GetVarValueI(const std::string &name) const
Get the value of a Int variable stored in the tree.
The maximum number of systematics that is supported.
std::string GetVarValueC(const std::string &name) const
Get the value of a Char variable stored in the tree.
Int_t GetWeightIndex(const std::string &conf, const std::string &name) const