1 |
fgolf |
1.1 |
#ifndef MACROS_histtools_H
|
2 |
|
|
#define MACROS_histtools_H
|
3 |
|
|
#include "TList.h"
|
4 |
|
|
#include "TObjArray.h"
|
5 |
|
|
#include "TH1.h"
|
6 |
|
|
#include "TH2.h"
|
7 |
|
|
#include "TLegend.h"
|
8 |
|
|
#include "THStack.h"
|
9 |
|
|
#include "TCanvas.h"
|
10 |
|
|
#include "TFile.h"
|
11 |
|
|
#include "TRegexp.h"
|
12 |
|
|
#include "TKey.h"
|
13 |
|
|
#include "TString.h"
|
14 |
|
|
#include <vector>
|
15 |
|
|
#include <iostream>
|
16 |
|
|
|
17 |
|
|
namespace hist {
|
18 |
|
|
|
19 |
|
|
void add(const char* outHistName, const char* patORpfx);
|
20 |
|
|
|
21 |
|
|
void add(const char* outHistName, const char* patORpfx0, const char* patORpfx1, const char* patORpfx2 = 0,
|
22 |
|
|
const char* patORpfx3 = 0, const char* patORpfx4 = 0, const char* patORpfx5 = 0, const char* patORpfx6 = 0,
|
23 |
|
|
const char* patORpfx7 = 0, const char* patORpfx8 = 0, const char* patORpfx9 = 0);
|
24 |
|
|
|
25 |
|
|
void color(const char* patORpfx, Color_t color);
|
26 |
|
|
|
27 |
|
|
TLegend* legend(TCanvas* canvas, Option_t* option = "lpf", Bool_t addColor = kFALSE, Int_t token = -1,
|
28 |
|
|
Float_t xmin = 0.75, Float_t ymin = 0.75, Float_t xmax = 0.99, Float_t ymax = 0.99);
|
29 |
|
|
|
30 |
|
|
TLegend* legend(THStack* stack, Option_t* option = "lpf", Bool_t addColor = kFALSE, Int_t token = -1,
|
31 |
|
|
Float_t xmin = 0.75, Float_t ymin = 0.65, Float_t xmax = 0.99, Float_t ymax = 0.99,
|
32 |
|
|
TH1F* hdata = NULL);
|
33 |
|
|
|
34 |
|
|
void normalize(const char* patORpfx);
|
35 |
|
|
void scale(const char* patORpfx, Double_t scale);
|
36 |
|
|
void setrangey(TCanvas* canvas);
|
37 |
|
|
|
38 |
|
|
void stack(const char* stackHistName, const char* patORpfx, Bool_t addColor = kFALSE, Option_t* drawOption = "",
|
39 |
|
|
Int_t orderScheme = 0, const char* bsmName =0, bool doRefPats = false, std::string prefixToSkip = "");//, float yMinimum=1e-3);
|
40 |
|
|
void xaxis(const char* patORpfx, const char* title);
|
41 |
|
|
|
42 |
|
|
void yaxis(const char* patORpfx, const char* title);
|
43 |
|
|
|
44 |
|
|
TH1F* eff(TH1F* h1, TH1F* h2, const char* name="eff");
|
45 |
|
|
TH1F* eff(const char* name1, const char* name2, const char* name="eff");
|
46 |
|
|
|
47 |
|
|
TH1F* eff_bg(TH1F* h1, TH1F* h2, TH1F* h3, TH1F* h4, const char* name="eff");
|
48 |
|
|
|
49 |
|
|
void deleteHistos();
|
50 |
|
|
|
51 |
|
|
void histio();
|
52 |
|
|
void saveHist(const char* filename, const char* pat="*");
|
53 |
|
|
void loadHist(const char* filename, const char* pfx=0, const char* pat="*", Bool_t doAdd=kFALSE);
|
54 |
|
|
|
55 |
|
|
void combineHists(const std::vector<TString> v_prfxsToCombine, const TString outPrefix);
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
#endif //MACROS_histtools_H
|