39 SpectrumLoader csLoader(
"prod_sumdecaf_R19-11-18-prod5reco.i_fd_cosmic_" + horn +
"_" + sPeriod +
"_v1_goodruns_numu2020");
40 SpectrumLoader dtLoader(
"prod_sumrestricteddecaf_R19-11-18-prod5reco.combi_opt2_fd_numi_" + horn +
"_" + sRange +
"_v1_numu2020_fddatav2");
49 std::string infile_quant =
"/cvmfs/nova.opensciencegrid.org/externals/numudata/v00.05/NULL/lib/ana2020/Quantiles/quantiles_" + horn +
"_full_numu2020.root";
50 TFile*
infile =
new TFile(infile_quant.c_str());
51 TH2* FDSpec2D = (TH2*)infile->FindObjectAny(
"FDSpec2D");
53 quantCuts.push_back(
kNoCut);
56 const std::map< std::string, Cut>
quantiles =
58 {
"Quant1" , quantCuts[0]},
59 {
"Quant2" , quantCuts[1]},
60 {
"Quant3" , quantCuts[2]},
61 {
"Quant4" , quantCuts[3]},
62 {
"AllQuants", quantCuts[4]}
66 std::map< std::string, PredictionNoExtrap* > mcPreds;
67 std::map< std::string, Spectrum* > csSpecs;
68 std::map< std::string, Spectrum* > dtSpecs;
71 for (
auto quant : quantiles) {
72 mcPreds[
"mcPred_" +
var.first.first +
"_" + quant.first] =
74 var.second.var, myCut && quant.second,
77 csSpecs[
"csSpec_" +
var.first.first +
"_" + quant.first] =
82 dtSpecs[
"dtSpec_" +
var.first.first +
"_" + quant.first] =
96 TFile *
outfile =
new TFile((
"numuDataMC_" + horn +
"_" + sRange +
".root").c_str(),
"RECREATE");
99 for (
auto pred : mcPreds)
100 pred.second->SaveTo(outfile,
pred.first.c_str());
102 for (
auto spec : csSpecs)
103 spec.second->SaveTo(outfile, spec.first.c_str());
105 for (
auto spec : dtSpecs)
106 spec.second->SaveTo(outfile, spec.first.c_str());
const SpillCut kStandardSpillCuts_FD_Prod4MotivatedDQ
std::vector< double > quantiles(TH1D *h)
Collection of SpectrumLoaders for many configurations.
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 ...
void SetSpillCut(const SpillCut &cut)
void Go()
Call Go() on all the loaders.
const Cut kInCosmicTimingWindow
Is the event far from the start and ends of the spill ? For FD cosmic selection.
void SetSpillCut(const SpillCut &cut)
For nominal spectra and reweighting systs (xsec/flux)
virtual void Go() override
Load all the registered spectra.
std::vector< float > Spectrum
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to 'custC'...
const SystShifts kNoShift
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
std::vector< Cut > QuantileCutsFromTH2(TH2 *quantileHist, const HistAxis &independentAxis, const HistAxis &quantileAxis, const unsigned int &numQuantiles, const bool verbose)
: Do the same as the QuantileCuts function but taking in the TH2 instead of making it...
const Cut kInBeamSpill([](const caf::SRProxy *sr){if(sr->spill.run > util::kLastBadTimingRun) return kInBeamSpill_main(sr);else return kInBeamSpill_main(sr)||kInBeamSpill_shifted(sr);}, [](const caf::SRSpillProxy *spill){if(spill->run > util::kLastBadTimingRun) return kInBeamSpill_main.Livetime(spill);else return kInBeamSpill_main.Livetime(spill)+kInBeamSpill_shifted.Livetime(spill);}, [](const caf::SRSpillProxy *spill) -> double{return spill->spillpot;})
Does the event fall inside the window we call the beam spill?
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
void make_DataMCComp_numu(std::string horn, uint period)
std::string to_string(ModuleType mt)
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.