write_out_h20_xsec.C
Go to the documentation of this file.
1 //
2 // read the output of make_sk_xsec_table.C used by SuperK for MC job normalization,
3 // and convert to ROOT format
4 //
5 
6 {
7  double Emin = 0.0;
8  double Emax = 15.0;
9  double dE = 0.050;
10  int nE = (Emax-Emin)/dE;
11 
12  TFile f("./xsec_H20.root","recreate");
13 
14  TH1D * xsec_numuH20 = new TH1D("xsec_numuH20", "", nE, Emin, Emax);
15  TH1D * xsec_numubarH20 = new TH1D("xsec_numubarH20", "", nE, Emin, Emax);
16  TH1D * xsec_nueH20 = new TH1D("xsec_nueH20", "", nE, Emin, Emax);
17  TH1D * xsec_nuebarH20 = new TH1D("xsec_nuebarH20", "", nE, Emin, Emax);
18 
19  TTree xsec_water;
20  const char * xsec_water_file = "./genie_sk_xsec_table.dat";
21  xsec_water.ReadFile(xsec_water_file, "E/D:xsec_numu/D:xsec_numubar/D:xsec_nue/D:xsec_nuebar/D");
22 
23  xsec_water.Draw("E>>xsec_numuH20", "xsec_numu", "goff");
24  xsec_water.Draw("E>>xsec_numubarH20", "xsec_numubar", "goff");
25  xsec_water.Draw("E>>xsec_nueH20", "xsec_nue", "goff");
26  xsec_water.Draw("E>>xsec_nuebarH20", "xsec_nuebar", "goff");
27 
28  f.Write();
29  f.Close();
30 }
const char * xsec_water_file
TH1D * xsec_nuebarH20
TH1D * xsec_nueH20
TH1D * xsec_numuH20
TH1D * xsec_numubarH20
double dE
TFile f("./xsec_H20.root","recreate")
TTree xsec_water
double Emax
int nE