16 #include <TParameter.h> 19 #ifndef __CINT__ // hide header stuff from CINT, assume load_dk2nu.C run first 20 #include "dk2nu/tree/dk2nu.h" 21 #include "dk2nu/tree/dkmeta.h" 22 #endif // ifndef __CINT__ 55 std::vector< Double_t > fastmc_bins;
57 for(
int i = 0;
i<8/0.125;
i++)
58 fastmc_bins.push_back(
i*.125);
60 for(
int i = 0;
i<(20-8)/0.5;
i++)
61 fastmc_bins.push_back(8.0+
i*.5);
63 for(
int i = 0;
i<(120-20)/2.0;
i++)
64 fastmc_bins.push_back(20.0+
i*2.0);
70 TH1D *fhNuMuFlux =
new TH1D(
"numu_flux_forplots",
71 "numu_flux_forplots", nbins,xmin,xmax);
72 TH1D *fhNuMuBarFlux =
new TH1D(
"numubar_flux_forplots",
73 "numubar_flux_forplots", nbins/2,xmin,xmax);
74 TH1D *fhNuEFlux =
new TH1D(
"nue_flux_forplots",
75 "nue_flux_forplots", nbins/2,xmin,xmax);
76 TH1D *fhNuEBarFlux =
new TH1D(
"nuebar_flux_forplots",
77 "nuebar_flux_forplots", nbins/2,xmin,xmax);
79 TH1D *fhNuTauFlux =
new TH1D(
"nutau_flux_forplots",
80 "nutau_flux_forplots", nbins/2,xmin,xmax);
81 TH1D *fhNuTauBarFlux =
new TH1D(
"nutaubar_flux_forplots",
82 "nutaubar_flux_forplots", nbins/2,xmin,xmax);
84 TH1D *fhNuMuCCEventRate =
new TH1D(
"numu_cceventrate_forplots",
85 "numu_cceventrate_forplots", nbins,xmin,xmax);
86 TH1D *fhNuMuBarCCEventRate =
new TH1D(
"numubar_cceventrate_forplots",
87 "numubar_cceventrate_forplots", nbins/2,xmin,xmax);
88 TH1D *fhNuECCEventRate =
new TH1D(
"nue_cceventrate_forplots",
89 "nue_cceventrate_forplots", nbins/2,xmin,xmax);
90 TH1D *fhNuEBarCCEventRate =
new TH1D(
"nuebar_cceventrate_forplots",
91 "nuebar_cceventrate_forplots", nbins/2,xmin,xmax);
93 TH1D *fhNuTauCCEventRate =
new TH1D(
"nutau_cceventrate_forplots",
94 "nutau_cceventrate_forplots", nbins/2,xmin,xmax);
95 TH1D *fhNuTauBarCCEventRate =
new TH1D(
"nutaubar_cceventrate_forplots",
96 "nutaubar_cceventrate_forplots", nbins/2,xmin,xmax);
98 TH1D *fhNuMuNCEventRate =
new TH1D(
"numu_nceventrate_forplots",
99 "numu_nceventrate_forplots", nbins,xmin,xmax);
100 TH1D *fhNuMuBarNCEventRate =
new TH1D(
"numubar_nceventrate_forplots",
101 "numubar_nceventrate_forplots", nbins/2,xmin,xmax);
102 TH1D *fhNuENCEventRate =
new TH1D(
"nue_nceventrate_forplots",
103 "nue_nceventrate_forplots", nbins/2,xmin,xmax);
104 TH1D *fhNuEBarNCEventRate =
new TH1D(
"nuebar_nceventrate_forplots",
105 "nuebar_nceventrate_forplots", nbins/2,xmin,xmax);
107 TH1D *fhNuTauNCEventRate =
new TH1D(
"nutau_nceventrate_forplots",
108 "nutau_nceventrate_forplots", nbins/2,xmin,xmax);
109 TH1D *fhNuTauBarNCEventRate =
new TH1D(
"nutaubar_nceventrate_forplots",
110 "nutaubar_nceventrate_forplots", nbins/2,xmin,xmax);
113 TH1D *fhNuMuFlux_FastMC =
new TH1D(
"numu_flux",
114 "numu_flux",fastmc_bins.size()-1,&fastmc_bins[0]);
115 TH1D *fhNuMuBarFlux_FastMC =
new TH1D(
"numubar_flux",
116 "numubar_flux", fastmc_bins.size()-1,&fastmc_bins[0]);
117 TH1D *fhNuEFlux_FastMC =
new TH1D(
"nue_flux",
118 "nue_flux", fastmc_bins.size()-1,&fastmc_bins[0]);
119 TH1D *fhNuEBarFlux_FastMC =
new TH1D(
"nuebar_flux",
120 "nuebar_flux", fastmc_bins.size()-1,&fastmc_bins[0]);
121 TH1D *fhNuTauFlux_FastMC =
new TH1D(
"nutau_flux",
122 "nutau_flux", fastmc_bins.size()-1,&fastmc_bins[0]);
123 TH1D *fhNuTauBarFlux_FastMC =
new TH1D(
"nutaubar_flux",
124 "nutaubar_flux", fastmc_bins.size()-1,&fastmc_bins[0]);
126 TH1D *fhNuMuCCEventRate_FastMC =
new TH1D(
"numu_cceventrate",
127 "numu_cceventrate",fastmc_bins.size()-1,&fastmc_bins[0]);
128 TH1D *fhNuMuBarCCEventRate_FastMC =
new TH1D(
"numubar_cceventrate",
129 "numubar_cceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
130 TH1D *fhNuECCEventRate_FastMC =
new TH1D(
"nue_cceventrate",
131 "nue_cceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
132 TH1D *fhNuEBarCCEventRate_FastMC =
new TH1D(
"nuebar_cceventrate",
133 "nuebar_cceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
134 TH1D *fhNuTauCCEventRate_FastMC =
new TH1D(
"nutau_cceventrate",
135 "nutau_cceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
136 TH1D *fhNuTauBarCCEventRate_FastMC =
new TH1D(
"nutaubar_cceventrate",
137 "nutaubar_cceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
139 TH1D *fhNuMuNCEventRate_FastMC =
new TH1D(
"numu_nceventrate",
140 "numu_nceventrate",fastmc_bins.size()-1,&fastmc_bins[0]);
141 TH1D *fhNuMuBarNCEventRate_FastMC =
new TH1D(
"numubar_nceventrate",
142 "numubar_nceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
143 TH1D *fhNuENCEventRate_FastMC =
new TH1D(
"nue_nceventrate",
144 "nue_nceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
145 TH1D *fhNuEBarNCEventRate_FastMC =
new TH1D(
"nuebar_nceventrate",
146 "nuebar_nceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
147 TH1D *fhNuTauNCEventRate_FastMC =
new TH1D(
"nutau_nceventrate",
148 "nutau_nceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
149 TH1D *fhNuTauBarNCEventRate_FastMC =
new TH1D(
"nutaubar_nceventrate",
150 "nutaubar_nceventrate", fastmc_bins.size()-1,&fastmc_bins[0]);
152 double globes_low = 0;
153 double globes_high = 125.25;
154 double globes_binwidth = 0.25;
155 int globes_nbins = ( globes_high - globes_low ) / globes_binwidth;
157 TH1D *fhNuMuFlux_Globes =
new TH1D(
"numu_flux_globes",
158 "numu_flux_globes", globes_nbins,globes_low,globes_high);
159 TH1D *fhNuMuBarFlux_Globes =
new TH1D(
"numubar_flux_globes",
160 "numubar_flux_globes", globes_nbins, globes_low, globes_high);
161 TH1D *fhNuEFlux_Globes =
new TH1D(
"nue_flux_globes",
162 "nue_flux_globes", globes_nbins, globes_low, globes_high);
163 TH1D *fhNuEBarFlux_Globes =
new TH1D(
"nuebar_flux_globes",
164 "nuebar_flux_globes", globes_nbins, globes_low, globes_high);
166 TH1D *fhNuTauFlux_Globes =
new TH1D(
"nutau_flux_globes",
167 "nutau_flux_globes", globes_nbins, globes_low, globes_high);
168 TH1D *fhNuTauBarFlux_Globes =
new TH1D(
"nutaubar_flux_globes",
169 "nutau_flux_globes", globes_nbins, globes_low, globes_high);
171 TH1D *fhNuMuFluxOsc =
new TH1D(
"numu_fluxosc_forplots",
172 "numu_fluxosc_forplots", nbins,xmin,xmax);
173 TH1D *fhNuMuBarFluxOsc =
new TH1D(
"numubar_fluxosc_forplots",
174 "numubar_fluxosc_forplots", nbins/2,xmin,xmax);
175 TH1D *fhNuEFluxOsc =
new TH1D(
"nue_fluxosc_forplots",
176 "nue_fluxosc_forplots", nbins/2,xmin,xmax);
177 TH1D *fhNuEBarFluxOsc =
new TH1D(
"nuebar_fluxosc_forplots",
178 "nuebar_fluxosc_forplots", nbins/2,xmin,xmax);
180 TH1D *fhNuTauFluxOsc =
new TH1D(
"nutau_fluxosc_forplots",
181 "nutau_fluxosc_forplots", nbins/2,xmin,xmax);
182 TH1D *fhNuTauBarFluxOsc =
new TH1D(
"nutaubar_fluxosc_forplots",
183 "nutaubar_fluxosc_forplots", nbins/2,xmin,xmax);
185 TH1D *fhNuMuCCEventRateOsc =
new TH1D(
"numu_cceventrateosc_forplots",
186 "numu_cceventrateosc_forplots", nbins,xmin,xmax);
187 TH1D *fhNuMuBarCCEventRateOsc =
new TH1D(
"numubar_cceventrateosc_forplots",
188 "numubar_cceventrateosc_forplots", nbins/2,xmin,xmax);
189 TH1D *fhNuECCEventRateOsc =
new TH1D(
"nue_cceventrateosc_forplots",
190 "nue_cceventrateosc_forplots", nbins/2,xmin,xmax);
191 TH1D *fhNuEBarCCEventRateOsc =
new TH1D(
"nuebar_cceventrateosc_forplots",
192 "nuebar_cceventrateosc_forplots", nbins/2,xmin,xmax);
194 TH1D *fhNuTauCCEventRateOsc =
new TH1D(
"nutau_cceventrateosc_forplots",
195 "nutau_cceventrateosc_forplots", nbins/2,xmin,xmax);
196 TH1D *fhNuTauBarCCEventRateOsc =
new TH1D(
"nutaubar_cceventrateosc_forplots",
197 "nutaubar_cceventrateosc_forplots", nbins/2,xmin,xmax);
199 TH1D *fhNuMuNCEventRateOsc =
new TH1D(
"numu_nceventrateosc_forplots",
200 "numu_nceventrateosc_forplots", nbins,xmin,xmax);
201 TH1D *fhNuMuBarNCEventRateOsc =
new TH1D(
"numubar_nceventrateosc_forplots",
202 "numubar_nceventrateosc_forplots", nbins/2,xmin,xmax);
203 TH1D *fhNuENCEventRateOsc =
new TH1D(
"nue_nceventrateosc_forplots",
204 "nue_nceventrateosc_forplots", nbins/2,xmin,xmax);
205 TH1D *fhNuEBarNCEventRateOsc =
new TH1D(
"nuebar_nceventrateosc_forplots",
206 "nuebar_nceventrateosc_forplots", nbins/2,xmin,xmax);
208 TH1D *fhNuTauNCEventRateOsc =
new TH1D(
"nutau_nceventrateosc_forplots",
209 "nutau_nceventrateosc_forplots", nbins/2,xmin,xmax);
210 TH1D *fhNuTauBarNCEventRateOsc =
new TH1D(
"nutaubar_nceventrateosc_forplots",
211 "nutaubar_nceventrateosc_forplots", nbins/2,xmin,xmax);
213 TH1D *fhNuMuFluxOsc_FastMC =
new TH1D(
"numu_fluxosc",
214 "numu_fluxosc",fastmc_bins.size()-1,&fastmc_bins[0]);
215 TH1D *fhNuMuBarFluxOsc_FastMC =
new TH1D(
"numubar_fluxosc",
216 "numubar_fluxosc", fastmc_bins.size()-1,&fastmc_bins[0]);
217 TH1D *fhNuEFluxOsc_FastMC =
new TH1D(
"nue_fluxosc",
218 "nue_fluxosc", fastmc_bins.size()-1,&fastmc_bins[0]);
219 TH1D *fhNuEBarFluxOsc_FastMC =
new TH1D(
"nuebar_fluxosc",
220 "nuebar_fluxosc", fastmc_bins.size()-1,&fastmc_bins[0]);
221 TH1D *fhNuTauFluxOsc_FastMC =
new TH1D(
"nutau_fluxosc",
222 "nutau_fluxosc", fastmc_bins.size()-1,&fastmc_bins[0]);
223 TH1D *fhNuTauBarFluxOsc_FastMC =
new TH1D(
"nutaubar_fluxosc",
224 "nutaubar_fluxosc", fastmc_bins.size()-1,&fastmc_bins[0]);
226 TH1D *fhNuMuCCEventRateOsc_FastMC =
new TH1D(
"numu_cceventrateosc",
227 "numu_cceventrateosc",fastmc_bins.size()-1,&fastmc_bins[0]);
228 TH1D *fhNuMuBarCCEventRateOsc_FastMC =
new TH1D(
"numubar_cceventrateosc",
229 "numubar_cceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
230 TH1D *fhNuECCEventRateOsc_FastMC =
new TH1D(
"nue_cceventrateosc",
231 "nue_cceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
232 TH1D *fhNuEBarCCEventRateOsc_FastMC =
new TH1D(
"nuebar_cceventrateosc",
233 "nuebar_cceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
234 TH1D *fhNuTauCCEventRateOsc_FastMC =
new TH1D(
"nutau_cceventrateosc",
235 "nutau_cceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
236 TH1D *fhNuTauBarCCEventRateOsc_FastMC =
new TH1D(
"nutaubar_cceventrateosc",
237 "nutaubar_cceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
239 TH1D *fhNuMuNCEventRateOsc_FastMC =
new TH1D(
"numu_nceventrateosc",
240 "numu_nceventrateosc",fastmc_bins.size()-1,&fastmc_bins[0]);
241 TH1D *fhNuMuBarNCEventRateOsc_FastMC =
new TH1D(
"numubar_nceventrateosc",
242 "numubar_nceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
243 TH1D *fhNuENCEventRateOsc_FastMC =
new TH1D(
"nue_nceventrateosc",
244 "nue_nceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
245 TH1D *fhNuEBarNCEventRateOsc_FastMC =
new TH1D(
"nuebar_nceventrateosc",
246 "nuebar_nceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
247 TH1D *fhNuTauNCEventRateOsc_FastMC =
new TH1D(
"nutau_nceventrateosc",
248 "nutau_nceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
249 TH1D *fhNuTauBarNCEventRateOsc_FastMC =
new TH1D(
"nutaubar_nceventrateosc",
250 "nutaubar_nceventrateosc", fastmc_bins.size()-1,&fastmc_bins[0]);
257 fhNuMuBarFlux->Sumw2();
259 fhNuEBarFlux->Sumw2();
260 fhNuTauFlux->Sumw2();
261 fhNuTauBarFlux->Sumw2();
263 fhNuMuFlux_FastMC->Sumw2();
264 fhNuMuBarFlux_FastMC->Sumw2();
265 fhNuEFlux_FastMC->Sumw2();
266 fhNuEBarFlux_FastMC->Sumw2();
267 fhNuTauFlux_FastMC->Sumw2();
268 fhNuTauBarFlux_FastMC->Sumw2();
270 fhNuMuFlux_Globes->Sumw2();
271 fhNuMuBarFlux_Globes->Sumw2();
272 fhNuEFlux_Globes->Sumw2();
273 fhNuEBarFlux_Globes->Sumw2();
274 fhNuTauFlux_Globes->Sumw2();
275 fhNuTauBarFlux_Globes->Sumw2();
277 fhNuMuFluxOsc->Sumw2();
278 fhNuMuBarFluxOsc->Sumw2();
279 fhNuEFluxOsc->Sumw2();
280 fhNuEBarFluxOsc->Sumw2();
281 fhNuTauFluxOsc->Sumw2();
282 fhNuTauBarFluxOsc->Sumw2();
284 fhNuMuFluxOsc_FastMC->Sumw2();
285 fhNuMuBarFluxOsc_FastMC->Sumw2();
286 fhNuEFluxOsc_FastMC->Sumw2();
287 fhNuEBarFluxOsc_FastMC->Sumw2();
288 fhNuTauFluxOsc_FastMC->Sumw2();
289 fhNuTauBarFluxOsc_FastMC->Sumw2();
291 fhNuMuCCEventRate->Sumw2();
292 fhNuMuBarCCEventRate->Sumw2();
293 fhNuECCEventRate->Sumw2();
294 fhNuEBarCCEventRate->Sumw2();
295 fhNuTauCCEventRate->Sumw2();
296 fhNuTauBarCCEventRate->Sumw2();
297 fhNuMuNCEventRate->Sumw2();
298 fhNuMuBarNCEventRate->Sumw2();
299 fhNuENCEventRate->Sumw2();
300 fhNuEBarNCEventRate->Sumw2();
301 fhNuTauNCEventRate->Sumw2();
302 fhNuTauBarNCEventRate->Sumw2();
304 fhNuMuCCEventRate_FastMC->Sumw2();
305 fhNuMuBarCCEventRate_FastMC->Sumw2();
306 fhNuECCEventRate_FastMC->Sumw2();
307 fhNuEBarCCEventRate_FastMC->Sumw2();
308 fhNuTauCCEventRate_FastMC->Sumw2();
309 fhNuTauBarCCEventRate_FastMC->Sumw2();
310 fhNuMuNCEventRate_FastMC->Sumw2();
311 fhNuMuBarNCEventRate_FastMC->Sumw2();
312 fhNuENCEventRate_FastMC->Sumw2();
313 fhNuEBarNCEventRate_FastMC->Sumw2();
314 fhNuTauNCEventRate_FastMC->Sumw2();
315 fhNuTauBarNCEventRate_FastMC->Sumw2();
317 fhNuMuCCEventRateOsc->Sumw2();
318 fhNuMuBarCCEventRateOsc->Sumw2();
319 fhNuECCEventRateOsc->Sumw2();
320 fhNuEBarCCEventRateOsc->Sumw2();
321 fhNuTauCCEventRateOsc->Sumw2();
322 fhNuTauBarCCEventRateOsc->Sumw2();
323 fhNuMuNCEventRateOsc->Sumw2();
324 fhNuMuBarNCEventRateOsc->Sumw2();
325 fhNuENCEventRateOsc->Sumw2();
326 fhNuEBarNCEventRateOsc->Sumw2();
327 fhNuTauNCEventRateOsc->Sumw2();
328 fhNuTauBarNCEventRateOsc->Sumw2();
330 fhNuMuCCEventRateOsc_FastMC->Sumw2();
331 fhNuMuBarCCEventRateOsc_FastMC->Sumw2();
332 fhNuECCEventRateOsc_FastMC->Sumw2();
333 fhNuEBarCCEventRateOsc_FastMC->Sumw2();
334 fhNuTauCCEventRateOsc_FastMC->Sumw2();
335 fhNuTauBarCCEventRateOsc_FastMC->Sumw2();
336 fhNuMuNCEventRateOsc_FastMC->Sumw2();
337 fhNuMuBarNCEventRateOsc_FastMC->Sumw2();
338 fhNuENCEventRateOsc_FastMC->Sumw2();
339 fhNuEBarNCEventRateOsc_FastMC->Sumw2();
340 fhNuTauNCEventRateOsc_FastMC->Sumw2();
341 fhNuTauBarNCEventRateOsc_FastMC->Sumw2();
348 std::string fluxtitle =
"Neutrinos / GeV / m^{2} / POT";
349 std::string oscfluxtitle =
"Oscillated Neutrinos / GeV / m^{2} / POT";
353 SetTitles(fhNuMuFlux,
"#nu_{#mu} Energy (GeV) ",
"Unosc #nu_{#mu}s / GeV / m^{2} / POT");
354 SetTitles(fhNuMuBarFlux,
"#bar{#nu}_{#mu} Energy (GeV)",
"Unosc #bar{#nu}_{#mu}s / GeV / m^{2} / POT");
355 SetTitles(fhNuEFlux,
"#nu_{e} Energy (GeV)",
"Unosc #nu_{e}s / GeV / m^{2} / POT");
356 SetTitles(fhNuEBarFlux,
"#bar{#nu}_{e} Energy (GeV)",
"Unosc #bar{#nu}_{e}s / GeV / m^{2} / POT");
357 SetTitles(fhNuTauFlux,
"#nu_{#tau} Energy (GeV)",
"Unosc #nu_{#tau}s / GeV / m^{2} / POT");
358 SetTitles(fhNuTauBarFlux,
"#bar{#nu}_{#tau} Energy (GeV)",
"Unosc #bar{#nu}_{#tau}s / GeV / m^{2} / POT");
360 SetTitles(fhNuMuFlux_FastMC,
"#nu_{#mu} Energy (GeV) ",
"Unosc #nu_{#mu}s / m^{2} / POT");
361 SetTitles(fhNuMuBarFlux_FastMC,
"#bar{#nu}_{#mu} Energy (GeV)",
"Unosc #bar{#nu}_{#mu}s / m^{2} / POT");
362 SetTitles(fhNuEFlux_FastMC,
"#nu_{e} Energy (GeV)",
"Unosc #nu_{e}s / m^{2} / POT");
363 SetTitles(fhNuEBarFlux_FastMC,
"#bar{#nu}_{e} Energy (GeV)",
"Unosc #bar{#nu}_{e}s / m^{2} / POT");
364 SetTitles(fhNuTauFlux_FastMC,
"#nu_{#tau} Energy (GeV)",
"Unosc #nu_{#tau}s / m^{2} / POT");
365 SetTitles(fhNuTauBarFlux_FastMC,
"#bar{#nu}_{#tau} Energy (GeV)",
"Unosc #bar{#nu}_{#tau}s / m^{2} / POT");
367 SetTitles(fhNuMuFlux_Globes,
"#nu_{#mu} Energy (GeV)",
"Unosc #nu_{#mu}s / GeV / m^{2} / POT");
368 SetTitles(fhNuMuBarFlux_Globes,
"#bar{#nu}_{#mu} Energy (GeV)",
"Unosc #bar{#nu}_{#mu}s / GeV / m^{2} / POT");
369 SetTitles(fhNuEFlux_Globes,
"#nu_{e} Energy (GeV)",
"Unosc #nu_{e}s / GeV / m^{2} / POT");
370 SetTitles(fhNuEBarFlux_Globes,
"#bar{#nu}_{e} Energy (GeV)",
"Unosc #bar{#nu}_{e}s / GeV / m^{2} / POT");
371 SetTitles(fhNuTauFlux_Globes,
"#nu_{#tau} Energy (GeV)",
"Unosc #nu_{#tau}s / GeV / m^{2} / POT");
372 SetTitles(fhNuTauBarFlux_Globes,
"#bar{#nu}_{#tau} Energy (GeV)",
"Unosc #bar{#nu}_{#tau}s / GeV / m^{2} / POT");
374 SetTitles(fhNuMuFluxOsc,
"Energy (GeV)",
"Oscillated #nu_{#mu}s / GeV / m^{2} / POT");
375 SetTitles(fhNuMuBarFluxOsc,
"Energy (GeV)",
"Oscillated #bar{#nu}_{#mu}s / GeV / m^{2} / POT");
376 SetTitles(fhNuEFluxOsc,
"Energy (GeV)",
"Oscillated #nu_{e}s / GeV / m^{2} / POT");
377 SetTitles(fhNuEBarFluxOsc,
"Energy (GeV)",
"Oscillated #bar{#nu}_{e}s / GeV / m^{2} / POT");
378 SetTitles(fhNuTauFluxOsc,
"Energy (GeV)",
"Oscillated #nu_{#tau}s / GeV / m^{2} / POT");
379 SetTitles(fhNuTauBarFluxOsc,
"Energy (GeV)",
"Oscillated #bar{#nu}_{#tau}s / GeV / m^{2} / POT");
381 SetTitles(fhNuMuFluxOsc_FastMC,
"Energy (GeV)",
"Oscillated #nu_{#mu}s / m^{2} / POT");
382 SetTitles(fhNuMuBarFluxOsc_FastMC,
"Energy (GeV)",
"Oscillated #bar{#nu}_{#mu}s / m^{2} / POT");
383 SetTitles(fhNuEFluxOsc_FastMC,
"Energy (GeV)",
"Oscillated #nu_{e}s / m^{2} / POT");
384 SetTitles(fhNuEBarFluxOsc_FastMC,
"Energy (GeV)",
"Oscillated #bar{#nu}_{e}s / m^{2} / POT");
385 SetTitles(fhNuTauFluxOsc_FastMC,
"Energy (GeV)",
"Oscillated #nu_{#tau}s / GeV / m^{2} / POT");
386 SetTitles(fhNuTauBarFluxOsc_FastMC,
"Energy (GeV)",
"Oscillated #bar{#nu}_{#tau}s / GeV / m^{2} / POT");
389 SetTitles(fhNuMuCCEventRate,
"Energy (GeV)",
"#nu_{#mu} CC Events / GeV / kTon / POT");
390 SetTitles(fhNuMuBarCCEventRate,
"Energy (GeV)",
"#bar{#nu}_{#mu} CC Events / kTon / POT");
391 SetTitles(fhNuECCEventRate,
"Energy (GeV)",
"#nu_{e} CC Events / GeV / kTon / POT");
392 SetTitles(fhNuEBarCCEventRate,
"Energy (GeV)",
"#bar{#nu}_{e} CC Events / kTon / POT");
393 SetTitles(fhNuTauCCEventRate,
"Energy (GeV)",
"#nu_{#tau} CC Events / kTon / POT");
394 SetTitles(fhNuTauBarCCEventRate,
"Energy (GeV)",
"#bar{#nu}_{#tau} CC Events / kTon / POT");
396 SetTitles(fhNuMuCCEventRate_FastMC,
"Energy (GeV)",
"#nu_{#mu} CC Events / kTon / POT");
397 SetTitles(fhNuMuBarCCEventRate_FastMC,
"Energy (GeV)",
"#bar{#nu}_{#mu} CC Events / kTon / POT");
398 SetTitles(fhNuECCEventRate_FastMC,
"Energy (GeV)",
"#nu_{e} CC Events / kTon / POT");
399 SetTitles(fhNuEBarCCEventRate_FastMC,
"Energy (GeV)",
"#bar{#nu}_{e} CC Events / kTon / POT");
400 SetTitles(fhNuTauCCEventRate_FastMC,
"Energy (GeV)",
"#nu_{#tau} CC Events / kTon / POT");
401 SetTitles(fhNuTauBarCCEventRate_FastMC,
"Energy (GeV)",
"#bar{#nu}_{#tau} CC Events / kTon / POT");
403 SetTitles(fhNuMuCCEventRateOsc,
"Energy (GeV)",
"Oscillated #nu_{#mu} CC Events / GeV / kTon / POT");
404 SetTitles(fhNuMuBarCCEventRateOsc,
"Energy (GeV)",
"Oscillated #bar{#nu}_{#mu} CC Events / GeV / kTon / POT");
405 SetTitles(fhNuECCEventRateOsc,
"Energy (GeV)",
"Oscillated #nu_{e} CC Events / GeV / kTon / POT");
406 SetTitles(fhNuEBarCCEventRateOsc,
"Energy (GeV)",
"Oscillated #bar{#nu}_{e} CC Events / GeV / kTon / POT");
407 SetTitles(fhNuTauCCEventRateOsc,
"Energy (GeV)",
"Oscillated #nu_{#tau} CC Events / GeV / kTon / POT");
408 SetTitles(fhNuTauBarCCEventRateOsc,
"Energy (GeV)",
"Oscillated #bar{#nu}_{#tau} CC Events / GeV / kTon / POT");
410 SetTitles(fhNuMuCCEventRateOsc_FastMC,
"Energy (GeV)",
"Oscillated #nu_{#mu} CC Events / kTon / POT");
411 SetTitles(fhNuMuBarCCEventRateOsc_FastMC,
"Energy (GeV)",
"Oscillated #bar{#nu}_{#mu} CC Events / kTon / POT");
412 SetTitles(fhNuECCEventRateOsc_FastMC,
"Energy (GeV)",
"Oscillated #nu_{e} CC Events / kTon / POT");
413 SetTitles(fhNuEBarCCEventRateOsc_FastMC,
"Energy (GeV)",
"Oscillated #bar{#nu}_{e} CC Events / kTon / POT");
414 SetTitles(fhNuTauCCEventRateOsc_FastMC,
"Energy (GeV)",
"Oscillated #nu_{#tau} CC Events / kTon / POT");
415 SetTitles(fhNuTauBarCCEventRateOsc_FastMC,
"Energy (GeV)",
"Oscillated #bar{#nu}_{#tau} CC Events / kTon / POT");
418 SetTitles(fhNuMuNCEventRate,
"Energy (GeV)",
"#nu_{#mu} NC Events / GeV / kTon / POT");
419 SetTitles(fhNuMuBarNCEventRate,
"Energy (GeV)",
"#bar{#nu}_{#mu} NC Events / GeV / kTon / POT");
420 SetTitles(fhNuENCEventRate,
"Energy (GeV)",
"#nu_{e} NC Events / GeV / kTon / POT");
421 SetTitles(fhNuEBarNCEventRate,
"Energy (GeV)",
"#bar{#nu}_{e} NC Events / GeV / kTon / POT");
422 SetTitles(fhNuTauNCEventRate,
"Energy (GeV)",
"#nu_{#tau} NC Events / GeV / kTon / POT");
423 SetTitles(fhNuTauBarNCEventRate,
"Energy (GeV)",
"#bar{#nu}_{#tau} NC Events / GeV / kTon / POT");
425 SetTitles(fhNuMuNCEventRate_FastMC,
"Energy (GeV)",
"#nu_{#mu} NC Events / kTon / POT");
426 SetTitles(fhNuMuBarNCEventRate_FastMC,
"#bar{#nu}_{#mu} Energy (GeV)",
"#bar{#nu}_{#mu} NC Events / kTon / POT");
427 SetTitles(fhNuENCEventRate_FastMC,
"#nu_{e} Energy (GeV)",
"#nu_{e} NC Events / kTon / POT");
428 SetTitles(fhNuEBarNCEventRate_FastMC,
"#bar{#nu}_{e} Energy (GeV)",
"#bar{#nu}_{e} NC Events / kTon / POT");
429 SetTitles(fhNuTauNCEventRate_FastMC,
"#nu_{#tau} Energy (GeV)",
"#nu_{#tau} NC Events / kTon / POT");
430 SetTitles(fhNuTauBarNCEventRate_FastMC,
"#bar{#nu}_{#tau} Energy (GeV)",
"#bar{#nu}_{#tau} NC Events / kTon / POT");
432 SetTitles(fhNuMuNCEventRateOsc,
"#nu_{#mu} Energy (GeV)",
"Oscillated #nu_{#mu} NC Events / GeV / kTon / POT");
433 SetTitles(fhNuMuBarNCEventRateOsc,
"#bar{#nu}_{#mu} Energy (GeV)",
"Oscillated #bar{#nu}_{#mu} NC Events / GeV / kTon / POT");
434 SetTitles(fhNuENCEventRateOsc,
"#nu_{e} Energy (GeV)",
"Oscillated #nu_{e} NC Events / GeV / kTon / POT");
435 SetTitles(fhNuEBarNCEventRateOsc,
"#bar{#nu}_{e} Energy (GeV)",
"Oscillated #bar{#nu}_{e} NC Events / GeV / kTon / POT");
436 SetTitles(fhNuTauNCEventRateOsc,
"#nu_{#tau} Energy (GeV)",
"Oscillated #nu_{#tau} NC Events / GeV / kTon / POT");
437 SetTitles(fhNuTauBarNCEventRateOsc,
"#bar{#nu}_{#tau} Energy (GeV)",
"Oscillated #bar{#nu}_{#tau} NC Events / GeV / kTon / POT");
439 SetTitles(fhNuMuNCEventRateOsc_FastMC,
"#nu_{#mu} Energy (GeV)",
"Oscillated #nu_{#mu} NC Events / kTon / POT");
440 SetTitles(fhNuMuBarNCEventRateOsc_FastMC,
"#bar{#nu}_{#mu} Energy (GeV)",
"Oscillated #bar{#nu}_{#mu} NC Events / kTon / POT");
441 SetTitles(fhNuENCEventRateOsc_FastMC,
"#nu_{e} Energy (GeV)",
"Oscillated #nu_{e} NC Events / kTon / POT");
442 SetTitles(fhNuEBarNCEventRateOsc_FastMC,
"#bar{#nu}_{e} Energy (GeV)",
"Oscillated #bar{#nu}_{e} NC Events / kTon / POT");
443 SetTitles(fhNuTauNCEventRateOsc_FastMC,
"#nu_{#tau} Energy (GeV)",
"Oscillated #nu_{#tau} NC Events / kTon / POT");
444 SetTitles(fhNuTauBarNCEventRateOsc_FastMC,
"#bar{#nu}_{#tau} Energy (GeV)",
"Oscillated #bar{#nu}_{#tau} NC Events / kTon / POT");
450 dk2nu =
new bsim::Dk2Nu;
452 fChain->SetBranchAddress(
"dk2nu",&dk2nu);
455 Long64_t nentries = fChain->GetEntries();
456 std::cout <<
"Total number of Entries = " << nentries <<
std::endl;
458 for (Long64_t jentry=0; jentry<nentries;jentry++)
462 fChain->GetEntry(jentry);
466 Long64_t ientry = LoadTree(jentry);
467 fChain->GetEntry(jentry);
468 if (ientry < 0)
break;
472 if(
iread % 10000 == 0)
484 double nuenergyatsomedet = -999.0;
485 double detectorwghtatsomedet = -999.0;
486 std::vector<double> detvec;
487 detvec.push_back(
detx);
488 detvec.push_back(
dety);
489 detvec.push_back(
detz);
498 Nimpwt = dk2nu->decay.nimpwt;
499 double fluxwghtsomedet = (detectorwghtatsomedet*Nimpwt/3.1415)*(refpot/fTotalPOT);
503 double cceventratewghtsomedet = fluxwghtsomedet * GetXSec((
double)Ntype,nuenergyatsomedet,current_string);
505 current_string =
"NC";
506 double nceventratewghtsomedet = fluxwghtsomedet * GetXSec(Ntype,nuenergyatsomedet,current_string);
509 int Ntype_osc = GetOscillatedNeutrinoType(Ntype,nuenergyatsomedet);
511 current_string =
"CC";
512 double cceventratewghtsomedet_osc = fluxwghtsomedet * GetXSec((
double)Ntype_osc,nuenergyatsomedet,current_string);
513 current_string =
"NC";
514 double nceventratewghtsomedet_osc = fluxwghtsomedet * GetXSec(Ntype_osc,nuenergyatsomedet,current_string);
521 Ntype = dk2nu->decay.ntype;
522 if(Ntype == 56 || Ntype == 14)
524 fhNuMuFlux -> Fill(nuenergyatsomedet, fluxwghtsomedet);
525 fhNuMuCCEventRate -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
526 fhNuMuNCEventRate -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
528 fhNuMuFlux_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
529 fhNuMuCCEventRate_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
530 fhNuMuNCEventRate_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
531 fhNuMuFlux_Globes-> Fill(nuenergyatsomedet, fluxwghtsomedet);
533 if(Ntype == 55 || Ntype==-14)
535 fhNuMuBarFlux -> Fill(nuenergyatsomedet, fluxwghtsomedet);
536 fhNuMuBarCCEventRate -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
537 fhNuMuBarNCEventRate -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
539 fhNuMuBarFlux_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
540 fhNuMuBarCCEventRate_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
541 fhNuMuBarNCEventRate_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
542 fhNuMuBarFlux_Globes-> Fill(nuenergyatsomedet, fluxwghtsomedet);
544 if(Ntype == 53 || Ntype==12)
546 fhNuEFlux -> Fill(nuenergyatsomedet, fluxwghtsomedet);
547 fhNuECCEventRate -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
548 fhNuENCEventRate -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
550 fhNuEFlux_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
551 fhNuECCEventRate_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
552 fhNuENCEventRate_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
553 fhNuEFlux_Globes-> Fill(nuenergyatsomedet, fluxwghtsomedet);
555 if(Ntype == 52 || Ntype==-12)
557 fhNuEBarFlux -> Fill(nuenergyatsomedet, fluxwghtsomedet);
558 fhNuEBarCCEventRate -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
559 fhNuEBarNCEventRate -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
561 fhNuEBarFlux_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
562 fhNuEBarCCEventRate_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
563 fhNuEBarNCEventRate_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
564 fhNuEBarFlux_Globes-> Fill(nuenergyatsomedet, fluxwghtsomedet);
567 if(Ntype == 59 || Ntype==16)
569 fhNuTauFlux -> Fill(nuenergyatsomedet, fluxwghtsomedet);
570 fhNuTauCCEventRate -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
571 fhNuTauNCEventRate -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
573 fhNuTauFlux_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
574 fhNuTauCCEventRate_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
575 fhNuTauNCEventRate_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
576 fhNuTauFlux_Globes-> Fill(nuenergyatsomedet, fluxwghtsomedet);
578 if(Ntype == 59 || Ntype==-16)
580 fhNuTauBarFlux -> Fill(nuenergyatsomedet, fluxwghtsomedet);
581 fhNuTauBarCCEventRate -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
582 fhNuTauBarNCEventRate -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
584 fhNuTauBarFlux_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
585 fhNuTauBarCCEventRate_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet);
586 fhNuTauBarNCEventRate_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet);
587 fhNuTauBarFlux_Globes-> Fill(nuenergyatsomedet, fluxwghtsomedet);
590 if(Ntype_osc == 56 || Ntype_osc==14)
592 fhNuMuFluxOsc -> Fill(nuenergyatsomedet, fluxwghtsomedet);
593 fhNuMuCCEventRateOsc -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
594 fhNuMuNCEventRateOsc -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
595 fhNuMuFluxOsc_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
596 fhNuMuCCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
597 fhNuMuNCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
599 if(Ntype_osc == 55 || Ntype_osc==-14)
601 fhNuMuBarFluxOsc -> Fill(nuenergyatsomedet, fluxwghtsomedet);
602 fhNuMuBarCCEventRateOsc -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
603 fhNuMuBarNCEventRateOsc -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
604 fhNuMuBarFluxOsc_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
605 fhNuMuBarCCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
606 fhNuMuBarNCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
609 if(Ntype_osc == 53 || Ntype_osc==12)
611 fhNuEFluxOsc -> Fill(nuenergyatsomedet, fluxwghtsomedet);
612 fhNuECCEventRateOsc -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
613 fhNuENCEventRateOsc -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
614 fhNuEFluxOsc_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
615 fhNuECCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
616 fhNuENCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
618 if(Ntype_osc == 52 || Ntype_osc==-12)
620 fhNuEBarFluxOsc -> Fill(nuenergyatsomedet, fluxwghtsomedet);
621 fhNuEBarCCEventRateOsc -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
622 fhNuEBarNCEventRateOsc -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
623 fhNuEBarFluxOsc_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
624 fhNuEBarCCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
625 fhNuEBarNCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
629 if(Ntype_osc == 59 || Ntype_osc==16)
631 fhNuTauFluxOsc -> Fill(nuenergyatsomedet, fluxwghtsomedet);
632 fhNuTauCCEventRateOsc -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
633 fhNuTauNCEventRateOsc -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
634 fhNuTauFluxOsc_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
635 fhNuTauCCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
636 fhNuTauNCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
639 if(Ntype_osc == 58 || Ntype_osc==-16)
641 fhNuTauBarFluxOsc -> Fill(nuenergyatsomedet, fluxwghtsomedet);
642 fhNuTauBarCCEventRateOsc -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
643 fhNuTauBarNCEventRateOsc -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
644 fhNuTauBarFluxOsc_FastMC -> Fill(nuenergyatsomedet, fluxwghtsomedet);
645 fhNuTauBarCCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, cceventratewghtsomedet_osc);
646 fhNuTauBarNCEventRateOsc_FastMC -> Fill(nuenergyatsomedet, nceventratewghtsomedet_osc);
651 fhNuMuFlux->Scale(1.0,
"width");
652 fhNuMuCCEventRate->Scale(1.0,
"width");
653 fhNuMuNCEventRate->Scale(1.0,
"width");
655 fhNuMuBarFlux->Scale(1.0,
"width");
656 fhNuMuBarCCEventRate->Scale(1.0,
"width");
657 fhNuMuBarNCEventRate->Scale(1.0,
"width");
659 fhNuEFlux->Scale(1.0,
"width");
660 fhNuECCEventRate->Scale(1.0,
"width");
661 fhNuENCEventRate->Scale(1.0,
"width");
663 fhNuEBarFlux->Scale(1.0,
"width");
664 fhNuEBarCCEventRate->Scale(1.0,
"width");
665 fhNuEBarNCEventRate->Scale(1.0,
"width");
667 fhNuTauFlux->Scale(1.0,
"width");
668 fhNuTauCCEventRate->Scale(1.0,
"width");
669 fhNuTauNCEventRate->Scale(1.0,
"width");
671 fhNuTauBarFlux->Scale(1.0,
"width");
672 fhNuTauBarCCEventRate->Scale(1.0,
"width");
673 fhNuTauBarNCEventRate->Scale(1.0,
"width");
675 fhNuMuFluxOsc->Scale(1.0,
"width");
676 fhNuMuCCEventRateOsc->Scale(1.0,
"width");
677 fhNuMuNCEventRateOsc->Scale(1.0,
"width");
679 fhNuMuBarFluxOsc->Scale(1.0,
"width");
680 fhNuMuBarCCEventRateOsc->Scale(1.0,
"width");
681 fhNuMuBarNCEventRateOsc->Scale(1.0,
"width");
683 fhNuEFluxOsc->Scale(1.0,
"width");
684 fhNuECCEventRateOsc->Scale(1.0,
"width");
685 fhNuENCEventRateOsc->Scale(1.0,
"width");
687 fhNuEBarFluxOsc->Scale(1.0,
"width");
688 fhNuEBarCCEventRateOsc->Scale(1.0,
"width");
689 fhNuEBarNCEventRateOsc->Scale(1.0,
"width");
691 fhNuTauFluxOsc->Scale(1.0,
"width");
692 fhNuTauCCEventRateOsc->Scale(1.0,
"width");
693 fhNuTauNCEventRateOsc->Scale(1.0,
"width");
695 fhNuTauBarFluxOsc->Scale(1.0,
"width");
696 fhNuTauBarCCEventRateOsc->Scale(1.0,
"width");
697 fhNuTauBarNCEventRateOsc->Scale(1.0,
"width");
699 fhNuMuFlux_Globes->Scale(1.0,
"width");
700 fhNuMuBarFlux_Globes->Scale(1.0,
"width");
701 fhNuEFlux_Globes->Scale(1.0,
"width");
702 fhNuEBarFlux_Globes->Scale(1.0,
"width");
703 fhNuTauFlux_Globes->Scale(1.0,
"width");
704 fhNuTauBarFlux_Globes->Scale(1.0,
"width");
710 TGaxis::SetMaxDigits(2);
711 fhNuMuFlux_FastMC->GetYaxis()->SetTitleOffset(1.4);
712 fhNuMuBarFlux_FastMC->GetYaxis()->SetTitleOffset(1.4);
713 fhNuEFlux_FastMC->GetYaxis()->SetTitleOffset(1.4);
714 fhNuEBarFlux_FastMC->GetYaxis()->SetTitleOffset(1.4);
715 fhNuTauFlux_FastMC->GetYaxis()->SetTitleOffset(1.4);
716 fhNuTauBarFlux_FastMC->GetYaxis()->SetTitleOffset(1.4);
718 fhNuMuCCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
719 fhNuMuBarCCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
720 fhNuECCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
721 fhNuEBarCCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
722 fhNuTauCCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
723 fhNuTauBarCCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
725 fhNuMuNCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
726 fhNuMuBarNCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
727 fhNuENCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
728 fhNuEBarNCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
729 fhNuTauNCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
730 fhNuTauBarNCEventRate_FastMC->GetYaxis()->SetTitleOffset(1.4);
733 ffilename = ffilename +
"_" + detectorname;
737 TParameter<double> det_x(
"det_x",
detx);
738 TParameter<double> det_y(
"det_y",
dety);
739 TParameter<double> det_z(
"det_z",
detz);
742 std::cout<<
"writing"+ffilename+
".root"<<
std::endl;
743 TFile
f((ffilename+
".root").c_str(),
"recreate");
748 fhNuMuBarFlux->Write();
750 fhNuEBarFlux->Write();
751 fhNuTauFlux->Write();
752 fhNuTauBarFlux->Write();
753 fhNuMuCCEventRate->Write();
754 fhNuMuBarCCEventRate->Write();
755 fhNuECCEventRate->Write();
756 fhNuEBarCCEventRate->Write();
757 fhNuTauCCEventRate->Write();
758 fhNuTauBarCCEventRate->Write();
759 fhNuMuNCEventRate->Write();
760 fhNuMuBarNCEventRate->Write();
761 fhNuENCEventRate->Write();
762 fhNuEBarNCEventRate->Write();
763 fhNuTauNCEventRate->Write();
764 fhNuTauBarNCEventRate->Write();
765 fhNuMuFluxOsc->Write();
766 fhNuMuBarFluxOsc->Write();
767 fhNuEFluxOsc->Write();
768 fhNuEBarFluxOsc->Write();
769 fhNuTauFluxOsc->Write();
770 fhNuTauBarFluxOsc->Write();
771 fhNuMuCCEventRateOsc->Write();
772 fhNuMuBarCCEventRateOsc->Write();
773 fhNuECCEventRateOsc->Write();
774 fhNuEBarCCEventRateOsc->Write();
775 fhNuTauCCEventRateOsc->Write();
776 fhNuTauBarCCEventRateOsc->Write();
777 fhNuMuNCEventRateOsc->Write();
778 fhNuMuBarNCEventRateOsc->Write();
779 fhNuENCEventRateOsc->Write();
780 fhNuEBarNCEventRateOsc->Write();
781 fhNuTauNCEventRateOsc->Write();
782 fhNuTauBarNCEventRateOsc->Write();
785 TFile g((ffilename+
"_fastmc.root").c_str(),
"recreate");
789 fhNuMuFlux_FastMC->Write();
790 fhNuMuBarFlux_FastMC->Write();
791 fhNuEFlux_FastMC->Write();
792 fhNuEBarFlux_FastMC->Write();
793 fhNuTauFlux_FastMC->Write();
794 fhNuTauBarFlux_FastMC->Write();
795 fhNuMuCCEventRate_FastMC->Write();
796 fhNuMuBarCCEventRate_FastMC->Write();
797 fhNuECCEventRate_FastMC->Write();
798 fhNuEBarCCEventRate_FastMC->Write();
799 fhNuTauCCEventRate_FastMC->Write();
800 fhNuTauBarCCEventRate_FastMC->Write();
801 fhNuMuNCEventRate_FastMC->Write();
802 fhNuMuBarNCEventRate_FastMC->Write();
803 fhNuENCEventRate_FastMC->Write();
804 fhNuEBarNCEventRate_FastMC->Write();
805 fhNuTauNCEventRate_FastMC->Write();
806 fhNuTauBarNCEventRate_FastMC->Write();
808 fhNuMuFluxOsc_FastMC->Write();
809 fhNuMuBarFluxOsc_FastMC->Write();
810 fhNuEFluxOsc_FastMC->Write();
811 fhNuEBarFluxOsc_FastMC->Write();
812 fhNuTauFluxOsc_FastMC->Write();
813 fhNuTauBarFluxOsc_FastMC->Write();
814 fhNuMuCCEventRateOsc_FastMC->Write();
815 fhNuMuBarCCEventRateOsc_FastMC->Write();
816 fhNuECCEventRateOsc_FastMC->Write();
817 fhNuEBarCCEventRateOsc_FastMC->Write();
818 fhNuTauCCEventRateOsc_FastMC->Write();
819 fhNuTauBarCCEventRateOsc_FastMC->Write();
820 fhNuMuNCEventRateOsc_FastMC->Write();
821 fhNuMuBarNCEventRateOsc_FastMC->Write();
822 fhNuENCEventRateOsc_FastMC->Write();
823 fhNuEBarNCEventRateOsc_FastMC->Write();
824 fhNuTauNCEventRateOsc_FastMC->Write();
825 fhNuTauBarNCEventRateOsc_FastMC->Write();
830 myfile.open((ffilename+
"_globes_flux.txt").c_str());
831 for(
int i = 0;
i<globes_nbins;
i++) {
832 myfile<<fhNuMuFlux_Globes->GetBinCenter(
i+1)<<
" "<<
833 fhNuEFlux_Globes->GetBinContent(
i+1)<<
" "<<
834 fhNuMuFlux_Globes->GetBinContent(
i+1)<<
" "<<
835 fhNuTauFlux_Globes->GetBinContent(
i+1)<<
" "<<
836 fhNuEBarFlux_Globes->GetBinContent(
i+1)<<
" "<<
837 fhNuMuBarFlux_Globes->GetBinContent(
i+1)<<
" "<<
838 fhNuTauBarFlux_Globes->GetBinContent(
i+1)<<
" "<<
std::endl;
847 std::stringstream potstrm;
848 potstrm << scientific << dpot;
850 string potstr = potstrm.str();
856 if(potstr.find(
"e",0) != string::npos)
858 baselength = potstr.find(
"e",0);
860 else if(potstr.find(
"E",0) != string::npos)
862 baselength = potstr.find(
"E",0);
866 cout <<
"eventRates::GetPOTAsString - PROBLEM: pot is not in scientific notation" <<
endl;
870 string base = potstr.substr(0, baselength);
876 if(potstr.find(
"+",baselength) != string::npos)
878 exppos = potstr.find(
"+",baselength);
880 else if(potstr.find(
"-",baselength) != string::npos)
882 exppos = potstr.find(
"-",baselength);
886 cout <<
"eventRates::GetPOTAsString - PROBLEM: pot is not in scientific notation" <<
endl;
890 string exp = potstr.substr(exppos);
896 string baseNumber = base;
898 size_t baseDecimalpos = base.find(
".",0);
899 if(baseDecimalpos != string::npos)
901 size_t baseNotZeropos = base.find_last_not_of(
"0", string::npos);
902 if(baseNotZeropos != string::npos)
904 if(baseNotZeropos > baseDecimalpos)
906 baseNumber = base.substr(0,baseNotZeropos+1);
910 baseNumber = base.substr(0,baseDecimalpos+2);
917 baseNumber = baseNumber +
".0";
924 string expSign = exp.substr(0, 1);
925 string expNumber = exp.substr(1, string::npos);
927 size_t expNotZeropos = expNumber.find_first_not_of(
"0",0);
928 if(expNotZeropos != string::npos)
930 expNumber = expNumber.substr(expNotZeropos, string::npos);
941 if(baseNumber.empty() && expNumber.empty())
943 cout <<
"eventRates::GetPOTAsString - PROBLEM: base number and exp number are both empty" <<
endl;
947 if(baseNumber ==
"1.0")
950 potfinalstr =
"10^{" + expSign + expNumber +
"}";
952 potfinalstr =
"10^{" + expNumber +
"}";
957 potfinalstr = baseNumber +
"#times10^{" + expSign + expNumber +
"}";
959 potfinalstr = baseNumber +
"#times10^{" + expNumber +
"}";
982 h -> GetYaxis() -> SetTitle(ytitle.c_str());
983 h -> GetYaxis() -> CenterTitle();
987 h -> GetXaxis() -> SetTitle(xtitle.c_str());
988 h -> GetXaxis() -> CenterTitle();
1003 const double rdet = 100.0;
1004 const double pimass = 0.13957;
1005 const double kmass = 0.49368;
1006 const double k0mass = 0.49767;
1007 const double mumass = 0.105658389;
1008 const double taumass = 1.77682;
1031 int m_ptype = -9999;
1032 double m_pdPx = -9999;
1033 double m_pdPy = -9999;
1034 double m_pdPz = -9999;
1035 double m_Vx = -9999;
1036 double m_Vy = -9999;
1037 double m_Vz = -9999;
1038 double m_ppdxdz = -9999;
1039 double m_ppdydz = -9999;
1040 double m_ppenergy = -9999;;
1041 double m_pppz = -9999;
1042 double m_muparpx = -9999;
1043 double m_muparpy = -9999;
1044 double m_muparpz = -9999;
1045 double m_mupare = -9999;
1046 int m_Ntype = -9999;
1047 double m_Necm = -9999;
1049 double m_parent_mass = -9999;
1051 m_ptype = dk2nu->decay.ptype;
1052 m_pdPx = dk2nu->decay.pdpx;
1053 m_pdPy = dk2nu->decay.pdpy;
1054 m_pdPz = dk2nu->decay.pdpz;
1055 m_Vx = dk2nu->decay.vx;
1056 m_Vy = dk2nu->decay.vy;
1057 m_Vz = dk2nu->decay.vz;
1058 m_ppdxdz = dk2nu->decay.ppdxdz;
1059 m_ppdydz = dk2nu->decay.ppdydz;
1060 m_ppenergy = dk2nu->decay.ppenergy;
1061 m_pppz = dk2nu->decay.pppz;
1062 m_muparpx = dk2nu->decay.muparpx;
1063 m_muparpy = dk2nu->decay.muparpy;
1064 m_muparpz = dk2nu->decay.muparpz;
1065 m_mupare = dk2nu->decay.mupare;
1066 m_Ntype = dk2nu->decay.ntype;
1067 m_Necm = dk2nu->decay.necm;
1069 if (m_ptype == 211 || m_ptype == -211) m_parent_mass = pimass;
1070 else if (m_ptype == 321 || m_ptype == -321) m_parent_mass = kmass;
1071 else if (m_ptype == 311 || m_ptype == 130 || m_ptype==310) m_parent_mass = k0mass;
1072 else if (m_ptype == 13 || m_ptype == -13) m_parent_mass = mumass;
1074 cout <<
"eventRates::GetWeight - Wrong parent type!! "<< m_ptype <<
" = " 1075 << m_ptype <<
" Decay code = " << Ndecay <<
endl;
1082 if (m_ptype == 8 || m_ptype == 9) {
1083 m_parent_mass = pimass;
1085 else if (m_ptype == 11 || m_ptype == 12) m_parent_mass = kmass;
1086 else if (m_ptype == 10) m_parent_mass = k0mass;
1087 else if (m_ptype == 5 || m_ptype == 6) m_parent_mass = mumass;
1089 cout <<
"eventRates::GetWeight - Wrong parent type!! "<< m_ptype <<
" = " 1090 << m_ptype <<
" Decay code = " << Ndecay <<
endl;
1101 m_ppenergy = ppenergy;
1103 m_muparpx = muparpx;
1104 m_muparpy = muparpy;
1105 m_muparpz = muparpz;
1132 double parent_energy = sqrt(m_pdPx*m_pdPx +
1135 m_parent_mass*m_parent_mass);
1136 double gamma = parent_energy / m_parent_mass;
1137 double gamma_sqr = gamma*gamma;
1138 double beta_mag = sqrt((gamma_sqr-1.)/gamma_sqr);
1140 double enuzr = m_Necm;
1142 double rad = sqrt((xdet[0]-m_Vx)*(xdet[0]-m_Vx) +
1143 (xdet[1]-m_Vy)*(xdet[1]-m_Vy) +
1144 (xdet[2]-m_Vz)*(xdet[2]-m_Vz));
1146 double parentp = sqrt((m_pdPx*m_pdPx)+
1149 double costh_pardet = (m_pdPx*(xdet[0]-m_Vx) +
1150 m_pdPy*(xdet[1]-m_Vy) +
1151 m_pdPz*(xdet[2]-m_Vz))/(parentp*rad);
1153 if (costh_pardet>1.) costh_pardet = 1.;
1154 else if (costh_pardet<-1.) costh_pardet = -1.;
1155 double theta_pardet = acos(costh_pardet);
1157 double emrat = 1./(gamma*(1. - beta_mag * cos(theta_pardet)));
1159 nu_energy = emrat*enuzr;
1161 double sangdet = (rdet*rdet /(rad*rad)/ 4.);
1163 nu_wght = sangdet * emrat * emrat;
1167 if (m_ptype==muplus || m_ptype==muminus)
1172 beta[0]=m_pdPx / parent_energy;
1173 beta[1]=m_pdPy / parent_energy;
1174 beta[2]=m_pdPz / parent_energy;
1176 p_nu[0] = (xdet[0]- m_Vx) * nu_energy / rad;
1177 p_nu[1] = (xdet[1]- m_Vy) * nu_energy / rad;
1178 p_nu[2] = (xdet[2]- m_Vz) * nu_energy / rad;
1180 double partial = gamma*(beta[0]*p_nu[0]+
1183 partial = nu_energy-partial / (gamma+1.);
1185 for (
int i=0;
i<3;
i++) p_dcm_nu[
i]=p_nu[
i]-beta[
i]*gamma*partial;
1187 for (
int i=0;
i<3;
i++) p_dcm_nu[3]+=p_dcm_nu[
i]*p_dcm_nu[
i];
1188 p_dcm_nu[3]=sqrt(p_dcm_nu[3]);
1191 gamma=m_ppenergy / m_parent_mass;
1192 beta[0] = m_ppdxdz * m_pppz / m_ppenergy;
1193 beta[1] = m_ppdydz * m_pppz / m_ppenergy;
1194 beta[2] = m_pppz / m_ppenergy;
1195 partial = gamma*(beta[0]*m_muparpx+
1198 partial = m_mupare - partial / (gamma+1.);
1200 p_pcm_mp[0]=m_muparpx-beta[0]*gamma*partial;
1201 p_pcm_mp[1]=m_muparpy-beta[1]*gamma*partial;
1202 p_pcm_mp[2]=m_muparpz-beta[2]*gamma*partial;
1204 for (
int i=0;
i<3;
i++) p_pcm_mp[3]+=p_pcm_mp[
i]*p_pcm_mp[
i];
1205 p_pcm_mp[3]=sqrt(p_pcm_mp[3]);
1207 double wt_ratio = 1.;
1210 if (p_pcm_mp[3] != 0. ) {
1212 double costh = (p_dcm_nu[0]*p_pcm_mp[0]+
1213 p_dcm_nu[1]*p_pcm_mp[1]+
1214 p_dcm_nu[2]*p_pcm_mp[2])/(p_dcm_nu[3]*p_pcm_mp[3]);
1216 if (costh>1.) costh = 1.;
1217 else if (costh<-1.) costh = -1.;
1220 if (m_Ntype == nue || m_Ntype == nuebar)
1222 wt_ratio = 1.-costh;
1224 else if (m_Ntype == numu || m_Ntype == numubar)
1226 double xnu = 2.* enuzr / mumass;
1227 wt_ratio = ( (3.-2.*xnu) - (1.-2.*xnu)*costh ) / (3.-2.*xnu);
1229 else if (m_Ntype == nutau || m_Ntype == nutaubar)
1231 double xnu = 2.* enuzr / taumass;
1232 wt_ratio = ( (3.-2.*xnu) - (1.-2.*xnu)*costh ) / (3.-2.*xnu);
1233 std::cout <<
"calculating weight for tau neutrino; this may not be correct" <<
std::endl;
1237 std::cout <<
"eventRates:: Bad neutrino type = " << m_Ntype <<
std::endl;
1240 nu_wght *= wt_ratio;
1255 if( current !=
"NC" && current !=
"CC") {
1256 cout <<
" eventRates::GetXSec: Current other than NC or CC specified... I don't know what to do." <<
endl;
1261 if (nu_type == 52) file_index = 0;
1262 if (nu_type == 53) file_index = 1;
1263 if (nu_type == 55) file_index = 2;
1264 if (nu_type == 56) file_index = 3;
1265 if (nu_type == 58) file_index = 4;
1266 if (nu_type == 59) file_index = 5;
1268 int current_index = 0;
1269 if( current ==
"NC")
1273 double thexsec = 0.;
1276 double scale_factor = 6.026e-10;
1290 if ( nu_energy > f_e_arr[fnlines-1][file_index][current_index] ) {
1291 thexsec = f_xsec_arr[fnlines-1][file_index][current_index]*f_e_arr[fnlines-1][file_index][current_index]*scale_factor;
1295 else if ( nu_energy < f_e_arr[0][file_index][current_index] ) {
1296 thexsec = f_xsec_arr[0][file_index][current_index]*f_e_arr[0][file_index][current_index]*scale_factor;
1301 int energy_index = 0;
1302 for(
int i = 0;
i< fnlines-1;
i++) {
1303 if( nu_energy > f_e_arr[
i][file_index][current_index] &&
1304 nu_energy < f_e_arr[
i+1][file_index][current_index]) {
1310 double sig1 = f_xsec_arr[energy_index][file_index][current_index];
1311 double sig2 = f_xsec_arr[energy_index+1][file_index][current_index];
1314 thexsec = sig1 + ((sig2 - sig1)/(f_e_arr[energy_index+1][file_index][current_index]-f_e_arr[energy_index][file_index][current_index]))*(nu_energy - f_e_arr[energy_index][file_index][current_index]);
1315 thexsec = thexsec * nu_energy;
1317 thexsec = thexsec * scale_factor;
1329 base = base +
"/ProductionScripts/data/argon_genie2.8.4/";
1333 string charge =
"cc";
1340 string suffix[narr];
1342 suffix[0] =
"_nuebar.dat";
1343 suffix[1] =
"_nue.dat";
1344 suffix[2] =
"_numubar.dat";
1345 suffix[3] =
"_numu.dat";
1346 suffix[4] =
"_nutaubar.dat";
1347 suffix[5] =
"_nutau.dat";
1349 suffix[0] =
"_nuebar.dat";
1350 suffix[1] =
"_nue.dat";
1351 suffix[2] =
"_numubar.dat";
1352 suffix[3] =
"_numu.dat";
1353 suffix[4] =
"_nutaubar.dat";
1354 suffix[5] =
"_nutau.dat";
1358 for (
int flavor=0; flavor<narr; flavor++) {
1359 filename[flavor] =
"xsec_"+charge+suffix[flavor];
1360 string tmpfilename = base + filename[flavor];
1362 fdat_file[flavor].open(tmpfilename.c_str());
1363 if (fdat_file[flavor].
fail()) {
1364 cout <<
" File not found: " << filename[flavor] <<
endl;
1368 cout <<
" Opened "<<filename[flavor] <<
"."<<
endl;
1373 while ( fdat_file[flavor] >> row[0] >> row[1] ) {
1375 if (fnlines >= fnbins) {
1376 cout <<
" length of data file exceed array size. Fix me. " << filename <<
endl;
1380 f_e_arr[fnlines][flavor][
current-1] = row[0];
1381 f_xsec_arr[fnlines][flavor][
current-1] = row[1];
1384 fdat_file[flavor].close();
1387 std::cout<<
"finished reading cross section files"<<
std::endl;
1395 const int nuebar = 52;
1396 const int numu = 56;
1397 const int numubar = 55;
1398 const int nutau = 59;
1399 const int nutaubar = 58;
1401 Ntype = dk2nu->decay.ntype;
1402 else if (ntype == nuebar) flavbefore = -12;
1403 else if (ntype == numubar) flavbefore = -14;
1404 else if (ntype == nutaubar) flavbefore = -16;
1405 else if (ntype == nue) flavbefore = 12;
1406 else if (ntype == numu) flavbefore = 14;
1407 else if (ntype == nutau) flavbefore = 16;
1409 std::cout<<
"WARNING: unrecognized neutrino type: "<<ntype<<
std::endl;
1427 P_e = calculator.
P(flavbefore, -12, E);
1428 P_m = calculator.
P(flavbefore, -14, E);
1429 P_t = calculator.
P(flavbefore, -16, E);
1432 P_e = calculator.
P(flavbefore, 12, E);
1433 P_m = calculator.
P(flavbefore, 14, E);
1434 P_t = calculator.
P(flavbefore, 16, E);
1438 double random_number = rand3->Rndm();
1440 int ntype_oscillated;
1442 if(random_number < P_e)
1443 ntype_oscillated = nuebar;
1444 else if(random_number < P_e + P_t)
1445 ntype_oscillated = nutaubar;
1447 ntype_oscillated = numubar;
1450 if(random_number < P_e)
1451 ntype_oscillated = nue;
1452 else if(random_number < P_e + P_t)
1453 ntype_oscillated = nutau;
1455 ntype_oscillated = numu;
1458 return ntype_oscillated;
double GetXSec(double nu_type, double nu_energy, std::string current)
void SetTh12(double th12)
void SetTh23(double th23)
double P(int flavBefore, int flavAfter, double E)
void ReadXSecsFromFiles()
std::string getenv(std::string const &name)
void SetDmsq21(double dmsq21)
void SetTitles(TH1 *h, const std::string &xtitle="", const std::string &ytitle="")
double GetOscillatedNeutrinoType(double ntype, double E)
std::string GetPOTAsString(const double dpot)
double GetWeight(const std::vector< double > xdet, double &nu_wght, double &nu_energy)
void SetDmsq32(double dmsq32)
void SetTh13(double th13)
QTextStream & endl(QTextStream &s)
h
training ###############################