ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/tschum/FWlite_Analysis/PlotTool.h
Revision: 1.11
Committed: Thu Dec 10 18:29:27 2009 UTC (15 years, 4 months ago) by tschum
Content type: text/plain
Branch: MAIN
Changes since 1.10: +28 -23 lines
Log Message:
friendtree only recreated on demand, add CaloTowers

File Contents

# User Rev Content
1 tschum 1.1 #ifndef PlotTool_h
2     #define PlotTool_h
3    
4 tschum 1.11
5     #if !defined(__CINT__) && !defined(__MAKECINT__)
6     #include "DataFormats/PatCandidates/interface/Jet.h"
7 tschum 1.1 #endif
8    
9 tschum 1.11 #include "DataFormats/FWLite/interface/Handle.h"
10     #include "DataFormats/FWLite/interface/Event.h"
11     #include "DataFormats/Math/interface/deltaR.h"
12    
13     //#include "DataFormats/FWLite/interface/TriggerNames.h"
14    
15 tschum 1.1
16 tschum 1.11 #include "TClonesArray.h"
17     #include "TFile.h"
18     #include "TGraphAsymmErrors.h"
19     #include "TF2.h"
20     #include "TStopwatch.h"
21     #include "TPostScript.h"
22     #include "TLeafElement.h"
23     #include "TMethod.h"
24 tschum 1.1 #include "TChain.h"
25     #include "TSystemDirectory.h"
26     #include "TList.h"
27     #include "TCanvas.h"
28     #include "TH1F.h"
29     #include "TPaletteAxis.h"
30     #include "TPaveStats.h"
31     #include "TFrame.h"
32     #include "TLegend.h"
33     #include "TLegendEntry.h"
34     #include "TColor.h"
35     #include "TStyle.h"
36 thomsen 1.3 #include "TROOT.h"
37 tschum 1.6 #include "TSystem.h"
38 tschum 1.11
39     #include <string>
40     #include <map>
41     #include <iostream>
42     #include <fstream>
43     #include <sstream>
44     #include <vector>
45    
46 tschum 1.1
47     using namespace std;
48    
49     class TClass;
50    
51     class PlotTool : public TClonesArray {
52    
53     private:
54    
55 gebbert 1.4 map< string, TCanvas* > canvases_;
56     map< string, TCanvas* > pads_;
57 tschum 1.1
58 gebbert 1.4 void setCanvas(TCanvas* thisCanvas);
59     void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist,
60     int counter);
61     void setColor(TH1* thisHist, int counter);
62     void setMathLabels(TH1* thisHist);
63     void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette);
64     void setHistMax(TCanvas* thisCanvas, double maxEntry);
65     void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter);
66     void createColors();
67 tschum 1.1
68     public:
69    
70 gebbert 1.4 PlotTool();
71     ~PlotTool() {
72     }
73     ;
74    
75     int init(string fileName = "",
76     string dirPath = "/scratch/hh/current/cms/user/schum/",
77     string treeName = "Events", string fileLabel="");
78     int plot(int chainIndex, string histName, string cutName= "",
79     int nEntries= -1, string drwOpt = "");
80     int loop(vector<string> _histName, vector<string> _cutName,
81     int nEntries= -1, string drwOpt = "", bool correspond = false);
82     int loop(vector<string> _histName, string cutName= "", int nEntries= -1,
83     string drwOpt = "");
84     int loop(string histName, vector<string> _cutName, int nEntries= -1,
85     string drwOpt = "");
86 tschum 1.5 int loop(string histName, string cutName = "", int nEntries= -1,
87 gebbert 1.4 string drwOpt = "");
88    
89 tschum 1.6 int plotEff(int chainIndex, string histName, string cutName, int nEntries, double fitXmin = 30, double fitXmax = 130, string fitFormula="expo");
90    
91 gebbert 1.4 bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees,
92     sameCanv_vars, sameCanv_cuts;
93 tschum 1.11 bool showLegend, logY, addTrackJets, addEventInfo, addTower, verbose, recreateTree;
94 tschum 1.9
95     string globalCuts;
96    
97 tschum 1.11 float* TrackJetKT, * towet, * toweta, * towphi, * towen, * towem, * towhd, * towoe;
98     int* towid_phi, *towid_eta, *towid;
99 gebbert 1.4 vector<string> fileNames;
100    
101 tschum 1.7 int saveCanvases(string name="test",
102 gebbert 1.4 string path="/afs/naf.desy.de/group/cms/scratch/schum/");
103 tschum 1.8 int clearCanvases();
104 gebbert 1.4 int updatePads();
105     int fillCanvases();
106 tschum 1.1
107 tschum 1.8 int setVariables(string label="");
108    
109     vector<string> autoVars;
110 tschum 1.5
111    
112 gebbert 1.4 ClassDef(PlotTool,4)
113 tschum 1.1
114 tschum 1.5
115 tschum 1.1 };
116    
117     #endif