1 |
|
#ifndef PlotTool_h |
2 |
|
#define PlotTool_h |
3 |
|
|
4 |
< |
#ifndef ROOT_TClonesArray |
5 |
< |
#include "TClonesArray.h" |
4 |
> |
|
5 |
> |
#if !defined(__CINT__) && !defined(__MAKECINT__) |
6 |
> |
#include "DataFormats/PatCandidates/interface/Jet.h" |
7 |
|
#endif |
8 |
|
|
9 |
< |
#include <string> |
10 |
< |
#include <map> |
11 |
< |
#include <iostream> |
12 |
< |
#include <fstream> |
13 |
< |
#include <sstream> |
14 |
< |
#include <vector> |
9 |
> |
#include "DataFormats/FWLite/interface/Handle.h" |
10 |
> |
#include "DataFormats/FWLite/interface/Event.h" |
11 |
> |
#include "DataFormats/Math/interface/deltaR.h" |
12 |
> |
|
13 |
> |
//#include "DataFormats/FWLite/interface/TriggerNames.h" |
14 |
> |
|
15 |
|
|
16 |
+ |
#include "TClonesArray.h" |
17 |
+ |
#include "TFile.h" |
18 |
+ |
#include "TGraphAsymmErrors.h" |
19 |
+ |
#include "TF2.h" |
20 |
+ |
#include "TStopwatch.h" |
21 |
+ |
#include "TPostScript.h" |
22 |
+ |
#include "TLeafElement.h" |
23 |
+ |
#include "TMethod.h" |
24 |
|
#include "TChain.h" |
25 |
|
#include "TSystemDirectory.h" |
26 |
|
#include "TList.h" |
33 |
|
#include "TLegendEntry.h" |
34 |
|
#include "TColor.h" |
35 |
|
#include "TStyle.h" |
36 |
< |
#include "TROOT.h" |
36 |
> |
#include "TROOT.h" |
37 |
> |
#include "TSystem.h" |
38 |
> |
|
39 |
> |
#include <string> |
40 |
> |
#include <map> |
41 |
> |
#include <iostream> |
42 |
> |
#include <fstream> |
43 |
> |
#include <sstream> |
44 |
> |
#include <vector> |
45 |
> |
|
46 |
|
|
47 |
|
using namespace std; |
48 |
|
|
52 |
|
|
53 |
|
private: |
54 |
|
|
55 |
< |
map< string, TCanvas* > canvases_; |
56 |
< |
map< string, TCanvas* > pads_; |
55 |
> |
map< string, TCanvas* > canvases_; |
56 |
> |
map< string, TCanvas* > pads_; |
57 |
|
|
58 |
< |
void setCanvas(TCanvas* thisCanvas); |
59 |
< |
void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist, int counter); |
60 |
< |
void setColor(TH1* thisHist, int counter); |
61 |
< |
void setMathLabels(TH1* thisHist); |
62 |
< |
void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette); |
63 |
< |
void setHistMax(TCanvas* thisCanvas, double maxEntry); |
64 |
< |
void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter); |
65 |
< |
void createColors(); |
58 |
> |
void setCanvas(TCanvas* thisCanvas); |
59 |
> |
void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist, |
60 |
> |
int counter); |
61 |
> |
void setColor(TH1* thisHist, int counter); |
62 |
> |
void setMathLabels(TH1* thisHist); |
63 |
> |
void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette); |
64 |
> |
void setHistMax(TCanvas* thisCanvas, double maxEntry); |
65 |
> |
void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter); |
66 |
> |
void createColors(); |
67 |
|
|
68 |
|
public: |
69 |
|
|
70 |
< |
PlotTool(); |
71 |
< |
~PlotTool(){}; |
72 |
< |
|
70 |
> |
PlotTool(); |
71 |
> |
~PlotTool() { |
72 |
> |
} |
73 |
> |
; |
74 |
> |
|
75 |
> |
int init(string fileName = "", |
76 |
> |
string dirPath = "/scratch/hh/current/cms/user/schum/", |
77 |
> |
string treeName = "Events", string fileLabel=""); |
78 |
> |
int plot(int chainIndex, string histName, string cutName= "", |
79 |
> |
int nEntries= -1, string drwOpt = ""); |
80 |
> |
int loop(vector<string> _histName, vector<string> _cutName, |
81 |
> |
int nEntries= -1, string drwOpt = "", bool correspond = false); |
82 |
> |
int loop(vector<string> _histName, string cutName= "", int nEntries= -1, |
83 |
> |
string drwOpt = ""); |
84 |
> |
int loop(string histName, vector<string> _cutName, int nEntries= -1, |
85 |
> |
string drwOpt = ""); |
86 |
> |
int loop(string histName, string cutName = "", int nEntries= -1, |
87 |
> |
string drwOpt = ""); |
88 |
> |
|
89 |
> |
int plotEff(int chainIndex, string histName, string cutName, int nEntries, double fitXmin = 30, double fitXmax = 130, string fitFormula="expo"); |
90 |
> |
|
91 |
> |
bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees, |
92 |
> |
sameCanv_vars, sameCanv_cuts; |
93 |
> |
bool showLegend, logY, addTrackJets, addEventInfo, addTower, verbose, recreateTree; |
94 |
> |
|
95 |
> |
string globalCuts; |
96 |
> |
|
97 |
> |
float* TrackJetKT, * towet, * toweta, * towphi, * towen, * towem, * towhd, * towoe; |
98 |
> |
int* towid_phi, *towid_eta, *towid; |
99 |
> |
vector<string> fileNames; |
100 |
> |
|
101 |
> |
int saveCanvases(string name="test", |
102 |
> |
string path="/afs/naf.desy.de/group/cms/scratch/schum/"); |
103 |
> |
int clearCanvases(); |
104 |
> |
int updatePads(); |
105 |
> |
int fillCanvases(); |
106 |
|
|
107 |
< |
int init(string fileName = "", string dirPath = "/scratch/hh/current/cms/user/schum/", string treeName = "Events"); |
56 |
< |
int plot(int chainIndex, string histName, string cutName= "", int nEntries= -1, string drwOpt = ""); |
57 |
< |
int loop(vector<string> _histName, vector<string> _cutName, int nEntries= -1, string drwOpt = "", bool correspond = false); |
58 |
< |
int loop(vector<string> _histName, string cutName= "", int nEntries= -1, string drwOpt = ""); |
59 |
< |
int loop(string histName, vector<string> _cutName, int nEntries= -1, string drwOpt = ""); |
60 |
< |
int loop(string histName, string cutName, int nEntries= -1, string drwOpt = ""); |
107 |
> |
int setVariables(string label=""); |
108 |
|
|
109 |
< |
bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees, sameCanv_vars, sameCanv_cuts; |
63 |
< |
bool showLegend, logY; |
109 |
> |
vector<string> autoVars; |
110 |
|
|
65 |
– |
int saveCanvases(string type=".ps", string path="/afs/naf.desy.de/group/cms/scratch/schum/"); |
66 |
– |
int updatePads(); |
67 |
– |
int fillCanvases(); |
111 |
|
|
112 |
+ |
ClassDef(PlotTool,4) |
113 |
|
|
70 |
– |
ClassDef(PlotTool,4) |
114 |
|
|
115 |
|
}; |
116 |
|
|