ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/Modules/FSRStudy.C
(Generate patch)

Comparing UserCode/cbrown/Development/Plotting/Modules/FSRStudy.C (file contents):
Revision 1.2 by buchmann, Mon Oct 15 11:53:03 2012 UTC vs.
Revision 1.5 by buchmann, Sun Nov 4 19:14:43 2012 UTC

# Line 22 | Line 22 | namespace GenPhotons {
22   namespace RecoPhotons {
23    void RecoLevelStudies();
24    
25 <  
26 <  
25 >  void NumberOfPhotonsPerEvent();
26 >  void CharacterizingFSRPhotons();
27 >  void MakeCharacterizationPlot(string variable, int nbins, float min, float max, string label, string saveas);
28 >  void dR2DPlots();
29 >  void CompareRecoJZBDistributions();
30 >  void EfficiencyPurity();
31 >  void FSRPhotonVsUnmatchedVsMatchedPhoton();
32 >  void FSRPhotonVsUnmatchedVsMatchedPhoton2D();
33 >    
34 >  TCut FSRcut;
35 >  TCut NoFSRcut;
36 >  TCut BaseCut;
37 > }
38 >
39 > void RecoPhotons::FSRPhotonVsUnmatchedVsMatchedPhoton() {
40 >    
41 >    TCanvas *can = new TCanvas("can","can");
42 >    can->SetLogy(1);
43 >    TH1F *MatchedFSR  = PhotonSamples.Draw("MatchedFSR" ,"min(recoPhotonsDR1,recoPhotonsDR2)",20,0,2,"min(#Delta R (#gamma,l_{1}), #Delta R (#gamma,l_{2}))" ,  "events", "recoPhotonGenIndex>=0 && genPhotonsIsFSR[recoPhotonGenIndex]",mc,PlottingSetup::luminosity);
44 >    TH1F *MatchednoFSR  = PhotonSamples.Draw("MatchednoFSR" ,"min(recoPhotonsDR1,recoPhotonsDR2)",20,0,2,"min(#Delta R (#gamma,l_{1}), #Delta R (#gamma,l_{2}))" ,  "events", "recoPhotonGenIndex>=0 && !genPhotonsIsFSR[recoPhotonGenIndex]",mc,PlottingSetup::luminosity);
45 >    TH1F *UnMatched  = PhotonSamples.Draw("UnMatched" ,"min(recoPhotonsDR1,recoPhotonsDR2)",20,0,2,"min(#Delta R (#gamma,l_{1}), #Delta R (#gamma,l_{2}))" ,  "events", "recoPhotonGenIndex<0",mc,PlottingSetup::luminosity);
46 >    
47 >    MatchedFSR->SetLineColor(TColor::GetColor("#01DF01"));//green
48 >    MatchednoFSR->SetLineColor(TColor::GetColor("#FF4000"));//red
49 >    UnMatched->SetLineColor(TColor::GetColor("#194fff"));//blue
50 >    
51 >    TLegend *leg = new TLegend(0.7,0.7,0.89,0.89);
52 >    leg->SetFillColor(kWhite);
53 >    leg->AddEntry(MatchedFSR,"Matched: FSR","l");
54 >    leg->AddEntry(MatchednoFSR,"Matched: no FSR","l");
55 >    leg->AddEntry(UnMatched,"Unmatched #gamma","l");
56 >    
57 >    MatchedFSR->DrawNormalized("histo");
58 >    MatchednoFSR->DrawNormalized("same,histo");
59 >    UnMatched->DrawNormalized("same,histo");
60 >    leg->SetHeader("DY MC:");
61 >    leg->Draw("same,histo");
62 >    DrawMCPrelim();
63 >    
64 >    CompleteSave(can,"PhotonStudies/Recophotons/DeltaR_Comparison_Matched_Unmatched_FSR");
65 >    
66 >    
67 > }
68 >
69 > void RecoPhotons::FSRPhotonVsUnmatchedVsMatchedPhoton2D() {
70 >    
71 >    TCanvas *can = new TCanvas("can","can",500,1500);
72 >    can->Divide(1,3);
73 >    
74 >    
75 >    vector<float> binX, binY;
76 >    for(int i=0;i<=31;i++) {
77 >        binX.push_back(i*0.1);
78 >        binY.push_back(i*0.1);
79 >    }
80 >    
81 >    TH2F *MatchedFSR   = PhotonSamples.Draw("MatchedFSR",  "recoPhotonsDR1:recoPhotonsDR2", binX,binY, "#Delta R (#gamma^{FSR},l_{1})","#Delta R (#gamma^{FSR},l_{2})",BaseCut&&TCut("recoPhotonGenIndex>=0 && genPhotonsIsFSR[recoPhotonGenIndex]"),mc,PlottingSetup::luminosity, PhotonSamples.FindSample("o"),false);
82 >    TH2F *MatchednoFSR   = PhotonSamples.Draw("MatchednoFSR",  "recoPhotonsDR1:recoPhotonsDR2", binX,binY, "#Delta R (#gamma^{FSR},l_{1})","#Delta R (#gamma^{FSR},l_{2})",BaseCut&&TCut("recoPhotonGenIndex>=0 && !genPhotonsIsFSR[recoPhotonGenIndex]"),mc,PlottingSetup::luminosity, PhotonSamples.FindSample("o"),false);
83 >    TH2F *UnMatched   = PhotonSamples.Draw("UnMatched",  "recoPhotonsDR1:recoPhotonsDR2", binX,binY, "#Delta R (#gamma^{FSR},l_{1})","#Delta R (#gamma^{FSR},l_{2})",BaseCut&&TCut("recoPhotonGenIndex<0"),mc,PlottingSetup::luminosity, PhotonSamples.FindSample("o"),false);
84 >    
85 >    
86 >    
87 >    MatchedFSR->SetLineColor(TColor::GetColor("#01DF01"));//green
88 >    MatchednoFSR->SetLineColor(TColor::GetColor("#FF4000"));//red
89 >    UnMatched->SetLineColor(TColor::GetColor("#194fff"));//blue
90 >    
91 >    TLegend *leg = new TLegend(0.7,0.7,0.89,0.89);
92 >    leg->SetFillColor(kWhite);
93 >    leg->AddEntry(MatchedFSR,"Matched: FSR","l");
94 >    leg->AddEntry(MatchednoFSR,"Matched: no FSR","l");
95 >    leg->AddEntry(UnMatched,"Unmatched #gamma","l");
96 >    
97 >    MatchedFSR->DrawNormalized("histo");
98 >    MatchednoFSR->DrawNormalized("same,histo");
99 >    UnMatched->DrawNormalized("same,histo");
100 >    leg->SetHeader("DY MC:");
101 >    leg->Draw("same,histo");
102 >    DrawMCPrelim();
103 >    
104 >    CompleteSave(can,"PhotonStudies/Recophotons/DeltaR_Comparison_Matched_Unmatched_FSR__2D");
105 >    
106 >    
107 > }
108 >
109 > void RecoPhotons::NumberOfPhotonsPerEvent() {
110 >    cout << __FUNCTION__ << " not implemented." << endl;
111 > }
112 >
113 > void RecoPhotons::CharacterizingFSRPhotons() {
114 >    cout << __FUNCTION__ << " not implemented." << endl;
115 > }
116 >
117 > void RecoPhotons::dR2DPlots() {
118 >    cout << __FUNCTION__ << " not implemented." << endl;
119 > }
120 >
121 > void RecoPhotons::MakeCharacterizationPlot(string variable, int nbins, float min, float max, string label, string saveas) {
122 >    cout << __FUNCTION__ << " not implemented." << endl;
123 > }
124 >
125 > void RecoPhotons::CompareRecoJZBDistributions() {
126 >    cout << __FUNCTION__ << " not implemented." << endl;
127 > }
128 >
129 > void RecoPhotons::EfficiencyPurity() {
130 >    cout << __FUNCTION__ << " not implemented." << endl;
131 > }
132 >
133 > void CompareZmassToFinalStateLeptons() {
134 >    
135 >    TCanvas *can = new TCanvas("can","can");
136 >    can->SetLogy(1);
137 >    
138 >    TH1F *FullZ  = PhotonSamples.Draw("FullZ" ,"genFSRmllg",36,20,200,"m_{ll} [GeV]" ,  "events", "genFSRmllg>20&&genFSRmllg<200",mc,PlottingSetup::luminosity);
139 >    TH1F *RecoLL = PhotonSamples.Draw("RecoLL","mll",       36,20,200,"m_{ll} [GeV]"      , "events","mll>20&&mll<200",mc,PlottingSetup::luminosity);
140 >    TH1F *FSRRll = PhotonSamples.Draw("FSRRll","mllg",      36,20,200,"m_{ll#gamma} [GeV]", "events","mllg>20&&mllg<200",mc,PlottingSetup::luminosity);
141 >    
142 >    FullZ->SetLineColor(TColor::GetColor("#01DF01"));//green
143 >    RecoLL->SetLineColor(TColor::GetColor("#FF4000"));//red
144 >    FSRRll->SetLineColor(TColor::GetColor("#194fff"));//blue
145 >    
146 >    TLegend *leg = new TLegend(0.7,0.7,0.89,0.89);
147 >    leg->SetFillColor(kWhite);
148 >    leg->AddEntry(FullZ,"gen Z mass","l");
149 >    leg->AddEntry(RecoLL,"reco m_{ll}","l");
150 >    leg->AddEntry(FSRRll,"reco m_{ll} w/ FSR recovery","l");
151 >    
152 >    FullZ->DrawNormalized("histo");
153 >    RecoLL->DrawNormalized("same,histo");
154 >    FSRRll->DrawNormalized("same,histo");
155 >    leg->SetHeader("DY MC:");
156 >    leg->Draw("same,histo");
157 >    DrawMCPrelim();
158 >    
159 >    CompleteSave(can,"PhotonStudies/Recophotons/CompareZmassToFinalStateLeptons");
160 >    
161 >    
162 >    TH1F *RecoLL2 = PhotonSamples.Draw("RecoLL2","mll-genFSRmllg",       50,-100,100,"m_{ll}-m_{Z}^{gen} [GeV]", "events","mll>20&&genFSRmllg>20", mc,PlottingSetup::luminosity);
163 >    TH1F *FSRRll2 = PhotonSamples.Draw("FSRRll2","mllg-genFSRmllg",      50,-100,100,"m_{ll}-m_{Z}^{gen} [GeV]", "events","mllg>20&&genFSRmllg>20",mc,PlottingSetup::luminosity);
164 >    
165 >    RecoLL2->SetLineColor(TColor::GetColor("#FF4000"));//red
166 >    FSRRll2->SetLineColor(TColor::GetColor("#194fff"));//blue
167 >    
168 >    TH1F *phony = new TH1F("phony","",1,0,1);
169 >    phony->SetLineColor(kWhite);
170 >    
171 >    stringstream summary;
172 >    summary << "Before: Mean @ " << std::setprecision(3) << RecoLL2->GetMean() << ", RMS: " << std::setprecision(3) << RecoLL2->GetRMS();
173 >    stringstream summary2;
174 >    summary2 << "After:  Mean @ " << std::setprecision(3) << FSRRll2->GetMean() << ", RMS: " << std::setprecision(3) << FSRRll2->GetRMS() << "";
175 >    
176 >    TLegend *leg2 = new TLegend(0.6,0.7,0.89,0.89);
177 >    leg2->SetFillColor(kWhite);
178 >    leg2->AddEntry(FullZ,"gen Z mass","l");
179 >    leg2->AddEntry(RecoLL,"m_{ll}-m{Z}^{gen}: no FSRR","l");
180 >    leg2->AddEntry(FSRRll,"m_{ll}-m{Z}^{gen}: FSRR","l");
181 >    leg2->AddEntry(phony, summary.str().c_str(),"l");
182 >    leg2->AddEntry(phony, summary2.str().c_str(),"l");
183 >    
184 >    RecoLL2->DrawNormalized("histo");
185 >    FSRRll2->DrawNormalized("same,histo");
186 >    leg2->SetHeader("DY MC:");
187 >    leg2->Draw("same,histo");
188 >    DrawMCPrelim();
189 >    
190 >    cout << "Mean (before recovery) : " << RecoLL2->GetMean() << " , RMS: " << RecoLL2->GetRMS() << endl;
191 >    cout << "Mean (after recovery) : " <<  FSRRll2->GetMean() << " , RMS: " << FSRRll2->GetRMS() << endl;
192 >    
193 >    
194 >    CompleteSave(can,"PhotonStudies/Recophotons/CompareZmassToFinalStateLeptons_MassDiff");
195 >    
196 >    
197 >    
198 >    delete RecoLL;
199 >    delete RecoLL2;
200 >    delete FullZ;
201 >    delete FSRRll;
202 >    delete FSRRll2;
203 >    delete phony;
204 >    delete can;
205   }
206  
207   void RecoPhotons::RecoLevelStudies() {
208 <  cout << "RecoLevelStudies have not been implemented yet" << endl;
208 >  TCut essential_bkp = essentialcut;
209 >  essentialcut=TCut("");
210 >    
211 > //  CompareZmassToFinalStateLeptons();
212 >    FSRPhotonVsUnmatchedVsMatchedPhoton();
213 >    FSRPhotonVsUnmatchedVsMatchedPhoton2D();
214 >  NumberOfPhotonsPerEvent();
215 >  CharacterizingFSRPhotons();
216 >  CompareRecoJZBDistributions();
217 >    
218 >  dR2DPlots();
219 >    
220 >  EfficiencyPurity();
221 >    
222 >  essentialcut=essential_bkp;
223   }
224  
225  
# Line 53 | Line 245 | void GenPhotons::CompareZmassToFinalStat
245    leg->Draw("same,histo");
246    DrawMCPrelim();
247    
248 <  CompleteSave(can,"PhotonStudies/CompareZmassToFinalStateLeptons");
248 >  CompleteSave(can,"PhotonStudies/GenPhotons/CompareZmassToFinalStateLeptons");
249    delete can;
250   }  
251  
# Line 79 | Line 271 | void GenPhotons::NumberOfPhotonsPerEvent
271      leg->Draw("same,histo");
272      DrawMCPrelim();
273      
274 <    CompleteSave(can,"PhotonStudies/NPhotons");
274 >    CompleteSave(can,"PhotonStudies/GenPhotons/NPhotons");
275      
276      
277      TH1F *PhotonPt[10];
# Line 91 | Line 283 | void GenPhotons::NumberOfPhotonsPerEvent
283      
284      TLegend *leg2 = make_legend();
285      for(int i=0;i<10;i++) {
94        cout << PhotonPt[i]->Integral() << endl;
286          if(PhotonPt[i]->Integral()>50) {
287              PhotonPt[i]->SetLineColor(DrawCounter+1);
288              leg2->AddEntry(PhotonPt[i],(any2string(i)+" FSR Photons").c_str(),"l");
# Line 106 | Line 297 | void GenPhotons::NumberOfPhotonsPerEvent
297      leg2->SetHeader("DY MC (N_{jets} #geq 0):");
298      DrawMCPrelim();
299      
300 <    CompleteSave(can,"PhotonStudies/PhotonPtvsNPhotons");
300 >    CompleteSave(can,"PhotonStudies/GenPhotons/PhotonPtvsNPhotons");
301      
302      delete can;
303   }
# Line 136 | Line 327 | void GenPhotons::MakeCharacterizationPlo
327    leg->Draw("same,histo");
328    DrawMCPrelim();
329    
330 <  CompleteSave(can,"PhotonStudies/CharacterizingFSRPhotons/"+saveas);
330 >  CompleteSave(can,"PhotonStudies/GenPhotons/CharacterizingFSRPhotons/"+saveas);
331    delete dR_FSR;
332    delete dR_nFSR;
333    delete can;
# Line 146 | Line 337 | void GenPhotons::MakeCharacterizationPlo
337   void GenPhotons::CharacterizingFSRPhotons() {
338    MakeCharacterizationPlot("min(genPhotonsdR1,genPhotonsdR2)",100,0,5,"min(#Delta R (#gamma,l_{1}), #Delta R (#gamma,l_{2}))", "MinDR");
339    MakeCharacterizationPlot("genPhotonsPt",100,0,100,"p_{T}^{#gamma}", "PhotonPt");
340 <  MakeCharacterizationPlot("genPhotonsEta",100,-5,5,"{#eta}^{#gamma}", "PhotonEta");
341 <  MakeCharacterizationPlot("genPhotonsPhi",100,0,4,"{#phi}^{#gamma}", "PhotonPhi");
151 <  MakeCharacterizationPlot("genPhotonsM",100,0,2,"m^{#gamma}", "PhotonM");
340 >  MakeCharacterizationPlot("genPhotonsEta",100,-5,5,"#eta^{#gamma}", "PhotonEta");
341 >  MakeCharacterizationPlot("genPhotonsPhi",40,-4,4,"#phi^{#gamma}", "PhotonPhi");
342   }
343  
344   void GenPhotons::CompareGenJZBDistributions() {
# Line 176 | Line 366 | void GenPhotons::CompareGenJZBDistributi
366      leg->Draw("same,histo");
367      DrawMCPrelim();
368      
369 <    CompleteSave(can,"PhotonStudies/GenJZBDistributions");
369 >    CompleteSave(can,"PhotonStudies/GenPhotons/GenJZBDistributions");
370      delete dR_FSR;
371      delete dR_nFSR;
372      delete can;
# Line 204 | Line 394 | void GenPhotons::dR2DPlots() {
394      dR_nFSR->Draw("COLZ");
395      DrawMCPrelim();
396      
397 <    CompleteSave(can,"PhotonStudies/dR_in_2D");
397 >    CompleteSave(can,"PhotonStudies/GenPhotons/dR_in_2D");
398      delete dR_FSR;
399      delete dR_nFSR;
400      delete can;
# Line 213 | Line 403 | void GenPhotons::dR2DPlots() {
403  
404   void GenPhotons::EfficiencyPurity() {
405      TCanvas *can = new TCanvas("can","can");
216    cout << "Computing efficiency and purity !" << endl;
406      vector<float> bindR, binPt;
407      for(int i=0;i<=100;i++) bindR.push_back(i*0.05);
408      binPt.push_back(0);binPt.push_back(10);binPt.push_back(50);binPt.push_back(100);binPt.push_back(1000);binPt.push_back(1010);
409   //    binPt.push_back(0);binPt.push_back(1000);binPt.push_back(1001);
410      
411      
412 <    TH2F *dR_FSR   = PhotonSamples.Draw("dR_FSR",  "genPhotonsPt:min(genPhotonsdR1,genPhotonsdR2)", bindR, binPt,"min DR","#gamma pT",BaseCut && FSRcut   ,mc,PlottingSetup::luminosity, PhotonSamples.FindSample("o"),false);
413 <    TH2F *dR_Any  = PhotonSamples.Draw("dR_Any", "genPhotonsPt:min(genPhotonsdR1,genPhotonsdR2)",bindR,binPt, "min DR","#gamma pT",BaseCut  ,mc,PlottingSetup::luminosity, PhotonSamples.FindSample("o"),false);
414 <    
415 <    TGraph *purity[dR_FSR->GetNbinsY()+1];
416 <    TGraph *efficiency[dR_FSR->GetNbinsY()+1];
417 <    TGraph *purity_n_efficiency[dR_FSR->GetNbinsY()+1];
418 <    for(int i=1;i<dR_FSR->GetNbinsY();i++) {
419 <        //do this for each pt range
420 <        int NPhotons=0;
421 <        int NFSRPhotons=0;
422 <        int totalNFSRphotons=0;
423 <        for(int k=1;k<dR_FSR->GetNbinsX();k++) totalNFSRphotons+=dR_FSR->GetBinContent(k,i);
424 <        cout << i << " : " << totalNFSRphotons << " FSR photons in pt range " << dR_FSR->GetYaxis()->GetBinLowEdge(i) << " , " << dR_FSR->GetYaxis()->GetBinLowEdge(i)+dR_FSR->GetYaxis()->GetBinWidth(i) << endl;
425 <        purity[i-1]=new TGraph(dR_FSR->GetNbinsX());
426 <        efficiency[i-1]=new TGraph(dR_FSR->GetNbinsX());
427 <        purity_n_efficiency[i-1]=new TGraph(dR_FSR->GetNbinsX());
428 <        for(int j=1;j<=dR_FSR->GetNbinsX();j++) {
429 <            NPhotons+=dR_Any->GetBinContent(j,i);
430 <            NFSRPhotons+=dR_FSR->GetBinContent(j,i);
431 <
432 < //            cout << "For the pt range " << dR_FSR->GetYaxis()->GetBinLowEdge(i) << " , " << dR_FSR->GetYaxis()->GetBinLowEdge(i)+dR_FSR->GetYaxis()->GetBinWidth(i) << " we find a purity of " << (float)NFSRPhotons/NPhotons << " and an efficiency of " << (float)NFSRPhotons/totalNFSRphotons << endl;
433 <            cout << "       ::::::::" << j << " : " << NPhotons << " : " << NFSRPhotons << " : " << totalNFSRphotons << endl;
434 < /*            if(NPhotons>0) purity[i-1]->SetPoint(j-1,dR_FSR->GetXaxis()->GetBinCenter(j)+dR_FSR->GetBinWidth(j),(float)NFSRPhotons/NPhotons);
435 <            else purity[i-1]->SetPoint(j-1,dR_FSR->GetXaxis()->GetBinCenter(j)+dR_FSR->GetBinWidth(j),-1);
436 <            if(totalNFSRphotons>0) efficiency[i-1]->SetPoint(j,dR_FSR->GetXaxis()->GetBinCenter(j)+dR_FSR->GetBinWidth(j),(float)NFSRPhotons/totalNFSRphotons);
437 <            else efficiency[i-1]->SetPoint(j-1,dR_FSR->GetXaxis()->GetBinCenter(j)+dR_FSR->GetBinWidth(j),-1);
438 <         //   if(NPhotons>0 && totalNFSRphotons>0) purity_n_efficiency->SetPoint(j-1,(float)NFSRPhotons/totalNFSRphotons,(float)NFSRPhotons/NPhotons);
439 <         //   else purity_n_efficiency->SetPoint(j-1,-1,-1);*/
412 >    TGraph *purity[binPt.size()];
413 >    TGraph *efficiency[binPt.size()];
414 >    TGraph *purity_n_efficiency[binPt.size()];
415 >    TH1F *FSR[binPt.size()];
416 >    TH1F *Any[binPt.size()];
417 >    for(int i=1;i<binPt.size();i++) {
418 >       //do this for each pt range
419 >       float ptlow=binPt[i-1];
420 >       float pthi =binPt[i];
421 >       stringstream ptcut;
422 >       ptcut << "genPhotonsPt>" << ptlow << " && genPhotonsPt<" << pthi << " && min(genPhotonsdR1,genPhotonsdR2)<5";
423 >      
424 >       FSR[i-1]  = PhotonSamples.Draw("FSR", "min(genPhotonsdR1,genPhotonsdR2)", bindR,"min DR","events",TCut(ptcut.str().c_str()) && BaseCut && FSRcut ,mc,PlottingSetup::luminosity);
425 >       Any[i-1]  = PhotonSamples.Draw("Any", "min(genPhotonsdR1,genPhotonsdR2)", bindR,"min DR","events",TCut(ptcut.str().c_str()) && BaseCut  ,mc,PlottingSetup::luminosity);
426 >      
427 >       float NPhotons=0;
428 >       float NFSRPhotons=0;
429 >       float totalNFSRphotons=0;
430 >      
431 >       for(int k=1;k<FSR[i-1]->GetNbinsX();k++) totalNFSRphotons+=FSR[i-1]->GetBinContent(k);
432 >       purity[i-1]=new TGraph(FSR[i-1]->GetNbinsX());
433 >       efficiency[i-1]=new TGraph(FSR[i-1]->GetNbinsX());
434 >       purity_n_efficiency[i-1]=new TGraph(FSR[i-1]->GetNbinsX());
435 >       for(int j=1;j<=FSR[i-1]->GetNbinsX();j++) {
436 >         NPhotons+=(int)Any[i-1]->GetBinContent(j);
437 >         NFSRPhotons+=FSR[i-1]->GetBinContent(j);
438 > //            cout << "       ::::::::" << j << " : " << NPhotons << " : " << NFSRPhotons << " : " << totalNFSRphotons << endl;
439 >            if(NPhotons>0) purity[i-1]->SetPoint(j-1,FSR[i-1]->GetXaxis()->GetBinCenter(j)+FSR[i-1]->GetBinWidth(j),(float)NFSRPhotons/NPhotons);
440 >            else purity[i-1]->SetPoint(j-1,FSR[i-1]->GetXaxis()->GetBinCenter(j)+FSR[i-1]->GetBinWidth(j),-1);
441 >            if(totalNFSRphotons>0) efficiency[i-1]->SetPoint(j,FSR[i-1]->GetXaxis()->GetBinCenter(j)+FSR[i-1]->GetBinWidth(j),(float)NFSRPhotons/totalNFSRphotons);
442 >            else efficiency[i-1]->SetPoint(j-1,FSR[i-1]->GetXaxis()->GetBinCenter(j)+FSR[i-1]->GetBinWidth(j),-1);
443 >            if(totalNFSRphotons>0&&NPhotons>0) purity_n_efficiency[i-1]->SetPoint(j-1,(float)NFSRPhotons/totalNFSRphotons,(float)NFSRPhotons/NPhotons);
444          }
445 <        cout << "Done for pt range" << endl;
445 >        purity[i-1]->GetXaxis()->SetTitle("min(#Delta R(#gamma,l_{1}), #Delta R(#gamma,_{2}))");
446 >        purity[i-1]->GetXaxis()->CenterTitle();
447 >        purity[i-1]->GetYaxis()->SetTitle("purity");
448 >        purity[i-1]->GetYaxis()->CenterTitle();
449 >        
450 >        efficiency[i-1]->GetXaxis()->SetTitle("min(#Delta R(#gamma,l_{1}), #Delta R(#gamma,_{2}))");
451 >        efficiency[i-1]->GetXaxis()->CenterTitle();
452 >        efficiency[i-1]->GetYaxis()->SetTitle("efficiency");
453 >        efficiency[i-1]->GetYaxis()->CenterTitle();
454 >        
455 >        purity_n_efficiency[i-1]->GetXaxis()->SetTitle("efficiency");
456 >        purity_n_efficiency[i-1]->GetXaxis()->CenterTitle();
457 >        purity_n_efficiency[i-1]->GetYaxis()->SetTitle("purity");
458 >        purity_n_efficiency[i-1]->GetYaxis()->CenterTitle();
459 >    }
460 >    
461 >    TLegend *leg = make_legend();
462 >    
463 >    
464 >    for(int i=0;i<binPt.size()-2;i++) {
465 >        stringstream description;
466 >        description << binPt[i] << " < p_{T}^{#gamma} < " << binPt[i+1];
467 >        purity[i]->SetLineColor(i+1);
468 >        purity_n_efficiency[i]->SetLineColor(i+1);
469 >        efficiency[i]->SetLineColor(i+1);
470 >        leg->AddEntry(purity[i],description.str().c_str(),"l");
471      }
472 <    cout << "Done with graphs" << endl;
473 <    TFile *f = new TFile("out.root","RECREATE");
256 <    dR_Any->Write();
257 <    dR_FSR->Write();
258 <    f->Close();
259 <    cout << "Artificially aborting ... " << endl;return;
260 <    for(int i=0;i<dR_FSR->GetNbinsY();i++) {
472 >
473 >    for(int i=0;i<binPt.size()-2;i++) {
474          if(i==0) purity[i]->Draw("AC");
475          else purity[i]->Draw("C");
476      }
477 <    CompleteSave(can,"PhotonStudies/Purity");
477 >    leg->Draw();
478 >    CompleteSave(can,"PhotonStudies/GenPhotons/Purity");
479      
480 <    for(int i=0;i<dR_FSR->GetNbinsY();i++) {
480 >    for(int i=0;i<binPt.size()-2;i++) {
481          if(i==0) efficiency[i]->Draw("AC");
482          else efficiency[i]->Draw("C");
483      }
484 <    CompleteSave(can,"PhotonStudies/Efficiency");
484 >    leg->Draw();
485 >    CompleteSave(can,"PhotonStudies/GenPhotons/Efficiency");
486      
487 <    for(int i=0;i<dR_FSR->GetNbinsY();i++) {
487 >    for(int i=0;i<binPt.size()-1;i++) {
488          if(i==0) purity_n_efficiency[i]->Draw("AC");
489          else purity_n_efficiency[i]->Draw("C");
490      }
491 <    CompleteSave(can,"PhotonStudies/Purity_n_efficiency");
492 <    
493 <    dR_FSR->Draw("COLZ");
494 <    CompleteSave(can,"PhotonStudies/dR_Pt_Diag_FSR");
495 <    dR_Any->Draw("COLZ");
496 <    CompleteSave(can,"PhotonStudies/dR_Pt_Diag_Any");
282 <    
283 <    
491 >    leg->SetX2(0.8);
492 >    leg->SetX1(0.65);
493 >    leg->SetY1(0.1);
494 >    leg->SetY2(0.6);
495 >    leg->Draw();
496 >    CompleteSave(can,"PhotonStudies/GenPhotons/Purity_n_efficiency");
497   }
498  
499  
# Line 292 | Line 505 | void GenPhotons::GenLevelStudies() {
505    NumberOfPhotonsPerEvent();
506    CharacterizingFSRPhotons();
507    CompareGenJZBDistributions();
508 +
509    dR2DPlots();
510      
511    EfficiencyPurity();
# Line 317 | Line 531 | void InitializePhotonSamples() {
531   void FSRstudy() {
532    InitializePhotonSamples();
533    
534 <  GenPhotons::GenLevelStudies();
534 > //  GenPhotons::GenLevelStudies();
535    RecoPhotons::RecoLevelStudies();
536   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines