ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/SchieferD/jetcalib/mcfakerate_x.cpp
(Generate patch)

Comparing UserCode/SchieferD/jetcalib/mcfakerate_x.cpp (file contents):
Revision 1.3 by schiefer, Tue Sep 4 12:10:40 2007 UTC vs.
Revision 1.4 by schiefer, Tue Sep 4 13:31:20 2007 UTC

# Line 34 | Line 34 | using namespace std;
34   ////////////////////////////////////////////////////////////////////////////////
35  
36   //______________________________________________________________________________
37 < void setBinomialErrors(TH1F* hEff,const TH1F* hFake, const TH1F* hAll);
37 > void   setBinomialErrors(TH1F* hEff,const TH1F* hFake, const TH1F* hAll);
38 > string getLegLabel(const string& jetalg);
39  
40   ////////////////////////////////////////////////////////////////////////////////
41   // main
# Line 161 | Line 162 | int main(int argc,char**argv)
162      int nevts=t->GetEntries();
163      
164      for (int ievt=0;ievt<nevts;ievt++) {
165 +
166        t->GetEntry(ievt);
167 +
168        for (int ijt=0;ijt<njt;ijt++) {
169          
170          float dr  = jtgendr[ijt];
# Line 224 | Line 227 | int main(int argc,char**argv)
227    color = kBlack;
228    for (unsigned int i=0;i<emfHistos.size();i++) {
229      TH1F* h = emfHistos[i];
230 <    lEmfEff->AddEntry(h,jetalgs[i].c_str(),"lp");
230 >    lEmfEff->AddEntry(h,getLegLabel(jetalgs[i]).c_str(),"lp");
231      h->SetLineWidth(2);
232      h->SetMarkerColor(color);
233      h->SetLineColor(color++);
# Line 232 | Line 235 | int main(int argc,char**argv)
235      h->SetMarkerSize(0.7);
236      if (i==0) {
237        h->SetTitle("#epsilon_{FAKE} vs emf");
238 <      h->SetXTitle("jet emf");
238 >      h->SetXTitle("emf");
239        h->SetYTitle("#epsilon_{FAKE}");
240        h->Draw("E");
241        h->SetMinimum(0.0);
# Line 251 | Line 254 | int main(int argc,char**argv)
254    color = kBlack;
255    for (unsigned int i=0;i<phiHistos.size();i++) {
256      TH1F* h = phiHistos[i];
257 <    lPhiEff->AddEntry(h,jetalgs[i].c_str(),"lp");
257 >    lPhiEff->AddEntry(h,getLegLabel(jetalgs[i]).c_str(),"lp");
258      h->SetLineWidth(2);
259      h->SetMarkerColor(color);
260      h->SetLineColor(color++);
# Line 259 | Line 262 | int main(int argc,char**argv)
262      h->SetMarkerSize(0.7);
263      if (i==0) {
264        h->SetTitle("#epsilon_{FAKE} vs #phi");
265 <      h->SetXTitle("jet #phi");
265 >      h->SetXTitle("#phi");
266        h->SetYTitle("#epsilon_{FAKE}");
267        h->Draw("E");
268        h->SetMinimum(0.0);
# Line 278 | Line 281 | int main(int argc,char**argv)
281    color = kBlack;
282    for (unsigned int i=0;i<etaHistos.size();i++) {
283      TH1F* h = etaHistos[i];
284 <    lEtaEff->AddEntry(h,jetalgs[i].c_str(),"lp");
284 >    lEtaEff->AddEntry(h,getLegLabel(jetalgs[i]).c_str(),"lp");
285      h->SetLineWidth(2);
286      h->SetMarkerColor(color);
287      h->SetLineColor(color++);
# Line 286 | Line 289 | int main(int argc,char**argv)
289      h->SetMarkerSize(0.7);
290      if (i==0) {
291        h->SetTitle("#epsilon_{FAKE} vs #eta");
292 <      h->SetXTitle("jet #eta");
292 >      h->SetXTitle("#eta");
293        h->SetYTitle("#epsilon_{FAKE}");
294        h->Draw("E");
295        h->SetMinimum(0.0);
# Line 306 | Line 309 | int main(int argc,char**argv)
309    color = kBlack;
310    for (unsigned int i=0;i<etHistos.size();i++) {
311      TH1F* h = etHistos[i];
312 <    lEtEff->AddEntry(h,jetalgs[i].c_str(),"lp");
312 >    lEtEff->AddEntry(h,getLegLabel(jetalgs[i]).c_str(),"lp");
313      h->SetLineWidth(2);
314      h->SetMarkerColor(color);
315      h->SetLineColor(color++);
# Line 314 | Line 317 | int main(int argc,char**argv)
317      h->SetMarkerSize(0.7);
318      if (i==0) {
319        h->SetTitle("#epsilon_{FAKE} vs E_{T}");
320 <      h->SetXTitle("jet E_{T} [GeV]");
320 >      h->SetXTitle("E_{T} [GeV]");
321        h->SetYTitle("#epsilon_{FAKE}");
322        h->Draw("E");
323        h->SetMinimum(0.0);
# Line 344 | Line 347 | void setBinomialErrors(TH1F* hEff,const
347      hEff->SetBinError(i,eeff);
348    }
349   }
350 +
351 +
352 + //______________________________________________________________________________
353 + string getLegLabel(const string& jetalg)
354 + {
355 +  string result;
356 +  string tmp(jetalg);
357 +  
358 +  if (tmp.find("fastjet")==0) {
359 +    result = "fast k_{T}, D=";
360 +    tmp=tmp.substr(7);
361 +  }
362 +  else if (tmp.find("icone")==0) {
363 +    result = "icone, R=";
364 +    tmp = tmp.substr(5);
365 +  }
366 +  else if (tmp.find("mcone")==0) {
367 +    result = "mcone, R=";
368 +    tmp = tmp.substr(5);
369 +  }
370 +  else return result;
371 +
372 +  stringstream ssparam;
373 +  ssparam<<tmp;
374 +  float param;
375 +  ssparam>>param;
376 +  param = 0.1*param;
377 +  stringstream ssparam2;
378 +  ssparam2<<param;
379 +  result += ssparam2.str();
380 +
381 +  return result;
382 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines