Fork me on GitHub

Changeset 503 in svn


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

added CMS expectation band for etmis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/routines/resolutions.C

    r473 r503  
    3939#include "TF1.h"
    4040#include "TGraph.h"
     41#include "TMultiGraph.h"
     42#include "TGraphErrors.h"
    4143#include "TLegend.h"
    4244
     
    6870  float ex[numBin-1];
    6971  float ey[numBin-1];
     72  float erec_over_etruth[numBin-1];
    7073 
    7174  float finval=0;//valeur a remplir puis a fitter
     
    9598      ex[i]=0;
    9699      ey[i]=0;
     100      erec_over_etruth[i]=mean[i]+1;
    97101    }
    98  
     102 
     103
     104  TCanvas *c3 = new TCanvas("c3","JET linearity",100,100,600,450);
     105  c3->cd();
     106  //for(int i=0; i<numBin-1; i++) cout << x[i] << "\t\t" << erec_over_etruth[i] << endl;
     107  TGraph *linearity = new TGraph(numBin-1,x,erec_over_etruth);
     108  linearity->Draw("AP");
     109  linearity->SetTitle("");
     110  linearity->GetXaxis()->SetTitle("E^{Truth} [GeV]");
     111  linearity->GetYaxis()->SetTitle("<E^{Reco}/E^{Truth}>");
     112  linearity->GetXaxis()->SetRangeUser(30,1000);
     113  linearity->SetMinimum(0.85);
     114  linearity->SetMaximum(1.20);
     115  gPad->SetLogx();
     116
     117 
    99118  TCanvas *c2 = new TCanvas("c2","JET resol",100,100,600,450);
    100119  c2->cd();
     
    297316 
    298317  TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,600);
    299   fitfun->SetLineColor(kBlue);
     318  fitfun->SetLineColor(kBlack);
     319  fitfun->SetLineStyle(2);
    300320  const Int_t numBin=6;
    301321  double bins[numBin]={180,260,340,420,500,580};
     
    338358  TCanvas *c6 = new TCanvas("c6","ETmis resolution",100,100,600,450);
    339359  c6->cd();
     360
     361  TF1 *fdo = new TF1("fdo","0.6*sqrt(x)",1,600);
     362  TF1 *fup = new TF1("fup","0.7*sqrt(x)",1,600);
     363  int N = 100;
     364  float xx[N], yy[N], eex[N], eey[N];
     365  for (int i=0; i<N; i++) {
     366     xx[i]  = 6*i;
     367     yy[i]  = (fup->Eval(xx[i]) + fdo->Eval(xx[i]))/2.;
     368     eex[i] = 0;
     369     eey[i] = (fup->Eval(xx[i]) - fdo->Eval(xx[i]))/2.;
     370  }
     371  TGraphErrors *gr = new TGraphErrors(N,xx,yy,eex,eey);
     372  gr->SetFillColor(18);
     373
    340374 
    341375  x[numBin]=0;
     
    344378  gr11->SetTitle("");
    345379  gr11->SetMarkerStyle(3);
    346   gr11->Draw("AP");
    347   gr11->GetXaxis()->SetTitle("#Sigma E_{T} [GeV]");
    348   gr11->GetYaxis()->SetTitle("Resolution of x-component  of MET [GeV]");
     380  gr11->SetLineStyle(2);
    349381  gr11->Fit("user","RQ");
    350382  gr11->Fit("user","RQ");
    351383  gr11->Fit("user","RQ");
    352384  gr11->Fit("user","RQ");
    353   gr11->GetYaxis()->SetRangeUser(0,60);
    354   gr11->GetXaxis()->SetRangeUser(1,600);
    355   gr11->SetMaximum(16);
     385
     386
     387  TMultiGraph *mgr = new TMultiGraph("mgr","");
     388  mgr->Add(gr,"3");
     389  mgr->Add(gr11,"P");
     390  mgr->Draw("A");
     391  mgr->GetXaxis()->SetTitle("#Sigma E_{T} [GeV]");
     392  mgr->GetYaxis()->SetTitle("Resolution of x-component  of MET [GeV]");
     393  mgr->GetYaxis()->SetRangeUser(0,60);
     394  mgr->GetXaxis()->SetRangeUser(1,600);
     395  mgr->SetMaximum(16);
    356396
    357397  Double_t* params = fitfun->GetParameters();
    358  
     398
    359399  char tempResol[500];
    360400  sprintf(tempResol,"E_{x}^{mis} resolution: %.2f #times #sqrt{E_{T}}",params[0]);
     
    369409  Delphes->Draw();
    370410 
    371   TPaveText *atlas = MakeTPave(0.65,0.25,0.8,0.30,"CMS-like detector");
    372   atlas->Draw();
     411  TPaveText *cms = MakeTPave(0.65,0.25,0.8,0.30,"CMS-like detector");
     412  cms->Draw();
     413
     414  TLegend *legend = new TLegend(0.69,0.6,0.94,0.74,NULL,"NDC");
     415  legend->AddEntry(gr,"CMS","f");
     416  legend->AddEntry(gr11,"Delphes","l");
     417  legend->SetFillColor(10);
     418  legend->SetBorderSize(0);
     419  legend->Draw();
     420
    373421 
    374422  delete fitfun;
Note: See TracChangeset for help on using the changeset viewer.