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.2 by dkralph, Thu Jul 12 15:10:53 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 41 | Line 44 | using namespace RooFit;
44   TCanvas *can;
45  
46   void fillHist(CSample *cs, TString channel, TString type, TString var, double val, double wgt, double wgt_lo=0, double wgt_hi=0);
47 < void makeHTML(FOFlags &ctrl, TString type);
47 > void makeHTML(FOFlags &ctrl, TString type, TString plotLabel);
48   map<TString,map<TString,TH1D*>* > init_hists(FOFlags &ctrl, TString str="");
49   TString f_to_a(double val) { stringstream ss; ss << fixed << setprecision(2) << val; return TString(ss.str().c_str()); }
50  
# Line 49 | Line 52 | TString f_to_a(double val) { stringstrea
52   int main(int argc, char** argv)
53   {
54    double lumi = 5000;
52  // UInt_t minRun=999999999,maxRun=0;
55  
56    FOFlags ctrl;
57    parse_foargs( argc, argv, ctrl );
# Line 57 | Line 59 | int main(int argc, char** argv)
59  
60    can = new TCanvas("can","can");
61  
62 <  // FR_struct fr = initFRs(ctrl.mufakedir+"/fr.root",ctrl.elefakedir+"/fr.root");
63 <  FR_struct fr = initFRs(ctrl.mufakedir,ctrl.elefakedir);
62 >  FR_struct fr2011 = initFRs(ctrl.mufakefile2011,ctrl.elefakefile2011);
63 >  FR_struct fr2012 = initFRs(ctrl.mufakefile2012,ctrl.elefakefile2012);
64  
65    TString cmsswpath(CMSSW_BASE + TString("/src"));
66    string xspath = (string(cmsswpath)+"/MitPhysics/data/xs.dat");
67    SimpleTable xstab(xspath.c_str());
68  
69    vector<CSample*> samplev;
70 +  TString ntupledir(""),label(""),plotLabel("");
71 +  readConfigFile(ctrl.config, ntupledir, label, plotLabel, samplev, &ctrl, init_hists);
72  
73 <  ifstream instream;
74 <  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
73 >  RunLumiSet rls;
74 >  UInt_t minRun=999999999,maxRun=0;
75    for(unsigned ics=0; ics<samplev.size(); ics++) {
76      CSample *cs = samplev[ics];
77      cout << cs->name << endl;
78      for(unsigned ifs=0; ifs<(cs->fsv).size(); ifs++) {
79        filestuff *fs = (cs->fsv)[ifs];
80        cout << "\t" << fs->fname_ << endl;
81 +      FR_struct *fr = (fs->era_==2011) ? &fr2011 : &fr2012;
82 +      unsigned nDuplSkipped=0;
83        for(unsigned ientry=0; ientry<fs->getentries("FOtree"); ientry++) {
84          fs->getentry(ientry,"","FOtree");
85          fs->getentry(ientry,"info","zznt");
86 <        // if(fs->isdata_) {
87 <        //   if(fs->info->run < minRun) minRun = fs->info->run;
88 <        //   if(fs->info->run > maxRun) maxRun = fs->info->run;
89 <        // }
90 <        bool dupl=false;
126 <        for(unsigned ievt=0; ievt<runEvtv.size(); ievt++) {
127 <          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 <          }
86 >
87 >        if(fs->isdata_) {
88 >          setMinMaxRun(fs->info->run, minRun, maxRun);
89 >          bool dupl = takeCareOfDuplicateEvents(fs->info->run, fs->info->evt, rls, nDuplSkipped);
90 >          if(dupl) continue;
91          }
132        if(dupl) continue;
133        runEvtv.push_back(pair<unsigned,unsigned> (fs->info->run,fs->info->evt));
92  
93          double wgt=1;
94 <        // if(!fs->isdata_) {
95 <        //   double xsWgt = lumi*xstab.Get(fs->dataset_)/fs->total_entries_;
96 <        //   double puWgt = weightTrue2012(fs->info->npu);
97 <        //   wgt = xsWgt*puWgt;
98 <        // }
94 >        if(!fs->isdata_) {
95 >          double xsWgt = lumi*xstab.Get(fs->dataset_)/fs->total_entries_;
96 >          // double puWgt = weightTrue2012(fs->info->npu);
97 >          wgt = xsWgt;//*puWgt;
98 >          // cout << "npu: " << fs->info->npu
99 >        }
100 >
101 >        if(fs->info->met > 25) continue;
102  
103          unsigned npass = fs->passingL->size();
104          unsigned nfail = fs->failingL->size();
144        // if(npass > 2) continue; // exclude signal region (???)
105  
106          float best_z_mass = -99999;
107          pair<int,int> best_z_indices;
# Line 186 | Line 146 | int main(int argc, char** argv)
146            types.push_back("fail");
147          }
148  
149 +        if(npass>3) continue;
150 +
151          for(unsigned iextra=0; iextra<ex_leps.size(); iextra++) {
152            SimpleLepton ex_lep = ex_leps[iextra];
153  
154 +          if(types[iextra]=="fail" && npass>2) continue;
155 +          
156 +
157            TString channel;
158            if(abs(ex_lep.type) == 13) channel = "mu";
159            if(abs(ex_lep.type) == 11) channel = "ele";
# Line 206 | Line 171 | int main(int argc, char** argv)
171            //????????????????????????????????????????????????????????????????????????????????????????
172            KinematicsStruct kine;
173            fillKinematics(evtdata,kine);
174 +          SimpleLepton lep1=evtdata.Z1leptons[0],lep2=evtdata.Z1leptons[1];
175 +          TLorentzVector l1l3(lep1.vec+ex_lep.vec);
176 +          TLorentzVector l2l3(lep2.vec+ex_lep.vec);
177  
178            if(types[iextra]=="pass") {
179              fillHist( cs, channel, "obs", "run",       fs->info->run  ,                 wgt);
180              fillHist( cs, channel, "obs", "mZ1",       kine.mZ1  ,                      wgt);                
181              fillHist( cs, channel, "obs", "Z1pt",      kine.Z1pt ,                      wgt);                
182 <            fillHist( cs, channel, "obs", "ip3ds_l1",  evtdata.Z1leptons[0].ip3dSig ,   wgt);
183 <            fillHist( cs, channel, "obs", "ip3ds_l2",  evtdata.Z1leptons[1].ip3dSig ,   wgt);
184 <            fillHist( cs, channel, "obs", "ip3ds_l3",  evtdata.Z2leptons[0].ip3dSig ,   wgt);
185 <            fillHist( cs, channel, "obs", "pt_l1",     evtdata.Z1leptons[0].vec.Pt() ,  wgt);
186 <            fillHist( cs, channel, "obs", "pt_l2",     evtdata.Z1leptons[1].vec.Pt() ,  wgt);
182 >            fillHist( cs, channel, "obs", "ip3ds_l1",  lep1.ip3dSig ,                   wgt);
183 >            fillHist( cs, channel, "obs", "ip3ds_l2",  lep2.ip3dSig ,                   wgt);
184 >            fillHist( cs, channel, "obs", "ip3ds_l3",  ex_lep.ip3dSig ,                 wgt);
185 >            fillHist( cs, channel, "obs", "pt_l1",     lep1.vec.Pt() ,                  wgt);
186 >            fillHist( cs, channel, "obs", "pt_l2",     lep2.vec.Pt() ,                  wgt);
187              fillHist( cs, channel, "obs", "pt_l3",     ex_lep.vec.Pt() ,                wgt);
188 <            fillHist( cs, channel, "obs", "eta_l1",    evtdata.Z1leptons[0].vec.Eta(), wgt);
189 <            fillHist( cs, channel, "obs", "eta_l2",    evtdata.Z1leptons[1].vec.Eta(), wgt);
190 <            fillHist( cs, channel, "obs", "eta_l3",    ex_lep.vec.Eta(),               wgt);
188 >            fillHist( cs, channel, "obs", "pt_l3_lo",     ex_lep.vec.Pt() ,             wgt);
189 >            fillHist( cs, channel, "obs", "eta_l1",    lep1.vec.Eta(),                  wgt);
190 >            fillHist( cs, channel, "obs", "eta_l2",    lep2.vec.Eta(),                  wgt);
191 >            fillHist( cs, channel, "obs", "eta_l3",    ex_lep.vec.Eta(),                wgt);
192 >            fillHist( cs, channel, "obs", "dR_l1l3_lo",dr(lep1,ex_lep),                 wgt);
193 >            fillHist( cs, channel, "obs", "dR_l1l3",   dr(lep1,ex_lep),                 wgt);
194 >            fillHist( cs, channel, "obs", "dR_l2l3_lo",dr(lep2,ex_lep),                 wgt);
195 >            fillHist( cs, channel, "obs", "dR_l2l3",   dr(lep2,ex_lep),                 wgt);
196 >            fillHist( cs, channel, "obs", "ml1l3",     l1l3.M(),                        wgt);
197 >            fillHist( cs, channel, "obs", "ml2l3",     l2l3.M(),                        wgt);
198 >            fillHist( cs, channel, "obs", "met",       fs->info->met,                   wgt);
199            } else if(types[iextra]=="fail") {
200 <            double fwgt    = get_fake_weight("",ex_lep,fr);
201 <            double fwgt_lo = get_fake_weight("lo",ex_lep,fr);
202 <            double fwgt_hi = get_fake_weight("hi",ex_lep,fr);
200 >            double fwgt    = get_fake_weight("",ex_lep,*fr);
201 >            double fwgt_lo = get_fake_weight("lo",ex_lep,*fr);
202 >            double fwgt_hi = get_fake_weight("hi",ex_lep,*fr);
203              double centr = wgt*fwgt;
204              double lo    = wgt*fwgt_lo;
205              double hi    = wgt*fwgt_hi;
206 <            fillHist( cs, channel, "pred", "run",       fs->info->run,                  centr, lo, hi);
207 <            fillHist( cs, channel, "pred", "mZ1",       kine.mZ1,                       centr, lo, hi);
208 <            fillHist( cs, channel, "pred", "Z1pt",      kine.Z1pt,                      centr, lo, hi);
209 <            fillHist( cs, channel, "pred", "ip3ds_l1",  evtdata.Z1leptons[0].ip3dSig,   centr, lo, hi);
210 <            fillHist( cs, channel, "pred", "ip3ds_l2",  evtdata.Z1leptons[1].ip3dSig,   centr, lo, hi);
211 <            fillHist( cs, channel, "pred", "ip3ds_l3",  ex_lep.ip3dSig,                 centr, lo, hi);
212 <            fillHist( cs, channel, "pred", "pt_l1",     evtdata.Z1leptons[0].vec.Pt(),  centr, lo, hi);
213 <            fillHist( cs, channel, "pred", "pt_l2",     evtdata.Z1leptons[1].vec.Pt(),  centr, lo, hi);
214 <            fillHist( cs, channel, "pred", "pt_l3",     ex_lep.vec.Pt(),                centr, lo, hi);
215 <            fillHist( cs, channel, "pred", "eta_l1",    evtdata.Z1leptons[0].vec.Eta(), centr, lo, hi);
216 <            fillHist( cs, channel, "pred", "eta_l2",    evtdata.Z1leptons[1].vec.Eta(), centr, lo, hi);
217 <            fillHist( cs, channel, "pred", "eta_l3",    ex_lep.vec.Eta(),               centr, lo, hi);
206 >
207 >            fillHist( cs, channel, "pred", "run",       fs->info->run,          centr, lo, hi);
208 >            fillHist( cs, channel, "pred", "mZ1",       kine.mZ1,               centr, lo, hi);
209 >            fillHist( cs, channel, "pred", "Z1pt",      kine.Z1pt,              centr, lo, hi);
210 >            fillHist( cs, channel, "pred", "ip3ds_l1",  lep1.ip3dSig,           centr, lo, hi);
211 >            fillHist( cs, channel, "pred", "ip3ds_l2",  lep2.ip3dSig,           centr, lo, hi);
212 >            fillHist( cs, channel, "pred", "ip3ds_l3",  ex_lep.ip3dSig,         centr, lo, hi);
213 >            fillHist( cs, channel, "pred", "pt_l1",     lep1.vec.Pt(),          centr, lo, hi);
214 >            fillHist( cs, channel, "pred", "pt_l2",     lep2.vec.Pt(),          centr, lo, hi);
215 >            fillHist( cs, channel, "pred", "pt_l3",     ex_lep.vec.Pt(),        centr, lo, hi);
216 >            fillHist( cs, channel, "pred", "pt_l3_lo",  ex_lep.vec.Pt(),        centr, lo, hi);
217 >            fillHist( cs, channel, "pred", "eta_l1",    lep1.vec.Eta(),         centr, lo, hi);
218 >            fillHist( cs, channel, "pred", "eta_l2",    lep2.vec.Eta(),         centr, lo, hi);
219 >            fillHist( cs, channel, "pred", "eta_l3",    ex_lep.vec.Eta(),       centr, lo, hi);
220 >            fillHist( cs, channel, "pred", "dR_l1l3_lo",dr(lep1,ex_lep),        centr, lo, hi);
221 >            fillHist( cs, channel, "pred", "dR_l1l3",   dr(lep1,ex_lep),        centr, lo, hi);
222 >            fillHist( cs, channel, "pred", "dR_l2l3_lo",dr(lep2,ex_lep),        centr, lo, hi);
223 >            fillHist( cs, channel, "pred", "dR_l2l3",   dr(lep2,ex_lep),        centr, lo, hi);
224 >            fillHist( cs, channel, "pred", "ml1l3",     l1l3.M(),               centr, lo, hi);
225 >            fillHist( cs, channel, "pred", "ml2l3",     l2l3.M(),               centr, lo, hi);
226 >            fillHist( cs, channel, "pred", "met",       fs->info->met,          centr, lo, hi);
227            } else assert(0);
228          }
229        }
230 +      cout << "\t\tWARNING: skipped " << nDuplSkipped << " duplicate events" << endl;
231      }
232    }
233 <  // cout << setw(12) << minRun << setw(12) << maxRun << endl;
233 >  cout << "run range: " << setw(12) << minRun << setw(12) << maxRun << endl;
234  
235    assert(samplev.size()>0);
236    vector<TString> typev;
# Line 253 | Line 239 | int main(int argc, char** argv)
239    typev.push_back("ele");
240    for(unsigned itype=0; itype<typev.size(); itype++) {
241      TString type(typev[itype]);
242 <    TFile runHistFile(ctrl.outdir+"/"+type+"/runs.root","recreate");
242 >    gSystem->mkdir(ctrl.outdir+"/"+plotLabel+"/"+type,true);
243 >    TFile runHistFile(ctrl.outdir+"/"+plotLabel+"/"+type+"/runs.root","recreate");
244      map<TString,TH1D*>::iterator it_v;
245      for(it_v=(*(samplev[0]->hists)[type+"_obs"]).begin(); it_v!=(*(samplev[0]->hists)[type+"_obs"]).end(); it_v++) {
246        TString var((*it_v).first);
247 <      CPlot cplot(var,"",(*(samplev[0]->hists)[type+"_obs"])[var]->GetXaxis()->GetTitle(),"events",ctrl.outdir+"/"+type+"/plots");
247 >      CPlot cplot(var,"",(*(samplev[0]->hists)[type+"_obs"])[var]->GetXaxis()->GetTitle(),"events",ctrl.outdir+"/"+plotLabel+"/"+type+"/plots");
248 >      double ymax=0;
249        for(unsigned isam=0; isam<samplev.size(); isam++) {
250          CSample *cs = samplev[isam];
251          TH1D *hObs = (*(cs->hists)[type+"_obs"])[var];
# Line 265 | Line 253 | int main(int argc, char** argv)
253          TH1D *hPred_lo = (*(cs->hists)[type+"_pred_lo"])[var];
254          TH1D *hPred_hi = (*(cs->hists)[type+"_pred_hi"])[var];
255          if(cs->isdata) {
256 <          cplot.AddHist1D(hObs,"data: "+integral_str(hObs),"E");
256 >          cplot.AddHist1D(hObs,cs->legend+": "+integral_str(hObs),"E");
257            double ratio = integrateHist(hObs) / integrateHist(hPred);
258            cplot.AddHist1D(hPred,"FR predic: "+integral_str(hPred),"hist",kRed);
259            cplot.AddHist1D(hPred_lo,"stat lo: "+integral_str(hPred_lo),"hist",kRed,kDashed);
260            cplot.AddHist1D(hPred_hi,"stat hi: "+integral_str(hPred_hi),"hist",kRed,kDashed);
261 +          ymax = max(ymax,histMax(hObs,hPred));
262          } else {
263 <          cplot.AddToStack(hObs,"mc: "+integral_str(hObs),kCyan-6);
263 >          cplot.AddToStack(hObs,cs->legend+": "+integral_str(hObs),kCyan-6);
264 >          ymax = max(ymax,histMax(hObs,hPred));
265          }
266          if(cs->isdata && var=="run") {
267            assert(hObs->GetBinContent(0)==0 && hObs->GetBinContent(hObs->GetXaxis()->GetNbins()+1)==0);
268            hObs->Write("runs");
269          }
270          if(var.Contains("ip3d")) {
281          cplot.SetLogy();
271            double maxVal = max(hObs->GetMaximum(), hPred->GetMaximum());
272            double isoMin = 0.00005*maxVal;
273            double isoMax = 1.8*maxVal;
274            cplot.SetYRange(isoMin,isoMax);
275 +          cplot.SetLogy();
276 +        } else {
277 +          cplot.SetYRange(0,1.2*ymax);
278          }
279 +                  
280        }
281        cplot.Draw(can,true,"png");
282      }
283      runHistFile.Close();
284 <    makeHTML(ctrl,type);
284 >    makeHTML(ctrl,type, plotLabel);
285    }
286   }
287   //----------------------------------------------------------------------------------------
# Line 314 | Line 307 | map<TString,map<TString,TH1D*>* > init_h
307    map<TString,map<TString,TH1D*>* >::iterator it_h;
308    for(it_h=hists.begin(); it_h!=hists.end(); it_h++) {
309      (*((*it_h).second))["run"]          = new TH1D(TString("run") +"_"+(*it_h).first+str,";#bf{run};",          50,160800,196535);   (*((*it_h).second))["run"]->Sumw2();
310 <    (*((*it_h).second))["mZ1"]          = new TH1D(TString("mZ1") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",    20,60,120);          (*((*it_h).second))["mZ1"]->Sumw2();
311 <    (*((*it_h).second))["Z1pt"]         = new TH1D(TString("Z1pt") +"_"+(*it_h).first+str,";#bf{Z1pt [GeV]};",  20,0,200);           (*((*it_h).second))["Z1pt"]->Sumw2();
310 >    (*((*it_h).second))["mZ1"]          = new TH1D(TString("mZ1") +"_"+(*it_h).first+str,";#bf{mZ1 [GeV]};",    37,70,110);          (*((*it_h).second))["mZ1"]->Sumw2();
311 >    (*((*it_h).second))["Z1pt"]         = new TH1D(TString("Z1pt") +"_"+(*it_h).first+str,";#bf{Z1pt [GeV]};",  37,0,100);           (*((*it_h).second))["Z1pt"]->Sumw2();
312  
313      (*((*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();
314 <    (*((*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();
315 <    (*((*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();
314 >    (*((*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();
315 >    (*((*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();
316 >    (*((*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();
317  
318      (*((*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();
319      (*((*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();
# Line 328 | Line 322 | map<TString,map<TString,TH1D*>* > init_h
322      (*((*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();
323      (*((*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();
324      (*((*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();
325 +
326 +    (*((*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();
327 +    (*((*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();
328 +    (*((*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();
329 +    (*((*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();
330 +
331 +    (*((*it_h).second))["ml1l3"]        = new TH1D(TString("ml1l3") +"_"+(*it_h).first+str,";#bf{m_{l1l3} [GeV]};",50,0,120);       (*((*it_h).second))["ml1l3"]->Sumw2();
332 +    (*((*it_h).second))["ml2l3"]        = new TH1D(TString("ml2l3") +"_"+(*it_h).first+str,";#bf{m_{l2l3} [GeV]};",50,0,120);       (*((*it_h).second))["ml2l3"]->Sumw2();
333 +
334 +    (*((*it_h).second))["met"]          = new TH1D(TString("met") +"_"+(*it_h).first+str,";#bf{m_{l2l3} [GeV]};",50,0,50);       (*((*it_h).second))["met"]->Sumw2();
335    }
336    
337    return hists;
338   }
339   //--------------------------------------------------------------------------------------------------
340 < void makeHTML(FOFlags &ctrl, TString type)
340 > void makeHTML(FOFlags &ctrl, TString type, TString plotLabel)
341   {
342    TString title("Z Plus Fake: "+type);
343    ofstream htmlfile;
344    char htmlfname[100];
345 <  sprintf(htmlfname,"%s/plots.html",TString(ctrl.outdir+"/"+type).Data());
345 >  sprintf(htmlfname,"%s/plots.html",TString(ctrl.outdir+"/"+plotLabel+"/"+type).Data());
346    htmlfile.open(htmlfname);
347  
348    htmlfile << "<!DOCTYPE html" << endl;
# Line 355 | Line 359 | void makeHTML(FOFlags &ctrl, TString typ
359    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;
360    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;
361    htmlfile << "</tr>" << endl;
358  htmlfile << "</table>" << endl;
362  
360  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
363    htmlfile << "<tr>" << endl;
364    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;
365    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;
366    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;
367    htmlfile << "</tr>" << endl;
366  htmlfile << "</table>" << endl;
368  
368  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
369    htmlfile << "<tr>" << endl;
370    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;
371    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;
372 +  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;
373    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;
374    htmlfile << "</tr>" << endl;
374  htmlfile << "</table>" << endl;
375  
376  htmlfile << "<table border=\"0\" cellspacing=\"5\" width=\"100%\">" << endl;  
376    htmlfile << "<tr>" << endl;
377    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;
378    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;
379    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;
380    htmlfile << "</tr>" << endl;
381 +
382 +  htmlfile << "<tr>" << endl;
383 +  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;
384 +  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;
385 +  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;
386 +  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;
387 +  // htmlfile << "<td width=\"25%\"><a><</a></td>" << endl;
388 +  htmlfile << "</tr>" << endl;
389 +
390 +  htmlfile << "<tr>" << endl;
391 +  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;
392 +  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;
393 +  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;
394 +  htmlfile << "<td width=\"25%\"><a></a></td>" << endl;
395 +  htmlfile << "</tr>" << endl;
396 +
397    htmlfile << "</table>" << endl;
398  
399    htmlfile << "<hr />" << endl;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines