ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/tschum/FWlite_Analysis/PlotTool.h
Revision: 1.6
Committed: Wed Dec 2 15:57:44 2009 UTC (15 years, 5 months ago) by tschum
Content type: text/plain
Branch: MAIN
Changes since 1.5: +7 -1 lines
Log Message:
add time info, event info in start.C

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.1
40     using namespace std;
41    
42     class TClass;
43    
44     class PlotTool : public TClonesArray {
45    
46     private:
47    
48 gebbert 1.4 map< string, TCanvas* > canvases_;
49     map< string, TCanvas* > pads_;
50 tschum 1.1
51 gebbert 1.4 void setCanvas(TCanvas* thisCanvas);
52     void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist,
53     int counter);
54     void setColor(TH1* thisHist, int counter);
55     void setMathLabels(TH1* thisHist);
56     void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette);
57     void setHistMax(TCanvas* thisCanvas, double maxEntry);
58     void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter);
59     void createColors();
60 tschum 1.1
61     public:
62    
63 gebbert 1.4 PlotTool();
64     ~PlotTool() {
65     }
66     ;
67    
68     int init(string fileName = "",
69     string dirPath = "/scratch/hh/current/cms/user/schum/",
70     string treeName = "Events", string fileLabel="");
71     int plot(int chainIndex, string histName, string cutName= "",
72     int nEntries= -1, string drwOpt = "");
73     int loop(vector<string> _histName, vector<string> _cutName,
74     int nEntries= -1, string drwOpt = "", bool correspond = false);
75     int loop(vector<string> _histName, string cutName= "", int nEntries= -1,
76     string drwOpt = "");
77     int loop(string histName, vector<string> _cutName, int nEntries= -1,
78     string drwOpt = "");
79 tschum 1.5 int loop(string histName, string cutName = "", int nEntries= -1,
80 gebbert 1.4 string drwOpt = "");
81    
82 tschum 1.6 int plotEff(int chainIndex, string histName, string cutName, int nEntries, double fitXmin = 30, double fitXmax = 130, string fitFormula="expo");
83    
84 gebbert 1.4 bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees,
85     sameCanv_vars, sameCanv_cuts;
86 tschum 1.6 bool showLegend, logY, addTrackJets, verbose;
87 gebbert 1.4 float* TrackJetKT;
88     vector<string> fileNames;
89    
90     int saveCanvases(string type=".ps",
91     string path="/afs/naf.desy.de/group/cms/scratch/schum/");
92     int updatePads();
93     int fillCanvases();
94 tschum 1.1
95 tschum 1.5 void showChainInfo();
96    
97    
98 gebbert 1.4 ClassDef(PlotTool,4)
99 tschum 1.1
100 tschum 1.5
101 tschum 1.1 };
102    
103     #endif