ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/tschum/FWlite_Analysis/PlotTool.h
Revision: 1.16
Committed: Fri Feb 12 15:21:17 2010 UTC (15 years, 2 months ago) by tschum
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +8 -7 lines
Log Message:
improved jetContent vars, plot utils

File Contents

# Content
1 #ifndef PlotTool_h
2 #define PlotTool_h
3
4 #include "TClonesArray.h"
5 #include "TFile.h"
6 #include "TGraphAsymmErrors.h"
7 #include "TF2.h"
8 #include "TStopwatch.h"
9 #include "TPostScript.h"
10 #include "TLeafElement.h"
11 #include "TMethod.h"
12 #include "TChain.h"
13 #include "TSystemDirectory.h"
14 #include "TList.h"
15 #include "TCanvas.h"
16 #include "TH1F.h"
17 #include "TPaletteAxis.h"
18 #include "TPaveStats.h"
19 #include "TFrame.h"
20 #include "TLegend.h"
21 #include "TLegendEntry.h"
22 #include "TColor.h"
23 #include "TStyle.h"
24 #include "TROOT.h"
25 #include "TSystem.h"
26
27 #include <TLorentzVector.h>
28
29 #include <string>
30 #include <map>
31 #include <iostream>
32 #include <fstream>
33 #include <sstream>
34 #include <vector>
35
36 #include "FWliteVariables.h"
37
38
39 using namespace std;
40
41 class TClass;
42
43 class PlotTool : public TClonesArray {
44
45 private:
46
47 map< string, TCanvas* > canvases_;
48 map< string, TCanvas* > pads_;
49
50 void setCanvas(TCanvas* thisCanvas);
51 void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist,
52 int counter);
53 void setColor(TH1* thisHist, int counter);
54 void setMathLabels(TH1* thisHist);
55 void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette);
56 void setHistMax(TCanvas* thisCanvas, double maxEntry);
57 void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter);
58 void createColors();
59
60 public:
61
62 PlotTool();
63 ~PlotTool() {
64 }
65 ;
66
67 int init(string fileName = "",
68 string dirPath = "/scratch/hh/current/cms/user/schum/",
69 string treeName = "Events", string fileLabel="");
70
71 TH1* plot(int chainIndex, string histName, string cutName= "",
72 int nEntries= -1, string bins = "" , string drwOpt = "");
73 int loop(vector<string> _histName, vector<string> _cutName,
74 int nEntries= -1, string bins = "" , string drwOpt = "", bool correspond = false);
75 int loop(vector<string> _histName, string cutName= "", int nEntries= -1, string bins = "" ,
76 string drwOpt = "");
77 int loop(string histName, vector<string> _cutName, int nEntries= -1, string bins = "" ,
78 string drwOpt = "");
79 int loop(string histName, string cutName = "", int nEntries= -1, string bins = "" ,
80 string drwOpt = "");
81
82
83 bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees, sameCanv_vars, sameCanv_cuts;
84
85 bool showLegend, logY, verbose, recreateTree, normHists;
86
87 vector<string> fileNames;
88
89 string globalCuts, varBlockNames;
90
91 int saveCanvases(string name="test",
92 string path="/afs/naf.desy.de/group/cms/scratch/schum/");
93 int clearCanvases();
94 int updatePads();
95 int fillCanvases();
96
97 int setVariables(string label="");
98
99 vector<string> autoVars;
100
101
102 ClassDef(PlotTool,4)
103
104
105 };
106
107 #endif