ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/tschum/PlotTool.h
Revision: 1.1.1.1 (vendor branch)
Committed: Wed Nov 11 15:34:20 2009 UTC (15 years, 5 months ago) by tschum
Content type: text/plain
Branch: FWlite_Analysis, MAIN
CVS Tags: START, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
plotting tool ---first commit---

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     #include "TROOT.h"
28    
29     using namespace std;
30    
31     class TClass;
32    
33     class PlotTool : public TClonesArray {
34    
35     private:
36    
37     map< string, TCanvas* > canvases_;
38     map< string, TCanvas* > pads_;
39    
40     void setCanvas(TCanvas* thisCanvas);
41     void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist, int counter);
42     void setColor(TH1* thisHist, int counter);
43     void setMathLabels(TH1* thisHist);
44     void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette);
45     void setHistMax(TCanvas* thisCanvas, double maxEntry);
46     void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter);
47     void createColors();
48    
49     public:
50    
51     PlotTool();
52     ~PlotTool(){};
53    
54    
55     int init(string fileName = "", string dirPath = "/scratch/hh/current/cms/user/schum/", string treeName = "Events");
56     int plot(int chainIndex, string histName, string cutName= "", int nEntries= -1, string drwOpt = "");
57     int loop(vector<string> _histName, vector<string> _cutName, int nEntries= -1, string drwOpt = "", bool correspond = false);
58     int loop(vector<string> _histName, string cutName= "", int nEntries= -1, string drwOpt = "");
59     int loop(string histName, vector<string> _cutName, int nEntries= -1, string drwOpt = "");
60     int loop(string histName, string cutName, int nEntries= -1, string drwOpt = "");
61    
62     bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees, sameCanv_vars, sameCanv_cuts;
63     bool showLegend;
64    
65     int saveCanvases(string type=".ps", string path="/afs/naf.desy.de/group/cms/scratch/schum/");
66     int updatePads();
67     int fillCanvases();
68    
69    
70     ClassDef(PlotTool,4)
71    
72     };
73    
74     #endif