Changeset 153 in svn for trunk/routines/resolutions.C
- Timestamp:
- Jan 7, 2009, 12:24:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/routines/resolutions.C
r91 r153 6 6 #include "TF1.h" 7 7 #include "TGraph.h" 8 #include "TLegend.h" 8 9 9 10 #include "interface/FuncDef.h" … … 17 18 TTree *Analyze = (TTree*)f1->Get("Analysis"); 18 19 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}; 21 22 TProfile *ETSoverET = new TProfile("ETSoverET","Jet resolution: E_{T}^{rec}/E_{T}^{mc}",(numBin-1),bins,-10,10); 22 23 … … 64 65 c2->cd(); 65 66 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); 69 72 gr11->Draw("AP"); 70 73 gr11->SetTitle(""); … … 74 77 75 78 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"); 87 98 88 99 TPaveText *events = MakeTPave(0.2,0.75,0.35,0.8,"Events: pp #rightarrow gg "); 89 100 events->Draw(); 90 101 91 92 102 TPaveText *Delphes = MakeTPave(0.2,0.15,0.35,0.2,"MG/ME + Delphes"); 93 103 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 96 112 delete fitfun; 97 113 } … … 103 119 gROOT->Reset(); 104 120 105 TFile *f1 = new TFile(" lept.root","read");121 TFile *f1 = new TFile("ETMIS2.root","read"); 106 122 TTree *Analyze = (TTree*)f1->Get("Analysis"); 107 123 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}; 110 126 TProfile *ETSminusET = new TProfile("ETSminusET","Electron resolution: E_{T}^{rec}/E_{T}^{mc}",(numBin-1),bins,-10,10); 111 127 … … 142 158 143 159 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); 145 162 x[i]=binCenter; 146 163 finval=rms[i]/binCenter; … … 189 206 gROOT->Reset(); 190 207 191 TFile *f1 = new TFile("E tmis.root","read");208 TFile *f1 = new TFile("ETMIS2.root","read"); 192 209 TTree *Analyze = (TTree*)f1->Get("Analysis"); 193 210 … … 206 223 TPaveText *ctau = MakeTPave(0.3,0.75,0.45,0.8,"C_{#tau} = #frac{#sum E^{towers} (#DeltaR = 0.15)}{E^{jet}}"); 207 224 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 "); 209 226 events1->Draw(); 210 227 … … 222 239 TPaveText *numtracks = MakeTPave(0.6,0.75,0.85,0.8,"#DeltaR < 0.4, p_{T}^{track} > 2 GeV"); 223 240 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 "); 225 242 events->Draw(); 226 243 … … 233 250 gROOT->Reset(); 234 251 235 TFile *f1 = new TFile(" Etmis.root","read");252 TFile *f1 = new TFile("JET.root","read"); 236 253 TTree *Analyze = (TTree*)f1->Get("Analysis"); 237 254 238 255 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}; 241 258 TProfile *ETSoverET = new TProfile("ETSoverET","ETmis resol",(numBin-1),bins,-1000,1000); 242 259 … … 288 305 gr11->Fit("user","RQ"); 289 306 gr11->Fit("user","RQ"); 290 gr11->GetYaxis()->SetRangeUser(0, 30);307 gr11->GetYaxis()->SetRangeUser(0,60); 291 308 gr11->GetXaxis()->SetRangeUser(1,600); 292 309 … … 299 316 leg1->Draw(); 300 317 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 "); 302 319 leg2->Draw(); 303 320 … … 312 329 { 313 330 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.