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.5 by dkralph, Tue Oct 23 11:39:21 2012 UTC vs.
Revision 1.6 by dkralph, Mon Dec 17 12:34:08 2012 UTC

# Line 15 | Line 15
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
# Line 30 | Line 32 | using namespace mithep;
32  
33   TCanvas *can;
34   //----------------------------------------------------------------------------------------
35 < TString entry_str(TH1D *hist)
35 > TString entry_str(TH1D *hist, bool dummyStr=false)
36   {
37 +  if(dummyStr) return "";
38    stringstream ss;
39    ss << hist->GetEntries();
40    TString str;
# Line 39 | Line 42 | TString entry_str(TH1D *hist)
42    return str;
43   }
44   //----------------------------------------------------------------------------------------
45 < TString integral_str(TH1D *hist, int dummy, bool nullStr) { if(nullStr) return ""; }
43 < void makeHTML(FOFlags &ctrl, TString plotLabel);
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    SetStyle();
52 <
51 <  TFile *flatfile = TFile::Open("pass.root","recreate");
52 <  TTree *flattuple = new TTree("zznt","zznt");
53 <  unsigned run,evt,channel;
54 <  float m4lbrvar;
55 <  flattuple->Branch("run",&run);
56 <  flattuple->Branch("evt",&evt);
57 <  flattuple->Branch("m4l",&m4lbrvar);
58 <  flattuple->Branch("channel",&channel);
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 +  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"));
# Line 80 | Line 77 | int main(int argc, char** argv)
77        filestuff *fs = (cs->fsv)[ifs];
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          fs->getentry(ientry,"weights","zznt");
87          fs->getentry(ientry,"angles","zznt");
88 <        if(fs->get_zz_chain()->GetBranchStatus("smalljetinfo"))
89 <          fs->getentry(ientry,"smalljetinfo","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))) {
# Line 104 | Line 104 | int main(int argc, char** argv)
104  
105          double wgt(1);
106          if(!fs->isdata_) {
107 <          if(fs->weights->npuw < 0 || fs->weights->npuw > 2) cout << "wtf? " << fs->weights->npuw << endl;
108 <          wgt = fs->lumi_ * fs->weights->w * fs->weights->npuw * fs->weights->woff * fs->weights->won;
109 <          if(fs->dataset_.Contains("-dkr")) wgt = 1;
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");
114          // wgt = fs->kine->mZ1err;
117            wgt = fs->weights->w;
116          // if(ientry<100) cout << "multiplying by fake weight: " << fs->weights->w << endl;
118          }
119  
120 <        // if(fs->isdata_ && fs->fname_.Contains("r12c")) {
121 <          if(fs->kine->m4l > 110 && fs->kine->m4l < 140) continue;
122 <          if(fs->kine->m4l > 300) continue;
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 <        flattuple->Fill();
132 <
133 <        (*(cs->hists)["all"])["run"]->Fill(     fs->info->run  ,        wgt);
134 <        (*(cs->hists)["all"])["npu"]->Fill(     fs->info->npu  ,        wgt);
135 <        (*(cs->hists)["all"])["npv"]->Fill(     fs->info->npv  ,        wgt);
136 <        (*(cs->hists)["all"])["w"]->Fill(       fs->weights->w ,        1);
137 <        (*(cs->hists)["all"])["npuw"]->Fill(    fs->weights->npuw ,     1);
138 <        (*(cs->hists)["all"])["woff"]->Fill(    fs->weights->woff ,     1);
139 <        (*(cs->hists)["all"])["won"]->Fill(     fs->weights->won ,      1);
140 <
141 <        // sctructs for scaling
142 <        KinematicsStruct kine = *(fs->kine);
143 <        Angles angles = *(fs->angles);
144 <          
145 <        double mZ1 = kine.mZ1;
146 <        double mZ2 = kine.mZ2;
147 <        double m4l = kine.m4l;
148 <        (*(cs->hists)["all"])["mZ1"]->Fill(             mZ1  ,                          wgt);
146 <        (*(cs->hists)["all"])["mZ1_zoom"]->Fill(        mZ1  ,                          wgt);
147 <        (*(cs->hists)["all"])["mZ2"]->Fill(             mZ2  ,                          wgt);
148 <        (*(cs->hists)["all"])["m4l"]->Fill(             m4l  ,                          wgt);
149 <        (*(cs->hists)["all"])["m4l_lo"]->Fill(          m4l  ,                          wgt);
150 <
151 <        (*(cs->hists)["all"])["costheta1"]->Fill(       angles.costheta1 ,      wgt);
152 <        (*(cs->hists)["all"])["costheta2"]->Fill(       angles.costheta2 ,      wgt);
153 <        (*(cs->hists)["all"])["costhetastar"]->Fill(    angles.costhetastar ,   wgt);
154 <        (*(cs->hists)["all"])["Phi"]->Fill(             angles.Phi ,            wgt);
155 <        (*(cs->hists)["all"])["Phi1"]->Fill(            angles.Phi1 ,           wgt);
156 <
157 <        (*(cs->hists)["all"])["pt4l"]->Fill(            kine.ZZpt/m4l ,         wgt);
158 <        (*(cs->hists)["all"])["pt4l_log"]->Fill(        kine.ZZpt/m4l ,         wgt);
159 <        (*(cs->hists)["all"])["y4l"]->Fill(             kine.ZZy ,              wgt);
160 <        (*(cs->hists)["all"])["Z1pt"]->Fill(            kine.Z1pt/m4l ,         wgt);
161 <        (*(cs->hists)["all"])["Z1pt_log"]->Fill(        kine.Z1pt/m4l ,         wgt);
162 <        (*(cs->hists)["all"])["Z2pt"]->Fill(            kine.Z2pt/m4l ,         wgt);
163 <        (*(cs->hists)["all"])["Z2pt_log"]->Fill(        kine.Z2pt/m4l ,         wgt);
164 <
165 <        (*(cs->hists)["all"])["ZZdotZ1"]->Fill(         kine.ZZdotZ1/(m4l*mZ1) ,        wgt);
166 <        (*(cs->hists)["all"])["ZZdotZ2"]->Fill(         kine.ZZdotZ2/(m4l*mZ2) ,        wgt);
167 <        (*(cs->hists)["all"])["ZZdotZ1_log"]->Fill(     kine.ZZdotZ1/(m4l*mZ1) ,        wgt);
168 <        (*(cs->hists)["all"])["ZZdotZ2_log"]->Fill(     kine.ZZdotZ2/(m4l*mZ2) ,        wgt);
169 <        (*(cs->hists)["all"])["dphi1"]->Fill(           kine.ZZptZ1ptCosDphi,   wgt);
170 <        (*(cs->hists)["all"])["dphi2"]->Fill(           kine.ZZptZ2ptCosDphi ,    wgt);
171 <        (*(cs->hists)["all"])["dphi1_log"]->Fill(       kine.ZZptZ1ptCosDphi,   wgt);
172 <        (*(cs->hists)["all"])["dphi2_log"]->Fill(       kine.ZZptZ2ptCosDphi ,    wgt);
173 <
174 <        (*(cs->hists)["all"])["nJets"]->Fill(           fs->sji->nJets,                 wgt);
175 <        (*(cs->hists)["all"])["ptJet1"]->Fill(          fs->sji->ptJet1,                wgt);
176 <        (*(cs->hists)["all"])["met"]->Fill(             fs->info->met,                  wgt);
177 <        (*(cs->hists)["all"])["metphi"]->Fill(          fs->info->metphi,               wgt);
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=false;
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(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")) 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) : integral_str(hist);//integral_str(hist,999,true);
174 <        cplot.AddHist1D(hist,cs->legend+": "+tmpstr,plotShapesOnly ? TString("Ehist") : TString("E"),cs->color);
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,4)/*integral_str(hist,4,true)*/,cs->color);
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=="w" || var.Contains("_log")) cplot.SetLogy();
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 <      cplot.SetYRange(0,1.2*ymax);
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);
199 <  flatfile->Write();
200 <  // flatfile->Close();
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   //----------------------------------------------------------------------------------------
# Line 231 | Line 212 | map<TString,map<TString,TH1D*>* > init_h
212    map<TString,TH1D*> *h_all  = new map<TString,TH1D*>; hists["all"]  = h_all;
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 <  map<TString,map<TString,TH1D*>* >::iterator it_h;
218 <  int nbins=35;
219 <  for(it_h=hists.begin(); it_h!=hists.end(); it_h++) {
220 <    (*((*it_h).second))["run"]          = new TH1D(TString("run") +"_"+(*it_h).first+str,";#bf{run};",          nbins,160000,196600);   (*((*it_h).second))["run"]->Sumw2();
221 <    (*((*it_h).second))["npu"]          = new TH1D(TString("npu") +"_"+(*it_h).first+str,";#bf{NPU};",          50,-0.5,49.5);       (*((*it_h).second))["npu"]->Sumw2();
222 <    (*((*it_h).second))["npv"]          = new TH1D(TString("npv") +"_"+(*it_h).first+str,";#bf{NPV};",          50,-0.5,49.5);       (*((*it_h).second))["npv"]->Sumw2();
223 <
224 <    (*((*it_h).second))["w"]            = new TH1D(TString("w") +"_"+(*it_h).first+str,";#bf{W};",              nbins,.0000001,.01);    (*((*it_h).second))["w"]->Sumw2();
225 <    (*((*it_h).second))["npuw"]         = new TH1D(TString("npuw") +"_"+(*it_h).first+str,";#bf{NPUW};",        nbins,0,4);             (*((*it_h).second))["npuw"]->Sumw2();
226 <    (*((*it_h).second))["woff"]         = new TH1D(TString("woff") +"_"+(*it_h).first+str,";#bf{WOFF};",        nbins,.5,1.5);          (*((*it_h).second))["woff"]->Sumw2();
227 <    (*((*it_h).second))["won"]          = new TH1D(TString("won") +"_"+(*it_h).first+str,";#bf{WON};",          nbins,.5,1.5);          (*((*it_h).second))["won"]->Sumw2();
228 <
229 <    (*((*it_h).second))["mZ1"]          = new TH1D(TString("mZ1") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",    nbins,30,130);          (*((*it_h).second))["mZ1"]->Sumw2();
230 <    (*((*it_h).second))["mZ1_zoom"]     = new TH1D(TString("mZ1_zoom") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",nbins,75,105);          (*((*it_h).second))["mZ1_zoom"]->Sumw2();
231 <    (*((*it_h).second))["mZ2"]          = new TH1D(TString("mZ2") +"_"+(*it_h).first+str,";#bf{mZ2 [GeV]};",    nbins,0,60);          (*((*it_h).second))["mZ2"]->Sumw2();
232 <    (*((*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();
233 <    (*((*it_h).second))["m4l"]          = new TH1D(TString("m4l") +"_"+(*it_h).first+str,";#bf{m4l [GeV]};",    nbins,90,600);          (*((*it_h).second))["m4l"]->Sumw2();
234 <
235 <    (*((*it_h).second))["costheta1"]    = new TH1D(TString("costheta1") +"_"+(*it_h).first+str,";#bf{costheta1};",      nbins,-1,1);          (*((*it_h).second))["costheta1"]->Sumw2();
236 <    (*((*it_h).second))["costheta2"]    = new TH1D(TString("costheta2") +"_"+(*it_h).first+str,";#bf{costheta2};",      nbins,-1,1);          (*((*it_h).second))["costheta2"]->Sumw2();
237 <    (*((*it_h).second))["costhetastar"] = new TH1D(TString("costhetastar") +"_"+(*it_h).first+str,";#bf{costhetastar};",nbins,-1,1);          (*((*it_h).second))["costhetastar"]->Sumw2();
238 <    (*((*it_h).second))["Phi"]          = new TH1D(TString("Phi") +"_"+(*it_h).first+str,";#bf{Phi};",                  nbins,-3.15,3.15);          (*((*it_h).second))["Phi"]->Sumw2();
239 <    (*((*it_h).second))["Phi1"]         = new TH1D(TString("Phi1") +"_"+(*it_h).first+str,";#bf{Phi1};",                nbins,-3.15,3.15);          (*((*it_h).second))["Phi1"]->Sumw2();
240 <
241 <    (*((*it_h).second))["pt4l"]         = new TH1D(TString("pt4l") +"_"+(*it_h).first+str,";#bf{pt4l/m4l};",                nbins,0,0.5);          (*((*it_h).second))["pt4l"]->Sumw2();
242 <    (*((*it_h).second))["pt4l_log"]     = new TH1D(TString("pt4l_log") +"_"+(*it_h).first+str,";#bf{pt4l/m4l};",            nbins,0,1.5);          (*((*it_h).second))["pt4l_log"]->Sumw2();
243 <    (*((*it_h).second))["y4l"]          = new TH1D(TString("y4l") +"_"+(*it_h).first+str,";#bf{y4l};",                  nbins,-2.4,2.4);      (*((*it_h).second))["y4l"]->Sumw2();
244 <    (*((*it_h).second))["Z1pt"]         = new TH1D(TString("Z1pt") +"_"+(*it_h).first+str,";#bf{Z1pt/m4l};",                nbins,0,0.5);          (*((*it_h).second))["Z1pt"]->Sumw2();
245 <    (*((*it_h).second))["Z1pt_log"]     = new TH1D(TString("Z1pt_log") +"_"+(*it_h).first+str,";#bf{Z1pt/m4l};",            nbins,0,1.5);          (*((*it_h).second))["Z1pt_log"]->Sumw2();
246 <    (*((*it_h).second))["Z2pt"]         = new TH1D(TString("Z2pt") +"_"+(*it_h).first+str,";#bf{Z2pt/m4l};",                nbins,0,0.5);          (*((*it_h).second))["Z2pt"]->Sumw2();
247 <    (*((*it_h).second))["Z2pt_log"]     = new TH1D(TString("Z2pt_log") +"_"+(*it_h).first+str,";#bf{Z2pt/m4l};",            nbins,0,1.5);          (*((*it_h).second))["Z2pt_log"]->Sumw2();
248 <
249 <    (*((*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();
250 <    (*((*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();
251 <    (*((*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();
252 <    (*((*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();
253 <    (*((*it_h).second))["dphi1"]        = new TH1D(TString("dphi1") +"_"+(*it_h).first+str,";#bf{dphi1};",              nbins,-1,1);          (*((*it_h).second))["dphi1"]->Sumw2();
254 <    (*((*it_h).second))["dphi2"]        = new TH1D(TString("dphi2") +"_"+(*it_h).first+str,";#bf{dphi2};",              nbins,-1,1);          (*((*it_h).second))["dphi2"]->Sumw2();
255 <    (*((*it_h).second))["dphi1_log"]    = new TH1D(TString("dphi1_log") +"_"+(*it_h).first+str,";#bf{dphi1};",          nbins,-1,1);          (*((*it_h).second))["dphi1_log"]->Sumw2();
256 <    (*((*it_h).second))["dphi2_log"]    = new TH1D(TString("dphi2_log") +"_"+(*it_h).first+str,";#bf{dphi2};",          nbins,-1,1);          (*((*it_h).second))["dphi2_log"]->Sumw2();
257 <
258 <    (*((*it_h).second))["nJets"]                = new TH1D(TString("nJets") +"_"+(*it_h).first+str,";#bf{nJets};",                  12,0.5,12.5);          (*((*it_h).second))["nJets"]->Sumw2();
259 <    (*((*it_h).second))["ptJet1"]               = new TH1D(TString("ptJet1") +"_"+(*it_h).first+str,";#bf{ptJet1};",                nbins,0,150);          (*((*it_h).second))["ptJet1"]->Sumw2();
260 <
261 <    (*((*it_h).second))["met"]                  = new TH1D(TString("met") +"_"+(*it_h).first+str,";#bf{met};",                      nbins,0,40);          (*((*it_h).second))["met"]->Sumw2();
262 <    (*((*it_h).second))["metphi"]               = new TH1D(TString("metphi") +"_"+(*it_h).first+str,";#bf{metphi};",                nbins,-3.15,3.15);          (*((*it_h).second))["metphi"]->Sumw2();
263 <    (*((*it_h).second))["metDotZZ"]             = new TH1D(TString("metDotZZ") +"_"+(*it_h).first+str,";#bf{metDotZZ};",            nbins,-500,500);          (*((*it_h).second))["metDotZZ"]->Sumw2();
264 <  }
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=\"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.png\"><img src=\"plots/mZ1.png\" alt=\"plots/mZ1.png\" width=\"100%\"></a></td>" << endl;
310 <  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;
311 <  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;
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/m4l_lo.png\"><img src=\"plots/m4l_lo.png\" alt=\"plots/m4l_lo.png\" width=\"100%\"></a></td>" << endl;
317 <  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;
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 << "</table>" << endl;
323 <  htmlfile << "<hr />" << endl;
324 <  htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">Angles: " << endl;
325 <  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
326 <
327 <  htmlfile << "<tr>" << endl;
328 <  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;
329 <  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;
330 <  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;
331 <  htmlfile << "<td width=\"25%\"></td>" << endl;
332 <  htmlfile << "</tr>" << endl;
333 <
334 <  htmlfile << "<tr>" << endl;
335 <  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;
336 <  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;
337 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
338 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
339 <  htmlfile << "</tr>" << endl;
340 <
341 <  htmlfile << "</table>" << endl;
342 <  htmlfile << "<hr />" << endl;
343 <  htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">Boson pt variables: " << endl;
344 <  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
345 <
346 <  htmlfile << "<tr>" << endl;
347 <  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;
348 <  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;
349 <  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;
350 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
351 <  htmlfile << "<tr>" << endl;
352 <
353 <  htmlfile << "</tr>" << endl;
354 <  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;
355 <  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;
356 <  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;
357 <  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;
358 <  htmlfile << "</tr>" << endl;
359 <
360 <  htmlfile << "<tr>" << endl;
361 <  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;
362 <  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;
363 <  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;
364 <  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;
365 <  htmlfile << "</tr>" << endl;
366 <
367 <  htmlfile << "<tr>" << endl;
368 <  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;
369 <  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;
370 <  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;
371 <  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;
372 <  htmlfile << "</tr>" << endl;
373 <
374 <  htmlfile << "</table>" << endl;
375 <  htmlfile << "<hr />" << endl;
376 <  htmlfile << "<h3 style=\"text-align:left; color:DD6600;\">weights & co.: " << endl;
377 <  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
378 <
379 <  htmlfile << "<tr>" << endl;
380 <  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;
381 <  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;
382 <  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;
383 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
384 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
385 <  htmlfile << "</tr>" << endl;
386 <
387 <  htmlfile << "<tr>" << endl;
388 <  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;
389 <  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;
390 <  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;
391 <  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;
392 <  htmlfile << "</tr>" << endl;
393 <
394 <  htmlfile << "<tr>" << endl;
395 <  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;
396 <  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;
397 <  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;
398 <  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;
399 <  htmlfile << "</tr>" << endl;
400 <
401 <  htmlfile << "<tr>" << endl;
402 <  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;
403 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
404 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
405 <  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
406 <  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 <  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