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

# User Rev Content
1 tschum 1.1 #ifndef PlotTool_h
2     #define PlotTool_h
3    
4 tschum 1.11 #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 tschum 1.1 #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 thomsen 1.3 #include "TROOT.h"
25 tschum 1.6 #include "TSystem.h"
26 tschum 1.15
27 thomsen 1.12 #include <TLorentzVector.h>
28 tschum 1.11
29     #include <string>
30     #include <map>
31     #include <iostream>
32     #include <fstream>
33     #include <sstream>
34     #include <vector>
35    
36 tschum 1.15 #include "FWliteVariables.h"
37 thomsen 1.13
38 tschum 1.1
39     using namespace std;
40    
41     class TClass;
42    
43     class PlotTool : public TClonesArray {
44    
45     private:
46    
47 gebbert 1.4 map< string, TCanvas* > canvases_;
48     map< string, TCanvas* > pads_;
49 tschum 1.1
50 gebbert 1.4 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 tschum 1.1
60     public:
61    
62 gebbert 1.4 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 tschum 1.15
71 tschum 1.16 TH1* plot(int chainIndex, string histName, string cutName= "",
72     int nEntries= -1, string bins = "" , string drwOpt = "");
73 gebbert 1.4 int loop(vector<string> _histName, vector<string> _cutName,
74 tschum 1.16 int nEntries= -1, string bins = "" , string drwOpt = "", bool correspond = false);
75     int loop(vector<string> _histName, string cutName= "", int nEntries= -1, string bins = "" ,
76 gebbert 1.4 string drwOpt = "");
77 tschum 1.16 int loop(string histName, vector<string> _cutName, int nEntries= -1, string bins = "" ,
78 gebbert 1.4 string drwOpt = "");
79 tschum 1.16 int loop(string histName, string cutName = "", int nEntries= -1, string bins = "" ,
80 gebbert 1.4 string drwOpt = "");
81    
82 tschum 1.16
83 thomsen 1.13 bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees, sameCanv_vars, sameCanv_cuts;
84    
85 tschum 1.16 bool showLegend, logY, verbose, recreateTree, normHists;
86 tschum 1.15
87 thomsen 1.12 vector<string> fileNames;
88 tschum 1.9
89 tschum 1.15 string globalCuts, varBlockNames;
90 gebbert 1.4
91 tschum 1.7 int saveCanvases(string name="test",
92 gebbert 1.4 string path="/afs/naf.desy.de/group/cms/scratch/schum/");
93 tschum 1.8 int clearCanvases();
94 gebbert 1.4 int updatePads();
95     int fillCanvases();
96 tschum 1.1
97 tschum 1.8 int setVariables(string label="");
98    
99     vector<string> autoVars;
100 tschum 1.5
101    
102 gebbert 1.4 ClassDef(PlotTool,4)
103 tschum 1.1
104 tschum 1.5
105 tschum 1.1 };
106    
107     #endif