- Timestamp:
- Jul 22, 2009, 7:20:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/routines/resolutions_atlas.C
r489 r504 39 39 #include "TF1.h" 40 40 #include "TGraph.h" 41 #include "TMultiGraph.h" 42 #include "TGraphErrors.h" 41 43 #include "TLegend.h" 42 44 … … 395 397 TProfile *ETSoverET = new TProfile("ETSoverET","ETmis resol",numBin-1,bins,-1000,1000); 396 398 TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,max); 397 fitfun->SetLineColor(kBlue); 399 fitfun->SetLineColor(kBlack); 400 fitfun->SetLineStyle(2); 398 401 399 402 … … 435 438 TCanvas *c6 = new TCanvas("c6","ETmis resolution",100,100,600,450); 436 439 c6->cd(); 440 441 TF1 *fdo = new TF1("fdo","0.53*sqrt(x)",1,900); 442 TF1 *fup = new TF1("fup","0.57*sqrt(x)",1,900); 443 int N = 100; 444 float xx[N], yy[N], eex[N], eey[N]; 445 for (int i=0; i<N; i++) { 446 xx[i] = 9*i; 447 yy[i] = (fup->Eval(xx[i]) + fdo->Eval(xx[i]))/2.; 448 eex[i] = 0; 449 eey[i] = (fup->Eval(xx[i]) - fdo->Eval(xx[i]))/2.; 450 } 451 TGraphErrors *gr = new TGraphErrors(N,xx,yy,eex,eey); 452 gr->SetFillColor(18); 453 437 454 438 455 x[numBin]=0; … … 441 458 gr11->SetTitle(""); 442 459 gr11->SetMarkerStyle(3); 443 gr11->Draw("AP");444 460 gr11->GetXaxis()->SetTitle("#Sigma E_{T} [GeV]"); 445 461 gr11->GetYaxis()->SetTitle("Resolution of x-component of MET [GeV]"); … … 448 464 gr11->Fit("user","RQ"); 449 465 gr11->Fit("user","RQ"); 450 gr11->GetYaxis()->SetRangeUser(0,60); 451 gr11->GetXaxis()->SetRangeUser(1,max); 452 gr11->SetMaximum(16); 466 467 TMultiGraph *mgr = new TMultiGraph("mgr",""); 468 mgr->Add(gr,"3"); 469 mgr->Add(gr11,"P"); 470 mgr->Draw("A"); 471 mgr->GetXaxis()->SetTitle("#Sigma E_{T} [GeV]"); 472 mgr->GetYaxis()->SetTitle("Resolution of x-component of MET [GeV]"); 473 mgr->GetXaxis()->SetRangeUser(1,900); 474 mgr->SetMaximum(16); 453 475 454 476 Double_t* params = fitfun->GetParameters(); … … 468 490 TPaveText *atlas = MakeTPave(0.65,0.25,0.8,0.30,"ATLAS-like detector"); 469 491 atlas->Draw(); 492 493 TLegend *legend = new TLegend(0.69,0.6,0.94,0.74,NULL,"NDC"); 494 legend->AddEntry(gr,"ATLAS","f"); 495 legend->AddEntry(gr11,"Delphes","l"); 496 legend->SetFillColor(10); 497 legend->SetBorderSize(0); 498 legend->Draw(); 499 470 500 471 501 delete fitfun;
Note:
See TracChangeset
for help on using the changeset viewer.