make_ehade_histogram.C
Go to the documentation of this file.
2 //#include "/nova/app/users/dmendez/Releases/dev/CAFAna/numu/Analysis2018/varsandcuts.h"
4 
5 using namespace ana;
6 
7 
8 void make_ehade_histogram(std::string polarity = "rhc",
9  std::string period = "full")
10 {
11 
12  std::cout << "\n=================================" << std::endl;
13  std::cout << " make distribution for quantiles " << std::endl;
14  std::cout << "=================================\n" << std::endl;
15 
16  std::string production = "sumdecaf_R17-11-14-prod4reco";
17  if(polarity == "fhc") production += ".d";
18  if(polarity == "rhc") production += ".e";
19 
20 
21  // define selection
22  const Cut kNumuNDCut = kNumuCutND2018;
23  const Cut kNumuFDCut = kNumuCutFD2018;
24  const Var kXSecWeight = kXSecCVWgt2018Fix;
25 
26  std::cout << "polarity: " << polarity << ", period: " << period << ", files: " << production << std::endl;
27 
28  std::string OutDir = "";
29  // Get a vector of file names to pass to the spectrum loader
30  std::string fd_genie_nonswap = "prod_" + production + "_fd_genie_nonswap_" + polarity + "_nova_v08_" + period + "_v1_numu2018";
31  SpectrumLoader loader(fd_genie_nonswap);
32  TH2* hQuantiles = MakeQuantileHistogram(loader, kNumuCCOptimisedAxis, kHadEFracAxis, kNumuFDCut && kIsNumuCC, kStandardSpillCuts, kNoShift, kPPFXFluxCVWgt*kXSecWeight);
33  std::string OutFileName = OutDir + "quantiles__" + polarity + "_" + period + "__numu2018.root";
34  std::cerr << "Saving distribution for quantiles to " << OutFileName << std::endl;
35  TFile *f = TFile::Open(OutFileName.c_str(), "RECREATE");
36  hQuantiles->Write("FDSpec2D");
37  f->Close();
38 
39 }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
const Cut kNumuCutND2018
Definition: NumuCuts2018.h:41
const HistAxis kHadEFracAxis("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kHadEFrac)
HistAxis that implements Hadronic Energy fraction binning used by L.Vinton to derive Hadronic Energy ...
Definition: HistAxes.h:30
OStream cerr
Definition: OStream.cxx:7
const Var kXSecCVWgt2018Fix
Definition: varsandcuts.h:6
std::string OutDir
void make_ehade_histogram(std::string polarity="rhc", std::string period="full")
loader
Definition: demo0.py:10
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39;...
Definition: HistAxes.h:24
TH2 * MakeQuantileHistogram(SpectrumLoader &loader, const HistAxis &independentAxis, const HistAxis &quantileAxis, const Cut &cut, const SpillCut &spillCut, const SystShifts &shift, const Var &wei)
Returns a TH2D with xAxis as independentAxis and yAxis as quantileAxis Quantiles in yAxis can be calc...
const SystShifts kNoShift
Definition: SystShifts.cxx:22
OStream cout
Definition: OStream.cxx:6
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Cut kNumuCutFD2018
Definition: NumuCuts2018.h:39
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
enum BeamMode string