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

Comparing UserCode/MitHzz4l/NonMCBackground/src/plotZPlusFake.cc (file contents):
Revision 1.1 by dkralph, Fri Jul 6 22:27:04 2012 UTC vs.
Revision 1.4 by dkralph, Mon Jul 16 10:21:13 2012 UTC

# Line 18 | Line 18
18   #include "RooExponential.h"
19   #include "RooExtendPdf.h"
20  
21 + #include "RunLumiSet.h"
22 +
23   #include "TCanvas.h"
24   #include "TChain.h"
25   #include "TString.h"
# Line 30 | Line 32
32   #include "fake_defs.h"
33   #include "Various.h"
34   #include "CommonDefs.h"
35 + #include "PlotHeaders.h"
36  
37   #ifndef CMSSW_BASE
38   #define CMSSW_BASE "../../"
# Line 37 | Line 40
40  
41   using namespace std;
42   using namespace RooFit;
43 + using namespace mithep;
44  
45   TCanvas *can;
46  
47   void fillHist(CSample *cs, TString channel, TString type, TString var, double val, double wgt, double wgt_lo=0, double wgt_hi=0);
48 < void makeHTML(FOFlags &ctrl, TString type);
48 > void makeHTML(FOFlags &ctrl, TString type, TString plotLabel);
49   map<TString,map<TString,TH1D*>* > init_hists(FOFlags &ctrl, TString str="");
50   TString f_to_a(double val) { stringstream ss; ss << fixed << setprecision(2) << val; return TString(ss.str().c_str()); }
51  
# Line 49 | Line 53 | TString f_to_a(double val) { stringstrea
53   int main(int argc, char** argv)
54   {
55    double lumi = 5000;
52  // UInt_t minRun=999999999,maxRun=0;
56  
57    FOFlags ctrl;
58    parse_foargs( argc, argv, ctrl );
# Line 57 | Line 60 | int main(int argc, char** argv)
60  
61    can = new TCanvas("can","can");
62  
63 <  // FR_struct fr = initFRs(ctrl.mufakedir+"/fr.root",ctrl.elefakedir+"/fr.root");
64 <  FR_struct fr = initFRs(ctrl.mufakedir,ctrl.elefakedir);
63 >  FR_struct fr2011 = initFRs(ctrl.mufakefile2011,ctrl.elefakefile2011);
64 >  FR_struct fr2012 = initFRs(ctrl.mufakefile2012,ctrl.elefakefile2012);
65  
66    TString cmsswpath(CMSSW_BASE + TString("/src"));
67    string xspath = (string(cmsswpath)+"/MitPhysics/data/xs.dat");
68    SimpleTable xstab(xspath.c_str());
69  
70    vector<CSample*> samplev;
71 +  TString ntupledir(""),label(""),plotLabel(""),jsonFile("");
72 +  readConfigFile(ctrl.config, ntupledir, label, plotLabel, jsonFile, samplev, &ctrl, init_hists);
73  
74 <  ifstream instream;
75 <  instream.open(ctrl.config); assert(instream.is_open());
71 <  TString ntupledir;
72 <  string line;
73 <  while(getline(instream,line)) {
74 <    if(line[0]=='#') continue;
75 <
76 <    stringstream ss(line);
77 <    if(line[0]=='^') {
78 <      TString dummy;
79 <      if(TString(line).Contains("^ntupdir")) ss >> dummy >> ntupledir;
80 <      // if(TString(line).Contains("^skim")) ss >> dummy >> ntupledir;
81 <      continue;
82 <    }
83 <
84 <    if(line[0]=='$') {
85 <      samplev.push_back(new CSample());
86 <      stringstream ss(line);
87 <      string chr;
88 <      TString sname;
89 <      Int_t color;
90 <      ss >> chr >> sname >> color;
91 <      string legend = line.substr(line.find('@')+1);
92 <      samplev.back()->name  = sname;
93 <      samplev.back()->legend = legend;
94 <      samplev.back()->color = color;
95 <      samplev.back()->hists = init_hists(ctrl,sname);
96 <      continue;
97 <    }
98 <    
99 <    TString dset;
100 <    bool isdata;
101 <    double xsec;
102 <    ss >> dset >> isdata >> xsec;
103 <    assert(ctrl.muSele==ctrl.eleSele);
104 <    TString fname = ntupledir+"/"+ctrl.muSele+"/"+dset+"/merged.root";
105 <    samplev.back()->isdata = isdata;
106 <    (samplev.back()->fsv).push_back(new filestuff(dset,fname,dset,isdata));
107 <  }
108 <  instream.close();
109 <
110 <
111 <  vector<pair<unsigned,unsigned> > runEvtv; // vector to veto duplicate events
74 >  RunLumiSet rls;
75 >  UInt_t minRun=999999999,maxRun=0;
76    for(unsigned ics=0; ics<samplev.size(); ics++) {
77      CSample *cs = samplev[ics];
78      cout << cs->name << endl;
79      for(unsigned ifs=0; ifs<(cs->fsv).size(); ifs++) {
80        filestuff *fs = (cs->fsv)[ifs];
81        cout << "\t" << fs->fname_ << endl;
82 +      FR_struct *fr = (fs->era_==2011) ? &fr2011 : &fr2012;
83 +      unsigned nDuplSkipped=0;
84        for(unsigned ientry=0; ientry<fs->getentries("FOtree"); ientry++) {
85          fs->getentry(ientry,"","FOtree");
86          fs->getentry(ientry,"info","zznt");
87 <        // if(fs->isdata_) {
88 <        //   if(fs->info->run < minRun) minRun = fs->info->run;
89 <        //   if(fs->info->run > maxRun) maxRun = fs->info->run;
90 <        // }
91 <        bool dupl=false;
92 <        for(unsigned ievt=0; ievt<runEvtv.size(); ievt++) {
93 <          if( (runEvtv[ievt].first == fs->info->run) && (runEvtv[ievt].second == fs->info->evt) ) {
128 <            // cout << "found duplicate event!" << setw(12) << fs->info->run << setw(12) << fs->info->evt << endl;
129 <            dupl = true;
130 <          }
87 >
88 >        if(fs->isdata_) {
89 >          setMinMaxRun(fs->info->run, minRun, maxRun);
90 >          bool dupl = takeCareOfDuplicateEvents(fs->info->run, fs->info->evt, rls, nDuplSkipped);
91 >          if(dupl) continue;
92 >          pair<unsigned,unsigned> rl(fs->info->run, fs->info->lumi);
93 >          if(!fs->rlrm_.HasRunLumi(rl)) continue;
94          }
132        if(dupl) continue;
133        runEvtv.push_back(pair<unsigned,unsigned> (fs->info->run,fs->info->evt));
95  
96          double wgt=1;
97 <        // if(!fs->isdata_) {
98 <        //   double xsWgt = lumi*xstab.Get(fs->dataset_)/fs->total_entries_;
99 <        //   double puWgt = weightTrue2012(fs->info->npu);
100 <        //   wgt = xsWgt*puWgt;
101 <        // }
97 >        if(!fs->isdata_) {
98 >          double xsWgt = lumi*xstab.Get(fs->dataset_)/fs->total_entries_;
99 >          // double puWgt = weightTrue2012(fs->info->npu);
100 >          wgt = xsWgt;//*puWgt;
101 >          // cout << "npu: " << fs->info->npu
102 >        }
103 >
104 >        if(fs->info->met > 25) continue;
105  
106          unsigned npass = fs->passingL->size();
107          unsigned nfail = fs->failingL->size();
144        // if(npass > 2) continue; // exclude signal region (???)
108  
109          float best_z_mass = -99999;
110          pair<int,int> best_z_indices;
# Line 186 | Line 149 | int main(int argc, char** argv)
149            types.push_back("fail");
150          }
151  
152 +        if(npass>3) continue;
153 +
154          for(unsigned iextra=0; iextra<ex_leps.size(); iextra++) {
155            SimpleLepton ex_lep = ex_leps[iextra];
156  
157 +          if(types[iextra]=="fail" && npass>2) continue;
158 +          SimpleLepton lep1=evtdata.Z1leptons[0],lep2=evtdata.Z1leptons[1];
159 +          if( dr(lep1,ex_lep) < 0.3) continue;
160 +          if( dr(lep2,ex_lep) < 0.3) continue;
161 +          
162 +
163            TString channel;
164            if(abs(ex_lep.type) == 13) channel = "mu";
165            if(abs(ex_lep.type) == 11) channel = "ele";
# Line 206 | Line 177 | int main(int argc, char** argv)
177            //????????????????????????????????????????????????????????????????????????????????????????
178            KinematicsStruct kine;
179            fillKinematics(evtdata,kine);
180 +          TLorentzVector l1l3(lep1.vec+ex_lep.vec);
181 +          TLorentzVector l2l3(lep2.vec+ex_lep.vec);
182  
183            if(types[iextra]=="pass") {
184              fillHist( cs, channel, "obs", "run",       fs->info->run  ,                 wgt);
185              fillHist( cs, channel, "obs", "mZ1",       kine.mZ1  ,                      wgt);                
186              fillHist( cs, channel, "obs", "Z1pt",      kine.Z1pt ,                      wgt);                
187 <            fillHist( cs, channel, "obs", "ip3ds_l1",  evtdata.Z1leptons[0].ip3dSig ,   wgt);
188 <            fillHist( cs, channel, "obs", "ip3ds_l2",  evtdata.Z1leptons[1].ip3dSig ,   wgt);
189 <            fillHist( cs, channel, "obs", "ip3ds_l3",  evtdata.Z2leptons[0].ip3dSig ,   wgt);
190 <            fillHist( cs, channel, "obs", "pt_l1",     evtdata.Z1leptons[0].vec.Pt() ,  wgt);
191 <            fillHist( cs, channel, "obs", "pt_l2",     evtdata.Z1leptons[1].vec.Pt() ,  wgt);
187 >            fillHist( cs, channel, "obs", "ip3ds_l1",  lep1.ip3dSig ,                   wgt);
188 >            fillHist( cs, channel, "obs", "ip3ds_l2",  lep2.ip3dSig ,                   wgt);
189 >            fillHist( cs, channel, "obs", "ip3ds_l3",  ex_lep.ip3dSig ,                 wgt);
190 >            fillHist( cs, channel, "obs", "pt_l1",     lep1.vec.Pt() ,                  wgt);
191 >            fillHist( cs, channel, "obs", "pt_l2",     lep2.vec.Pt() ,                  wgt);
192              fillHist( cs, channel, "obs", "pt_l3",     ex_lep.vec.Pt() ,                wgt);
193 <            fillHist( cs, channel, "obs", "eta_l1",    evtdata.Z1leptons[0].vec.Eta(), wgt);
194 <            fillHist( cs, channel, "obs", "eta_l2",    evtdata.Z1leptons[1].vec.Eta(), wgt);
195 <            fillHist( cs, channel, "obs", "eta_l3",    ex_lep.vec.Eta(),               wgt);
193 >            fillHist( cs, channel, "obs", "pt_l3_lo",     ex_lep.vec.Pt() ,             wgt);
194 >            fillHist( cs, channel, "obs", "eta_l1",    lep1.vec.Eta(),                  wgt);
195 >            fillHist( cs, channel, "obs", "eta_l2",    lep2.vec.Eta(),                  wgt);
196 >            fillHist( cs, channel, "obs", "eta_l3",    ex_lep.vec.Eta(),                wgt);
197 >            fillHist( cs, channel, "obs", "dR_l1l3_lo",dr(lep1,ex_lep),                 wgt);
198 >            fillHist( cs, channel, "obs", "dR_l1l3",   dr(lep1,ex_lep),                 wgt);
199 >            fillHist( cs, channel, "obs", "dR_l2l3_lo",dr(lep2,ex_lep),                 wgt);
200 >            fillHist( cs, channel, "obs", "dR_l2l3",   dr(lep2,ex_lep),                 wgt);
201 >            fillHist( cs, channel, "obs", "ml1l3",     l1l3.M(),                        wgt);
202 >            fillHist( cs, channel, "obs", "ml2l3",     l2l3.M(),                        wgt);
203 >            fillHist( cs, channel, "obs", "met",       fs->info->met,                   wgt);
204            } else if(types[iextra]=="fail") {
205 <            double fwgt    = get_fake_weight("",ex_lep,fr);
206 <            double fwgt_lo = get_fake_weight("lo",ex_lep,fr);
207 <            double fwgt_hi = get_fake_weight("hi",ex_lep,fr);
205 >            double fwgt    = get_fake_weight("",ex_lep,*fr);
206 >            double fwgt_lo = get_fake_weight("lo",ex_lep,*fr);
207 >            double fwgt_hi = get_fake_weight("hi",ex_lep,*fr);
208              double centr = wgt*fwgt;
209              double lo    = wgt*fwgt_lo;
210              double hi    = wgt*fwgt_hi;
211 <            fillHist( cs, channel, "pred", "run",       fs->info->run,                  centr, lo, hi);
212 <            fillHist( cs, channel, "pred", "mZ1",       kine.mZ1,                       centr, lo, hi);
213 <            fillHist( cs, channel, "pred", "Z1pt",      kine.Z1pt,                      centr, lo, hi);
214 <            fillHist( cs, channel, "pred", "ip3ds_l1",  evtdata.Z1leptons[0].ip3dSig,   centr, lo, hi);
215 <            fillHist( cs, channel, "pred", "ip3ds_l2",  evtdata.Z1leptons[1].ip3dSig,   centr, lo, hi);
216 <            fillHist( cs, channel, "pred", "ip3ds_l3",  ex_lep.ip3dSig,                 centr, lo, hi);
217 <            fillHist( cs, channel, "pred", "pt_l1",     evtdata.Z1leptons[0].vec.Pt(),  centr, lo, hi);
218 <            fillHist( cs, channel, "pred", "pt_l2",     evtdata.Z1leptons[1].vec.Pt(),  centr, lo, hi);
219 <            fillHist( cs, channel, "pred", "pt_l3",     ex_lep.vec.Pt(),                centr, lo, hi);
220 <            fillHist( cs, channel, "pred", "eta_l1",    evtdata.Z1leptons[0].vec.Eta(), centr, lo, hi);
221 <            fillHist( cs, channel, "pred", "eta_l2",    evtdata.Z1leptons[1].vec.Eta(), centr, lo, hi);
222 <            fillHist( cs, channel, "pred", "eta_l3",    ex_lep.vec.Eta(),               centr, lo, hi);
211 >
212 >            fillHist( cs, channel, "pred", "run",       fs->info->run,          centr, lo, hi);
213 >            fillHist( cs, channel, "pred", "mZ1",       kine.mZ1,               centr, lo, hi);
214 >            fillHist( cs, channel, "pred", "Z1pt",      kine.Z1pt,              centr, lo, hi);
215 >            fillHist( cs, channel, "pred", "ip3ds_l1",  lep1.ip3dSig,           centr, lo, hi);
216 >            fillHist( cs, channel, "pred", "ip3ds_l2",  lep2.ip3dSig,           centr, lo, hi);
217 >            fillHist( cs, channel, "pred", "ip3ds_l3",  ex_lep.ip3dSig,         centr, lo, hi);
218 >            fillHist( cs, channel, "pred", "pt_l1",     lep1.vec.Pt(),          centr, lo, hi);
219 >            fillHist( cs, channel, "pred", "pt_l2",     lep2.vec.Pt(),          centr, lo, hi);
220 >            fillHist( cs, channel, "pred", "pt_l3",     ex_lep.vec.Pt(),        centr, lo, hi);
221 >            fillHist( cs, channel, "pred", "pt_l3_lo",  ex_lep.vec.Pt(),        centr, lo, hi);
222 >            fillHist( cs, channel, "pred", "eta_l1",    lep1.vec.Eta(),         centr, lo, hi);
223 >            fillHist( cs, channel, "pred", "eta_l2",    lep2.vec.Eta(),         centr, lo, hi);
224 >            fillHist( cs, channel, "pred", "eta_l3",    ex_lep.vec.Eta(),       centr, lo, hi);
225 >            fillHist( cs, channel, "pred", "dR_l1l3_lo",dr(lep1,ex_lep),        centr, lo, hi);
226 >            fillHist( cs, channel, "pred", "dR_l1l3",   dr(lep1,ex_lep),        centr, lo, hi);
227 >            fillHist( cs, channel, "pred", "dR_l2l3_lo",dr(lep2,ex_lep),        centr, lo, hi);
228 >            fillHist( cs, channel, "pred", "dR_l2l3",   dr(lep2,ex_lep),        centr, lo, hi);
229 >            fillHist( cs, channel, "pred", "ml1l3",     l1l3.M(),               centr, lo, hi);
230 >            fillHist( cs, channel, "pred", "ml2l3",     l2l3.M(),               centr, lo, hi);
231 >            fillHist( cs, channel, "pred", "met",       fs->info->met,          centr, lo, hi);
232            } else assert(0);
233          }
234        }
235 +      cout << "\t\tWARNING: skipped " << nDuplSkipped << " duplicate events" << endl;
236      }
237    }
238 <  // cout << setw(12) << minRun << setw(12) << maxRun << endl;
238 >  cout << "run range: " << setw(12) << minRun << setw(12) << maxRun << endl;
239  
240    assert(samplev.size()>0);
241    vector<TString> typev;
# Line 253 | Line 244 | int main(int argc, char** argv)
244    typev.push_back("ele");
245    for(unsigned itype=0; itype<typev.size(); itype++) {
246      TString type(typev[itype]);
247 <    TFile runHistFile(ctrl.outdir+"/"+type+"/runs.root","recreate");
247 >    gSystem->mkdir(ctrl.outdir+"/"+plotLabel+"/"+type,true);
248 >    TFile runHistFile(ctrl.outdir+"/"+plotLabel+"/"+type+"/runs.root","recreate");
249      map<TString,TH1D*>::iterator it_v;
250      for(it_v=(*(samplev[0]->hists)[type+"_obs"]).begin(); it_v!=(*(samplev[0]->hists)[type+"_obs"]).end(); it_v++) {
251        TString var((*it_v).first);
252 <      CPlot cplot(var,"",(*(samplev[0]->hists)[type+"_obs"])[var]->GetXaxis()->GetTitle(),"events",ctrl.outdir+"/"+type+"/plots");
252 >      CPlot cplot(var,"",(*(samplev[0]->hists)[type+"_obs"])[var]->GetXaxis()->GetTitle(),"events",ctrl.outdir+"/"+plotLabel+"/"+type+"/plots");
253 >      double ymax=0;
254        for(unsigned isam=0; isam<samplev.size(); isam++) {
255          CSample *cs = samplev[isam];
256          TH1D *hObs = (*(cs->hists)[type+"_obs"])[var];
# Line 265 | Line 258 | int main(int argc, char** argv)
258          TH1D *hPred_lo = (*(cs->hists)[type+"_pred_lo"])[var];
259          TH1D *hPred_hi = (*(cs->hists)[type+"_pred_hi"])[var];
260          if(cs->isdata) {
261 <          cplot.AddHist1D(hObs,"data: "+integral_str(hObs),"E");
261 >          cplot.AddHist1D(hObs,cs->legend+": "+integral_str(hObs),"E");
262            double ratio = integrateHist(hObs) / integrateHist(hPred);
263            cplot.AddHist1D(hPred,"FR predic: "+integral_str(hPred),"hist",kRed);
264            cplot.AddHist1D(hPred_lo,"stat lo: "+integral_str(hPred_lo),"hist",kRed,kDashed);
265            cplot.AddHist1D(hPred_hi,"stat hi: "+integral_str(hPred_hi),"hist",kRed,kDashed);
266 +          ymax = max(ymax,histMax(hObs,hPred));
267          } else {
268 <          cplot.AddToStack(hObs,"mc: "+integral_str(hObs),kCyan-6);
268 >          cplot.AddToStack(hObs,cs->legend+": "+integral_str(hObs),kCyan-6);
269 >          ymax = max(ymax,histMax(hObs,hPred));
270          }
271          if(cs->isdata && var=="run") {
272            assert(hObs->GetBinContent(0)==0 && hObs->GetBinContent(hObs->GetXaxis()->GetNbins()+1)==0);
273            hObs->Write("runs");
274          }
275          if(var.Contains("ip3d")) {
281          cplot.SetLogy();
276            double maxVal = max(hObs->GetMaximum(), hPred->GetMaximum());
277            double isoMin = 0.00005*maxVal;
278            double isoMax = 1.8*maxVal;
279            cplot.SetYRange(isoMin,isoMax);
280 +          cplot.SetLogy();
281 +        } else {
282 +          cplot.SetYRange(0,1.2*ymax);
283          }
284 +                  
285        }
286        cplot.Draw(can,true,"png");
287      }
288      runHistFile.Close();
289 <    makeHTML(ctrl,type);
289 >    makeHTML(ctrl,type, plotLabel);
290    }
291   }
292   //----------------------------------------------------------------------------------------
# Line 314 | Line 312 | map<TString,map<TString,TH1D*>* > init_h
312    map<TString,map<TString,TH1D*>* >::iterator it_h;
313    for(it_h=hists.begin(); it_h!=hists.end(); it_h++) {
314      (*((*it_h).second))["run"]          = new TH1D(TString("run") +"_"+(*it_h).first+str,";#bf{run};",          50,160800,196535);   (*((*it_h).second))["run"]->Sumw2();
315 <    (*((*it_h).second))["mZ1"]          = new TH1D(TString("mZ1") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",    20,60,120);          (*((*it_h).second))["mZ1"]->Sumw2();
316 <    (*((*it_h).second))["Z1pt"]         = new TH1D(TString("Z1pt") +"_"+(*it_h).first+str,";#bf{Z1pt [GeV]};",  20,0,200);           (*((*it_h).second))["Z1pt"]->Sumw2();
315 >    (*((*it_h).second))["mZ1"]          = new TH1D(TString("mZ1") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",    37,70,110);          (*((*it_h).second))["mZ1"]->Sumw2();
316 >    (*((*it_h).second))["Z1pt"]         = new TH1D(TString("Z1pt") +"_"+(*it_h).first+str,";#bf{Z1pt [GeV]};",  37,0,100);           (*((*it_h).second))["Z1pt"]->Sumw2();
317  
318      (*((*it_h).second))["pt_l1"]        = new TH1D(TString("pt_l1") +"_"+(*it_h).first+str,";#bf{l1 p_{T} [GeV]};",     37,0,120);  (*((*it_h).second))["pt_l1"]->Sumw2();
319 <    (*((*it_h).second))["pt_l2"]        = new TH1D(TString("pt_l2") +"_"+(*it_h).first+str,";#bf{l2 p_{T} [GeV]};",     37,0,65);  (*((*it_h).second))["pt_l2"]->Sumw2();
320 <    (*((*it_h).second))["pt_l3"]        = new TH1D(TString("pt_l3") +"_"+(*it_h).first+str,";#bf{l3 p_{T} [GeV]};",     37,0,50);  (*((*it_h).second))["pt_l3"]->Sumw2();
319 >    (*((*it_h).second))["pt_l2"]        = new TH1D(TString("pt_l2") +"_"+(*it_h).first+str,";#bf{l2 p_{T} [GeV]};",     37,0,65);   (*((*it_h).second))["pt_l2"]->Sumw2();
320 >    (*((*it_h).second))["pt_l3_lo"]     = new TH1D(TString("pt_l3_lo") +"_"+(*it_h).first+str,";#bf{l3_lo p_{T} [GeV]};",37,3,15);  (*((*it_h).second))["pt_l3_lo"]->Sumw2();
321 >    (*((*it_h).second))["pt_l3"]        = new TH1D(TString("pt_l3") +"_"+(*it_h).first+str,";#bf{l3 p_{T} [GeV]};",     37,10,40);   (*((*it_h).second))["pt_l3"]->Sumw2();
322  
323      (*((*it_h).second))["eta_l1"]       = new TH1D(TString("eta_l1")+"_"+(*it_h).first+str,";#bf{l1 #eta};",            25,-2.5,2.5);     (*((*it_h).second))["eta_l1"]->Sumw2();
324      (*((*it_h).second))["eta_l2"]       = new TH1D(TString("eta_l2")+"_"+(*it_h).first+str,";#bf{l2 #eta};",            25,-2.5,2.5);     (*((*it_h).second))["eta_l2"]->Sumw2();
325      (*((*it_h).second))["eta_l3"]       = new TH1D(TString("eta_l3")+"_"+(*it_h).first+str,";#bf{l3 #eta};",            25,-2.5,2.5);     (*((*it_h).second))["eta_l3"]->Sumw2();
326  
327 <    (*((*it_h).second))["ip3ds_l1"]     = new TH1D(TString("ip3ds_l1") +"_"+(*it_h).first+str,";#bf{ip3ds l1};",30,0,10);   (*((*it_h).second))["ip3ds_l1"]->Sumw2();
328 <    (*((*it_h).second))["ip3ds_l2"]     = new TH1D(TString("ip3ds_l2") +"_"+(*it_h).first+str,";#bf{ip3ds l2};",30,0,10);   (*((*it_h).second))["ip3ds_l2"]->Sumw2();
329 <    (*((*it_h).second))["ip3ds_l3"]     = new TH1D(TString("ip3ds_l3") +"_"+(*it_h).first+str,";#bf{ip3ds l3};",30,0,8);   (*((*it_h).second))["ip3ds_l3"]->Sumw2();
327 >    (*((*it_h).second))["ip3ds_l1"]     = new TH1D(TString("ip3ds_l1") +"_"+(*it_h).first+str,";#bf{ip3ds l1};",30,-10,10);   (*((*it_h).second))["ip3ds_l1"]->Sumw2();
328 >    (*((*it_h).second))["ip3ds_l2"]     = new TH1D(TString("ip3ds_l2") +"_"+(*it_h).first+str,";#bf{ip3ds l2};",30,-10,10);   (*((*it_h).second))["ip3ds_l2"]->Sumw2();
329 >    (*((*it_h).second))["ip3ds_l3"]     = new TH1D(TString("ip3ds_l3") +"_"+(*it_h).first+str,";#bf{ip3ds l3};",30,-10,10);   (*((*it_h).second))["ip3ds_l3"]->Sumw2();
330 >
331 >    (*((*it_h).second))["dR_l1l3_lo"]   = new TH1D(TString("dR_l1l3_lo") +"_"+(*it_h).first+str,";#bf{#Delta R l3,l4};",75,0,.2);    (*((*it_h).second))["dR_l1l3_lo"]->Sumw2();
332 >    (*((*it_h).second))["dR_l1l3"]      = new TH1D(TString("dR_l1l3") +"_"+(*it_h).first+str,";#bf{#Delta R l3,l4};",75,0,6);        (*((*it_h).second))["dR_l1l3"]->Sumw2();
333 >    (*((*it_h).second))["dR_l2l3_lo"]   = new TH1D(TString("dR_l2l3_lo") +"_"+(*it_h).first+str,";#bf{#Delta R l3,l4};",75,0,.2);    (*((*it_h).second))["dR_l2l3_lo"]->Sumw2();
334 >    (*((*it_h).second))["dR_l2l3"]      = new TH1D(TString("dR_l2l3") +"_"+(*it_h).first+str,";#bf{#Delta R l3,l4};",75,0,6);        (*((*it_h).second))["dR_l2l3"]->Sumw2();
335 >
336 >    (*((*it_h).second))["ml1l3"]        = new TH1D(TString("ml1l3") +"_"+(*it_h).first+str,";#bf{m_{l1l3} [GeV]};",50,0,120);       (*((*it_h).second))["ml1l3"]->Sumw2();
337 >    (*((*it_h).second))["ml2l3"]        = new TH1D(TString("ml2l3") +"_"+(*it_h).first+str,";#bf{m_{l2l3} [GeV]};",50,0,120);       (*((*it_h).second))["ml2l3"]->Sumw2();
338 >
339 >    (*((*it_h).second))["met"]          = new TH1D(TString("met") +"_"+(*it_h).first+str,";#bf{m_{l2l3} [GeV]};",50,0,50);       (*((*it_h).second))["met"]->Sumw2();
340    }
341    
342    return hists;
343   }
344   //--------------------------------------------------------------------------------------------------
345 < void makeHTML(FOFlags &ctrl, TString type)
345 > void makeHTML(FOFlags &ctrl, TString type, TString plotLabel)
346   {
347    TString title("Z Plus Fake: "+type);
348    ofstream htmlfile;
349    char htmlfname[100];
350 <  sprintf(htmlfname,"%s/plots.html",TString(ctrl.outdir+"/"+type).Data());
350 >  sprintf(htmlfname,"%s/plots.html",TString(ctrl.outdir+"/"+plotLabel+"/"+type).Data());
351    htmlfile.open(htmlfname);
352  
353    htmlfile << "<!DOCTYPE html" << endl;
# Line 355 | Line 364 | void makeHTML(FOFlags &ctrl, TString typ
364    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;
365    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;
366    htmlfile << "</tr>" << endl;
358  htmlfile << "</table>" << endl;
367  
360  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
368    htmlfile << "<tr>" << endl;
369    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ip3ds_l1.png\"><img src=\"plots/ip3ds_l1.png\" alt=\"plots/ip3ds_l1.png\" width=\"100%\"></a></td>" << endl;
370    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ip3ds_l2.png\"><img src=\"plots/ip3ds_l2.png\" alt=\"plots/ip3ds_l2.png\" width=\"100%\"></a></td>" << endl;
371    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ip3ds_l3.png\"><img src=\"plots/ip3ds_l3.png\" alt=\"plots/ip3ds_l3.png\" width=\"100%\"></a></td>" << endl;
372    htmlfile << "</tr>" << endl;
366  htmlfile << "</table>" << endl;
373  
368  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
374    htmlfile << "<tr>" << endl;
375    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/pt_l1.png\"><img src=\"plots/pt_l1.png\" alt=\"plots/pt_l1.png\" width=\"100%\"></a></td>" << endl;
376    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/pt_l2.png\"><img src=\"plots/pt_l2.png\" alt=\"plots/pt_l2.png\" width=\"100%\"></a></td>" << endl;
377 +  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/pt_l3_lo.png\"><img src=\"plots/pt_l3_lo.png\" alt=\"plots/pt_l3_lo.png\" width=\"100%\"></a></td>" << endl;
378    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/pt_l3.png\"><img src=\"plots/pt_l3.png\" alt=\"plots/pt_l3.png\" width=\"100%\"></a></td>" << endl;
379    htmlfile << "</tr>" << endl;
374  htmlfile << "</table>" << endl;
380  
376  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
381    htmlfile << "<tr>" << endl;
382    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/eta_l1.png\"><img src=\"plots/eta_l1.png\" alt=\"plots/eta_l1.png\" width=\"100%\"></a></td>" << endl;
383    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/eta_l2.png\"><img src=\"plots/eta_l2.png\" alt=\"plots/eta_l2.png\" width=\"100%\"></a></td>" << endl;
384    htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/eta_l3.png\"><img src=\"plots/eta_l3.png\" alt=\"plots/eta_l3.png\" width=\"100%\"></a></td>" << endl;
385    htmlfile << "</tr>" << endl;
386 +
387 +  htmlfile << "<tr>" << endl;
388 +  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/dR_l1l3_lo.png\"><img src=\"plots/dR_l1l3_lo.png\" alt=\"plots/dR_l1l3_lo.png\" width=\"100%\"></a></td>" << endl;
389 +  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/dR_l1l3.png\"><img src=\"plots/dR_l1l3.png\" alt=\"plots/dR_l1l3.png\" width=\"100%\"></a></td>" << endl;
390 +  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/dR_l2l3_lo.png\"><img src=\"plots/dR_l2l3_lo.png\" alt=\"plots/dR_l2l3_lo.png\" width=\"100%\"></a></td>" << endl;
391 +  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/dR_l2l3.png\"><img src=\"plots/dR_l2l3.png\" alt=\"plots/dR_l2l3.png\" width=\"100%\"></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/ml1l3.png\"><img src=\"plots/ml1l3.png\" alt=\"plots/ml1l3.png\" width=\"100%\"></a></td>" << endl;
397 +  htmlfile << "<td width=\"25%\"><a target=\"_blank\" href=\"plots/ml2l3.png\"><img src=\"plots/ml2l3.png\" alt=\"plots/ml2l3.png\" width=\"100%\"></a></td>" << endl;
398 +  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;
399 +  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
400 +  htmlfile << "</tr>" << endl;
401 +
402    htmlfile << "</table>" << endl;
403  
404    htmlfile << "<hr />" << endl;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines