1 |
|
#ifndef PlotTool_h |
2 |
|
#define PlotTool_h |
3 |
|
|
4 |
– |
#ifndef ROOT_TClonesArray |
4 |
|
#include "TClonesArray.h" |
5 |
< |
#endif |
6 |
< |
|
7 |
< |
#include <string> |
8 |
< |
#include <map> |
9 |
< |
#include <iostream> |
10 |
< |
#include <fstream> |
11 |
< |
#include <sstream> |
13 |
< |
#include <vector> |
14 |
< |
|
5 |
> |
#include "TFile.h" |
6 |
> |
#include "TGraphAsymmErrors.h" |
7 |
> |
#include "TF2.h" |
8 |
> |
#include "TStopwatch.h" |
9 |
> |
#include "TPostScript.h" |
10 |
> |
#include "TLeafElement.h" |
11 |
> |
#include "TMethod.h" |
12 |
|
#include "TChain.h" |
13 |
|
#include "TSystemDirectory.h" |
14 |
|
#include "TList.h" |
21 |
|
#include "TLegendEntry.h" |
22 |
|
#include "TColor.h" |
23 |
|
#include "TStyle.h" |
24 |
< |
#include "TROOT.h" |
24 |
> |
#include "TROOT.h" |
25 |
> |
#include "TSystem.h" |
26 |
> |
#include "DataFormats/FWLite/interface/Handle.h" |
27 |
> |
#include "DataFormats/FWLite/interface/Event.h" |
28 |
> |
#if !defined(__CINT__) && !defined(__MAKECINT__) |
29 |
> |
#include "DataFormats/PatCandidates/interface/Jet.h" |
30 |
> |
#include <DataFormats/DetId/interface/DetId.h> |
31 |
> |
#include <DataFormats/CaloRecHit/interface/CaloCluster.h> |
32 |
> |
#include <DataFormats/CaloTowers/interface/CaloTower.h> |
33 |
> |
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" |
34 |
> |
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" |
35 |
> |
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h" |
36 |
> |
#include "DataFormats/Math/interface/deltaR.h" |
37 |
> |
#endif |
38 |
> |
#include <TLorentzVector.h> |
39 |
> |
|
40 |
> |
#include <string> |
41 |
> |
#include <map> |
42 |
> |
#include <iostream> |
43 |
> |
#include <fstream> |
44 |
> |
#include <sstream> |
45 |
> |
#include <vector> |
46 |
> |
|
47 |
> |
//#include "DetEtaPhi.h" |
48 |
> |
|
49 |
|
|
50 |
|
using namespace std; |
51 |
|
|
55 |
|
|
56 |
|
private: |
57 |
|
|
58 |
< |
map< string, TCanvas* > canvases_; |
59 |
< |
map< string, TCanvas* > pads_; |
58 |
> |
map< string, TCanvas* > canvases_; |
59 |
> |
map< string, TCanvas* > pads_; |
60 |
|
|
61 |
< |
void setCanvas(TCanvas* thisCanvas); |
62 |
< |
void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist, int counter); |
63 |
< |
void setColor(TH1* thisHist, int counter); |
64 |
< |
void setMathLabels(TH1* thisHist); |
65 |
< |
void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette); |
66 |
< |
void setHistMax(TCanvas* thisCanvas, double maxEntry); |
67 |
< |
void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter); |
68 |
< |
void createColors(); |
61 |
> |
void setCanvas(TCanvas* thisCanvas); |
62 |
> |
void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist, |
63 |
> |
int counter); |
64 |
> |
void setColor(TH1* thisHist, int counter); |
65 |
> |
void setMathLabels(TH1* thisHist); |
66 |
> |
void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette); |
67 |
> |
void setHistMax(TCanvas* thisCanvas, double maxEntry); |
68 |
> |
void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter); |
69 |
> |
void createColors(); |
70 |
|
|
71 |
|
public: |
72 |
|
|
73 |
< |
PlotTool(); |
74 |
< |
~PlotTool(){}; |
75 |
< |
|
73 |
> |
PlotTool(); |
74 |
> |
~PlotTool() { |
75 |
> |
} |
76 |
> |
; |
77 |
> |
|
78 |
> |
int init(string fileName = "", |
79 |
> |
string dirPath = "/scratch/hh/current/cms/user/schum/", |
80 |
> |
string treeName = "Events", string fileLabel=""); |
81 |
> |
int plot(int chainIndex, string histName, string cutName= "", |
82 |
> |
int nEntries= -1, string drwOpt = ""); |
83 |
> |
int loop(vector<string> _histName, vector<string> _cutName, |
84 |
> |
int nEntries= -1, string drwOpt = "", bool correspond = false); |
85 |
> |
int loop(vector<string> _histName, string cutName= "", int nEntries= -1, |
86 |
> |
string drwOpt = ""); |
87 |
> |
int loop(string histName, vector<string> _cutName, int nEntries= -1, |
88 |
> |
string drwOpt = ""); |
89 |
> |
int loop(string histName, string cutName = "", int nEntries= -1, |
90 |
> |
string drwOpt = ""); |
91 |
> |
|
92 |
> |
int plotEff(int chainIndex, string histName, string cutName, int nEntries, double fitXmin = 30, double fitXmax = 130, string fitFormula="expo"); |
93 |
> |
|
94 |
> |
int getEtaBin(double eta); |
95 |
> |
double getEtaFromBin(int etaBin, bool lowerEdge); |
96 |
> |
int getPhiBin(double phi); |
97 |
> |
double getPhiFromBin(int phiBin, bool lowerEdge); |
98 |
> |
|
99 |
> |
bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees, sameCanv_vars, sameCanv_cuts; |
100 |
> |
|
101 |
> |
bool showLegend, logY, addTrackJets, addHitDetInfo, diTrackMass, addTrigger, verbose, addEventInfo, addTower, addJetContent, recreateTree ; |
102 |
> |
float *TrackJetKT, *TrackDetE, *TrackDetEECAL, * towet, * toweta, * towphi, * towen, * towem, * towhd, * towoe; |
103 |
> |
float *TowLeadJetE, *TowLeadJetDPhi, *TowLeadJetDEta, *TowLeadJetEMF, *TrackLeadJetE, *TrackLeadJetDPhi, *TrackLeadJetDEta; |
104 |
> |
vector<string> fileNames; |
105 |
> |
|
106 |
> |
string globalCuts; |
107 |
> |
int* towid_phi, *towid_eta, *towid; |
108 |
> |
|
109 |
> |
int saveCanvases(string name="test", |
110 |
> |
string path="/afs/naf.desy.de/group/cms/scratch/schum/"); |
111 |
> |
int clearCanvases(); |
112 |
> |
int updatePads(); |
113 |
> |
int fillCanvases(); |
114 |
|
|
115 |
< |
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 = ""); |
115 |
> |
int setVariables(string label=""); |
116 |
|
|
117 |
< |
bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees, sameCanv_vars, sameCanv_cuts; |
63 |
< |
bool showLegend, logY; |
117 |
> |
vector<string> autoVars; |
118 |
|
|
65 |
– |
int saveCanvases(string type=".ps", string path="/afs/naf.desy.de/group/cms/scratch/schum/"); |
66 |
– |
int updatePads(); |
67 |
– |
int fillCanvases(); |
119 |
|
|
120 |
+ |
ClassDef(PlotTool,4) |
121 |
|
|
70 |
– |
ClassDef(PlotTool,4) |
122 |
|
|
123 |
|
}; |
124 |
|
|