-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTree.h
33 lines (26 loc) · 1.23 KB
/
Tree.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
#include <iostream>
#include <string>
#include <vector>
using std::vector;
#include <math.h>
#include <TFile.h>
#include <TTree.h>
#include "Branch.h"
#include "Histogram.h"
class Tree {
TTree *ttree;
vector<Branch*> branches;
vector<Histogram*> histograms;
void traverse(void (Tree::*process)(const vector<Float_t>& var, const Int_t& j) const) const;
void processFillHistograms(const vector<Float_t>& var, const Int_t& j) const;
void processCalculateMean(const vector<Float_t>& var, const Int_t& j) const;
void processCalculateRMS(const vector<Float_t>& var, const Int_t& j) const;
public:
Tree(TFile *file, const std::string& name);
void setBranch(const std::string& name);
Histogram *setHistogram(bool (*check)(const vector<Float_t>&), Float_t (*transform)(const vector<Float_t>&), const std::string& name, Int_t nbins, Float_t min, Float_t max, std::string title = "");
Histogram *setHistogramLog(bool (*check)(const vector<Float_t>&), Float_t (*transform)(const vector<Float_t>&), const std::string& name, Int_t nbins, Float_t min, Float_t max, std::string title = "");
void fillHistograms() const;
void calculateMean() const;
void calculateRMS() const;
};