1 |
#ifndef ROOTPLOTTER_H
|
2 |
#define ROOTPLOTTER_H
|
3 |
|
4 |
#include <TH1.h>
|
5 |
#include <THStack.h>
|
6 |
#include <TH2.h>
|
7 |
#include <TObjArray.h>
|
8 |
#include <TFile.h>
|
9 |
#include <TDirectory.h>
|
10 |
#include <TCanvas.h>
|
11 |
#include <TPostScript.h>
|
12 |
#include <TLatex.h>
|
13 |
|
14 |
class RootPlotter
|
15 |
{
|
16 |
|
17 |
public:
|
18 |
|
19 |
RootPlotter();
|
20 |
~RootPlotter();
|
21 |
|
22 |
// Open the Root files
|
23 |
void OpenRootFiles(TObjArray* filenames, const char* cyclename = 0);
|
24 |
|
25 |
// Plotters
|
26 |
void PlotHistos(const char* psfilename);
|
27 |
void PlotYields(TH1* hist);
|
28 |
|
29 |
// Utilities
|
30 |
void ShapeNormalize(TH1* hist);
|
31 |
void ShapeNormalize(THStack* stack);
|
32 |
TH1* MakePtFractionHisto(TH2D* in2dhist);
|
33 |
TH1* MakeJetShapeMeanHist(TH2D* in2dhist);
|
34 |
TH1* MakeMatchingEfficiencyHisto(TH2D* In2DHist);
|
35 |
TH1* GetSliceHisto(TH2D* In2DHist, Int_t bin);
|
36 |
TObjArray* FindSubdirs(TDirectory* dir);
|
37 |
void DrawPageNum(TCanvas* can, Int_t num);
|
38 |
TObjArray* GetPtBalanceHists();
|
39 |
TObjArray* GetResolutionHists();
|
40 |
TH1* StackHistograms(TString subdirname, TString histname);
|
41 |
TH1* BuildBackground(TString subdirname, TString histname);
|
42 |
TPostScript* MakeNewPsFile(const char* psfilename);
|
43 |
void MakeSubTitle(TH1* hist);
|
44 |
Bool_t ShouldBeStacked(const char* name);
|
45 |
void Cosmetics(TH1* hist, Int_t isample);
|
46 |
void CopyStyle(TH1& h1, TH1* h2);
|
47 |
void ApplyWeight(TH1* hist, Int_t isample);
|
48 |
|
49 |
// Setters
|
50 |
void SetShapeNorm(Bool_t flag = true){bShapeNorm = flag;}
|
51 |
void SetPortraitMode(Bool_t flag = true){bPortrait = flag;}
|
52 |
void SetDrawEntries(Bool_t flag = true){bDrawEntries = flag;}
|
53 |
void PerformFit(Bool_t flag = true){bFitPtBalanceHists = flag;}
|
54 |
void SetJetShapesPerSlice(Bool_t flag = true){bJetShapesPerSlice = flag;}
|
55 |
void SetSubstractBkgd(Bool_t flag = true){bSubstractBkgd = flag;}
|
56 |
void SetPlotRatio(Bool_t flag=true){bPlotRatio = flag;}
|
57 |
void SetDrawLumi(Bool_t flag=true){bDrawLumi = flag;}
|
58 |
|
59 |
void SetSampleNames(TObjArray* SampleNames);
|
60 |
void SetHistColors(TArrayI colors);
|
61 |
void SetHistMarkers(TArrayI markers);
|
62 |
void SetSamplesToStack(TObjArray* names);
|
63 |
void SetSamplesWeight(TArrayF weights);
|
64 |
|
65 |
private:
|
66 |
|
67 |
TFile** fRootfiles; // the Rootfiles
|
68 |
Int_t fNumOfSamples; // how many chains should be plotted?
|
69 |
|
70 |
TObjArray* fSampleNames; // the sample names
|
71 |
|
72 |
TObjArray* fSamplesToStack; // the samples that should be stacked
|
73 |
Int_t fNumOfSamplesToStack; // number of samples to stack
|
74 |
|
75 |
TArrayF fSamplesWeight; // weights of the chains
|
76 |
TArrayI fSampleColors; // colors of the chains
|
77 |
TArrayI fSampleMarkers; // markers of the chains
|
78 |
|
79 |
Bool_t bShapeNorm; // use shape normalization
|
80 |
Bool_t bPortrait; // portrait or landscape mode
|
81 |
Bool_t bDrawEntries; // display the number of entries
|
82 |
Bool_t bDrawLumi; // display the lumi information
|
83 |
Bool_t bFitPtBalanceHists; // perform fit of Pt-balance histograms?
|
84 |
Bool_t bJetShapesPerSlice; // perform fit of Pt-balance histograms?
|
85 |
Bool_t bSubstractBkgd; // substract background from the first chain?
|
86 |
Bool_t bPlotRatio; // should a ratio be plotted?
|
87 |
|
88 |
};
|
89 |
|
90 |
#endif // __JETANAPLOTTER_H
|