1 |
tschum |
1.1 |
#ifndef PlotTool_h
|
2 |
|
|
#define PlotTool_h
|
3 |
|
|
|
4 |
tschum |
1.11 |
#include "TClonesArray.h"
|
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 |
tschum |
1.1 |
#include "TChain.h"
|
13 |
|
|
#include "TSystemDirectory.h"
|
14 |
|
|
#include "TList.h"
|
15 |
|
|
#include "TCanvas.h"
|
16 |
|
|
#include "TH1F.h"
|
17 |
|
|
#include "TPaletteAxis.h"
|
18 |
|
|
#include "TPaveStats.h"
|
19 |
|
|
#include "TFrame.h"
|
20 |
|
|
#include "TLegend.h"
|
21 |
|
|
#include "TLegendEntry.h"
|
22 |
|
|
#include "TColor.h"
|
23 |
|
|
#include "TStyle.h"
|
24 |
thomsen |
1.3 |
#include "TROOT.h"
|
25 |
tschum |
1.6 |
#include "TSystem.h"
|
26 |
thomsen |
1.12 |
#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 |
tschum |
1.11 |
|
40 |
|
|
#include <string>
|
41 |
|
|
#include <map>
|
42 |
|
|
#include <iostream>
|
43 |
|
|
#include <fstream>
|
44 |
|
|
#include <sstream>
|
45 |
|
|
#include <vector>
|
46 |
|
|
|
47 |
tschum |
1.1 |
|
48 |
|
|
using namespace std;
|
49 |
|
|
|
50 |
|
|
class TClass;
|
51 |
|
|
|
52 |
|
|
class PlotTool : public TClonesArray {
|
53 |
|
|
|
54 |
|
|
private:
|
55 |
|
|
|
56 |
gebbert |
1.4 |
map< string, TCanvas* > canvases_;
|
57 |
|
|
map< string, TCanvas* > pads_;
|
58 |
tschum |
1.1 |
|
59 |
gebbert |
1.4 |
void setCanvas(TCanvas* thisCanvas);
|
60 |
|
|
void setStats(TCanvas* thisCanvas, TPaveStats* thisStatsBox, TH1* thisHist,
|
61 |
|
|
int counter);
|
62 |
|
|
void setColor(TH1* thisHist, int counter);
|
63 |
|
|
void setMathLabels(TH1* thisHist);
|
64 |
|
|
void setPalette(TCanvas* thisCanvas, TPaletteAxis* palette);
|
65 |
|
|
void setHistMax(TCanvas* thisCanvas, double maxEntry);
|
66 |
|
|
void setLegend(TCanvas* thisCanvas, TLegend* thisLeg, int counter);
|
67 |
|
|
void createColors();
|
68 |
tschum |
1.1 |
|
69 |
|
|
public:
|
70 |
|
|
|
71 |
gebbert |
1.4 |
PlotTool();
|
72 |
|
|
~PlotTool() {
|
73 |
|
|
}
|
74 |
|
|
;
|
75 |
|
|
|
76 |
|
|
int init(string fileName = "",
|
77 |
|
|
string dirPath = "/scratch/hh/current/cms/user/schum/",
|
78 |
|
|
string treeName = "Events", string fileLabel="");
|
79 |
|
|
int plot(int chainIndex, string histName, string cutName= "",
|
80 |
|
|
int nEntries= -1, string drwOpt = "");
|
81 |
|
|
int loop(vector<string> _histName, vector<string> _cutName,
|
82 |
|
|
int nEntries= -1, string drwOpt = "", bool correspond = false);
|
83 |
|
|
int loop(vector<string> _histName, string cutName= "", int nEntries= -1,
|
84 |
|
|
string drwOpt = "");
|
85 |
|
|
int loop(string histName, vector<string> _cutName, int nEntries= -1,
|
86 |
|
|
string drwOpt = "");
|
87 |
tschum |
1.5 |
int loop(string histName, string cutName = "", int nEntries= -1,
|
88 |
gebbert |
1.4 |
string drwOpt = "");
|
89 |
|
|
|
90 |
tschum |
1.6 |
int plotEff(int chainIndex, string histName, string cutName, int nEntries, double fitXmin = 30, double fitXmax = 130, string fitFormula="expo");
|
91 |
|
|
|
92 |
gebbert |
1.4 |
bool samePad_trees, samePad_vars, samePad_cuts, sameCanv_trees,
|
93 |
|
|
sameCanv_vars, sameCanv_cuts;
|
94 |
thomsen |
1.12 |
bool showLegend, logY, addTrackJets, addHitDetInfo, diTrackMass, addTrigger, verbose, addEventInfo, addTower, recreateTree ;
|
95 |
|
|
float *TrackJetKT, *TrackDetE, *TrackDetEECAL, * towet, * toweta, * towphi, * towen, * towem, * towhd, * towoe;
|
96 |
|
|
vector<string> fileNames;
|
97 |
tschum |
1.9 |
|
98 |
|
|
string globalCuts;
|
99 |
tschum |
1.11 |
int* towid_phi, *towid_eta, *towid;
|
100 |
gebbert |
1.4 |
|
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
|