1 |
tschum |
1.1 |
#ifndef PlotTool_h
|
2 |
|
|
#define PlotTool_h
|
3 |
|
|
|
4 |
|
|
#ifndef ROOT_TClonesArray
|
5 |
|
|
#include "TClonesArray.h"
|
6 |
|
|
#endif
|
7 |
|
|
|
8 |
|
|
#include <string>
|
9 |
|
|
#include <map>
|
10 |
|
|
#include <iostream>
|
11 |
|
|
#include <fstream>
|
12 |
|
|
#include <sstream>
|
13 |
|
|
#include <vector>
|
14 |
|
|
|
15 |
|
|
#include "TChain.h"
|
16 |
|
|
#include "TSystemDirectory.h"
|
17 |
|
|
#include "TList.h"
|
18 |
|
|
#include "TCanvas.h"
|
19 |
|
|
#include "TH1F.h"
|
20 |
|
|
#include "TPaletteAxis.h"
|
21 |
|
|
#include "TPaveStats.h"
|
22 |
|
|
#include "TFrame.h"
|
23 |
|
|
#include "TLegend.h"
|
24 |
|
|
#include "TLegendEntry.h"
|
25 |
|
|
#include "TColor.h"
|
26 |
|
|
#include "TStyle.h"
|
27 |
thomsen |
1.3 |
#include "TROOT.h"
|
28 |
|
|
#include "DataFormats/FWLite/interface/Handle.h"
|
29 |
|
|
#include "DataFormats/FWLite/interface/Event.h"
|
30 |
|
|
#if !defined(__CINT__) && !defined(__MAKECINT__)
|
31 |
|
|
#include "DataFormats/PatCandidates/interface/Jet.h"
|
32 |
|
|
#endif
|
33 |
|
|
#include "DataFormats/Math/interface/deltaR.h"
|
34 |
|
|
#include "TFile.h"
|
35 |
tschum |
1.1 |
|
36 |
|
|
using namespace std;
|
37 |
|
|
|
38 |
|
|
class TClass;
|
39 |
|
|
|
40 |
|
|
class PlotTool : public TClonesArray {
|
41 |
|
|
|
42 |
|
|
private:
|
43 |
|
|
|
44 |
gebbert |
1.4 |
map< string, TCanvas* > canvases_;
|
45 |
|
|
map< string, TCanvas* > pads_;
|
46 |
tschum |
1.1 |
|
47 |
gebbert |
1.4 |
void setCanvas(TCanvas* thisCanvas);
|
48 |
|
|
void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist,
|
49 |
|
|
int counter);
|
50 |
|
|
void setColor(TH1* thisHist, int counter);
|
51 |
|
|
void setMathLabels(TH1* thisHist);
|
52 |
|
|
void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette);
|
53 |
|
|
void setHistMax(TCanvas* thisCanvas, double maxEntry);
|
54 |
|
|
void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter);
|
55 |
|
|
void createColors();
|
56 |
tschum |
1.1 |
|
57 |
|
|
public:
|
58 |
|
|
|
59 |
gebbert |
1.4 |
PlotTool();
|
60 |
|
|
~PlotTool() {
|
61 |
|
|
}
|
62 |
|
|
;
|
63 |
|
|
|
64 |
|
|
int init(string fileName = "",
|
65 |
|
|
string dirPath = "/scratch/hh/current/cms/user/schum/",
|
66 |
|
|
string treeName = "Events", string fileLabel="");
|
67 |
|
|
int plot(int chainIndex, string histName, string cutName= "",
|
68 |
|
|
int nEntries= -1, string drwOpt = "");
|
69 |
|
|
int loop(vector<string> _histName, vector<string> _cutName,
|
70 |
|
|
int nEntries= -1, string drwOpt = "", bool correspond = false);
|
71 |
|
|
int loop(vector<string> _histName, string cutName= "", int nEntries= -1,
|
72 |
|
|
string drwOpt = "");
|
73 |
|
|
int loop(string histName, vector<string> _cutName, int nEntries= -1,
|
74 |
|
|
string drwOpt = "");
|
75 |
tschum |
1.5 |
int loop(string histName, string cutName = "", int nEntries= -1,
|
76 |
gebbert |
1.4 |
string drwOpt = "");
|
77 |
|
|
|
78 |
|
|
bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees,
|
79 |
|
|
sameCanv_vars, sameCanv_cuts;
|
80 |
tschum |
1.5 |
bool showLegend, logY, addTrackJets;
|
81 |
gebbert |
1.4 |
float* TrackJetKT;
|
82 |
|
|
vector<string> fileNames;
|
83 |
|
|
|
84 |
|
|
int saveCanvases(string type=".ps",
|
85 |
|
|
string path="/afs/naf.desy.de/group/cms/scratch/schum/");
|
86 |
|
|
int updatePads();
|
87 |
|
|
int fillCanvases();
|
88 |
tschum |
1.1 |
|
89 |
tschum |
1.5 |
void showChainInfo();
|
90 |
|
|
|
91 |
|
|
|
92 |
gebbert |
1.4 |
ClassDef(PlotTool,4)
|
93 |
tschum |
1.1 |
|
94 |
tschum |
1.5 |
|
95 |
tschum |
1.1 |
};
|
96 |
|
|
|
97 |
|
|
#endif
|