- Timestamp:
- Jul 22, 2009, 7:19:56 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/routines/resolutions.C
r473 r503 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 … … 68 70 float ex[numBin-1]; 69 71 float ey[numBin-1]; 72 float erec_over_etruth[numBin-1]; 70 73 71 74 float finval=0;//valeur a remplir puis a fitter … … 95 98 ex[i]=0; 96 99 ey[i]=0; 100 erec_over_etruth[i]=mean[i]+1; 97 101 } 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 99 118 TCanvas *c2 = new TCanvas("c2","JET resol",100,100,600,450); 100 119 c2->cd(); … … 297 316 298 317 TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,600); 299 fitfun->SetLineColor(kBlue); 318 fitfun->SetLineColor(kBlack); 319 fitfun->SetLineStyle(2); 300 320 const Int_t numBin=6; 301 321 double bins[numBin]={180,260,340,420,500,580}; … … 338 358 TCanvas *c6 = new TCanvas("c6","ETmis resolution",100,100,600,450); 339 359 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 340 374 341 375 x[numBin]=0; … … 344 378 gr11->SetTitle(""); 345 379 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); 349 381 gr11->Fit("user","RQ"); 350 382 gr11->Fit("user","RQ"); 351 383 gr11->Fit("user","RQ"); 352 384 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); 356 396 357 397 Double_t* params = fitfun->GetParameters(); 358 398 359 399 char tempResol[500]; 360 400 sprintf(tempResol,"E_{x}^{mis} resolution: %.2f #times #sqrt{E_{T}}",params[0]); … … 369 409 Delphes->Draw(); 370 410 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 373 421 374 422 delete fitfun;
Note:
See TracChangeset
for help on using the changeset viewer.