Fork me on GitHub

Changeset 504 in svn for trunk


Ignore:
Timestamp:
Jul 22, 2009, 7:20:03 PM (15 years ago)
Author:
Xavier Rouby
Message:

added ATLAS expectation band for etmis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/routines/resolutions_atlas.C

    r489 r504  
    3939#include "TF1.h"
    4040#include "TGraph.h"
     41#include "TMultiGraph.h"
     42#include "TGraphErrors.h"
    4143#include "TLegend.h"
    4244
     
    395397  TProfile *ETSoverET = new TProfile("ETSoverET","ETmis resol",numBin-1,bins,-1000,1000);
    396398  TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,max);
    397   fitfun->SetLineColor(kBlue);
     399  fitfun->SetLineColor(kBlack);
     400  fitfun->SetLineStyle(2);
    398401 
    399402 
     
    435438  TCanvas *c6 = new TCanvas("c6","ETmis resolution",100,100,600,450);
    436439  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
    437454 
    438455  x[numBin]=0;
     
    441458  gr11->SetTitle("");
    442459  gr11->SetMarkerStyle(3);
    443   gr11->Draw("AP");
    444460  gr11->GetXaxis()->SetTitle("#Sigma E_{T} [GeV]");
    445461  gr11->GetYaxis()->SetTitle("Resolution of x-component  of MET [GeV]");
     
    448464  gr11->Fit("user","RQ");
    449465  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);
    453475
    454476  Double_t* params = fitfun->GetParameters();
     
    468490  TPaveText *atlas = MakeTPave(0.65,0.25,0.8,0.30,"ATLAS-like detector");
    469491  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
    470500 
    471501  delete fitfun;
Note: See TracChangeset for help on using the changeset viewer.