11 #include "CAFAna/Core/Cut.h" 16 #include "CAFAna/Core/Var.h" 28 template<>
struct hash<
std::pair<int, int>>
32 return std::hash<int>()(x.first*65536 + x.second);
36 template<>
struct hash<
std::tuple<int, int, int>>
40 return std::hash<int>()(std::get<0>(x)*1048576 + std::get<1>(
x)*1024 + std::get<2>(x));
44 template<>
struct hash<
std::tuple<int, int, int, int>>
46 size_t operator()(
const std::tuple<int, int, int, int>&
x)
const 48 return std::hash<int>()(std::get<0>(x)*16777216 + std::get<1>(
x)*65536 + std::get<2>(x) * 256 + std::get<3>(
x));
56 class ReweightableSpectrum;
80 virtual void AddSpectrum(
Spectrum& spect,
87 virtual void AddSpectrum(
Spectrum& spect,
94 virtual void AddSpectrum(
Spectrum& spect,
100 virtual void AddSpectrum(
Spectrum& spect,
101 const NuTruthMultiVar&
var,
115 virtual void AddSpillHistogram(TH1*
h,
121 virtual void Go() = 0;
124 virtual bool Gone()
const {
return fGone;}
126 double GetWeightedPOT();
153 TFile* GetNextFile();
176 std::unordered_map<int, SystApplier*>
fSinksS;
189 :
h(_h),
var(_var),
cut(_cut), wei(_wei)
207 : spect(_spect),
var(_var),
cut(_cut), shift(_shift), wei(_wei)
212 const NuTruthMultiVar& _var,
216 : spect(_spect), multivar(_var),
cut(_cut), shift(_shift), wei(_wei)
222 const std::optional<NuTruthVar>
var;
245 virtual void Go()
override;
262 const NuTruthMultiVar&
var,
271 const Var& wei)
override {}
size_t operator()(const std::pair< int, int > &x) const
Histograms that are filled from the nuTree.
Cuts and Vars for the 2020 FD DiF Study.
void AddSpectrum(Spectrum &spect, const NuTruthVar &var, const NuTruthCut &cut, const SystShifts &shift, const NuTruthVar &wei=kNuTruthUnweighted) override
For use by the Spectrum constructor.
bool fGone
Has Go() been called? Can't add more histograms after that.
Simple record of shifts applied to systematic parameters.
Spectrum with the value of a second variable, allowing for reweighting
double fRunPOT
Crude measure, not including spill cuts.
const std::optional< NuTruthVar > var
void AddSpectrum(Spectrum &spect, const MultiVar &var, const Cut &cut, const SystShifts &shift, const Var &wei=kUnweighted) override
For use by the Spectrum constructor.
Representation of a spectrum in any variable, with associated POT.
std::unique_ptr< SpillCut > fSpillCut
Cut applied to the spill branch for every event.
std::set< IRecordSink * > fSpectrumSinks
const SpillVar kSpillUnweighted
void AddSpectrum(Spectrum &spect, const NuTruthMultiVar &var, const NuTruthCut &cut, const SystShifts &shift, const NuTruthVar &wei=kNuTruthUnweighted) override
SpillHistDef(TH1 *_h, const SpillVar &_var, const SpillCut &_cut, const SpillVar &_wei=kSpillUnweighted)
void AddSpectrum(Spectrum &spect, const Var &var, const Cut &cut, const SystShifts &shift, const Var &wei=kUnweighted) override
For use by the Spectrum constructor.
std::vector< std::string > wildcard(const std::string &wildcardString)
ExposureSource fExposureSource
void AddReweightableSpectrum(ReweightableSpectrum &spect, const Var &xvar, const Var &yvar, const Cut &cut, const SystShifts &shift, const Var &wei) override
For use by the constructors of ReweightableSpectrum subclasses.
std::unordered_map< int, SystApplier * > fSinksS
std::list< SpillHistDef > fSpillHistDefs
std::unordered_map< std::pair< int, int >, CutApplier * > fSinksSC
Base class for the various types of spectrum loader.
size_t operator()(const std::tuple< int, int, int > &x) const
Interface class for accessing ROOT files in sequence.
std::unique_ptr< IFileSource > fFileSource
NuHistDef(Spectrum &_spect, const NuTruthMultiVar &_var, const NuTruthCut &_cut, const SystShifts &_shift, const NuTruthVar &_wei=kNuTruthUnweighted)
const std::optional< NuTruthMultiVar > multivar
const NuTruthVar kNuTruthUnweighted
Helper for SpectrumLoaderBase. Details of SpillVar plots.
Dummy loader that doesn't load any files.
std::unordered_map< std::tuple< int, int, int >, WeightApplier * > fSinksSCW
_MultiVar< caf::SRNeutrinoProxy > NuTruthMultiVar
void AccumulateExposures(const caf::SRSpillProxy *spill) override
Template for Cut and SpillCut.
double fPOT
Accumulated by calls to GetNextFile.
Spectrum with true energy information, allowing it to be oscillated
virtual bool Gone() const
Indicate whether or not Go has been called.
std::list< NuHistDef > fNuHistDefs
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
Spectrum with true L/E information, allowing it to be oscillated
static NullLoader kNullLoader
Dummy loader that doesn't load any files.
size_t operator()(const std::tuple< int, int, int, int > &x) const
NuHistDef(Spectrum &_spect, const NuTruthVar &_var, const NuTruthCut &_cut, const SystShifts &_shift, const NuTruthVar &_wei=kNuTruthUnweighted)