-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlotUtil.h
47 lines (36 loc) · 1.42 KB
/
PlotUtil.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
#ifndef _PlotUtil_h_
#define _PlotUtil_h_
#include "TLegend.h"
#include "HistHolder.h"
class PlotUtil {
public :
PlotUtil(HistHolder* hh);
virtual ~PlotUtil();
//methods for doing the same thing to a bunch of samples
void addSample(TString sampleid,TTree* sampletree,TString sampleName="",UInt_t kcolor=1);
void createHistos(TString varname,int nbins, float hmin, float hmax) ;
//if drawcommand is empty, then varname is used
void fillHistos(TString varname, TString cut, TString drawcommand="");
// This function takes the histogram called _qcd and adds the _qcdnnn to it
void addQCD(TString varname);
//if no varname is specified, the last used varname is used
void fillLegend(TLegend * leg, TString varname="");
//will use whatever the current canvas is
void drawPlots(TString varname="");
//======methods that calculate things======
//this is built in to later versions of ROOT, but not 5.22
Double_t ErrorOnIntegral(const TH1D* h, const Int_t lowbin=1, Int_t highbin=0) ;
//=====misc settings=====
void setDebug(bool debug) {debug_=debug;}
private:
void setLineColors(TString varname); //called by fillLegend()
TString getFullName(TString varname,TString sampleid);
//the TString is the sampleid
std::map< TString, TTree*> samples_;
std::map< TString, TString> sampleNames_;
std::map< TString, UInt_t> sampleColors_;
HistHolder * hh_;
bool debug_;
TString lastVarname_;
};
#endif