22 #include "TLegendEntry.h" 27 TLatex*
prelim =
new TLatex(.9, .95,
"NOvA Simulation");
28 prelim->SetTextColor(kGray+1);
30 prelim->SetTextSize(2/30.);
31 prelim->SetTextAlign(32);
32 TGaxis::SetMaxDigits(3);
37 TString
outDir2 =
"/nova/app/users/acedeno/tag_releaseS17-09-24/NDAna/ncpi0_Systematics/Resolution/Correction";
47 {
"/AbsoluteResTruthTotEnWithCorrection"},
48 {
"/BiasRecoTotEnWithCorrection"},
49 {
"/LogDeltaEnVsPi0RecoWithCorrection"},
50 {
"/AbsoluteResRecoTotEnWithCorrection"},
51 {
"/BiasTrueTotEnWithCorrection"},
52 {
"/LogDeltaEnVsPi0TrueWithCorrection"},
58 {
"_05-21-18_09_UncorrectedAngle"},
64 TFile *
f =
new TFile(
"resolutionstudybiasMay24-18-Png2_0_8_Cut_BeamAngle_uncorrected.root",
"READ");
71 TH2D*
h=(TH2D*)f->Get(
"selResolutionEn");
72 TH2D*
hh=(TH2D*)f->Get(
"selSigResolutionEn");
73 TH2D*
hhh=(TH2D*)f->Get(
"selBkgResolutionEn");
75 TH2D*
b=(TH2D*)f->Get(
"selResolutionEn1Bias");
76 TH2D* bb=(TH2D*)f->Get(
"selSigResolutionEn1Bias");
77 TH2D* bbb=(TH2D*)f->Get(
"selBkgResolutionEn1Bias");
87 float datapot = 8.09e20/3.54e21;
105 int nbins = h->GetNbinsX();
106 double xmin = h->GetXaxis()->GetXmin();
107 double xmax = h->GetXaxis()->GetXmax();
109 int nnbins = hh->GetNbinsX();
110 double xxmin = hh->GetXaxis()->GetXmin();
111 double xxmax = hh->GetXaxis()->GetXmax();
113 int nnnbins = hhh->GetNbinsX();
114 double xxxmin = hhh->GetXaxis()->GetXmin();
115 double xxxmax = hhh->GetXaxis()->GetXmax();
120 int mbins = b->GetNbinsX();
121 double bxmin = b->GetXaxis()->GetXmin();
122 double bxmax = b->GetXaxis()->GetXmax();
124 int mmbins = bb->GetNbinsX();
125 double bbxmin = bb->GetXaxis()->GetXmin();
126 double bbxmax = bb->GetXaxis()->GetXmax();
128 int mmmbins = bbb->GetNbinsX();
129 double bbbxmin = bbb->GetXaxis()->GetXmin();
130 double bbbxmax = bbb->GetXaxis()->GetXmax();
134 TH1D *hrms =
new TH1D(
"hrms" ,
"", nbins ,xmin,xmax);
135 TH1D *hhrms =
new TH1D(
"hhrms" ,
"", nnbins ,xxmin,xxmax);
136 TH1D *hhhrms =
new TH1D(
"hhhrms" ,
"", nnnbins ,xxxmin,xxxmax);
138 TH1D *biashmean =
new TH1D(
"brms" ,
"", mbins ,bxmin,bxmax);
139 TH1D *biashhmean =
new TH1D(
"bbrms" ,
"", mmbins ,bbxmin,bbxmax);
140 TH1D *biashhhmean =
new TH1D(
"bbbrms" ,
"", mmmbins ,bbbxmin,bbbxmax);
146 TH1D *projection = (TH1D*) h->ProjectionY(
"",
i,
i);
147 TH1D *projectionb = (TH1D*) b->ProjectionY(
"",
i,
i);
149 projectionb->Sumw2();
151 double mean = projectionb->GetMean();
152 double meanerr = projectionb->GetMeanError();
153 biashmean->SetBinContent(
i,mean);
154 biashmean->SetBinError(
i,meanerr);
157 double rms = projection->GetRMS();
158 double rmserr = projection->GetRMSError();
159 hrms->SetBinContent(
i,rms);
160 hrms->SetBinError(
i,rmserr);
165 for(
int i = 1;
i <= nnbins; ++
i){
167 TH1D *projection1 = (TH1D*) hh->ProjectionY(
"",
i,
i);
168 TH1D *projection1b = (TH1D*) bb->ProjectionY(
"",
i,
i);
169 projection1->Sumw2();
170 projection1b->Sumw2();
172 double hhmean = projection1b->GetMean();
173 double hhmeanerr = projection1b->GetMeanError();
174 biashhmean->SetBinContent(
i,hhmean);
175 biashhmean->SetBinError(
i,hhmeanerr);
177 double rms1 = projection1->GetRMS();
178 double rmserr1 = projection1->GetRMSError();
180 hhrms->SetBinContent(
i,rms1);
181 hhrms->SetBinError(
i,rmserr1);
187 for(
int i = 1;
i <= nnnbins; ++
i){
189 TH1D *projection2 = (TH1D*) hhh->ProjectionY(
"",
i,
i);
190 TH1D *projection2b = (TH1D*) bbb->ProjectionY(
"",
i,
i);
191 projection2->Sumw2();
192 projection2b->Sumw2();
194 double hhhmean = projection2b->GetMean();
195 double hhhmeanerr = projection2b->GetMeanError();
196 biashhhmean->SetBinContent(
i,hhhmean);
197 biashhhmean->SetBinError(
i,hhhmeanerr);
199 double rms2 = projection2->GetRMS();
200 double rmserr2 = projection2->GetRMSError();
202 hhhrms->SetBinContent(
i,rms2);
203 hhhrms->SetBinError(
i,rmserr2);
209 TCanvas *
c =
new TCanvas ();
210 c->SetLeftMargin(0.15);
213 hrms->SetLineColor(46);
214 hhrms->SetLineColor(31);
215 hhhrms->SetLineColor(38);
217 hhrms->Draw(
"e1 same");
218 hhhrms->Draw(
"e1 same");
219 hrms->GetYaxis()->SetTitle(
"Absolute Resolution [Deg.]");
221 hrms->GetXaxis()->SetTitle(
"Reco #theta_{beam} [Deg.]");
222 TLegend * leg2 =
new TLegend(0.22,0.67,0.32,0.82);
224 leg2->SetTextFont(42);
225 leg2->SetTextSize(0.05);
226 leg2->SetFillStyle(0);
227 leg2->AddEntry( hrms,
"Alternate Selection",
"kFullDotSmall");
228 leg2->AddEntry(hhhrms,
"Background",
"kFullDotSmall");
229 leg2->AddEntry( hhrms,
"NC w/Pi0 > 0.3 E",
"kFullDotSmall");
232 c->SaveAs(
outDir2+CurrentFile[0].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
238 TCanvas *
c1 =
new TCanvas ();
239 c1->SetLeftMargin(0.15);
242 biashmean->SetLineColor(46);
243 biashhmean->SetLineColor(31);
244 biashhhmean->SetLineColor(38);
245 biashmean->Draw(
"e1");
246 biashhmean->Draw(
"e1 same");
247 biashhhmean->Draw(
"e1 same");
248 biashmean->GetYaxis()->SetTitle(
"Bias [Deg.]");
249 biashmean->GetXaxis()->SetTitle(
"Reco #theta_{beam} [Deg.]");
251 TLegend * leg3 =
new TLegend(0.22,0.67,0.32,0.82);
253 leg3->SetTextFont(42);
254 leg3->SetTextSize(0.05);
255 leg3->SetFillStyle(0);
256 leg3->AddEntry( biashmean,
"Alternate Selection",
"kFullDotSmall");
257 leg3->AddEntry(biashhhmean,
"Background",
"kFullDotSmall");
258 leg3->AddEntry( biashhmean,
"NC w/Pi0 > 0.3 E",
"kFullDotSmall");
261 c1->SaveAs(
outDir2+CurrentFile[1].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
265 TCanvas *cs14 =
new TCanvas(
"cs14",
"cs14",10,10,855,500);
270 b->GetXaxis()->SetTitle(
"Reco #theta_{beam} [Deg.] ");
271 b->GetYaxis()->SetTitle(
"(Reco-True) #Delta#theta_{beam} [Deg.]");
272 b->SetTitleOffset(0.9,
"Y");
275 cs14->SaveAs(
outDir2+CurrentFile[2].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
::xsd::cxx::tree::date< char, simple_type > date
std::map< std::string, double > xmax
void resolutionplotterbias()
const FileUp CurrentFile[File]
const DateUp CurrentDate[Date]