38 const std::string& xlabel,
const std::string& ylabel,
40 int nbinsx,
double xmin,
double xmax,
41 int nbinsy,
double ymin,
double ymax);
45 const std::vector<std::string>&
labels,
46 const std::vector<Binning>& bins,
47 double pot,
double livetime);
50 std::unique_ptr<TH2D>
h,
51 const std::vector<std::string>&
labels,
52 const std::vector<Binning>& bins,
53 double pot,
double livetime);
66 void Fill(
double x,
double y,
double w = 1);
68 TH2D*
ToTH2(
double pot)
const;
89 static std::unique_ptr<ReweightableSpectrum>
LoadFrom(TDirectory*
dir);
98 const std::vector<Binning>& bins,
119 const std::vector<std::string>&
labels,
120 const std::vector<Binning>& bins,
121 double pot,
double livetime)
const Var & ReweightVar() const
The variable that will be used to fill the y-axis.
Spectrum UnWeighted() const
Represent the binning of a Spectrum's x-axis.
process_name opflash particleana ie x
void Fill(double x, double y, double w=1)
virtual ~ReweightableSpectrum()
Simple record of shifts applied to systematic parameters.
Var fRWVar
What goes on the y axis?
Spectrum with the value of a second variable, allowing for reweighting
void ReweightToRecoSpectrum(const Spectrum &target)
Recale bins so that Unweighted will return target.
process_name opflashCryoW ana
ReweightableSpectrum(const std::vector< std::string > &labels, const std::vector< Binning > &bins, const Var &rwVar)
Representation of a spectrum in any variable, with associated POT.
void RemoveLoader(SpectrumLoaderBase *)
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
process_name opflash particleana ie ie y
std::vector< Binning > GetBinnings() const
std::vector< std::string > GetLabels() const
void SaveTo(TDirectory *dir) const
std::set< SpectrumLoaderBase * > fLoaderCount
This count is maintained by SpectrumLoader, as a sanity check.
std::vector< std::string > fLabels
const SystShifts kNoShift
Base class for the various types of spectrum loader.
ReweightableSpectrum & operator=(const ReweightableSpectrum &rhs)
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Var kUnweighted([](const caf::SRSliceProxy *){return 1;})
The simplest possible Var, always 1. Used as a default weight.
Spectrum WeightedBy(const TH1 *weights) const
static std::unique_ptr< ReweightableSpectrum > LoadFrom(TDirectory *dir)
std::vector< Binning > fBins
Dummy loader that doesn't load any files.
void ReweightToTrueSpectrum(const Spectrum &target)
Rescale bins so that WeightingVariable will return target.
ReweightableSpectrum(SpectrumLoaderBase &loader, const HistAxis &recoAxis, const HistAxis &trueAxis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
void AddLoader(SpectrumLoaderBase *)
ReweightableSpectrum(TH2 *h, const std::vector< std::string > &labels, const std::vector< Binning > &bins, double pot, double livetime)
ReweightableSpectrum(const std::string &label, const Binning &bins, const Var &rwVar)
unsigned int NDimensions() const
Spectrum WeightingVariable() const
TH2D * ToTH2(double pot) const