Functions | Variables
getFlatWeightSpectra.C File Reference
#include "CAFAna/Core/SpectrumLoader.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Core/Var.h"
#include "CAFAna/Cuts/SpillCuts.h"
#include "CAFAna/Cuts/TruthCuts.h"
#include "3FlavorAna/Cuts/NueCutsSecondAna.h"
#include "3FlavorAna/Vars/NueVars.h"
#include "3FlavorAna/Vars/NueVarsExtra.h"
#include "CAFAna/Vars/XsecTunes.h"
#include "CAFAna/Vars/PPFXWeights.h"
#include "NDAna/nuebarcc_inc/NuebarCCIncVars.h"
#include "NDAna/nuebarcc_inc/NuebarCCIncCuts.h"
#include "NDAna/nuebarcc_inc/NuebarCCIncExtra.h"

Go to the source code of this file.

Functions

void getFlatWeightSpectra ()
 

Variables

Var weights = kPPFXFluxCVWgt * kXSecCVWgt2018
 
std::string training_data = NominalMC_energy_training_RHC_prod4
 
const Binning trueE_bins = Binning::Simple(50, 0, 10)
 

Function Documentation

void getFlatWeightSpectra ( )

Definition at line 36 of file getFlatWeightSpectra.C.

References update_sam_good_runs_metadata::cuts, ana::SpectrumLoaderBase::Go(), ana::nueccinc::kcPresel, ana::kIsTrueSig, ana::kNoShift, ana::kTrueE, demo0::loader, modifyFHiCL::out_file, ana::Spectrum::SaveTo(), and training_data.

37 {
38  Cut cuts = kcPresel && kIsTrueSig; // ktIsNuebarCCST && kTrueFiducialST
40 
41  Spectrum* trueE = new Spectrum("True #nu Energy [GeV]",
42  trueE_bins,
43  *loader,
44  kTrueE,
45  cuts,
46  kNoShift,
47  weights);
48 
49  loader->Go();
50 
51 
52  TFile* out_file = new TFile("flat_weight_energy_spectra.root", "recreate");
53  trueE->SaveTo(out_file, "trueE");
54 
55 }
const Cut kcPresel
Definition: NueCCIncCuts.h:139
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const Cut kIsTrueSig
Definition: NueCCIncCuts.h:278
virtual void Go()=0
Load all the registered spectra.
out_file
Append EOF lines.
Definition: modifyFHiCL.py:113
const Var kTrueE([](const caf::SRProxy *sr){return(sr->mc.nnu==0)?0.:float(sr->mc.nu[0].E);})
Definition: Vars.cxx:85
Var weights
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:517
loader
Definition: demo0.py:10
std::vector< float > Spectrum
Definition: Constants.h:573
const SystShifts kNoShift
Definition: SystShifts.cxx:21
Base class for the various types of spectrum loader.
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
std::string training_data
const Binning trueE_bins

Variable Documentation

std::string training_data = NominalMC_energy_training_RHC_prod4

Definition at line 31 of file getFlatWeightSpectra.C.

Referenced by getFlatWeightSpectra().

const Binning trueE_bins = Binning::Simple(50, 0, 10)

Definition at line 33 of file getFlatWeightSpectra.C.

Var weights = kPPFXFluxCVWgt * kXSecCVWgt2018