#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include "TString.h"
#include "TROOT.h"
#include "TStyle.h"
#include "TH1F.h"
#include "TFile.h"
#include "TCanvas.h"
#include "TLegend.h"
Go to the source code of this file.
|
void | PlotCombiner () |
|
void | plotMaker (TString histoName, TString typeOfplot, vector< TString > file, vector< TString > type, vector< double > weight, TString xtitle, Int_t NBins, Double_t min, Double_t max) |
|
Definition at line 81 of file PlotCombiner.cc.
References EnergyCorrector::c, gather_cfg::cout, relativeConstraints::empty, haddnano::files, alignmentValidation::fname, mps_fire::i, input, createfilelist::int, mps_splice::line, plotMaker(), AlCaHLTBitMon_QueryRunRegistry::string, w, and HGCalRecHit_cfi::weights.
84 ifstream
input(
"inputFiles");
86 TString typeOfplot =
"";
87 vector<TString>
types;
88 vector<TString>
files;
91 if (
input.is_open()) {
93 while (!
input.eof()) {
94 getline(
input, myline);
100 if (i==1) typeOfplot=
line;
106 int lineSize = (
int)
line.Length();
115 else if(ftype.Length()==3)
break;
120 else{
if(
fw.Length()>0)
break;}
123 if (
fname.Length() == 0)
break;
124 files.push_back(
fname);
125 types.push_back(ftype);
126 double w =
fw.Atof();
127 weights.push_back(w);
135 std::cout <<
"File with name inputFile was not found" << std::endl;
140 if (typeOfplot ==
"wenu") {
141 cout <<
"wenu plot maker" << endl;
145 plotMaker(
"h_met", typeOfplot, files, types, weights,
"MET (GeV)", 100,0,100);
148 cout <<
"zee plot maker" << endl;
152 plotMaker(
"h_mee", typeOfplot, files, types, weights,
"M_{ee} (GeV)", 150,0,150);
void plotMaker(TString histoName, TString typeOfplot, vector< TString > file, vector< TString > type, vector< double > weight, TString xtitle)
static std::string const input
void plotMaker |
( |
TString |
histoName, |
|
|
TString |
typeOfplot, |
|
|
vector< TString > |
file, |
|
|
vector< TString > |
type, |
|
|
vector< double > |
weight, |
|
|
TString |
xtitle, |
|
|
Int_t |
NBins, |
|
|
Double_t |
min, |
|
|
Double_t |
max |
|
) |
| |
Definition at line 160 of file PlotCombiner.cc.
References EnergyCorrector::c, f, h, mps_fire::i, createfilelist::int, and create_public_lumi_plots::leg.
166 gROOT->ProcessLine(
".L tdrstyle.C");
167 gROOT->ProcessLine(
"setTDRStyle()");
170 TH1F h_wenu(
"h_wenu",
"h_wenu", NBins,
min,
max);
172 for (
int i=0;
i<fmax; ++
i) {
175 TH1F *
h = (TH1F*)
f.Get(histoName);
182 TH1F h_qcd(
"h_qcd",
"h_qcd", NBins,
min,
max);
183 for (
int i=0;
i<fmax; ++
i) {
186 TH1F *
h = (TH1F*)
f.Get(histoName);
191 TH1F h_bce(
"h_bce",
"h_bce", NBins,
min,
max);
192 for (
int i=0;
i<fmax; ++
i) {
195 TH1F *
h = (TH1F*)
f.Get(histoName);
200 TH1F h_gj(
"h_gj",
"h_gj", NBins,
min,
max);
201 for (
int i=0;
i<fmax; ++
i) {
204 TH1F *
h = (TH1F*)
f.Get(histoName);
209 TH1F h_ewk(
"h_ewk",
"h_ewk", NBins,
min,
max);
210 for (
int i=0;
i<fmax; ++
i) {
213 TH1F *
h = (TH1F*)
f.Get(histoName);
220 h_ewk.SetFillColor(3);
224 h_gj.SetFillColor(1);
228 h_bce.SetFillColor(2);
230 TH1F h_tot(
"h_tot",
"h_tot", NBins,
min,
max);
233 h_wenu.SetLineColor(4); h_wenu.SetLineWidth(2);
236 h_tot.GetXaxis()->SetTitle(
xtitle);
244 TLegend
leg(0.6,0.65,0.95,0.92);
245 if (wzsignal ==
"wenu")
246 leg.AddEntry(&h_wenu,
"W#rightarrow e#nu",
"l");
248 leg.AddEntry(&h_wenu,
"Z#rightarrow ee",
"l");
249 leg.AddEntry(&h_tot,
"Signal + Bkg",
"p");
250 leg.AddEntry(&h_bce,
"dijets",
"f");
251 leg.AddEntry(&h_gj,
"#gamma + jets",
"f");
252 leg.AddEntry(&h_ewk,
"EWK+t#bar t",
"f");
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.