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.4 by buchmann, Fri Nov 2 19:03:18 2012 UTC vs.
Revision 1.5 by buchmann, Sun Nov 4 19:14:43 2012 UTC

# Line 28 | Line 28 | namespace RecoPhotons {
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   }
# Line 59 | Line 131 | void RecoPhotons::EfficiencyPurity() {
131   }
132  
133   void CompareZmassToFinalStateLeptons() {
134 <    cout << __FUNCTION__ << " not implemented." << endl;
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() {
66  cout << "RecoLevelStudies have not been implemented yet" << endl;
208    TCut essential_bkp = essentialcut;
209    essentialcut=TCut("");
210      
211 <  CompareZmassToFinalStateLeptons();
211 > //  CompareZmassToFinalStateLeptons();
212 >    FSRPhotonVsUnmatchedVsMatchedPhoton();
213 >    FSRPhotonVsUnmatchedVsMatchedPhoton2D();
214    NumberOfPhotonsPerEvent();
215    CharacterizingFSRPhotons();
216    CompareRecoJZBDistributions();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines