Fork me on GitHub

Changeset 153 in svn


Ignore:
Timestamp:
Jan 7, 2009, 12:24:34 PM (16 years ago)
Author:
severine ovyn
Message:

used for publi

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/interface/FuncDef.h

    r91 r153  
    7979
    8080  string nom = histo.erase(0,histo.find(">>")+2);
    81   TH1F *h = new TH1F(nom.c_str(),"",50,-1,3);
    82 
     81  TH1F *h = new TH1F(nom.c_str(),"",100,0,3);
    8382  string all = min + " && " + max;
    8483  Analyze->Draw(temp.c_str(),all.c_str());
    8584  h->SetMarkerSize(0.6);
    8685  double MeanFix = h->GetMean();
    87   TF1 *Gauss = new TF1("Gauss","gaus",-1,3);
    88   Gauss->FixParameter(1,MeanFix);
     86  double RangMin = (h->GetMean()-2*h->GetRMS());
     87  double RangMax = (h->GetMean()+2*h->GetRMS());
     88  TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax);
     89//  Gauss->FixParameter(1,MeanFix);
    8990  h->Fit("Gauss","QR");
    9091  h->Fit("Gauss","QRI");
     
    9293  Double_t* params = Gauss->GetParameters();
    9394  rms=params[2];
     95  //mean= MeanFix;
    9496  mean=params[1];
    9597  h->Draw("P");
    9698  h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]");
    9799Gauss->Delete();
    98  
    99 }
    100 
    101 void GaussValuesETmis(TTree * Analyze,string histo,double &rms, string min,string max)
     100}
     101
     102void GaussValuesElec(TTree * Analyze,string histo,double &rms, double &mean, string min,string max)
    102103{
    103104  string temp = histo;
     
    106107
    107108  string nom = histo.erase(0,histo.find(">>")+2);
    108   TH1F *h = new TH1F(nom.c_str(),"",20,-100,100);
    109 
     109  TH1F *h = new TH1F(nom.c_str(),"",20,-1,3);
    110110  string all = min + " && " + max;
    111111  Analyze->Draw(temp.c_str(),all.c_str());
    112112  h->SetMarkerSize(0.6);
    113   double RangMin = h->GetMean()-h->GetRMS();
    114   double RangMax = h->GetMean()+h->GetRMS();
     113  double MeanFix = h->GetMean();
     114  TF1 *Gauss = new TF1("Gauss","gaus",-0.5,1.5);
     115  Gauss->FixParameter(1,MeanFix);
     116  h->Fit("Gauss","QR");
     117  h->Fit("Gauss","QRI");
     118  h->Fit("Gauss","QRI");
     119  Double_t* params = Gauss->GetParameters();
     120  rms=params[2];
     121  //mean= MeanFix;
     122  mean=params[1];
     123  h->Draw("P");
     124  h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]");
     125  Gauss->Delete();
     126}
     127 
     128
     129
     130void GaussValuesETmis(TTree * Analyze,string histo,double &rms, string min,string max)
     131{
     132  string temp = histo;
     133  string mintemp = min;
     134  string maxtemp = max;
     135
     136  string nom = histo.erase(0,histo.find(">>")+2);
     137  TH1F *h = new TH1F(nom.c_str(),"",50,-50,50);
     138
     139  string all = min + " && " + max;
     140  Analyze->Draw(temp.c_str(),all.c_str());
     141  h->SetMarkerSize(0.6);
     142  double RangMin = (h->GetMean()-2*h->GetRMS());
     143  double RangMax = (h->GetMean()+2*h->GetRMS());
     144  //TF1 *Gauss = new TF1("Gauss","gaus");
    115145  TF1 *Gauss = new TF1("Gauss","gaus",RangMin,RangMax);
    116146  //TF1 *Gauss = new TF1("Gauss","gaus");
  • trunk/routines/resolutions.C

    r91 r153  
    66#include "TF1.h"
    77#include "TGraph.h"
     8#include "TLegend.h"
    89
    910#include "interface/FuncDef.h"
     
    1718  TTree *Analyze = (TTree*)f1->Get("Analysis");
    1819 
    19   const Int_t numBin=7;
    20   double bins[numBin]={0,20,40,60,80,100,220};
     20  const Int_t numBin=16;
     21  double bins[numBin]={0,10,20,30,40,50,60,70,80,100,120,140,180,220,300,1200};
    2122  TProfile *ETSoverET = new TProfile("ETSoverET","Jet resolution: E_{T}^{rec}/E_{T}^{mc}",(numBin-1),bins,-10,10);
    2223 
     
    6465  c2->cd();
    6566 
    66   TF1 *fitfun = new TF1("user","sqrt(pow([0],2)+pow([1]/sqrt(x),2)+pow([2]/x,2))",1,170);
    67  
    68   TGraphErrors *gr11 = new TGraphErrors((numBin-1),x,y,ex,ey);
     67  TF1 *fitfun = new TF1("user","sqrt(pow([0]/x,2)+pow([1]/sqrt(x),2)+pow([2],2))",10,800);
     68  TF1 *fitfunCMS = new TF1("userCMS","sqrt(pow(1.05*100/sqrt(x),2)+pow(0.06*100,2)+pow(0*100/x,2))",10,800);
     69  //TF1 *fitfunCMS = new TF1("userCMS","sqrt(pow(1.17*100/sqrt(x),2)+pow(0.039*100,2))",10,800);
     70 
     71  TGraph *gr11 = new TGraph((numBin-1),x,y);
    6972  gr11->Draw("AP");
    7073  gr11->SetTitle("");
     
    7477 
    7578  Double_t* params = fitfun->GetParameters();
    76  
    77   gr11->Fit("user","QR");
    78   gr11->Fit("user","QRI");
    79   gr11->Fit("user","QRI");
    80   gr11->Fit("user","QRI");
    81   char tempResol[500];
    82   if(params[2]==0.000000)sprintf(tempResol,"#frac{#sigma(E_{T}^{rec}/E_{T}^{MC})}{<E_{T}^{rec}/E_{T}^{MC}>} = #frac{%f}{#sqrt{E_{T}^{MC}}} #oplus %f",params[1]/100,params[0]/100);
    83   else sprintf(tempResol,"#frac{#sigma(E_{T}^{rec}/E_{T}^{MC})}{<E_{T}^{rec}/E_{T}^{MC}>} = #frac{%f}{#sqrt{E_{T}^{MC}}} #oplus #frac{%f}{E_{T}^{MC}} #oplus %f",params[1]/100,params[2]/100,params[0]/100);
    84  
    85   TPaveText *leg1 = MakeTPave(0.4,0.6,0.8,0.65,tempResol);
    86   leg1->Draw();
     79
     80  fitfun->SetLineColor(6);
     81  gr11->Fit("user","QR");
     82  gr11->Fit("user","QR");
     83  gr11->Fit("user","QR");
     84  gr11->Fit("user","QR");
     85  char tempResol[100];
     86  sprintf(tempResol,"Delphes resolution: #frac{#sigma(E_{T}^{rec}/E_{T}^{MC})}{<E_{T}^{rec}/E_{T}^{MC}>} = #frac{%f}{#sqrt{E_{T}^{MC}}} #oplus %f",params[1],params[2]);
     87 char tempResol2[100];
     88  sprintf(tempResol2,"sqrt(pow(%f/sqrt(x),2)+pow(%f,2))",params[1],params[2]);
     89
     90
     91  TF1 *fitfunDelphes = new TF1("userDelphes",tempResol2,7,1000);
     92  fitfunDelphes->SetLineColor(6);
     93  fitfunDelphes->Draw("same");
     94
     95  //CMS values
     96  fitfunCMS->SetLineColor(9);
     97  fitfunCMS->Draw("same");
    8798
    8899  TPaveText *events = MakeTPave(0.2,0.75,0.35,0.8,"Events: pp #rightarrow gg ");
    89100  events->Draw();
    90101
    91 
    92102  TPaveText *Delphes = MakeTPave(0.2,0.15,0.35,0.2,"MG/ME + Delphes");
    93103  Delphes->Draw();
    94  
    95  
     104
     105  TLegend *legend = new TLegend(0.2,0.6,0.9,0.85,NULL,"NDC");
     106  legend->AddEntry(fitfunCMS,"CMS resolution","l");
     107  legend->AddEntry(fitfunDelphes,tempResol,"l");
     108  legend->SetFillColor(10);
     109  legend->SetBorderSize(0);
     110  legend->Draw();
     111
    96112  delete fitfun;
    97113}
     
    103119  gROOT->Reset();
    104120 
    105   TFile *f1 = new TFile("lept.root","read");
     121  TFile *f1 = new TFile("ETMIS2.root","read");
    106122  TTree *Analyze = (TTree*)f1->Get("Analysis");
    107123 
    108   const Int_t numBin=6;
    109   double bins[numBin]={0,20,40,60,80,140};
     124  const Int_t numBin=11;
     125  double bins[numBin]={0,10,20,30,40,50,60,70,80,100,120};
    110126  TProfile *ETSminusET = new TProfile("ETSminusET","Electron resolution: E_{T}^{rec}/E_{T}^{mc}",(numBin-1),bins,-10,10);
    111127 
     
    142158     
    143159      c3->cd(++frame);
    144       GaussValues(Analyze,tempName,rms[i],mean[i],mystringMin,mystringMax);
     160      GaussValuesElec(Analyze,tempName,rms[i],mean[i],mystringMin,mystringMax);
     161      //GaussValues(Analyze,tempName,rms[i],mean[i],mystringMin,mystringMax);
    145162      x[i]=binCenter;
    146163      finval=rms[i]/binCenter;
     
    189206  gROOT->Reset();
    190207 
    191   TFile *f1 = new TFile("Etmis.root","read");
     208  TFile *f1 = new TFile("ETMIS2.root","read");
    192209  TTree *Analyze = (TTree*)f1->Get("Analysis");
    193210 
     
    206223  TPaveText *ctau = MakeTPave(0.3,0.75,0.45,0.8,"C_{#tau} = #frac{#sum E^{towers} (#DeltaR = 0.15)}{E^{jet}}");
    207224  ctau->Draw();
    208   TPaveText *events1 = MakeTPave(0.3,0.65,0.45,0.7,"Events: WHq'#rightarrow W#tau#tauq'#rightarrowjjl#tauq', m_{H}=150 GeV ");
     225  TPaveText *events1 = MakeTPave(0.3,0.65,0.45,0.7,"Events: WHq'#rightarrow WWWq'#rightarrow lllq', m_{H}=150 GeV ");
    209226  events1->Draw();
    210227 
     
    222239  TPaveText *numtracks = MakeTPave(0.6,0.75,0.85,0.8,"#DeltaR < 0.4, p_{T}^{track} > 2 GeV");
    223240  numtracks->Draw();
    224   TPaveText *events = MakeTPave(0.6,0.65,0.85,0.7,"Events: WHq'#rightarrow W#tau#tauq'#rightarrowjjl#tauq', m_{H}=150 GeV ");
     241  TPaveText *events = MakeTPave(0.6,0.65,0.85,0.7,"Events: WHq'#rightarrow WWWq'#rightarrow lllq', m_{H}=150 GeV ");
    225242  events->Draw();
    226243   
     
    233250  gROOT->Reset();
    234251 
    235   TFile *f1 = new TFile("Etmis.root","read");
     252  TFile *f1 = new TFile("JET.root","read");
    236253  TTree *Analyze = (TTree*)f1->Get("Analysis");
    237254 
    238255  TF1 *fitfun = new TF1("user","[0]*sqrt(x)",0,600);
    239   const Int_t numBin=7;
    240   double bins[numBin]={200,250,300,350,400,450,500};
     256  const Int_t numBin=6;
     257  double bins[numBin]={180,260,340,420,500,580};
    241258  TProfile *ETSoverET = new TProfile("ETSoverET","ETmis resol",(numBin-1),bins,-1000,1000);
    242259 
     
    288305  gr11->Fit("user","RQ");
    289306  gr11->Fit("user","RQ");
    290   gr11->GetYaxis()->SetRangeUser(0,30);
     307  gr11->GetYaxis()->SetRangeUser(0,60);
    291308  gr11->GetXaxis()->SetRangeUser(1,600);
    292309
     
    299316  leg1->Draw();
    300317
    301   TPaveText *leg2 = MakeTPave(0.2,0.8,0.8,0.85,"WHq'#rightarrow W#tau#tauq'#rightarrowjjl#tauq', m_{H}=150 GeV ");
     318  TPaveText *leg2 = MakeTPave(0.2,0.8,0.8,0.85,"WHq'#rightarrow WWWq'#rightarrow lllq', m_{H}=150 GeV ");
    302319  leg2->Draw();
    303320
     
    312329{
    313330  JetResol();
    314   ElecResol();
    315   ETmisResol();
    316   TauJetInfo();
    317  
    318 }
    319 
    320 
     331//  ElecResol();
     332//  ETmisResol();
     333//  TauJetInfo();
     334 
     335}
     336
     337
Note: See TracChangeset for help on using the changeset viewer.