forked from h2gglobe/h2gglobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TreeContainer.h
56 lines (44 loc) · 1.55 KB
/
TreeContainer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef TREECONTAINER
#define TREECONTAINER
#include <TFile.h>
#include <TTree.h>
#include <map>
#include <string>
class TreeContainer {
public:
TreeContainer();
TreeContainer(int,std::string, std::string);
~TreeContainer();
void FillFloat(std::string, float);
void FillDouble(std::string, double);
void FillUInt(std::string, unsigned int);
void FillInt(std::string, int);
void FillString(std::string, std::string);
void FillBool(std::string, bool);
void AddTreeBranch(std::string, int);
template<class T> void AddExternalBranch(const char * name, T* addr) { tr_->Branch(name,addr); };
template <class T> void AddExternalBranch(const char * name, T* addr, const char* type) { tr_->Branch(name,addr,type); };
template <class T> void AddExternalBranch(const char * name, T* addr, int bufsize, int splitlevel) { tr_->Branch(name,addr,bufsize,splitlevel); };
void FillTree();
int ncat(int n);
void Save(TFile*);
void setDirName(std::string);
void setTreeVal(int);
int getTreeVal();
void setTreeNam(std::string);
std::string ModifiedName(char*, int);
float total_scale;
private:
int treeVal;
std::string treeNam;
std::string dirName;
TTree *tr_;
std::map<std::string, double> double_branches;
std::map<std::string, float> float_branches;
std::map<std::string, int> int_branches;
std::map<std::string, unsigned int> uint_branches;
std::map<std::string, std::string> string_branches;
std::map<std::string, bool> bool_branches;
void resetDefaults();
};
#endif