Fork me on GitHub

Changeset 473 in svn


Ignore:
Timestamp:
Jul 13, 2009, 5:26:01 PM (15 years ago)
Author:
Xavier Rouby
Message:

update des labels / securites dans le code

Location:
trunk/routines
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/routines/resolutions.C

    r443 r473  
    4949 
    5050  TFile *f1 = new TFile("JET2.root","read");
     51  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
     52  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    5153  TTree *Analyze = (TTree*)f1->Get("Analysis");
    5254 
     
    153155 
    154156  TFile *f1 = new TFile("ETMIS2.root","read");
     157  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
     158  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    155159  TTree *Analyze = (TTree*)f1->Get("Analysis");
    156160 
     
    240244 
    241245  TFile *f1 = new TFile("TAUJET2.root","read");
     246  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
     247  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    242248  TTree *Analyze = (TTree*)f1->Get("Analysis");
    243249 
     
    283289  gROOT->Reset();
    284290 
    285   TFile *f1 = new TFile("JET2.root","read");
     291  //TFile *f1 = new TFile("JET2.root","read");
     292  TFile *f1 = new TFile("JET2_cms_midpoint.root","read");
     293 
     294  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
     295  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    286296  TTree *Analyze = (TTree*)f1->Get("Analysis");
    287297 
    288298  TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,600);
     299  fitfun->SetLineColor(kBlue);
    289300  const Int_t numBin=6;
    290301  double bins[numBin]={180,260,340,420,500,580};
     
    330341  x[numBin]=0;
    331342  y[numBin]=0;
    332   TGraph *gr11 = new TGraph((numBin),x,rms);
     343  TGraph *gr11 = new TGraph(numBin,x,rms);
     344  gr11->SetTitle("");
     345  gr11->SetMarkerStyle(3);
    333346  gr11->Draw("AP");
    334   gr11->GetXaxis()->SetTitle("Offline sum of E_{T} [GeV]");
     347  gr11->GetXaxis()->SetTitle("#Sigma E_{T} [GeV]");
    335348  gr11->GetYaxis()->SetTitle("Resolution of x-component  of MET [GeV]");
    336349  gr11->Fit("user","RQ");
     
    340353  gr11->GetYaxis()->SetRangeUser(0,60);
    341354  gr11->GetXaxis()->SetRangeUser(1,600);
     355  gr11->SetMaximum(16);
    342356
    343357  Double_t* params = fitfun->GetParameters();
    344358 
    345359  char tempResol[500];
    346   sprintf(tempResol,"%f * #sqrt{E_{T}}",params[0]);
    347 
    348   TPaveText *leg1 = MakeTPave(0.4,0.6,0.8,0.65,tempResol);
     360  sprintf(tempResol,"E_{x}^{mis} resolution: %.2f #times #sqrt{E_{T}}",params[0]);
     361
     362  TPaveText *leg1 = MakeTPave(0.26,0.84,0.43,0.89,tempResol);
    349363  leg1->Draw();
    350364
    351   TPaveText *leg2 = MakeTPave(0.2,0.8,0.8,0.85,"WHq'#rightarrow WWWq'#rightarrow lllq', m_{H}=150 GeV ");
     365  TPaveText *leg2 = MakeTPave(0.15,0.75,0.45,0.8,"Events: pp #rightarrow ggX");
    352366  leg2->Draw();
    353367
    354   TPaveText *Delphes = MakeTPave(0.2,0.15,0.35,0.2,"MG/ME + Delphes");
     368  TPaveText *Delphes = MakeTPave(0.65,0.19,0.8,0.24,"MG/ME + Pythia + Delphes");
    355369  Delphes->Draw();
    356  
    357  
     370 
     371  TPaveText *atlas = MakeTPave(0.65,0.25,0.8,0.30,"CMS-like detector");
     372  atlas->Draw();
     373 
    358374  delete fitfun;
    359375}
  • trunk/routines/resolutions_atlas.C

    r470 r473  
    5555  //TFile *f1 = new TFile("JET2_atlas_midpoint_newCaloRes.root","read");
    5656  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
     57  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    5758  TTree *Analyze = (TTree*)f1->Get("Analysis");
    5859 
     
    124125  Double_t* params = fitfun->GetParameters();
    125126
    126   fitfun->SetLineColor(1);
     127  fitfun->SetLineColor(kBlue);
    127128  gr11->Fit("user","QRN");
    128129  gr11->Fit("user","QRN");
     
    136137
    137138  TF1 *fitfunDelphes = new TF1("userDelphes",tempResol2,7,1000);
    138   fitfunDelphes->SetLineColor(596);
     139  fitfunDelphes->SetLineColor(kBlue);
    139140  fitfunDelphes->SetLineStyle(7);
    140141  fitfunDelphes->Draw("same");
    141142
    142   fitfunATLAS->SetLineColor(1);
     143  fitfunATLAS->SetLineColor(kRed);
    143144  fitfunATLAS->SetLineWidth(2);
    144145  fitfunATLAS->Draw("same");
     
    168169  TFile *f1 = new TFile("ETMIS2_ATLAS.root","read");
    169170  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
     171  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    170172  TTree *Analyze = (TTree*)f1->Get("Analysis");
    171173 
     
    256258  TFile *f1 = new TFile("TAUJET2_ATLAS.root","read");
    257259  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
     260  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    258261  TTree *Analyze = (TTree*)f1->Get("Analysis");
    259262 
     
    299302  gROOT->Reset();
    300303 
    301   TFile *f1 = new TFile("JET2_ATLAS.root","read");
     304  //TFile *f1 = new TFile("JET2_ATLAS.root","read");
     305  TFile *f1 = new TFile("JET2_atlas_midpoint.root","read");
    302306  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
     307  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    303308  TTree *Analyze = (TTree*)f1->Get("Analysis");
    304309 
    305310  TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,600);
     311  fitfun->SetLineColor(kBlue);
    306312  const Int_t numBin=6;
    307313  double bins[numBin]={180,260,340,420,500,580};
     
    333339      char tempName[500];
    334340      sprintf(tempName,"ETmisResol.ExSmeare>>hETSoverET%d",i);
     341      //sprintf(tempName,"ETmisResol.EtSmeare>>hETSoverET%d",i); // non-gaussian, so it does not work properly
    335342      string mystringName(tempName);
    336343     
     
    347354  x[numBin]=0;
    348355  y[numBin]=0;
    349   TGraph *gr11 = new TGraph((numBin),x,rms);
     356  TGraph *gr11 = new TGraph(numBin,x,rms);
     357  gr11->SetTitle("");
     358  gr11->SetMarkerStyle(3);
    350359  gr11->Draw("AP");
    351   gr11->GetXaxis()->SetTitle("Offline sum of E_{T} [GeV]");
     360  gr11->GetXaxis()->SetTitle("#Sigma E_{T} [GeV]");
    352361  gr11->GetYaxis()->SetTitle("Resolution of x-component  of MET [GeV]");
    353362  gr11->Fit("user","RQ");
     
    357366  gr11->GetYaxis()->SetRangeUser(0,60);
    358367  gr11->GetXaxis()->SetRangeUser(1,600);
     368  gr11->SetMaximum(16);
    359369
    360370  Double_t* params = fitfun->GetParameters();
    361371 
    362372  char tempResol[500];
    363   sprintf(tempResol,"%f * #sqrt{E_{T}}",params[0]);
    364 
    365   TPaveText *leg1 = MakeTPave(0.4,0.6,0.8,0.65,tempResol);
     373  sprintf(tempResol,"E_{x}^{mis} resolution: %.2f #times #sqrt{E_{T}}",params[0]);
     374
     375  TPaveText *leg1 = MakeTPave(0.26,0.84,0.43,0.89,tempResol);
    366376  leg1->Draw();
    367377
    368   TPaveText *leg2 = MakeTPave(0.2,0.8,0.8,0.85,"WHq'#rightarrow WWWq'#rightarrow lllq', m_{H}=150 GeV ");
     378  TPaveText *leg2 = MakeTPave(0.15,0.75,0.45,0.8,"Events: pp #rightarrow ggX");
    369379  leg2->Draw();
    370380
    371   TPaveText *Delphes = MakeTPave(0.2,0.15,0.35,0.2,"MG/ME + Delphes");
     381  TPaveText *Delphes = MakeTPave(0.65,0.19,0.8,0.24,"MG/ME + Pythia + Delphes");
    372382  Delphes->Draw();
    373383 
     384  TPaveText *atlas = MakeTPave(0.65,0.25,0.8,0.30,"ATLAS-like detector");
     385  atlas->Draw();
    374386 
    375387  delete fitfun;
Note: See TracChangeset for help on using the changeset viewer.