Changeset 479 in svn for trunk/routines/resolutions_atlas.C
- Timestamp:
- Jul 14, 2009, 12:51:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/routines/resolutions_atlas.C
r473 r479 49 49 50 50 //TFile *f1 = new TFile("JET2_atlas_jetclu.root","read"); 51 //TFile *f1 = new TFile("JET2_atlas_jetclu_new.root","read"); // 40k 51 52 //TFile *f1 = new TFile("JET2_atlas_siscone.root","read"); 52 53 //TFile *f1 = new TFile("JET2_atlas_antikt.root","read"); 53 TFile *f1 = new TFile("JET2_atlas_midpoint.root","read");54 //TFile *f1 = new TFile("JET2_atlas_midpoint.root","read"); 54 55 //TFile *f1 = new TFile("JET2_atlas_midpoint_eflow.root","read"); 55 56 //TFile *f1 = new TFile("JET2_atlas_midpoint_newCaloRes.root","read"); 57 //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 60 56 61 if(!f1->IsOpen()) { cout << "could not open "<< f1->GetName() << ". Exiting..." << endl; return;} 57 62 if(!f1->FindKey("Analysis")) { cout << "Bad input file, could not find the \"Analysis\" tree. Exiting..." << endl; return;} 58 63 TTree *Analyze = (TTree*)f1->Get("Analysis"); 59 64 60 const Int_t numBin=16; 61 double bins[numBin]={0,10,20,30,40,50,60,70,80,100,120,140,180,220,300,1200}; 62 TProfile *ESoverE = new TProfile("ESoverE","Jet resolution for ATLAS ",(numBin-1),bins,-10,10); 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 }; 71 const int numBin=14; 72 double bins[numBin]={21,26,32,39,48, 59,72,88,130, 191,278, 405,581,834 }; 73 TProfile *ESoverE = new TProfile("ESoverE","Jet resolution for ATLAS ",numBin-1,bins,-10,10); 63 74 64 75 double mean[numBin], mean2[numBin]; … … 66 77 TCanvas *c1 = new TCanvas("c1","JET resol: (E_reco - E_gen)/E_gen",0,0,1000,650); 67 78 c1->cd(); int frame=0; 68 c1->Divide( 6,2);79 c1->Divide(10,2); 69 80 TCanvas *c1b = new TCanvas("c1b","JET resol: [(E_reco - E_gen)/E_gen]^2 ",0,0,1000,650); 70 81 c1b->cd(); int frame2=0; 71 c1b->Divide( 6,2);82 c1b->Divide(10,2); 72 83 73 84 float x[numBin-1]; … … 75 86 float ex[numBin-1]; 76 87 float ey[numBin-1]; 88 float erec_over_etruth[numBin-1]; 77 89 78 90 float finval=0;//valeur a remplir puis a fitter 79 80 for ( int i=0; i<(numBin-1); i++) // premiÚre bin : i ==1 et pas i == 0 91 // available variables: 92 // - E : true Energy 93 // - PT : true transverse energy 94 // - SmearedPT : ratio ET_rec / ET_gen 95 // - dE : ratio (E_rec - E_truth)/E_truth 96 // - dE2 : ( (E_rec - E_truth)/E_truth )^2 97 98 99 for ( int i=0; i<numBin-1; i++) // premiÚre bin : i ==1 et pas i == 0 81 100 { 82 101 TAxis *xaxis = ESoverE->GetXaxis(); … … 92 111 string mystringMax(tempMax); 93 112 char tempName[500]; 94 sprintf(tempName,"(JetPTResol.dE)>>hdE%d",i); 113 //sprintf(tempName,"JetPTResol.dE/JetPTResol.SmearedPT>>hdE%d",i); 114 //sprintf(tempName,"JetPTResol.dE>>hdE%d",i); 115 sprintf(tempName,"JetPTResol.dE_reco>>hdE%d",i); 95 116 string mystringName(tempName); 96 117 c1->cd(++frame); 97 GaussValuesAsymmetry(Analyze,tempName,mean[i],mystringMin,mystringMax); 98 99 sprintf(tempName,"(JetPTResol.dE2)>>hdE2%d",i); 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"; 121 GaussValuesAsymmetry(Analyze,tempName,mean[i],mystringMin,mystringMax,cut); 122 123 //sprintf(tempName,"JetPTResol.dE2/JetPTResol.SmearedPT>>hdE2%d",i); 124 //sprintf(tempName,"JetPTResol.dE2/JetPTResol.SmearedPT>>hdE2%d",i); 125 sprintf(tempName,"JetPTResol.dE2_reco>>hdE2%d",i); 100 126 string mystringName2(tempName); 101 127 c1b->cd(++frame2); 102 GaussValuesAsymmetry(Analyze,tempName,mean2[i],mystringMin,mystringMax); 128 GaussValuesAsymmetry2(Analyze,tempName,mean2[i],mystringMin,mystringMax,cut); 129 103 130 104 131 x[i]=binCenter; 105 132 finval=sqrt(mean2[i] - mean[i]*mean[i]); 106 y[i]= (finval*100);133 y[i]=finval*100; 107 134 ex[i]=0; 108 135 ey[i]=0; 136 erec_over_etruth[i]=mean[i]+1; 109 137 110 138 } 111 139 140 TCanvas *c3 = new TCanvas("c3","JET linearity",100,100,600,450); 141 c3->cd(); 142 //for(int i=0; i<numBin-1; i++) cout << x[i] << "\t\t" << erec_over_etruth[i] << endl; 143 TGraph *linearity = new TGraph(numBin-1,x,erec_over_etruth); 144 linearity->Draw("AP"); 145 linearity->SetTitle(""); 146 linearity->GetXaxis()->SetTitle("E^{Truth} [GeV]"); 147 linearity->GetYaxis()->SetTitle("<E^{Reco}/E^{Truth}>"); 148 linearity->GetXaxis()->SetRangeUser(30,1000); 149 linearity->SetMinimum(0.85); 150 linearity->SetMaximum(1.20); 151 gPad->SetLogx(); 152 153 112 154 TCanvas *c2 = new TCanvas("c2","JET resol",100,100,600,450); 113 155 c2->cd(); 114 156 115 TF1 *fitfun = new TF1("user","sqrt(pow([0]/x,2)+pow([1]/sqrt(x),2)+pow([2],2))",10,800); 116 TF1 *fitfunATLAS = new TF1("userATLAS","sqrt(pow(1.03*100/sqrt(x),2)+pow(0.026*100,2)+pow(8*100/x,2))",10,800); 117 118 TGraph *gr11 = new TGraph((numBin-1),x,y); 157 TGraph *gr11 = new TGraph(numBin-1,x,y); 119 158 gr11->Draw("AP"); 120 159 gr11->SetTitle(""); … … 123 162 gr11->GetYaxis()->SetTitle("#sigma(E)/E"); 124 163 164 TF1 *fitfun = new TF1("user","sqrt(pow([0]/x,2)+pow([2]/sqrt(x),2)+pow([1],2))",10,800); 125 165 Double_t* params = fitfun->GetParameters(); 126 127 166 fitfun->SetLineColor(kBlue); 128 167 gr11->Fit("user","QRN"); … … 130 169 gr11->Fit("user","QRN"); 131 170 gr11->Fit("user","QRN"); 171 gr11->GetXaxis()->SetRangeUser(30,1200); 172 //gPad->SetLogx(); 132 173 char tempResol[100]; 133 sprintf(tempResol,"Delphes resolution: #frac{#sigma(E)}{E} = #sqrt{ <( #frac{E_{reco} - E_{gen}}{E_{gen}} )^{2} > - < #frac{E_{reco}-E_{gen}}{E_{gen}}>^{2} } =\n #frac{%f}{#sqrt{E_{T}^{MC}}} #oplus %f #oplus #frac{%f}{E}",params[1],params[2],params[3]); 174 //sprintf(tempResol,"Delphes resolution: #frac{#sigma(E)}{E} = #sqrt{ <( #frac{E_{reco} - E_{gen}}{E_{gen}} )^{2} > - < #frac{E_{reco}-E_{gen}}{E_{gen}}>^{2} } =\n #frac{%f}{#sqrt{E_{T}^{MC}}} #oplus %f #oplus #frac{%f}{E}",params[1],params[2],params[3]); 175 sprintf(tempResol,"Delphes resolution: #frac{#sigma(E)}{E} = #frac{%.1f}{#sqrt{E^{MC}}} #oplus %.1f #oplus #frac{%.1f}{E^{MC}}",params[2],params[1],params[0]); 134 176 char tempResol2[100]; 135 sprintf(tempResol2,"sqrt(pow(%f/ sqrt(x),2)+pow(%f,2))",params[1],params[2]);177 sprintf(tempResol2,"sqrt(pow(%f/x,2)+pow(%f/sqrt(x),2)+pow(%f,2) )",params[0],params[2],params[1]); 136 178 137 179 138 180 TF1 *fitfunDelphes = new TF1("userDelphes",tempResol2,7,1000); 139 fitfunDelphes->SetLineColor(kBl ue);181 fitfunDelphes->SetLineColor(kBlack); 140 182 fitfunDelphes->SetLineStyle(7); 141 183 fitfunDelphes->Draw("same"); 142 184 143 fitfunATLAS->SetLineColor(kRed);144 fitfunATLAS->SetLine Width(2);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); 186 fitfunATLAS->SetLineColor(kBlue); 145 187 fitfunATLAS->Draw("same"); 146 188 147 TPaveText *events = MakeTPave(0.2,0.75,0.35,0.8,"Events: pp #rightarrow gg "); 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 "); 194 etacut->Draw(); 195 196 TPaveText *events = MakeTPave(0.62,0.43,0.75,0.47,"Events: pp #rightarrow ggX "); 148 197 events->Draw(); 149 198 150 TPaveText *Delphes = MakeTPave(0.2,0.15,0.35,0.2,"MG/ME + Delphes"); 199 TPaveText *algo = MakeTPave(0.64,0.36,0.76,0.40,"k_{T} algorithm #Delta R = 0.6"); 200 //TPaveText *algo = MakeTPave(0.64,0.36,0.76,0.40,"Cone algorithm #Delta R = 0.7"); 201 algo->Draw(); 202 203 TPaveText *Delphes = MakeTPave(0.62,0.29,0.85,0.33,"MG/ME + Pythia + Delphes"); 151 204 Delphes->Draw(); 152 205 153 TLegend *legend = new TLegend(0. 2,0.6,0.9,0.85,NULL,"NDC");206 TLegend *legend = new TLegend(0.18,0.72,0.87,0.87,NULL,"NDC"); 154 207 legend->AddEntry(fitfunATLAS,"ATLAS resolution","l"); 155 208 legend->AddEntry(fitfunDelphes,tempResol,"l"); … … 157 210 legend->SetBorderSize(0); 158 211 legend->Draw(); 212 159 213 160 214 delete fitfun;
Note:
See TracChangeset
for help on using the changeset viewer.