ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/Selection/src/plotH4l.cc
(Generate patch)

Comparing UserCode/MitHzz4l/Selection/src/plotH4l.cc (file contents):
Revision 1.3 by dkralph, Mon Jul 16 10:21:13 2012 UTC vs.
Revision 1.6 by dkralph, Mon Dec 17 12:34:08 2012 UTC

# Line 5 | Line 5
5   #include "TCanvas.h"
6   #include "TChain.h"
7   #include "TString.h"
8 + #include "Various.h"
9   #include "TStyle.h"
10 + #include "TRandom.h"
11   #include "TH1D.h"
12  
13   #include "Various.h"
14 + #include "RunLumiRangeMap.h"
15  
16   #include "CPlot.h"
17   #include "FOArgs.h"
18 + #include "varkeepter.h"
19   #include "SampleWeight.h"
20 + #include "SelectionFuncs.h"
21   #include "PlotHeaders.h"
22 + #include "HistHeaders.h"
23 + #include "MitStyleRemix.h"
24  
25   #ifndef CMSSW_BASE
26   #define CMSSW_BASE "../../"
# Line 24 | Line 31 | using namespace RooFit;
31   using namespace mithep;
32  
33   TCanvas *can;
34 <
35 < void makeHTML(FOFlags &ctrl, TString plotLabel);
34 > //----------------------------------------------------------------------------------------
35 > TString entry_str(TH1D *hist, bool dummyStr=false)
36 > {
37 >  if(dummyStr) return "";
38 >  stringstream ss;
39 >  ss << hist->GetEntries();
40 >  TString str;
41 >  ss >> str;
42 >  return str;
43 > }
44 > //----------------------------------------------------------------------------------------
45 > // void makeHTML(FOFlags &ctrl, TString plotLabel);
46   map<TString,map<TString,TH1D*>* > init_hists(FOFlags &ctrl, TString str="");
47  
48   //----------------------------------------------------------------------------------------
49   int main(int argc, char** argv)
50   {
51 <  double lumi = 5000;//10093;//5000+2600;
52 <
51 >  SetStyle();
52 >  bool dummyStr(false); // don't add the yield numbers to legends
53    FOFlags ctrl;
54    parse_foargs( argc, argv, ctrl );
55    ctrl.dump();
56  
57 <  can = new TCanvas("can","can");
57 >  varkeepter vk("Selection/data/passVars.txt","w","pass.root",0,"zznt");
58 >  bool writeFlatTuple(ctrl.makeFakeTuples);
59 >
60 >  can = new TCanvas("can","can",700,500);
61  
62    TString cmsswpath(CMSSW_BASE + TString("/src"));
63    string xspath = (string(cmsswpath)+"/MitPhysics/data/xs.dat");
# Line 45 | Line 65 | int main(int argc, char** argv)
65  
66    vector<CSample*> samplev;
67    TString ntupledir(""),label(""),plotLabel(""),jsonFile("");
68 <  readConfigFile(ctrl.config, ntupledir, label, plotLabel, jsonFile, samplev, &ctrl, init_hists);
68 >  int puTarget;
69 >  readConfigFile(ctrl.config, ntupledir, label, plotLabel, jsonFile, puTarget, samplev, &ctrl, init_hists);
70  
71    vector<pair<unsigned,unsigned> > runEvtv; // vector to veto duplicate events
72    UInt_t minRun=999999999,maxRun=0;
# Line 54 | Line 75 | int main(int argc, char** argv)
75      cout << cs->name << endl;
76      for(unsigned ifs=0; ifs<(cs->fsv).size(); ifs++) {
77        filestuff *fs = (cs->fsv)[ifs];
78 <      cout << "\t" << fs->fname_ << endl;
78 >      cout << "\t" << fs->fname_ << " " << fs->getentries("zznt"); cout << flush;
79        unsigned nDuplSkipped=0;
80 +      double total=0;
81 +
82        for(unsigned ientry=0; ientry<fs->getentries("zznt"); ientry++) {
83 +        // if(ientry>1500) { cout << "SKIPPING AFTER 1500\n"; break;}
84          fs->getentry(ientry,"info","zznt");
85          fs->getentry(ientry,"kinematics","zznt");
86 <
87 <        if(fs->isdata_) {
86 >        fs->getentry(ientry,"weights","zznt");
87 >        fs->getentry(ientry,"angles","zznt");
88 >        fs->getentry(ientry,"","zznt");
89 >        if(fs->get_zz_chain()->GetBranchStatus("jetinfo"))
90 >          fs->getentry(ientry,"jetinfo","zznt");
91 >
92 >        if(fs->isdata_ && !(fs->dataset_.Contains("fakes"))) {
93 >          if(!fs->rlrm_.HasRunLumi(pair<unsigned,unsigned> (fs->info->run, fs->info->lumi))) {
94 >            continue;
95 >          }
96            setMinMaxRun(fs->info->run, minRun, maxRun);
97            bool dupl = takeCareOfDuplicateEvents(fs->info->run, fs->info->evt, runEvtv, nDuplSkipped);
98            if(dupl) continue;
99          }
68          
69        double wgt = fs->isdata_ ? 1 : lumi*xstab.Get(fs->dataset_)/fs->total_entries_;
100  
101 <        (*(cs->hists)["all"])["run"]->Fill(     fs->info->run  ,     wgt);
102 <        (*(cs->hists)["all"])["mZ1"]->Fill(     fs->kine->mZ1  ,     wgt);
103 <        (*(cs->hists)["all"])["m4l"]->Fill(     fs->kine->m4l  ,     wgt);
104 <        (*(cs->hists)["all"])["m4l_lo"]->Fill(  fs->kine->m4l  ,     wgt);
105 <        (*(cs->hists)["all"])["Z1pt"]->Fill(    fs->kine->Z1pt ,     wgt);
106 <        (*(cs->hists)["all"])["ZZpt"]->Fill(    fs->kine->ZZpt ,     wgt);
107 <        
101 >        // calculate weights here:
102 >        // double wgt = fs->isdata_ ? 1 : fs->lumi_*xstab.Get(fs->dataset_)/fs->total_entries_;
103 >        // cout << "setting wgt to: " << wgt << " = " << fs->lumi_ << "*" << xstab.Get(fs->dataset_) << "/" << fs->total_entries_ << endl;
104 >
105 >        double wgt(1);
106 >        if(!fs->isdata_) {
107 >          if(fs->dataset_.Contains("fakes")) {
108 >          } else {
109 >            if(fs->weights->npuw < 0 || fs->weights->npuw > 2) cout << "wtf? " << fs->weights->npuw << endl;
110 >            wgt = fs->lumi_ * fs->weights->w * fs->weights->npuw * fs->weights->woff * fs->weights->won;
111 >            if(fs->dataset_.Contains("-dkr")) wgt = 1;
112 >          }
113 >        }
114 >
115 >        if(fs->dataset_.Contains("fakes")) {
116 >          fs->getentry(ientry,"weights","zznt");
117 >          wgt = fs->weights->w;
118 >        }
119 >
120 >        // if(fs->kine->m4l < 100) continue;
121 >        // impose blinded region
122 >        // if(fs->isdata_ && !fs->dataset_.Contains("fakes")) {
123 >        //   if(fs->kine->m4l > 110 && fs->kine->m4l < 140) continue;
124 >        //   if(fs->kine->m4l > 300) continue;
125 >        // }
126 >
127 >        // run = fs->info->run;
128 >        // evt = fs->info->evt;
129 >        // m4lbrvar = fs->kine->m4l;
130 >        // channel = fs->kine->channel;
131 >        if(writeFlatTuple) {
132 >          vk.setval("run",fs->info->run);
133 >          vk.setval("evt",fs->info->evt);
134 >          vk.setval("channel",fs->kine->channel);
135 >          vk.setval("m4l",fs->kine->m4l);
136 >          vk.setval("mZ1",fs->kine->mZ1);
137 >          vk.setval("mZ2",fs->kine->mZ2);
138 >          vk.setval("l1pt",fs->kine->l1pt);
139 >          vk.setval("l2pt",fs->kine->l2pt);
140 >          vk.setval("l3pt",fs->kine->l3pt);
141 >          vk.setval("l4pt",fs->kine->l4pt);
142 >          vk.fill();
143 >        }
144 >        total += wgt;
145 >
146 >        fillAllHists( ctrl, cs, getChannel(fs->kine->channel), "", fs, *(fs->kine), *(fs->angles), wgt);
147 >        fillAllJetHists( ctrl, cs, getChannel(fs->kine->channel), "", fs, *(fs->kine), /*fusion,*/ /*goodJets,*/ *(fs->ji), wgt);
148 >
149        }
150 <      cout << "\t\tWARNING: skipped " << nDuplSkipped << " duplicate events" << endl;
150 >      cout << "\t( " << setw(12) << total << " ) skipped " << nDuplSkipped << " duplicate events" << endl;
151      }
152    }
153    cout << "run range: " << setw(12) << minRun << setw(12) << maxRun << endl;
154 <  gSystem->mkdir(ctrl.outdir+"/"+plotLabel,true);
154 >  TString type("all");
155 >  TString fullOutDir(ctrl.outdir+"/"+plotLabel+"/"+type);
156 >  gSystem->mkdir(fullOutDir,true);
157    TFile runHistFile(ctrl.outdir+"/"+plotLabel+"/runs.root","recreate");
158    assert(samplev.size() > 0);
159 +  bool plotShapesOnly=ctrl.plotWholeSample;
160    map<TString,TH1D*>::iterator it_v;
161    for(it_v=(*(samplev[0]->hists)["all"]).begin(); it_v!=(*(samplev[0]->hists)["all"]).end(); it_v++) {
162      TString var((*it_v).first);
163 <    CPlot cplot(var,"",(*(samplev[0]->hists)["all"])[var]->GetXaxis()->GetTitle(),"events",ctrl.outdir+"/"+plotLabel+"/plots");
163 >    CPlot cplot(var,"",(*(samplev[0]->hists)["all"])[var]->GetXaxis()->GetTitle(),"events",TString(fullOutDir+"/plots"));
164 >    double ymax=0;
165      for(unsigned isam=0; isam<samplev.size(); isam++) {
166        CSample *cs = samplev[isam];
167        TH1D *hist = (*(cs->hists)["all"])[var];
168 <      if(cs->isdata) {
169 <        cplot.AddHist1D(hist,cs->legend+": "+integral_str(hist),"E",cs->color);
168 >      if(plotShapesOnly)     hist->Scale(1./hist->Integral());
169 >      // if(!var.Contains("Zdot") && !var.Contains("_zoom") && !(var=="pt4l") && !(var=="Z1pt") && !(var=="Z2pt") && !(var=="mZ2"))) shiftOverflows(hist);
170 >      if(var.Contains("run") || var.Contains("npu") || var=="mZ1" || var=="mZ2" || var.Contains("pt_j")) shiftOverflows(hist);
171 >      ymax = max(ymax,hist->GetMaximum());
172 >      if(plotShapesOnly || (cs->isdata && !(cs->name.Contains("fakes")))) {
173 >        TString tmpstr = plotShapesOnly ? entry_str(hist,dummyStr) : integral_str(hist,1,dummyStr);
174 >        cplot.AddHist1D(hist,cs->legend+": "+tmpstr,plotShapesOnly ? TString("hist") : TString("E"),cs->color);
175        } else {
176 <        cplot.AddToStack(hist,cs->legend+": "+integral_str(hist),kCyan-6);
97 <        // cplot.AddToStack((*(cs_zj->hists)["all"])[var],"ZJ: "+integral_str((*(cs_zj->hists)["all"])[var]),843);
176 >        cplot.AddToStack(hist,cs->legend+": "+integral_str(hist,4,dummyStr),cs->color);
177        }
178        if(cs->isdata && var=="run") {
179          assert(hist->GetBinContent(0)==0 && hist->GetBinContent(hist->GetXaxis()->GetNbins()+1)==0);
180          hist->Write();
181        }
182      }
183 +    if(var=="mZ1" || var=="m4l_lo") cplot.TransLegend(-.4,0);
184 +    if(var=="w" || var.Contains("_log"))
185 +      cplot.SetLogy();
186 +    else {
187 +      cplot.SetLogy(false);
188 +      double factor(1.2);
189 +      if(var=="m4l_lo") factor = 1.5;
190 +      cplot.SetYRange(0,factor*ymax);
191 +    }
192 +    TString txt("#bf{CMS Preliminary           L = 5 ( + 12 ) fb^{-1} at #sqrt{s} = 7 ( + 8 ) TeV}"); // #sqrt{s} = 7 TeV, L = 5 fb^{-1}; #sqrt{s} = 8 TeV, L = 12 fb^{-1}");
193 +    cplot.AddTextBox(txt,0.16,0.95,0.85,0.99,0);
194      cplot.Draw(can,true,"png");
195    }
196    runHistFile.Close();
197    
198 <  makeHTML(ctrl,plotLabel);
198 >  makeHTML(ctrl,"XXX",plotLabel,fullOutDir);
199 >  // makeHTML(FOFlags &ctrl, TString type, TString plotLabel, TString fullOutDir)
200 >  if(writeFlatTuple) {
201 >    vk.writeclose();
202 >  }
203 >  assert(string("ROOT SUCKS") == string("FALSE"));
204   }
205   //----------------------------------------------------------------------------------------
206   map<TString,map<TString,TH1D*>* > init_hists(FOFlags &ctrl, TString str)
# Line 115 | Line 210 | map<TString,map<TString,TH1D*>* > init_h
210    map<TString,TH1D*> *h_4m   = new map<TString,TH1D*>; hists["4m"]   = h_4m;
211    map<TString,TH1D*> *h_2e2m = new map<TString,TH1D*>; hists["2e2m"] = h_2e2m;
212    map<TString,TH1D*> *h_all  = new map<TString,TH1D*>; hists["all"]  = h_all;
213 <  map<TString,map<TString,TH1D*>* >::iterator it_h;
214 <  for(it_h=hists.begin(); it_h!=hists.end(); it_h++) {
215 <    (*((*it_h).second))["run"]          = new TH1D(TString("run") +"_"+(*it_h).first+str,";#bf{run};",          50,163330,196455);   (*((*it_h).second))["run"]->Sumw2();
216 <    (*((*it_h).second))["mZ1"]          = new TH1D(TString("mZ1") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",    20,75,105);          (*((*it_h).second))["mZ1"]->Sumw2();
217 <    (*((*it_h).second))["m4l"]          = new TH1D(TString("m4l") +"_"+(*it_h).first+str,";#bf{m4l [GeV]};",    40,50,500);          (*((*it_h).second))["m4l"]->Sumw2();
218 <    (*((*it_h).second))["m4l_lo"]       = new TH1D(TString("m4l_lo") +"_"+(*it_h).first+str,";#bf{m4l [GeV]};", 40,100,170);         (*((*it_h).second))["m4l_lo"]->Sumw2();
219 <    (*((*it_h).second))["Z1pt"]         = new TH1D(TString("Z1pt") +"_"+(*it_h).first+str,";#bf{Z1pt [GeV]};",  20,0,200);           (*((*it_h).second))["Z1pt"]->Sumw2();
220 <    (*((*it_h).second))["ZZpt"]         = new TH1D(TString("ZZpt") +"_"+(*it_h).first+str,";#bf{ZZpt [GeV]};",  30,0,200);           (*((*it_h).second))["ZZpt"]->Sumw2();
221 <  }
213 >
214 >  map<TString,TH1D*> *h_vbf  = new map<TString,TH1D*>; hists["vbf"]  = h_vbf;
215 >  // cout << "find: " << (hists.find("4e")!=hists.end()) << endl;
216 >
217 >  allocate_hists(hists,str);
218 >  // for(it_h=hists.begin(); it_h!=hists.end(); it_h++) {
219 >  //   (*((*it_h).second))["run"]               = new TH1D(TString("run") +"_"+(*it_h).first+str,";#bf{run};",          nbins,160000,196600);   (*((*it_h).second))["run"]->Sumw2();
220 >  //   (*((*it_h).second))["npu"]               = new TH1D(TString("npu") +"_"+(*it_h).first+str,";#bf{NPU};",          50,-0.5,49.5);       (*((*it_h).second))["npu"]->Sumw2();
221 >  //   (*((*it_h).second))["npv"]               = new TH1D(TString("npv") +"_"+(*it_h).first+str,";#bf{NPV};",          50,-0.5,49.5);       (*((*it_h).second))["npv"]->Sumw2();
222 >
223 >  //   (*((*it_h).second))["w"]         = new TH1D(TString("w") +"_"+(*it_h).first+str,";#bf{W};",              nbins,.0000001,.01);    (*((*it_h).second))["w"]->Sumw2();
224 >  //   (*((*it_h).second))["npuw"]              = new TH1D(TString("npuw") +"_"+(*it_h).first+str,";#bf{NPUW};",        nbins,0,4);             (*((*it_h).second))["npuw"]->Sumw2();
225 >  //   (*((*it_h).second))["woff"]              = new TH1D(TString("woff") +"_"+(*it_h).first+str,";#bf{WOFF};",        nbins,.5,1.5);          (*((*it_h).second))["woff"]->Sumw2();
226 >  //   (*((*it_h).second))["won"]               = new TH1D(TString("won") +"_"+(*it_h).first+str,";#bf{WON};",          nbins,.5,1.5);          (*((*it_h).second))["won"]->Sumw2();
227 >
228 >  //   (*((*it_h).second))["mZ1"]               = new TH1D(TString("mZ1") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",    nbins,50,105);          (*((*it_h).second))["mZ1"]->Sumw2();
229 >  //   (*((*it_h).second))["mZ1_zoom"]     = new TH1D(TString("mZ1_zoom") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",nbins,78,105);          (*((*it_h).second))["mZ1_zoom"]->Sumw2();
230 >  //   (*((*it_h).second))["mZ2"]               = new TH1D(TString("mZ2") +"_"+(*it_h).first+str,";#bf{mZ2 [GeV]};",    nbins,12,120);          (*((*it_h).second))["mZ2"]->Sumw2();
231 >  //   (*((*it_h).second))["mZ2_lo"]    = new TH1D(TString("mZ2_lo") +"_"+(*it_h).first+str,";#bf{mZ2 [GeV]};", nbins,0,50);          (*((*it_h).second))["mZ2_lo"]->Sumw2();
232 >  //   (*((*it_h).second))["m4l_lolo"]     = new TH1D(TString("m4l_lolo") +"_"+(*it_h).first+str,";#bf{m4l [GeV]};", 40,65,165);         (*((*it_h).second))["m4l_lolo"]->Sumw2();
233 >  //   (*((*it_h).second))["m4l_lo"]       = new TH1D(TString("m4l_lo") +"_"+(*it_h).first+str,";#bf{m4l [GeV]};", 18,100,165);         (*((*it_h).second))["m4l_lo"]->Sumw2();
234 >  //   (*((*it_h).second))["m4l"]               = new TH1D(TString("m4l") +"_"+(*it_h).first+str,";#bf{m4l [GeV]};",    nbins,90,600);          (*((*it_h).second))["m4l"]->Sumw2();
235 >
236 >  //   (*((*it_h).second))["costheta1"] = new TH1D(TString("costheta1") +"_"+(*it_h).first+str,";#bf{cos(#theta 1)};",  nbinsSmall,-1,1);          (*((*it_h).second))["costheta1"]->Sumw2();
237 >  //   (*((*it_h).second))["costheta2"] = new TH1D(TString("costheta2") +"_"+(*it_h).first+str,";#bf{cos(#theta 2)};",  nbinsSmall,-1,1);          (*((*it_h).second))["costheta2"]->Sumw2();
238 >  //   (*((*it_h).second))["costhetastar"]      = new TH1D(TString("costhetastar") +"_"+(*it_h).first+str,";#bf{cos(#theta star)};",nbinsSmall,-1,1);          (*((*it_h).second))["costhetastar"]->Sumw2();
239 >  //   (*((*it_h).second))["Phi"]               = new TH1D(TString("Phi") +"_"+(*it_h).first+str,";#bf{Phi};",                  nbinsSmall,-3.15,3.15);          (*((*it_h).second))["Phi"]->Sumw2();
240 >  //   (*((*it_h).second))["Phi1"]              = new TH1D(TString("Phi1") +"_"+(*it_h).first+str,";#bf{Phi1};",                nbinsSmall,-3.15,3.15);          (*((*it_h).second))["Phi1"]->Sumw2();
241 >
242 >  //   (*((*it_h).second))["pt4l"]              = new TH1D(TString("pt4l") +"_"+(*it_h).first+str,";#bf{ZZ pT/m4l};",                nbins,0,0.5);          (*((*it_h).second))["pt4l"]->Sumw2();
243 >  //   (*((*it_h).second))["pt4l_log"]  = new TH1D(TString("pt4l_log") +"_"+(*it_h).first+str,";#bf{ZZ pT/m4l};",            nbins,0,1.5);          (*((*it_h).second))["pt4l_log"]->Sumw2();
244 >  //   (*((*it_h).second))["y4l"]               = new TH1D(TString("y4l") +"_"+(*it_h).first+str,";#bf{ZZ y};",                  nbins,-2.4,2.4);      (*((*it_h).second))["y4l"]->Sumw2();
245 >  //   (*((*it_h).second))["Z1pt"]              = new TH1D(TString("Z1pt") +"_"+(*it_h).first+str,";#bf{Z1 pT/m4l};",                nbinsSmall,0,0.5);          (*((*it_h).second))["Z1pt"]->Sumw2();
246 >  //   (*((*it_h).second))["Z1pt_log"]  = new TH1D(TString("Z1pt_log") +"_"+(*it_h).first+str,";#bf{Z1 pT/m4l};",            nbinsSmall,0,1.5);          (*((*it_h).second))["Z1pt_log"]->Sumw2();
247 >  //   (*((*it_h).second))["Z2pt"]              = new TH1D(TString("Z2pt") +"_"+(*it_h).first+str,";#bf{Z2 pT/m4l};",                nbinsSmall,0,0.5);          (*((*it_h).second))["Z2pt"]->Sumw2();
248 >  //   (*((*it_h).second))["Z2pt_log"]  = new TH1D(TString("Z2pt_log") +"_"+(*it_h).first+str,";#bf{Z2 pT/m4l};",            nbinsSmall,0,1.5);          (*((*it_h).second))["Z2pt_log"]->Sumw2();
249 >
250 >  //   (*((*it_h).second))["ZZdotZ1"]   = new TH1D(TString("ZZdotZ1") +"_"+(*it_h).first+str,";#bf{ZZ #bullet Z1/(m4l*mZ1)};",          nbins,-.2,2.5);          (*((*it_h).second))["ZZdotZ1"]->Sumw2();
251 >  //   (*((*it_h).second))["ZZdotZ2"]   = new TH1D(TString("ZZdotZ2") +"_"+(*it_h).first+str,";#bf{ZZ #bullet Z2/(m4l*mZ2)};",          nbins,-1,3);          (*((*it_h).second))["ZZdotZ2"]->Sumw2();
252 >  //   (*((*it_h).second))["ZZdotZ1_log"]       = new TH1D(TString("ZZdotZ1_log") +"_"+(*it_h).first+str,";#bf{ZZ #bullet Z1/(m4l*mZ1)};",      nbins,-1.5,15);          (*((*it_h).second))["ZZdotZ1_log"]->Sumw2();
253 >  //   (*((*it_h).second))["ZZdotZ2_log"]       = new TH1D(TString("ZZdotZ2_log") +"_"+(*it_h).first+str,";#bf{ZZ #bullet Z2/(m4l*mZ2)};",      nbins,-1.5,15);          (*((*it_h).second))["ZZdotZ2_log"]->Sumw2();
254 >  //   (*((*it_h).second))["dphi1"]     = new TH1D(TString("dphi1") +"_"+(*it_h).first+str,";#bf{#Delta #phi (Z1,ZZ)};",                nbins,-1,1);          (*((*it_h).second))["dphi1"]->Sumw2();
255 >  //   (*((*it_h).second))["dphi2"]     = new TH1D(TString("dphi2") +"_"+(*it_h).first+str,";#bf{#Delta #phi (Z2,ZZ)};",                nbins,-1,1);          (*((*it_h).second))["dphi2"]->Sumw2();
256 >  //   (*((*it_h).second))["dphi1_log"] = new TH1D(TString("dphi1_log") +"_"+(*it_h).first+str,";#bf{#Delta #phi (Z1,ZZ)};",            nbins,-1,1);          (*((*it_h).second))["dphi1_log"]->Sumw2();
257 >  //   (*((*it_h).second))["dphi2_log"] = new TH1D(TString("dphi2_log") +"_"+(*it_h).first+str,";#bf{#Delta #phi (Z2,ZZ)};",            nbins,-1,1);          (*((*it_h).second))["dphi2_log"]->Sumw2();
258 >
259 >  //   (*((*it_h).second))["pt_j1"]     = new TH1D(TString("pt_j1") +"_"+(*it_h).first+str,";#bf{jet 1 p_{T} [GeV]};",  37,0,400);  (*((*it_h).second))["pt_j1"]->Sumw2();
260 >  //   (*((*it_h).second))["pt_j2"]     = new TH1D(TString("pt_j2") +"_"+(*it_h).first+str,";#bf{jet 2 p_{T} [GeV]};",  37,0,125);  (*((*it_h).second))["pt_j2"]->Sumw2();
261 >  //   (*((*it_h).second))["pt_j3"]     = new TH1D(TString("pt_j3") +"_"+(*it_h).first+str,";#bf{jet 3 p_{T} [GeV]};",  37,0,125);  (*((*it_h).second))["pt_j3"]->Sumw2();
262 >  //   (*((*it_h).second))["pt_j4"]     = new TH1D(TString("pt_j4") +"_"+(*it_h).first+str,";#bf{jet 4 p_{T} [GeV]};",  37,0,125);  (*((*it_h).second))["pt_j4"]->Sumw2();
263 >  //   (*((*it_h).second))["eta_j1"]    = new TH1D(TString("eta_j1")+"_"+(*it_h).first+str,";#bf{jet 1 #eta};",         55,-4.8,4.8);     (*((*it_h).second))["eta_j1"]->Sumw2();
264 >  //   (*((*it_h).second))["eta_j2"]    = new TH1D(TString("eta_j2")+"_"+(*it_h).first+str,";#bf{jet 2 #eta};",         55,-4.8,4.8);     (*((*it_h).second))["eta_j2"]->Sumw2();
265 >  //   (*((*it_h).second))["eta_j3"]    = new TH1D(TString("eta_j3")+"_"+(*it_h).first+str,";#bf{jet 3 #eta};",         55,-4.8,4.8);     (*((*it_h).second))["eta_j3"]->Sumw2();
266 >  //   (*((*it_h).second))["eta_j4"]    = new TH1D(TString("eta_j4")+"_"+(*it_h).first+str,";#bf{jet 4 #eta};",         55,-4.8,4.8);     (*((*it_h).second))["eta_j4"]->Sumw2();
267 >  //   (*((*it_h).second))["phi_j1"]    = new TH1D(TString("phi_j1")+"_"+(*it_h).first+str,";#bf{jet 1 #phi};",         25,-3.2,3.2);     (*((*it_h).second))["phi_j1"]->Sumw2();
268 >  //   (*((*it_h).second))["phi_j2"]    = new TH1D(TString("phi_j2")+"_"+(*it_h).first+str,";#bf{jet 2 #phi};",         25,-3.2,3.2);     (*((*it_h).second))["phi_j2"]->Sumw2();
269 >  //   (*((*it_h).second))["phi_j3"]    = new TH1D(TString("phi_j3")+"_"+(*it_h).first+str,";#bf{jet 3 #phi};",         25,-3.2,3.2);     (*((*it_h).second))["phi_j3"]->Sumw2();
270 >  //   (*((*it_h).second))["phi_j4"]    = new TH1D(TString("phi_j4")+"_"+(*it_h).first+str,";#bf{jet 4 #phi};",         25,-3.2,3.2);     (*((*it_h).second))["phi_j4"]->Sumw2();
271 >  //   (*((*it_h).second))["idmva_j1"]  = new TH1D(TString("idmva_j1")+"_"+(*it_h).first+str,";#bf{jet 1 MVA};",        25,-1.1,1.1);     (*((*it_h).second))["idmva_j1"]->Sumw2();
272 >  //   (*((*it_h).second))["idmva_j2"]  = new TH1D(TString("idmva_j2")+"_"+(*it_h).first+str,";#bf{jet 2 MVA};",        25,-1.1,1.1);     (*((*it_h).second))["idmva_j2"]->Sumw2();
273 >  //   (*((*it_h).second))["idmva_j3"]  = new TH1D(TString("idmva_j3")+"_"+(*it_h).first+str,";#bf{jet 3 MVA};",        25,-1.1,1.1);     (*((*it_h).second))["idmva_j3"]->Sumw2();
274 >  //   (*((*it_h).second))["idmva_j4"]  = new TH1D(TString("idmva_j4")+"_"+(*it_h).first+str,";#bf{jet 4 MVA};",        25,-1.1,1.1);     (*((*it_h).second))["idmva_j4"]->Sumw2();
275 >  //   (*((*it_h).second))["mjj"]               = new TH1D(TString("mjj")+"_"+(*it_h).first+str,";#bf{m_{jj}};",                25,10,1550);     (*((*it_h).second))["mjj"]->Sumw2();
276 >  //   (*((*it_h).second))["dEta"]              = new TH1D(TString("dEta")+"_"+(*it_h).first+str,";#bf{#Delta #eta};",          25,-6,6);       (*((*it_h).second))["dEta"]->Sumw2();
277 >  //   (*((*it_h).second))["etaProd"]   = new TH1D(TString("etaProd")+"_"+(*it_h).first+str,";#bf{#eta_{1} * #eta_{2}};",25,-12,12);      (*((*it_h).second))["etaProd"]->Sumw2();
278 >  //   (*((*it_h).second))["njets"]     = new TH1D(TString("njets")+"_"+(*it_h).first+str,";#bf{N Jets};",      7,-0.5,6.5);      (*((*it_h).second))["njets"]->Sumw2();
279 >
280 >  //   (*((*it_h).second))["met"]                       = new TH1D(TString("met") +"_"+(*it_h).first+str,";#bf{met};",                      nbins,0,40);          (*((*it_h).second))["met"]->Sumw2();
281 >  //   (*((*it_h).second))["metphi"]            = new TH1D(TString("metphi") +"_"+(*it_h).first+str,";#bf{metphi};",                nbins,-3.15,3.15);          (*((*it_h).second))["metphi"]->Sumw2();
282 >  //   (*((*it_h).second))["metDotZZ"]          = new TH1D(TString("metDotZZ") +"_"+(*it_h).first+str,";#bf{metDotZZ};",            nbins,-500,500);          (*((*it_h).second))["metDotZZ"]->Sumw2();
283 >  // }
284    
285    return hists;
286   }
287 < //--------------------------------------------------------------------------------------------------
288 < void makeHTML(FOFlags &ctrl, TString plotLabel)
289 < {
290 <  // TString title(ctrl.inputdir);
291 <  // title = title(title.Last('/')+1,title.Length());
292 <  TString title("Full selection: "+plotLabel);
293 <  TString htmlfname(ctrl.outdir+"/"+plotLabel+"/plots.html");
294 <  ofstream htmlfile(htmlfname);
295 <
296 <  htmlfile << "<!DOCTYPE html" << endl;
297 <  htmlfile << "    PUBLIC \"-//W3C//DTD HTML 3.2//EN\">" << endl;
298 <  htmlfile << "<html>" << endl;
299 <
300 <  htmlfile << "<head><title>"+title+"</title></head>" << endl;
301 <  htmlfile << "<body bgcolor=\"EEEEEE\">" << endl;
302 <  htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">"+title+"</h3>" << endl;
303 <
304 <  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
305 <
306 <  htmlfile << "<tr>" << endl;
307 <  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/mZ1.png\"><img src=\"plots/mZ1.png\" alt=\"plots/mZ1.png\" width=\"100%\"></a></td>" << endl;
308 <  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/Z1pt.png\"><img src=\"plots/Z1pt.png\" alt=\"plots/Z1pt.png\" width=\"100%\"></a></td>" << endl;
309 <  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ZZpt.png\"><img src=\"plots/ZZpt.png\" alt=\"plots/ZZpt.png\" width=\"100%\"></a></td>" << endl;
310 <  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/m4l.png\"><img src=\"plots/m4l.png\" alt=\"plots/m4l.png\" width=\"100%\"></a></td>" << endl;
311 <  // htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
312 <  htmlfile << "</tr>" << endl;
313 <
314 <  htmlfile << "<tr>" << endl;
315 <  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/m4l_lo.png\"><img src=\"plots/m4l_lo.png\" alt=\"plots/m4l_lo.png\" width=\"100%\"></a></td>" << endl;
316 <  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/run.png\"><img src=\"plots/run.png\" alt=\"plots/run.png\" width=\"100%\"></a></td>" << endl;
317 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
318 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
319 <  htmlfile << "</tr>" << endl;
287 > // //--------------------------------------------------------------------------------------------------
288 > // void makeHTML(FOFlags &ctrl, TString plotLabel)
289 > // {
290 > //   // TString title(ctrl.inputdir);
291 > //   // title = title(title.Last('/')+1,title.Length());
292 > //   TString title("Full selection: "+plotLabel);
293 > //   TString htmlfname(ctrl.outdir+"/"+plotLabel+"/plots.html");
294 > //   ofstream htmlfile(htmlfname);
295 >
296 > //   htmlfile << "<!DOCTYPE html" << endl;
297 > //   htmlfile << "    PUBLIC \"-//W3C//DTD HTML 3.2//EN\">" << endl;
298 > //   htmlfile << "<html>" << endl;
299 >
300 > //   htmlfile << "<head><title>"+title+"</title></head>" << endl;
301 > //   htmlfile << "<body bgcolor=\"000000\">" << endl;
302 > //   htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">"+title+"</h3>" << endl;
303 >
304 > //   htmlfile << "<hr />" << endl;
305 > //   htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">Boson masses:" << endl;
306 > //   htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
307 >
308 > //   htmlfile << "<tr>" << endl;
309 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/mZ1_zoom.png\"><img src=\"plots/mZ1_zoom.png\" alt=\"plots/mZ1_zoom.png\" width=\"100%\"></a></td>" << endl;
310 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/mZ1.png\"><img src=\"plots/mZ1.png\" alt=\"plots/mZ1.png\" width=\"100%\"></a></td>" << endl;
311 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
312 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
313 > //   htmlfile << "</tr>" << endl;
314 >
315 > //   htmlfile << "<tr>" << endl;
316 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/mZ2_lo.png\"><img src=\"plots/mZ2_lo.png\" alt=\"plots/mZ2_lo.png\" width=\"100%\"></a></td>" << endl;
317 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/mZ2.png\"><img src=\"plots/mZ2.png\" alt=\"plots/mZ2.png\" width=\"100%\"></a></td>" << endl;
318 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
319 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
320 > //   htmlfile << "</tr>" << endl;
321 >
322 > //   htmlfile << "<tr>" << endl;
323 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/m4l_lolo.png\"><img src=\"plots/m4l_lolo.png\" alt=\"plots/m4l_lolo.png\" width=\"100%\"></a></td>" << endl;
324 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/m4l_lo.png\"><img src=\"plots/m4l_lo.png\" alt=\"plots/m4l_lo.png\" width=\"100%\"></a></td>" << endl;
325 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/m4l.png\"><img src=\"plots/m4l.png\" alt=\"plots/m4l.png\" width=\"100%\"></a></td>" << endl;
326 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
327 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
328 > //   htmlfile << "</tr>" << endl;
329 >
330 > //   htmlfile << "</table>" << endl;
331 > //   htmlfile << "<hr />" << endl;
332 > //   htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">Angles: " << endl;
333 > //   htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
334 >
335 > //   htmlfile << "<tr>" << endl;
336 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/costheta1.png\"><img src=\"plots/costheta1.png\" alt=\"plots/costheta1.png\" width=\"100%\"></a></td>" << endl;
337 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/costheta2.png\"><img src=\"plots/costheta2.png\" alt=\"plots/costheta2.png\" width=\"100%\"></a></td>" << endl;
338 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/costhetastar.png\"><img src=\"plots/costhetastar.png\" alt=\"plots/costhetastar.png\" width=\"100%\"></a></td>" << endl;
339 > //   htmlfile << "<td width=\"25%\"></td>" << endl;
340 > //   htmlfile << "</tr>" << endl;
341 >
342 > //   htmlfile << "<tr>" << endl;
343 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/Phi.png\"><img src=\"plots/Phi.png\" alt=\"plots/Phi.png\" width=\"100%\"></a></td>" << endl;
344 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/Phi1.png\"><img src=\"plots/Phi1.png\" alt=\"plots/Phi1.png\" width=\"100%\"></a></td>" << endl;
345 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
346 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
347 > //   htmlfile << "</tr>" << endl;
348 >
349 > //   htmlfile << "</table>" << endl;
350 > //   htmlfile << "<hr />" << endl;
351 > //   htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">Boson pt variables: " << endl;
352 > //   htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
353 >
354 > //   htmlfile << "<tr>" << endl;
355 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/y4l.png\"><img src=\"plots/y4l.png\" alt=\"plots/y4l.png\" width=\"100%\"></a></td>" << endl;
356 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/pt4l.png\"><img src=\"plots/pt4l.png\" alt=\"plots/pt4l.png\" width=\"100%\"></a></td>" << endl;
357 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/pt4l_log.png\"><img src=\"plots/pt4l_log.png\" alt=\"plots/pt4l_log.png\" width=\"100%\"></a></td>" << endl;
358 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
359 > //   htmlfile << "<tr>" << endl;
360 >
361 > //   htmlfile << "</tr>" << endl;
362 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/Z1pt.png\"><img src=\"plots/Z1pt.png\" alt=\"plots/Z1pt.png\" width=\"100%\"></a></td>" << endl;
363 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/Z2pt.png\"><img src=\"plots/Z2pt.png\" alt=\"plots/Z2pt.png\" width=\"100%\"></a></td>" << endl;
364 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/Z1pt_log.png\"><img src=\"plots/Z1pt_log.png\" alt=\"plots/Z1pt_log.png\" width=\"100%\"></a></td>" << endl;
365 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/Z2pt_log.png\"><img src=\"plots/Z2pt_log.png\" alt=\"plots/Z2pt_log.png\" width=\"100%\"></a></td>" << endl;
366 > //   htmlfile << "</tr>" << endl;
367 >
368 > //   htmlfile << "<tr>" << endl;
369 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ZZdotZ1.png\"><img src=\"plots/ZZdotZ1.png\" alt=\"plots/ZZdotZ1.png\" width=\"100%\"></a></td>" << endl;
370 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ZZdotZ2.png\"><img src=\"plots/ZZdotZ2.png\" alt=\"plots/ZZdotZ2.png\" width=\"100%\"></a></td>" << endl;
371 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ZZdotZ1_log.png\"><img src=\"plots/ZZdotZ1_log.png\" alt=\"plots/ZZdotZ1_log.png\" width=\"100%\"></a></td>" << endl;
372 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ZZdotZ2_log.png\"><img src=\"plots/ZZdotZ2_log.png\" alt=\"plots/ZZdotZ2_log.png\" width=\"100%\"></a></td>" << endl;
373 > //   htmlfile << "</tr>" << endl;
374 >
375 > //   htmlfile << "<tr>" << endl;
376 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/dphi1.png\"><img src=\"plots/dphi1.png\" alt=\"plots/dphi1.png\" width=\"100%\"></a></td>" << endl;
377 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/dphi2.png\"><img src=\"plots/dphi2.png\" alt=\"plots/dphi2.png\" width=\"100%\"></a></td>" << endl;
378 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/dphi1_log.png\"><img src=\"plots/dphi1_log.png\" alt=\"plots/dphi1_log.png\" width=\"100%\"></a></td>" << endl;
379 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/dphi2_log.png\"><img src=\"plots/dphi2_log.png\" alt=\"plots/dphi2_log.png\" width=\"100%\"></a></td>" << endl;
380 > //   htmlfile << "</tr>" << endl;
381 >
382 > //   htmlfile << "</table>" << endl;
383 > //   htmlfile << "<hr />" << endl;
384 > //   htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">weights & co.: " << endl;
385 > //   htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
386 >
387 > //   htmlfile << "<tr>" << endl;
388 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/run.png\"><img src=\"plots/run.png\" alt=\"plots/run.png\" width=\"100%\"></a></td>" << endl;
389 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/npu.png\"><img src=\"plots/npu.png\" alt=\"plots/npu.png\" width=\"100%\"></a></td>" << endl;
390 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/npv.png\"><img src=\"plots/npv.png\" alt=\"plots/npv.png\" width=\"100%\"></a></td>" << endl;
391 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
392 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
393 > //   htmlfile << "</tr>" << endl;
394 >
395 > //   htmlfile << "<tr>" << endl;
396 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/w.png\"><img src=\"plots/w.png\" alt=\"plots/w.png\" width=\"100%\"></a></td>" << endl;
397 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/npuw.png\"><img src=\"plots/npuw.png\" alt=\"plots/npuw.png\" width=\"100%\"></a></td>" << endl;
398 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/woff.png\"><img src=\"plots/woff.png\" alt=\"plots/woff.png\" width=\"100%\"></a></td>" << endl;
399 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/won.png\"><img src=\"plots/won.png\" alt=\"plots/won.png\" width=\"100%\"></a></td>" << endl;
400 > //   htmlfile << "</tr>" << endl;
401 >
402 > //   htmlfile << "<tr>" << endl;
403 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/nJets.png\"><img src=\"plots/nJets.png\" alt=\"plots/nJets.png\" width=\"100%\"></a></td>" << endl;
404 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ptJet1.png\"><img src=\"plots/ptJet1.png\" alt=\"plots/ptJet1.png\" width=\"100%\"></a></td>" << endl;
405 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/met.png\"><img src=\"plots/met.png\" alt=\"plots/met.png\" width=\"100%\"></a></td>" << endl;
406 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/metphi.png\"><img src=\"plots/metphi.png\" alt=\"plots/metphi.png\" width=\"100%\"></a></td>" << endl;
407 > //   htmlfile << "</tr>" << endl;
408 >
409 > //   htmlfile << "<tr>" << endl;
410 > //   htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/metDotZZ.png\"><img src=\"plots/metDotZZ.png\" alt=\"plots/metDotZZ.png\" width=\"100%\"></a></td>" << endl;
411 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
412 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
413 > //   htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
414 > //   htmlfile << "</tr>" << endl;
415  
416 <  htmlfile << "</table>" << endl;
417 <
166 <  htmlfile << "<hr />" << endl;
167 <
168 <  htmlfile << "<hr />" << endl;
416 > //   htmlfile << "</table>" << endl;
417 > //   htmlfile << "<hr />" << endl;
418      
419 <  htmlfile << "</body>" << endl;
420 <  htmlfile << "</html>" << endl;
421 <  htmlfile.close();
422 < }
419 > //   htmlfile << "</body>" << endl;
420 > //   htmlfile << "</html>" << endl;
421 > //   htmlfile.close();
422 > // }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines