Fork me on GitHub

Changeset 489 in svn for trunk


Ignore:
Timestamp:
Jul 15, 2009, 8:13:06 PM (15 years ago)
Author:
Xavier Rouby
Message:

last changes for ATLAS resolution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/routines/resolutions_atlas.C

    r487 r489  
    5656  //TFile *f1 = new TFile("JET2_atlas_midpoint_newCaloRes.root","read");
    5757  //TFile *f1 = new TFile("JET2_atlas_kt_40k.root","read"); // 40k events
    58   TFile *f1 = new TFile("JET2_atlas_kt_60k.root","read"); // 60k events
    59   //TFile *f1 = new TFile("JET2_atlas_jetclu_new_60k.root","read"); // 60k events
     58  //TFile *f1 = new TFile("JET2_atlas_kt_60k.root","read"); // 60k events
     59  //TFile *f1 = new TFile("JET2_atlas_jetclu_60k.root","read"); // 60k events
     60  //TFile *f1 = new TFile("JET2_atlas.kt_80k.root","read"); // 80k events -- samples jx -- default Delphes
     61  //TFile *f1 = new TFile("JET2_atlas.cone_80k.root","read"); // 80k events -- samples jx -- default Delphes + endcaps
     62  TFile *f1 = new TFile("JET2_atlas_kt_80k_endcap.root","read"); // 80k events -- samples jx -- default Delphes + endcaps
    6063
    6164  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
    6265  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    6366  TTree *Analyze = (TTree*)f1->Get("Analysis");
    64  
    65   //const int numBin=16;
    66   //double bins[numBin]={0,10,20,30,40,50,60,70,80,100,120,140,180,220,300,1200};
    67   //const int numBin=25;
    68   //double bins[numBin]={21,26,32,39,48, 59,72,88,107,130, 158,191,230,278,336, 405,485,581,696,834, 1000,1198,1435,1719,2060};
    69   //const int numBin=20;
    70   //double bins[numBin]={21,26,32,39,48, 59,72,88,107,130, 158,191,230,278,336, 405,485,581,696,834 };
     67 
     68/*
     69  const int numBin=16;
     70  double bins[numBin]={0,10,20,30,40,50,60,70,80,100,120,140,180,220,300,1200}; // cms-samples bins
     71  string cut = "1==1";
     72  TF1 *fitfunATLAS = new TF1("userATLAS","sqrt(pow(0.69*100/sqrt(x),2)+pow(0.03*100,2)+pow(6.3*100/x,2))",10,800);
     73  TPaveText *etacut = MakeTPave(0.58,0.51,0.65,0.55,"|#eta|<0.5 ");
     74*/
     75/*
     76  const int numBin=25;
     77  double bins[numBin]={21,26,32,39,48, 59,72,88,107,130, 158,191,230,278,336, 405,485,581,696,834, 1000,1198,1435,1719,2060};
     78  string cut = "1==1";
     79  TF1 *fitfunATLAS = new TF1("userATLAS","sqrt(pow(0.69*100/sqrt(x),2)+pow(0.03*100,2)+pow(6.3*100/x,2))",10,800);
     80  TPaveText *etacut = MakeTPave(0.58,0.51,0.65,0.55,"|#eta|<0.5 ");
     81*/
     82/*
     83  const int numBin=20;
     84  double bins[numBin]={21,26,32,39,48, 59,72,88,107,130, 158,191,230,278,336, 405,485,581,696,834 };
     85  string cut = "1==1";
     86  TF1 *fitfunATLAS = new TF1("userATLAS","sqrt(pow(0.69*100/sqrt(x),2)+pow(0.03*100,2)+pow(6.3*100/x,2))",10,800);
     87  TPaveText *etacut = MakeTPave(0.58,0.51,0.65,0.55,"|#eta|<0.5 ");
     88*/
     89
     90  // for eta < 0.5, use this
    7191  const int numBin=14;
    7292  double bins[numBin]={21,26,32,39,48, 59,72,88,130, 191,278, 405,581,834 };
     93  string cut = "abs(JetPTResol.Eta)<0.5";
     94  TF1 *fitfunATLAS = new TF1("userATLAS","sqrt(pow(0.69*100/sqrt(x),2)+pow(0.03*100,2)+pow(6.3*100/x,2))",10,800);
     95  TPaveText *etacut = MakeTPave(0.58,0.51,0.65,0.55,"|#eta|<0.5 ");
     96
     97/*
     98  // for forward 1.5 < eta < 2.0, use this
     99  const int numBin=10;
     100  double bins[numBin]={48, 59,72,88,130, 191,278, 405,581,834 };
     101  string cut = "abs(JetPTResol.Eta)<2.0 && abs(JetPTResol.Eta)>1.5";
     102  TF1 *fitfunATLAS= new TF1("userATLAS","sqrt(pow(1.19*100/sqrt(x),2)+pow(0.01*100,2)+pow(10*100/x,2))",10,800);
     103  TPaveText *etacut = MakeTPave(0.58,0.51,0.65,0.55,"1.5<|#eta|<2.0 ");
     104*/
    73105  TProfile *ESoverE = new TProfile("ESoverE","Jet resolution for ATLAS ",numBin-1,bins,-10,10);
    74106 
     
    77109  TCanvas *c1 = new TCanvas("c1","JET resol: (E_reco - E_gen)/E_gen",0,0,1000,650);
    78110  c1->cd(); int frame=0;
    79   c1->Divide(10,2);
     111  int nc = numBin/2 + numBin%2;
     112  c1->Divide(nc,2);
    80113  TCanvas *c1b = new TCanvas("c1b","JET resol: [(E_reco - E_gen)/E_gen]^2 ",0,0,1000,650);
    81114  c1b->cd(); int frame2=0;
    82   c1b->Divide(10,2);
     115  c1b->Divide(nc,2);
    83116 
    84117  float x[numBin-1];
     
    116149      string mystringName(tempName);
    117150      c1->cd(++frame);
    118       //string cut = "abs(JetPTResol.Eta)<2.0 && abs(JetPTResol.Eta)>1.5";
    119       string cut = "abs(JetPTResol.Eta)<0.5";
    120       //string cut = "1==1";
    121151      GaussValuesAsymmetry(Analyze,tempName,mean[i],mystringMin,mystringMax,cut);
    122152
     
    127157      c1b->cd(++frame2);
    128158      GaussValuesAsymmetry2(Analyze,tempName,mean2[i],mystringMin,mystringMax,cut);
    129 
    130159
    131160      x[i]=binCenter;
     
    183212  fitfunDelphes->Draw("same");
    184213
    185   TF1 *fitfunATLAS = new TF1("userATLAS","sqrt(pow(0.69*100/sqrt(x),2)+pow(0.03*100,2)+pow(6.3*100/x,2))",10,800);
    186214  fitfunATLAS->SetLineColor(kBlue);
    187215  fitfunATLAS->Draw("same");
    188216
    189   TF1 *fitfunATLAS2= new TF1("userATLAS2","sqrt(pow(1.19*100/sqrt(x),2)+pow(0.01*100,2)+pow(10*100/x,2))",10,800);
    190   fitfunATLAS2->SetLineColor(kBlue);
    191   //fitfunATLAS2->Draw("same");
    192 
    193   TPaveText *etacut = MakeTPave(0.58,0.51,0.65,0.55,"|#eta|<0.5 ");
     217
    194218  etacut->Draw();
    195219
     
    358382  //TFile *f1 = new TFile("JET2_ATLAS.root","read");
    359383  //TFile *f1 = new TFile("JET2_atlas_midpoint.root","read");
    360   TFile *f1 = new TFile("JET2_atlas_kt_60k.root","read"); // 60k events
     384  //TFile *f1 = new TFile("JET2_atlas_kt_60k.root","read"); // 60k events
     385  //TFile *f1 = new TFile("JET2_atlas_kt_80k_endcap.root","read"); // 80k events + endcap
     386  TFile *f1 = new TFile("JET2_atlas.cone_80k.root","read"); // 80k events + endcap
    361387  if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;}
    362388  if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;}
    363389  TTree *Analyze = (TTree*)f1->Get("Analysis");
    364390 
    365   TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,600);
     391  //const Int_t numBin=6;   double bins[numBin]={180,260,340,420,500,580};
     392  double max = 900;
     393  const Int_t numBin=6;   double bins[numBin]={100,250,400,550,700,max};
     394  //const Int_t numBin=6;   double bins[numBin]={180,260,340,420,500,max};
     395  TProfile *ETSoverET = new TProfile("ETSoverET","ETmis resol",numBin-1,bins,-1000,1000);
     396  TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,max);
    366397  fitfun->SetLineColor(kBlue);
    367   const Int_t numBin=6;
    368   double bins[numBin]={180,260,340,420,500,580};
    369   TProfile *ETSoverET = new TProfile("ETSoverET","ETmis resol",(numBin-1),bins,-1000,1000);
    370398 
    371399 
     
    374402  TCanvas *c5 = new TCanvas("c5","PTmis resol",0,0,1000,650);
    375403  c5->cd(); int frame=0;
    376   c5->Divide(6,2);
     404  int nb = numBin/2 + numBin%2;
     405  c5->Divide(nb,2);
    377406 
    378407  double x[numBin];
     
    420449  gr11->Fit("user","RQ");
    421450  gr11->GetYaxis()->SetRangeUser(0,60);
    422   gr11->GetXaxis()->SetRangeUser(1,600);
     451  gr11->GetXaxis()->SetRangeUser(1,max);
    423452  gr11->SetMaximum(16);
    424453
Note: See TracChangeset for help on using the changeset viewer.