ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/tschum/FWlite_Analysis/PlotTool.h
Revision: 1.3
Committed: Wed Nov 18 14:53:42 2009 UTC (15 years, 5 months ago) by thomsen
Content type: text/plain
Branch: MAIN
Changes since 1.2: +10 -1 lines
Log Message:
added Track-Jets and environment to build own 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     #include "DataFormats/FWLite/interface/Handle.h"
29     #include "DataFormats/FWLite/interface/Event.h"
30     #if !defined(__CINT__) && !defined(__MAKECINT__)
31     #include "DataFormats/PatCandidates/interface/Jet.h"
32     #endif
33     #include "DataFormats/Math/interface/deltaR.h"
34     #include "TFile.h"
35 tschum 1.1
36     using namespace std;
37    
38     class TClass;
39    
40     class PlotTool : public TClonesArray {
41    
42     private:
43    
44     map< string, TCanvas* > canvases_;
45     map< string, TCanvas* > pads_;
46    
47     void setCanvas(TCanvas* thisCanvas);
48     void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist, int counter);
49     void setColor(TH1* thisHist, int counter);
50     void setMathLabels(TH1* thisHist);
51     void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette);
52     void setHistMax(TCanvas* thisCanvas, double maxEntry);
53     void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter);
54     void createColors();
55    
56     public:
57    
58     PlotTool();
59     ~PlotTool(){};
60    
61    
62     int init(string fileName = "", string dirPath = "/scratch/hh/current/cms/user/schum/", string treeName = "Events");
63     int plot(int chainIndex, string histName, string cutName= "", int nEntries= -1, string drwOpt = "");
64     int loop(vector<string> _histName, vector<string> _cutName, int nEntries= -1, string drwOpt = "", bool correspond = false);
65     int loop(vector<string> _histName, string cutName= "", int nEntries= -1, string drwOpt = "");
66     int loop(string histName, vector<string> _cutName, int nEntries= -1, string drwOpt = "");
67     int loop(string histName, string cutName, int nEntries= -1, string drwOpt = "");
68    
69     bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees, sameCanv_vars, sameCanv_cuts;
70 tschum 1.2 bool showLegend, logY;
71 thomsen 1.3 float* TrackJetKT;
72     vector<string> fileNames;
73 tschum 1.1
74     int saveCanvases(string type=".ps", string path="/afs/naf.desy.de/group/cms/scratch/schum/");
75     int updatePads();
76     int fillCanvases();
77    
78    
79     ClassDef(PlotTool,4)
80    
81     };
82    
83     #endif