3 #include "CAFAna/Core/Cut.h" 5 #include "CAFAna/Core/Binning.h" 53 const vector<pair<const string, const ana::Var>>
weights{
56 {
"ppfxxsecwgt", ppfxXSecWeights}
61 std::string data_def =
"def_snapshot prod_caf_R17-11-14-prod4reco.remid-hotfix.b_nd_numi_fhc_full_v1_addShortSimpleCVN_goodruns";
62 std::string nominal_def =
"def_snapshot nd_fhc_remid-hotfix_caf_minus_muonid_training_minus_fakedata";
67 std::map<std::string, std::map<std::string, Spectrum*> > dataSpectrumsReco;
69 for(std::pair<std::string, ana::HistAxis> unfoldingVar :
unfoldingVars){
70 for(std::pair<const string, const ana::Var>
weight :
weights){
73 dataSpectrumsReco[unfoldingVar.first][
weight.first] = dataReco;
78 const int wanted_pdg = 14;
82 TVector3 flux_vtxmin =
vtxmin;
83 TVector3 flux_vtxmax =
vtxmax;
93 TFile *
fOut =
new TFile(outputfile.c_str(),
"RECREATE");
96 for (std::pair<
std::string, std::map<std::string, Spectrum*> > dataReco : dataSpectrumsReco){
98 dir = fOut->mkdir(dataReco.first.c_str());
99 dir = dir->mkdir(
"reco");
102 std::map<std::string, Spectrum*>& weightSpecs = dataReco.second;
103 for(std::pair<std::string, Spectrum*> weightSpec : weightSpecs)
104 weightSpec.second->SaveTo(dir->mkdir(weightSpec.first.c_str()));
108 dir = fOut->mkdir(
"fluxes");
110 fluxData->
SaveTo(dir->mkdir(
"Data"));
111 fluxCV->
SaveTo(dir->mkdir(
"CV"));
const HistAxis kRecoQ2StandardAxis("Reco Q2 (GeV)", q2bins, kRecoq2)
Represent the binning of a Spectrum's x-axis.
Cuts and Vars for the 2020 FD DiF Study.
const TVector3 vtxmin(-130,-176, 225)
void makeRealDataFluxes(std::string outputfile="fRealDataFluxes.root")
Representation of a spectrum in any variable, with associated POT.
std::map< std::string, ana::HistAxis > unfoldingVars
const vector< pair< const string, const ana::Var > > weights
virtual void Go() override
Load all the registered spectra.
void SaveTo(TDirectory *dir, const std::string &name) const
const NuTruthVar kXSecCVWgt2018_smallerDISScale_NT
std::vector< float > Spectrum
const SystShifts kNoShift
const Cut kAllNumuCC1DCuts
Var VarFromNuTruthVar(const NuTruthVar &stv, double _default)
const ana::NuTruthVar ppfxXSecWeightsST
Spectrum * DeriveFlux(SpectrumLoaderBase &loader, const Binning &bins, int pdg, const TVector3 *min, const TVector3 *max, const SystShifts &shift, const NuTruthVar weight)
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const HistAxis kRecoMuKEVsCosVsEavailStandardAxis("Reco. T_{#mu} vs cos #{theta} vs Available Energy (GeV)", angvsmukevseavailbins, kRecoMuKEVsCosVsEavail)
std::map< std::string, ana::Cut > recoCuts
const TVector3 vtxmax(160, 160, 1000)
Template for Var and SpillVar.
const HistAxis kRecoEStandardAxis("Reconstructed Neutrino Energy (GeV)", enubins, kRecoE)
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
const NuTruthVar kPPFXFluxCVWgtST([](const caf::SRNeutrinoProxy *nu){ if(nu->rwgt.ppfx.cv!=nu->rwgt.ppfx.cv){return 1.f;}if(nu->rwgt.ppfx.cv >90){return 1.f;}return float(nu->rwgt.ppfx.cv);})
weight events with the flux PPFX Central value correction.
const ana::Var ppfxXSecWeights