ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/tschum/FWlite_Analysis/PlotTool.h
Revision: 1.8
Committed: Mon Dec 7 14:02:01 2009 UTC (15 years, 4 months ago) by tschum
Content type: text/plain
Branch: MAIN
Changes since 1.7: +6 -1 lines
Log Message:
enabled auto plot of variables

File Contents

# User Rev Content
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 tschum 1.6 #include "TSystem.h"
29 thomsen 1.3 #include "DataFormats/FWLite/interface/Handle.h"
30     #include "DataFormats/FWLite/interface/Event.h"
31     #if !defined(__CINT__) && !defined(__MAKECINT__)
32     #include "DataFormats/PatCandidates/interface/Jet.h"
33     #endif
34     #include "DataFormats/Math/interface/deltaR.h"
35     #include "TFile.h"
36 tschum 1.6 #include "TGraphAsymmErrors.h"
37     #include "TF2.h"
38     #include "TStopwatch.h"
39 tschum 1.7 #include "TPostScript.h"
40 tschum 1.8 #include "TLeafElement.h"
41     #include "TMethod.h"
42 tschum 1.1
43     using namespace std;
44    
45     class TClass;
46    
47     class PlotTool : public TClonesArray {
48    
49     private:
50    
51 gebbert 1.4 map< string, TCanvas* > canvases_;
52     map< string, TCanvas* > pads_;
53 tschum 1.1
54 gebbert 1.4 void setCanvas(TCanvas* thisCanvas);
55     void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist,
56     int counter);
57     void setColor(TH1* thisHist, int counter);
58     void setMathLabels(TH1* thisHist);
59     void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette);
60     void setHistMax(TCanvas* thisCanvas, double maxEntry);
61     void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter);
62     void createColors();
63 tschum 1.1
64     public:
65    
66 gebbert 1.4 PlotTool();
67     ~PlotTool() {
68     }
69     ;
70    
71     int init(string fileName = "",
72     string dirPath = "/scratch/hh/current/cms/user/schum/",
73     string treeName = "Events", string fileLabel="");
74     int plot(int chainIndex, string histName, string cutName= "",
75     int nEntries= -1, string drwOpt = "");
76     int loop(vector<string> _histName, vector<string> _cutName,
77     int nEntries= -1, string drwOpt = "", bool correspond = false);
78     int loop(vector<string> _histName, string cutName= "", int nEntries= -1,
79     string drwOpt = "");
80     int loop(string histName, vector<string> _cutName, int nEntries= -1,
81     string drwOpt = "");
82 tschum 1.5 int loop(string histName, string cutName = "", int nEntries= -1,
83 gebbert 1.4 string drwOpt = "");
84    
85 tschum 1.6 int plotEff(int chainIndex, string histName, string cutName, int nEntries, double fitXmin = 30, double fitXmax = 130, string fitFormula="expo");
86    
87 gebbert 1.4 bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees,
88     sameCanv_vars, sameCanv_cuts;
89 tschum 1.6 bool showLegend, logY, addTrackJets, verbose;
90 gebbert 1.4 float* TrackJetKT;
91     vector<string> fileNames;
92    
93 tschum 1.7 int saveCanvases(string name="test",
94 gebbert 1.4 string path="/afs/naf.desy.de/group/cms/scratch/schum/");
95 tschum 1.8 int clearCanvases();
96 gebbert 1.4 int updatePads();
97     int fillCanvases();
98 tschum 1.1
99 tschum 1.8 int setVariables(string label="");
100    
101     vector<string> autoVars;
102 tschum 1.5
103    
104 gebbert 1.4 ClassDef(PlotTool,4)
105 tschum 1.1
106 tschum 1.5
107 tschum 1.1 };
108    
109     #endif