12 #include "THnSparse.h"
96 Spectrum(
const std::string& label,
double pot,
double livetime,
const Binning& bins);
100 const std::vector<std::string>&
labels,
101 const std::vector<Binning>& bins,
102 double pot,
double livetime);
106 const std::vector<std::string>&
labels,
107 const std::vector<Binning>& bins,
108 double pot,
double livetime);
152 const std::string& yLabel,
162 const std::string& yLabel,
170 const std::string& yLabel,
180 const std::string& yLabel,
199 const std::string& yLabel,
200 const std::string& zLabel,
230 void Fill(
double x,
double w = 1);
238 TH1D*
ToTH1(
double exposure,
239 Color_t col = kBlack,
240 Style_t
style = kSolid,
252 return ToTH1(exposure, kBlack, kSolid, expotype, bintype);
303 void Scale(
double c);
321 static std::unique_ptr<Spectrum>
LoadFrom(TDirectory*
dir);
329 const std::vector<Binning>& bins,
const SpillVar kSpillUnweighted([](const caf::SRSpillProxy *){return 1;})
Spectrum & operator-=(const Spectrum &rhs)
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
Spectrum operator*(const Ratio &rhs) const
Represent the binning of a Spectrum's x-axis.
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir)
process_name opflash particleana ie x
Simple record of shifts applied to systematic parameters.
void OverridePOT(double newpot)
DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN'T A BETTER WAY!
TH3 * ToTH3(double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Spectrum must be 3D to obtain TH3.
EResult err(const char *call)
Spectrum & PlusEqualsHelper(const Spectrum &rhs, int sign)
Helper for operator+= and operator-=.
TH2 * ToTH2NormX(double exposure, EExposureType expotype=kPOT) const
Spectrum must be 2D to obtain TH2. Normalized to X axis.
void AddLoader(SpectrumLoaderBase *)
void ConstructHistogram(ESparse sparse=kDense)
void Fill(double x, double w=1)
process_name opflashCryoW ana
double Integral(double exposure, double *err=0, EExposureType expotype=kPOT) const
Return total number of events scaled to pot.
Spectrum & operator=(const Spectrum &rhs)
void Scale(double c)
Multiply this spectrum by a constant c.
Representation of a spectrum in any variable, with associated POT.
std::vector< std::string > fLabels
std::set< SpectrumLoaderBase * > fLoaderCount
This count is maintained by SpectrumLoader, as a sanity check.
Spectrum FakeData(double pot) const
Fake data is a MC spectrum scaled to the POT expected in the data.
Spectrum operator/(const Ratio &rhs) const
EExposureType
For use as an argument to Spectrum::ToTH1.
TH1 * ToTHX(double exposure, bool force1D=false, EExposureType expotype=kPOT) const
Function decides what is the appropriate projection based on fBins, and does that.
EnsembleSpectrum operator*(const EnsembleRatio &lhs, const EnsembleSpectrum &rhs)
Spectrum & operator+=(const Spectrum &rhs)
const SpillCut kNoSpillCut([](const caf::SRSpillProxy *){return true;})
The simplest possible cut: pass everything, used as a default.
void OverrideLivetime(double newlive)
DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN'T A BETTER WAY!
unsigned int NDimensions() const
void RemoveLoader(SpectrumLoaderBase *)
EnsembleRatio operator/(const EnsembleSpectrum &lhs, const EnsembleSpectrum &rhs)
Spectrum(SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Represent the ratio between two spectra.
const SystShifts kNoShift
Base class for the various types of spectrum loader.
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Spectrum operator+(const Spectrum &rhs) const
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.
TH2 * ToTH2(double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Spectrum must be 2D to obtain TH2.
std::vector< Binning > fBins
Spectrum & operator/=(const Ratio &rhs)
Dummy loader that doesn't load any files.
TH1D * ToTH1(double exposure, EExposureType expotype, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
std::vector< std::string > GetLabels() const
Spectrum MockData(double pot, bool makethrow=true, int seed=0) const
Mock data is FakeData with Poisson fluctuations applied.
Spectrum operator-(const Spectrum &rhs) const
double Livetime() const
Seconds. For informational purposes only. No calculations use this.
std::vector< Binning > GetBinnings() const
Spectrum & operator*=(const Ratio &rhs)
void SaveTo(TDirectory *dir) const
double Mean() const
Return mean of 1D histogram.
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)