Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ana::Spectrum Class Reference

Representation of a spectrum in any variable, with associated POT. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-07-07/CAFAna/Core/Spectrum.h"

Public Types

enum  ESparse { kDense, kSparse, kFloat }
 

Public Member Functions

 Spectrum (const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 Spectrum (const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const MultiVar &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 Spectrum (const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const NuTruthVar &var, const NuTruthCut &cut, const SystShifts &shifts=kNoShift, const NuTruthVar &wei=kNuTruthUnweighted)
 
 Spectrum (const std::string &label, SpectrumLoaderBase &loader, const Binning &binsx, const NuTruthVar &varx, const Binning &binsy, const NuTruthVar &vary, const NuTruthCut &cut, const SystShifts &shifts=kNoShift, const NuTruthVar &wei=kNuTruthUnweighted)
 
 Spectrum (SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 Spectrum (SpectrumLoaderBase &loader, const MultiVarHistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 Spectrum (SpectrumLoaderBase &loader, const NuTruthHistAxis &axis, const NuTruthCut &cut, const SystShifts &shifts=kNoShift, const NuTruthVar &weight=kNuTruthUnweighted)
 
 Spectrum (const std::string &label, const Binning &bins, ESparse sparse=kDense)
 
 Spectrum (const std::string &label, double pot, double livetime, const Binning &bins)
 
 Spectrum (TH1 *h, const std::vector< std::string > &labels, const std::vector< Binning > &bins, double pot, double livetime)
 Copies h. More...
 
 Spectrum (TH1 *h, double pot, double livetime)
 
 Spectrum (std::unique_ptr< TH1D > h, const std::vector< std::string > &labels, const std::vector< Binning > &bins, double pot, double livetime)
 Takes possession of h. More...
 
 Spectrum (std::unique_ptr< TH1F > h, const std::vector< std::string > &labels, const std::vector< Binning > &bins, double pot, double livetime)
 
 Spectrum (const std::string &label, SpectrumLoaderBase &loader, const Binning &binsx, const Var &varx, const Binning &binsy, const Var &vary, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 2D Spectrum of two Vars More...
 
 Spectrum (const std::string &label, SpectrumLoaderBase &loader, const Binning &binsx, const MultiVar &varx, const Binning &binsy, const MultiVar &vary, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 2D Spectrum of two MultiVars More...
 
 Spectrum (SpectrumLoaderBase &loader, const HistAxis &xAxis, const HistAxis &yAxis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 2D Spectrum taking 2 HistAxis More...
 
 Spectrum (const std::string &xLabel, const std::string &yLabel, SpectrumLoaderBase &loader, const Binning &binsx, const Var &varx, const Binning &binsy, const Var &vary, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 Spectrum (const std::string &xLabel, const std::string &yLabel, SpectrumLoaderBase &loader, const Binning &binsx, const MultiVar &varx, const Binning &binsy, const MultiVar &vary, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 Spectrum (const std::string &label, SpectrumLoaderBase &loader, const Binning &binsx, const Var &varx, const Binning &binsy, const Var &vary, const Binning &binsz, const Var &varz, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted, ESparse sparse=kDense)
 3D Spectrum of three Vars More...
 
 Spectrum (const std::string &xLabel, const std::string &yLabel, const std::string &zLabel, SpectrumLoaderBase &loader, const Binning &binsx, const Var &varx, const Binning &binsy, const Var &vary, const Binning &binsz, const Var &varz, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted, ESparse sparse=kDense)
 
 Spectrum (SpectrumLoaderBase &loader, const HistAxis &xAxis, const HistAxis &yAxis, const HistAxis &zAxis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted, ESparse sparse=kDense)
 3D Spectrum taking 3 HistAxis More...
 
virtual ~Spectrum ()
 
 Spectrum (const Spectrum &rhs)
 
 Spectrum (Spectrum &&rhs)
 
Spectrumoperator= (const Spectrum &rhs)
 
Spectrumoperator= (Spectrum &&rhs)
 
 Spectrum (const SpectrumStan &rhs)
 Copy conversion from SpectrumStan. More...
 
Spectrumoperator= (const SpectrumStan &rhs)
 
void Fill (double x, double w=1)
 
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. More...
 
TH1D * ToTH1 (double exposure, EExposureType expotype, EBinType bintype=kBinContent) const
 Histogram made from this Spectrum, scaled to some exposure. More...
 
TH2 * ToTH2 (double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
 Spectrum must be 2D to obtain TH2. More...
 
TH2 * ToTH2NormX (double exposure, EExposureType expotype=kPOT) const
 Spectrum must be 2D to obtain TH2. Normalized to X axis. More...
 
TH3 * ToTH3 (double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
 Spectrum must be 3D to obtain TH3. More...
 
double Integral (double exposure, double *err=0, EExposureType expotype=kPOT) const
 Return total number of events scaled to pot. More...
 
double Mean () const
 Return mean of 1D histogram. More...
 
Spectrum MockData (double pot, int idx=0) const
 Mock data is FakeData with Poisson fluctuations applied. More...
 
Spectrum FakeData (double pot) const
 Fake data is a MC spectrum scaled to the POT expected in the data. More...
 
Spectrum FakeData (double pot, double livetime) const
 
double POT () const
 
double Livetime () const
 Seconds. For informational purposes only. No calculations use this. More...
 
void OverridePOT (double newpot)
 DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN'T A BETTER WAY! More...
 
void OverrideLivetime (double newlive)
 DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN'T A BETTER WAY! More...
 
void Clear ()
 
void Scale (double c)
 Multiply this spectrum by a constant c. More...
 
Spectrumoperator+= (const Spectrum &rhs)
 
Spectrum operator+ (const Spectrum &rhs) const
 
Spectrumoperator-= (const Spectrum &rhs)
 
Spectrum operator- (const Spectrum &rhs) const
 
Spectrumoperator*= (const Ratio &rhs)
 
Spectrum operator* (const Ratio &rhs) const
 
Spectrumoperator/= (const Ratio &rhs)
 
Spectrum operator/ (const Ratio &rhs) const
 
void SaveTo (TDirectory *dir) const
 
unsigned int NDimensions () const
 
std::vector< std::string > GetLabels () const
 
std::vector< BinningGetBinnings () const
 

Static Public Member Functions

static std::unique_ptr< SpectrumLoadFrom (TDirectory *dir)
 

Protected Member Functions

 Spectrum (const std::vector< std::string > &labels, const std::vector< Binning > &bins, ESparse sparse=kDense)
 
Binning GetMultiDBinning () const
 
void ConstructHistogram (ESparse sparse=kDense)
 
void RemoveLoader (SpectrumLoaderBase *)
 
void AddLoader (SpectrumLoaderBase *)
 
SpectrumPlusEqualsHelper (const Spectrum &rhs, int sign)
 Helper for operator+= and operator-=. More...
 

Protected Attributes

TH1D * fHistD
 
TH1F * fHistF
 
THnSparseDfHistSparse
 
double fPOT
 
double fLivetime
 
std::set< SpectrumLoaderBase * > fLoaderCount
 This count is maintained by SpectrumLoader, as a sanity check. More...
 
std::vector< std::string > fLabels
 
std::vector< BinningfBins
 

Friends

class SpectrumStan
 
class SpectrumLoaderBase
 
class SpectrumLoader
 
class NullLoader
 

Detailed Description

Representation of a spectrum in any variable, with associated POT.

Definition at line 37 of file Spectrum.h.

Member Enumeration Documentation

Enumerator
kDense 
kSparse 
kFloat 

Definition at line 45 of file Spectrum.h.

Constructor & Destructor Documentation

ana::Spectrum::Spectrum ( const std::string &  label,
const Binning bins,
SpectrumLoaderBase loader,
const Var var,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 47 of file Spectrum.cxx.

References ana::SpectrumLoaderBase::AddSpectrum().

Referenced by GetBinnings(), and operator=().

53  : Spectrum(label, bins)
54  {
55  loader.AddSpectrum(*this, var, cut, shift, wei);
56  }
var
const char * label
loader
Definition: demo0.py:10
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  label,
const Binning bins,
SpectrumLoaderBase loader,
const MultiVar var,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 59 of file Spectrum.cxx.

References ana::SpectrumLoaderBase::AddSpectrum().

65  : Spectrum(label, bins)
66  {
67  loader.AddSpectrum(*this, var, cut, shift, wei);
68  }
var
const char * label
loader
Definition: demo0.py:10
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  label,
const Binning bins,
SpectrumLoaderBase loader,
const NuTruthVar var,
const NuTruthCut cut,
const SystShifts shifts = kNoShift,
const NuTruthVar wei = kNuTruthUnweighted 
)

Definition at line 71 of file Spectrum.cxx.

References ana::SpectrumLoaderBase::AddSpectrum().

77  : Spectrum(label, bins)
78  {
79  loader.AddSpectrum(*this, var, cut, shifts, wei);
80  }
var
const char * label
loader
Definition: demo0.py:10
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  label,
SpectrumLoaderBase loader,
const Binning binsx,
const NuTruthVar varx,
const Binning binsy,
const NuTruthVar vary,
const NuTruthCut cut,
const SystShifts shifts = kNoShift,
const NuTruthVar wei = kNuTruthUnweighted 
)

Definition at line 83 of file Spectrum.cxx.

References cut, label, demo0::loader, and ana::Var2D().

89  : Spectrum({label, ""}, {binsx, binsy}) // TODO why no labelY?
90  {
91  loader.AddSpectrum(*this, Var2D(varx, binsx, vary, binsy), cut, shifts, wei);
92  }
const char * label
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
GenericVar< T > Var2D(const GenericVar< T > &a, const Binning &binsa, const GenericVar< T > &b, const Binning &binsb)
Variable formed from two input variables.
Definition: Var.cxx:245
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( SpectrumLoaderBase loader,
const HistAxis axis,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 95 of file Spectrum.cxx.

References ana::SpectrumLoaderBase::AddSpectrum(), cut, ana::GenericHistAxis< T >::GetMultiDVar(), and plotSysts::shift.

100  : Spectrum(axis.GetLabels(), axis.GetBinnings())
101  {
102  loader.AddSpectrum(*this, axis.GetMultiDVar(), cut, shift, wei);
103  }
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( SpectrumLoaderBase loader,
const MultiVarHistAxis axis,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 106 of file Spectrum.cxx.

References ana::SpectrumLoaderBase::AddSpectrum(), cut, ana::GenericHistAxis< T >::GetMultiDVar(), and plotSysts::shift.

111  : Spectrum(axis.GetLabels(), axis.GetBinnings())
112  {
113  loader.AddSpectrum(*this, axis.GetMultiDVar(), cut, shift, wei);
114  }
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( SpectrumLoaderBase loader,
const NuTruthHistAxis axis,
const NuTruthCut cut,
const SystShifts shifts = kNoShift,
const NuTruthVar weight = kNuTruthUnweighted 
)

Definition at line 117 of file Spectrum.cxx.

References ana::SpectrumLoaderBase::AddSpectrum(), cut, ana::GenericHistAxis< T >::GetMultiDVar(), and ana::weight.

122  : Spectrum(axis.GetLabels(), axis.GetBinnings())
123  {
124  loader.AddSpectrum(*this, axis.GetMultiDVar(), cut, shifts, weight);
125  }
const Var weight
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  label,
const Binning bins,
ESparse  sparse = kDense 
)

Definition at line 37 of file Spectrum.cxx.

References ConstructHistogram().

40  : fHistD(0), fHistF(0), fHistSparse(0), fPOT(0), fLivetime(0),
41  fLabels(1, label), fBins(1, bins)
42  {
43  ConstructHistogram(sparse);
44  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
void ConstructHistogram(ESparse sparse=kDense)
Definition: Spectrum.cxx:524
double fPOT
Definition: Spectrum.h:319
const char * label
std::vector< std::string > fLabels
Definition: Spectrum.h:325
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
const Binning bins
Definition: NumuCC_CPiBin.h:8
std::vector< Binning > fBins
Definition: Spectrum.h:326
ana::Spectrum::Spectrum ( const std::string &  label,
double  pot,
double  livetime,
const Binning bins 
)

Definition at line 128 of file Spectrum.cxx.

References fLivetime, fPOT, livetime, and pot.

130  : Spectrum(label, bins)
131  {
132  fPOT = pot;
134  }
double fPOT
Definition: Spectrum.h:319
const char * label
#define pot
double fLivetime
Definition: Spectrum.h:320
const Binning bins
Definition: NumuCC_CPiBin.h:8
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( TH1 *  h,
const std::vector< std::string > &  labels,
const std::vector< Binning > &  bins,
double  pot,
double  livetime 
)

Copies h.

Definition at line 137 of file Spectrum.cxx.

References ana::HistCache::Copy(), fHistD, fHistF, GetMultiDBinning(), and ana::HistCache::New().

142  {
143  if(!h){
144  fHistD = 0;
145  fHistF = 0;
146  return;
147  }
148 
149  DontAddDirectory guard;
150 
151  const TString className = h->ClassName();
152 
153  if(className == "TH1D"){
154  // Shortcut if types match
156  }
157  else if(className == "TH1F"){
159  }
160  else{
162  fHistD->Add(h);
163  }
164  }
TH1D * fHistD
Definition: Spectrum.h:316
static TH1D * Copy(const TH1D *h)
Definition: HistCache.cxx:138
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
#define pot
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
Binning GetMultiDBinning() const
Definition: Spectrum.cxx:510
const Binning bins
Definition: NumuCC_CPiBin.h:8
std::vector< Binning > fBins
Definition: Spectrum.h:326
static TH1D * New(const std::string &title, const Binning &bins)
Definition: HistCache.cxx:22
ana::Spectrum::Spectrum ( TH1 *  h,
double  pot,
double  livetime 
)

Definition at line 167 of file Spectrum.cxx.

168  : Spectrum(h,
169  std::vector<std::string>(1, h->GetXaxis()->GetTitle()),
170  std::vector<Binning>(1, Binning::FromTAxis(h->GetXaxis())),
171  pot, livetime)
172  {
173  }
static Binning FromTAxis(const TAxis *ax)
Definition: Binning.cxx:122
#define pot
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( std::unique_ptr< TH1D >  h,
const std::vector< std::string > &  labels,
const std::vector< Binning > &  bins,
double  pot,
double  livetime 
)

Takes possession of h.

Definition at line 176 of file Spectrum.cxx.

References fHistD.

180  : fHistD(h.release()), fHistF(0), fHistSparse(0), fPOT(pot), fLivetime(livetime), fLabels(labels), fBins(bins)
181  {
182  fHistD->SetDirectory(0);
183  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
#define pot
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
const Binning bins
Definition: NumuCC_CPiBin.h:8
std::vector< Binning > fBins
Definition: Spectrum.h:326
ana::Spectrum::Spectrum ( std::unique_ptr< TH1F >  h,
const std::vector< std::string > &  labels,
const std::vector< Binning > &  bins,
double  pot,
double  livetime 
)

Definition at line 186 of file Spectrum.cxx.

References fHistF.

190  : fHistD(0), fHistF(h.release()), fHistSparse(0), fPOT(pot), fLivetime(livetime), fLabels(labels), fBins(bins)
191  {
192  fHistF->SetDirectory(0);
193  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
#define pot
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
const Binning bins
Definition: NumuCC_CPiBin.h:8
std::vector< Binning > fBins
Definition: Spectrum.h:326
ana::Spectrum::Spectrum ( const std::string &  label,
SpectrumLoaderBase loader,
const Binning binsx,
const Var varx,
const Binning binsy,
const Var vary,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

2D Spectrum of two Vars

Definition at line 196 of file Spectrum.cxx.

202  : Spectrum(label, "", loader, binsx, varx, binsy, vary, cut, shift, wei)
203  {
204  // TODO do we want this variant when there's one with a labelY just below?
205  }
const char * label
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  label,
SpectrumLoaderBase loader,
const Binning binsx,
const MultiVar varx,
const Binning binsy,
const MultiVar vary,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

2D Spectrum of two MultiVars

Definition at line 208 of file Spectrum.cxx.

214  : Spectrum(label, "", loader, binsx, varx, binsy, vary, cut, shift, wei)
215  {
216  }
const char * label
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( SpectrumLoaderBase loader,
const HistAxis xAxis,
const HistAxis yAxis,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

2D Spectrum taking 2 HistAxis

Definition at line 219 of file Spectrum.cxx.

References ana::assert(), and ana::GenericHistAxis< T >::NDimensions().

225  : Spectrum(xAxis.GetLabels()[0], yAxis.GetLabels()[0],
226  loader,
227  xAxis.GetBinnings()[0], xAxis.GetVars()[0],
228  yAxis.GetBinnings()[0], yAxis.GetVars()[0],
229  cut, shift, wei)
230  {
231  // TODO - do we want to keep this variant around?
232  assert(xAxis.NDimensions() == 1);
233  assert(yAxis.NDimensions() == 1);
234  }
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
assert(nhit_max >=nhit_nbins)
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  xLabel,
const std::string &  yLabel,
SpectrumLoaderBase loader,
const Binning binsx,
const Var varx,
const Binning binsy,
const Var vary,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 237 of file Spectrum.cxx.

References cut, demo0::loader, plotSysts::shift, and ana::Var2D().

245  : Spectrum({xLabel, yLabel}, {binsx, binsy})
246  {
247  Var multiDVar = Var2D(varx, binsx, vary, binsy);
248 
249  loader.AddSpectrum(*this, multiDVar, cut, shift, wei);
250  }
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
GenericVar< T > Var2D(const GenericVar< T > &a, const Binning &binsa, const GenericVar< T > &b, const Binning &binsb)
Variable formed from two input variables.
Definition: Var.cxx:245
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  xLabel,
const std::string &  yLabel,
SpectrumLoaderBase loader,
const Binning binsx,
const MultiVar varx,
const Binning binsy,
const MultiVar vary,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 253 of file Spectrum.cxx.

References cut, demo0::loader, ana::MultiVar2D(), and plotSysts::shift.

261  : Spectrum({xLabel, yLabel}, {binsx, binsy})
262  {
263  MultiVar multiDVar = MultiVar2D(varx, binsx, vary, binsy);
264 
265  loader.AddSpectrum(*this, multiDVar, cut, shift, wei);
266  }
MultiVar MultiVar2D(const MultiVar &a, const Binning &binsa, const MultiVar &b, const Binning &binsb)
Definition: MultiVar.cxx:57
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  label,
SpectrumLoaderBase loader,
const Binning binsx,
const Var varx,
const Binning binsy,
const Var vary,
const Binning binsz,
const Var varz,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted,
ESparse  sparse = kDense 
)

3D Spectrum of three Vars

Definition at line 269 of file Spectrum.cxx.

277  : Spectrum(label, "", "", loader, binsx, varx, binsy, vary, binsz, varz, cut, shift, wei, sparse)
278  {
279  // TODO do we want this variant when there's one with a labelY and labelZ
280  // just below?
281  }
const char * label
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( const std::string &  xLabel,
const std::string &  yLabel,
const std::string &  zLabel,
SpectrumLoaderBase loader,
const Binning binsx,
const Var varx,
const Binning binsy,
const Var vary,
const Binning binsz,
const Var varz,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted,
ESparse  sparse = kDense 
)

Definition at line 284 of file Spectrum.cxx.

References cut, demo0::loader, plotSysts::shift, and ana::Var3D().

295  : Spectrum({xLabel, yLabel, zLabel}, {binsx, binsy, binsz}, sparse)
296  {
297  Var multiDVar = Var3D(varx, binsx, vary, binsy, varz, binsz);
298 
299  loader.AddSpectrum(*this, multiDVar, cut, shift, wei);
300  }
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
GenericVar< T > Var3D(const GenericVar< T > &a, const Binning &binsa, const GenericVar< T > &b, const Binning &binsb, const GenericVar< T > &c, const Binning &binsc)
This is just like a Var2D, but useful for 3D Spectra.
Definition: Var.cxx:271
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::Spectrum ( SpectrumLoaderBase loader,
const HistAxis xAxis,
const HistAxis yAxis,
const HistAxis zAxis,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted,
ESparse  sparse = kDense 
)

3D Spectrum taking 3 HistAxis

Definition at line 303 of file Spectrum.cxx.

References ana::assert(), and ana::GenericHistAxis< T >::NDimensions().

311  : Spectrum(xAxis.GetLabels()[0], loader,
312  xAxis.GetBinnings()[0], xAxis.GetVars()[0],
313  yAxis.GetBinnings()[0], yAxis.GetVars()[0],
314  zAxis.GetBinnings()[0], zAxis.GetVars()[0],
315  cut, shift, wei, sparse)
316  {
317  // TODO - do we want to keep this variant around?
318  assert(xAxis.NDimensions() == 1);
319  assert(yAxis.NDimensions() == 1);
320  assert(zAxis.NDimensions() == 1);
321  }
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
assert(nhit_max >=nhit_nbins)
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
ana::Spectrum::~Spectrum ( )
virtual

Definition at line 324 of file Spectrum.cxx.

References om::cerr, ana::HistCache::Delete(), allTimeWatchdog::endl, fHistD, fHistF, fHistSparse, fLoaderCount, GetMultiDBinning(), and demo0::loader.

Referenced by operator=().

325  {
326  if(fHistD && fHistD->GetDirectory()){
327  static bool once = true;
328  if(once){
329  once = false;
330  std::cerr << "Spectrum's fHist (" << fHistD << ") is associated with a directory (" << fHistD->GetDirectory() << " " << fHistD->GetDirectory()->GetName() << " " << fHistD->GetDirectory()->GetTitle() << "). How did that happen?" << std::endl;
331  }
332  }
333 
335  { loader->RemoveSpectrum(this); }
336 
339 
340  delete fHistSparse;
341  }
TH1D * fHistD
Definition: Spectrum.h:316
friend class SpectrumLoaderBase
Definition: Spectrum.h:41
TH1F * fHistF
Definition: Spectrum.h:317
OStream cerr
Definition: OStream.cxx:7
std::set< SpectrumLoaderBase * > fLoaderCount
This count is maintained by SpectrumLoader, as a sanity check.
Definition: Spectrum.h:323
static void Delete(TH1D *&h)
Definition: HistCache.cxx:220
loader
Definition: demo0.py:10
THnSparseD * fHistSparse
Definition: Spectrum.h:318
Binning GetMultiDBinning() const
Definition: Spectrum.cxx:510
ana::Spectrum::Spectrum ( const Spectrum rhs)

Definition at line 344 of file Spectrum.cxx.

References ana::assert(), ana::HistCache::Copy(), fHistD, fHistF, fHistSparse, fLoaderCount, and GetMultiDBinning().

344  :
345  fHistD(0),
346  fHistF(0),
347  fHistSparse(0),
348  fPOT(rhs.fPOT),
349  fLivetime(rhs.fLivetime),
350  fLabels(rhs.fLabels),
351  fBins(rhs.fBins)
352  {
353  DontAddDirectory guard;
354 
355  assert(rhs.fHistD || rhs.fHistF || rhs.fHistSparse);
356  if(rhs.fHistD)
357  fHistD = HistCache::Copy(rhs.fHistD, rhs.GetMultiDBinning());
358  if(rhs.fHistF)
359  fHistF = HistCache::Copy(rhs.fHistF, rhs.GetMultiDBinning());
360  if(rhs.fHistSparse){
361  // Doesn't exist?
362  // fHistSparse = new THnSparseD(*rhs.fHistSparse);
363  fHistSparse = (THnSparseD*)rhs.fHistSparse->Clone();
364  }
365 
366  assert( rhs.fLoaderCount.empty() ); // Copying with pending loads is unexpected
367  }
TH1D * fHistD
Definition: Spectrum.h:316
static TH1D * Copy(const TH1D *h)
Definition: HistCache.cxx:138
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
std::vector< Binning > fBins
Definition: Spectrum.h:326
assert(nhit_max >=nhit_nbins)
ana::Spectrum::Spectrum ( Spectrum &&  rhs)

Definition at line 370 of file Spectrum.cxx.

References ana::assert(), fHistD, fHistF, fHistSparse, fLoaderCount, and demo0::loader.

370  :
371  fHistD(0),
372  fHistF(0),
373  fHistSparse(0),
374  fPOT(rhs.fPOT),
375  fLivetime(rhs.fLivetime),
376  fLabels(rhs.fLabels),
377  fBins(rhs.fBins)
378  {
379  assert(rhs.fHistD || rhs.fHistF || rhs.fHistSparse);
380 
381  if(rhs.fHistD){
382  fHistD = rhs.fHistD;
383  rhs.fHistD = 0;
384  }
385  if(rhs.fHistF){
386  fHistF = rhs.fHistF;
387  rhs.fHistF = 0;
388  }
389  if(rhs.fHistSparse){
390  fHistSparse = rhs.fHistSparse;
391  rhs.fHistSparse = 0;
392  }
393 
394  for (auto & loader : rhs.fLoaderCount)
395  {
396  loader->ReplaceSpectrum(&rhs, this);
397  fLoaderCount.insert(loader);
398  }
399  rhs.fLoaderCount.clear();
400 
401  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
std::set< SpectrumLoaderBase * > fLoaderCount
This count is maintained by SpectrumLoader, as a sanity check.
Definition: Spectrum.h:323
double fLivetime
Definition: Spectrum.h:320
loader
Definition: demo0.py:10
THnSparseD * fHistSparse
Definition: Spectrum.h:318
std::vector< Binning > fBins
Definition: Spectrum.h:326
assert(nhit_max >=nhit_nbins)
ana::Spectrum::Spectrum ( const SpectrumStan rhs)

Copy conversion from SpectrumStan.

Definition at line 404 of file Spectrum.cxx.

References ana::assert(), ConstructHistogram(), fHistD, fHistF, ana::SpectrumStan::GetBinnings(), ana::gFloatMode, ana::SpectrumStan::POT(), ana::SpectrumStan::ToBins(), and febshutoff_auto::val.

405  : fHistD(nullptr), fHistF(nullptr), fHistSparse(nullptr),
406  fPOT(rhs.POT()), fLivetime(rhs.Livetime()),
407  fLabels(rhs.GetLabels()), fBins(rhs.GetBinnings())
408  {
409  // for now we don't have any other use cases besides 1D...
410  assert(rhs.GetBinnings().size() == 1);
411 
413 
414  // now fill in the bin content...
415  auto binC = rhs.ToBins(rhs.POT());
416  for (int binIdx = 0; binIdx < rhs.GetBinnings()[0].NBins()+2; binIdx++) // be sure to get under- and overflow
417  {
418  if (gFloatMode)
419  fHistF->SetBinContent(binIdx, binC[binIdx].val());
420  else
421  fHistD->SetBinContent(binIdx, binC[binIdx].val());
422  }
423  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
void ConstructHistogram(ESparse sparse=kDense)
Definition: Spectrum.cxx:524
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
double fLivetime
Definition: Spectrum.h:320
const HistogramTypePolicy gFloatMode
THnSparseD * fHistSparse
Definition: Spectrum.h:318
std::vector< Binning > fBins
Definition: Spectrum.h:326
assert(nhit_max >=nhit_nbins)
ana::Spectrum::Spectrum ( const std::vector< std::string > &  labels,
const std::vector< Binning > &  bins,
ESparse  sparse = kDense 
)
protected

Definition at line 26 of file Spectrum.cxx.

References ConstructHistogram().

29  : fHistD(0), fHistF(0), fHistSparse(0), fPOT(0), fLivetime(0),
31  {
32  ConstructHistogram(sparse);
33  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
void ConstructHistogram(ESparse sparse=kDense)
Definition: Spectrum.cxx:524
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
const Binning bins
Definition: NumuCC_CPiBin.h:8
std::vector< Binning > fBins
Definition: Spectrum.h:326

Member Function Documentation

void ana::Spectrum::AddLoader ( SpectrumLoaderBase p)
protected

Definition at line 901 of file Spectrum.cxx.

References fLoaderCount.

Referenced by ana::SpectrumLoaderBase::AddSpectrum(), and GetBinnings().

902  { fLoaderCount.insert(p); }
const char * p
Definition: xmltok.h:285
std::set< SpectrumLoaderBase * > fLoaderCount
This count is maintained by SpectrumLoader, as a sanity check.
Definition: Spectrum.h:323
void ana::Spectrum::Clear ( )
void ana::Spectrum::ConstructHistogram ( ESparse  sparse = kDense)
protected

Definition at line 524 of file Spectrum.cxx.

References ana::assert(), fHistD, fHistF, fHistSparse, GetMultiDBinning(), ana::gFloatMode, ana::Binning::IsSimple(), kDense, kFloat, kSparse, ana::Binning::Max(), ana::Binning::Min(), nbins, ana::Binning::NBins(), ana::HistCache::New(), ana::HistCache::NewF(), ana::UniqueName(), make_syst_table_plots::xmax, and make_mec_shifts_plots::xmin.

Referenced by GetBinnings(), and Spectrum().

525  {
526  DontAddDirectory guard;
527 
528  assert(!fHistD && !fHistF && !fHistSparse);
529 
530  const Binning bins1D = GetMultiDBinning();
531 
532  if(sparse == kSparse){
533  assert(bins1D.IsSimple());
534  const int nbins = bins1D.NBins();
535  const double xmin = bins1D.Min();
536  const double xmax = bins1D.Max();
537  fHistSparse = new THnSparseD(UniqueName().c_str(), UniqueName().c_str(),
538  1, &nbins, &xmin, &xmax);
539 
540  // Ensure errors get accumulated properly
541  fHistSparse->Sumw2();
542  }
543  else if(sparse == kDense && !gFloatMode){
544  fHistD = HistCache::New("", bins1D);
545  fHistF = 0;
546 
547  // first clear the sum-of-weights.
548  // can be pre-filled with 0s if you happen to have made several Spectra
549  // out of the same Binning and a preceding one is still in the cache.
550  fHistD->Sumw2(false);
551  fHistD->Sumw2(); // Ensure errors get accumulated properly
552  }
553  else if(sparse == kFloat || gFloatMode){
554  fHistF = HistCache::NewF("", bins1D);
555  fHistD = 0;
556 
557  // see above
558  fHistF->Sumw2(false);
559  fHistF->Sumw2(); // Ensure errors get accumulated properly
560  }
561  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
const int nbins
Definition: cellShifts.C:15
THnSparseT< TArrayD > THnSparseD
Definition: Spectrum.h:24
const HistogramTypePolicy gFloatMode
THnSparseD * fHistSparse
Definition: Spectrum.h:318
static TH1F * NewF(const std::string &title, const Binning &bins)
Definition: HistCache.cxx:46
Binning GetMultiDBinning() const
Definition: Spectrum.cxx:510
assert(nhit_max >=nhit_nbins)
static TH1D * New(const std::string &title, const Binning &bins)
Definition: HistCache.cxx:22
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:30
Spectrum ana::Spectrum::FakeData ( double  pot) const

Fake data is a MC spectrum scaled to the POT expected in the data.

Use for sensitivity plots and testing fit convergence

Definition at line 830 of file Spectrum.cxx.

References fHistD, fHistF, fHistSparse, fPOT, pot, and runNovaSAM::ret.

Referenced by BlessedPlotsLoad(), caf_numu_sensitivity(), caf_numu_sensitivity_no_tau(), cc(), compare_pid_cut_sens(), contours(), cpv(), delta_precision(), delta_slices(), demo_CPT(), extrap_syst_fa(), fa_numuContours(), ana::FDPredictionSterile::FakeData(), ana::NDPredictionSterile::FakeData(), futureSig_reach_singlePOTcombo_syst(), GenerateFutureData(), ana2019::fakedata::Get2019Prediction(), get_sa_syst_mags(), get_sa_systs_mags_v2(), getContProf_Sensitivity(), GetFakeData(), getSensitivity(), hierarchy(), joint_fit_make_fc_slice(), joint_fit_make_fc_surf(), make_fa_pred(), make_plots(), ana::NumuAnalysis::MakeExperiment(), MakeExtrapSurface(), MakeFakeData(), MakeNusPrediction(), makeSystTable(), makeSystTable_reduced(), MichelDecompTest(), MockData(), NDDataMCSystBandAna(), nue_ana_basic(), numu_demo_split_plot(), numu_sig_nonmax(), octant(), plot_extrap_syst_fa(), plot_fa_results(), plot_sa_results_nodata(), PlotNus17Prediction(), plots(), saTestContours(), saveContours_addExpt(), saveContours_complete(), saveContours_oscpar(), saveContours_simple(), saveContours_systs(), sensitivity(), sensitivity_slices(), starPlot(), syst_test(), template_basic(), template_GENIE_systs(), template_nonGENIE_systs(), test_ana(), test_stanfit_statsonly(), test_stanfit_systpulls(), test_stanfit_withsysts(), th23_delta_contour(), ToTH1(), and ana::UnfoldIterative::Truth().

831  {
832  Spectrum ret = *this;
833  if(fPOT > 0){
834  if(ret.fHistD)
835  ret.fHistD->Scale(pot/fPOT);
836  if(ret.fHistF)
837  ret.fHistF->Scale(pot/fPOT);
838  if(ret.fHistSparse)
839  ret.fHistSparse->Scale(pot/fPOT);
840  }
841  ret.fPOT = pot;
842 
843  // Drop old errors, which are based on the MC statistics, and create new
844  // ones that are based on the prediction for the data
845  if(ret.fHistD){
846  ret.fHistD->Sumw2(false);
847  ret.fHistD->Sumw2();
848  }
849  if(ret.fHistF){
850  ret.fHistF->Sumw2(false);
851  ret.fHistF->Sumw2();
852  }
853 
854  return ret;
855  }
double fPOT
Definition: Spectrum.h:319
#define pot
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
Spectrum ana::Spectrum::FakeData ( double  pot,
double  livetime 
) const

Use for sensitivity plots when fake cosmic data is needed. Fake cosmic spectra can be added to FakeData by desired livetime.

Definition at line 858 of file Spectrum.cxx.

References fHistD, fHistF, fHistSparse, fLivetime, fPOT, livetime, pot, and runNovaSAM::ret.

859  {
860  Spectrum ret = *this;
861 
862  if(fPOT > 0){
863  if(ret.fHistD)
864  ret.fHistD->Scale(pot/fPOT);
865  if(ret.fHistF)
866  ret.fHistF->Scale(pot/fPOT);
867  if(ret.fHistSparse)
868  ret.fHistSparse->Scale(pot/fPOT);
869  }
870  ret.fPOT = pot;
871 
872  // overwrite livetime for fake data
873  // PlusEqualsHelper will take over the rest
874  ret.fLivetime = livetime;
875 
876  if(ret.fHistD){
877  ret.fHistD->Sumw2(false);
878  ret.fHistD->Sumw2();
879  }
880  if(ret.fHistF){
881  ret.fHistF->Sumw2(false);
882  ret.fHistF->Sumw2();
883  }
884 
885  return ret;
886  }
double fPOT
Definition: Spectrum.h:319
#define pot
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
void ana::Spectrum::Fill ( double  x,
double  w = 1 
)

Definition at line 785 of file Spectrum.cxx.

References ana::assert(), fHistD, fHistF, and fHistSparse.

Referenced by first_ana_proj(), and ana::SpectrumLoader::HandleRecord().

786  {
787  assert( (fHistD || fHistF || fHistSparse) && "Somehow both fHist and fHistSparse are null in Spectrum::Fill" );
788 
789  if(fHistD)
790  fHistD->Fill(x, w);
791  else if(fHistF)
792  fHistF->Fill(x, w);
793  else if(fHistSparse)
794  fHistSparse->Fill(&x, w);
795  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
THnSparseD * fHistSparse
Definition: Spectrum.h:318
assert(nhit_max >=nhit_nbins)
Float_t w
Definition: plot.C:20
std::vector<Binning> ana::Spectrum::GetBinnings ( ) const
inline
std::vector<std::string> ana::Spectrum::GetLabels ( ) const
inline
Binning ana::Spectrum::GetMultiDBinning ( ) const
protected

Definition at line 510 of file Spectrum.cxx.

References ana::assert(), b, fBins, getGoodRuns4SAM::n, and ana::Binning::Simple().

Referenced by ConstructHistogram(), GetBinnings(), operator=(), Spectrum(), ToTH1(), and ~Spectrum().

511  {
512  // TODO same function exists in HistAxis
513 
514  assert(!fBins.empty());
515 
516  if(fBins.size() == 1) return fBins[0];
517 
518  int n = 1;
519  for(const Binning& b: fBins) n *= b.NBins();
520  return Binning::Simple(n, 0, n);
521  }
std::vector< Binning > fBins
Definition: Spectrum.h:326
const hit & b
Definition: hits.cxx:21
assert(nhit_max >=nhit_nbins)
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:38
double ana::Spectrum::Integral ( double  exposure,
double *  err = 0,
EExposureType  expotype = kPOT 
) const

Return total number of events scaled to pot.

Parameters
exposurePOT/livetime to scale to
errThe statistical error on this total (optional)
expotypeWhat the first parameter represents

Definition at line 753 of file Spectrum.cxx.

References fHistD, fHistF, fLivetime, fPOT, make_syst_table_plots::h, MECModelEnuComparisons::i, ana::kPOT, plotSysts::ratio, util::sqr(), and std::sqrt().

Referenced by BicountEllipse_dCP(), ana::CountingExperiment::ChiSq(), compare_pid_cut_sens(), ComputeEfficiency(), contours(), ana::DataMCAreaNormalizedRatio(), ana::SpectrumComponents::DrawLegend(), ana::DataMCPair::DrawMCNormSyst(), DataMCPair::DrawMCNormSyst(), Efficiency(), FCContour(), ana::FluxMultiverseSyst::FindSigmaBoundaries(), FitParamEffectsAna(), FitSystEffectsAna(), getHists_FNEX(), GetNueCosmics2017(), GetNueCosmics2018(), GetNueCosmics2019(), ana::GetNueCosmics2020(), GetNueCosmicsFuture(), GetNueData2017(), GetNueData2018(), GetNueData2019(), ana::GetNueData2020(), GetNuePrediction2017(), GetNuePrediction2018(), GetNuePrediction2019(), ana::GetNuePrediction2020(), GetNuePredictionFuture(), ana::GetNumuCosmics2020(), ana::GetNumuData2020(), GetSpectra(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplateShapeOnly1D(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplateShapeOnly3D(), Integral(), joint_fit_2017_make_fc_slice(), joint_fit_2017_make_fc_surf(), joint_fit_make_experiments(), joint_fit_make_fc_slice(), joint_fit_make_fc_surf(), make_fc_mass_and_oct_nersc_2018(), make_fc_mass_and_oct_nersc_2019(), make_fc_mh_nersc_2018(), make_fc_mh_nersc_2019(), make_fc_oct_nersc_2018(), make_fc_oct_nersc_2019(), make_fc_slice(), make_fc_slices_nersc_2018(), make_fc_slices_nersc_2018_stats(), make_fc_slices_nersc_2019(), make_fc_surf(), make_fc_surfaces_nersc_2018(), make_fc_surfaces_nersc_2018_stats(), make_fc_surfaces_nersc_2019(), make_nominal_xs(), make_xs(), MakeHBar(), MakeTable(), MCCompPredictionTable(), monoprob_plot(), ana::GenieMultiverseNormalizedSpectra::NormalizeSpectra(), PeripheralCuts(), ana::PlotWithAreaSystErrorBand(), predEventCountWithSystError(), PrintCount(), PrintEventCounts(), sensitivity(), sensitivity_slices(), slices(), slices_paper(), SpectrumParamEffectsAna(), ToTH1(), and ana::UnfoldSVD::Truth().

755  {
756  const double ratio = (expotype == kPOT) ? exposure/fPOT : exposure/fLivetime;
757 
758  TH1* h = fHistD ? (TH1*)fHistD : (TH1*)fHistF;
759 
760  if(err){
761  *err = 0;
762 
763  for(int i = 0; i < h->GetNbinsX()+2; ++i){
764  *err += util::sqr(h->GetBinError(i));
765  }
766  *err = sqrt(*err) * ratio;
767  }
768 
769  // TODO how to integrate fHistSparse?
770 
771  return h->Integral(0, -1) * ratio;
772  }
TH1D * fHistD
Definition: Spectrum.h:316
T sqrt(T number)
Definition: d0nt_math.hpp:156
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
if(dump)
double fLivetime
Definition: Spectrum.h:320
double ana::Spectrum::Livetime ( ) const
inline

Seconds. For informational purposes only. No calculations use this.

Definition at line 266 of file Spectrum.h.

References fLivetime.

Referenced by ana::FitInAnaBinsBkgdEstimator::Background(), ana::NumuCC2p2hBkgdEstimator::Background(), BlessedPlotsLoad(), CalcRWithSystsNus17(), contours(), Cumulative(), ana::TwoSampleDecomp::Decomp(), ana::FakeDecomp::Decompose(), FCContour(), fd_plot(), fd_plot_bless(), ana::FluxMultiverseSyst::FindSigmaBoundaries(), FitParamEffectsAna(), FitSystEffectsAna(), getBNBPlots(), GetFluxError(), getHists_FNEX(), ana::Multiverse::GetNSigmaShift(), GetNueCosmics2017(), GetNueCosmics2018(), GetNueCosmics2019(), ana::GetNueCosmics2020(), GetNueCosmicsFuture(), GetNueData2017(), GetNueData2018(), GetNueData2019(), ana::GetNueData2020(), ana::GetNumuCosmics2020(), ana::GetNumuData2020(), ana::PredictionInterp::InitFits(), joint_fit_make_experiments(), joint_fit_make_fc_slice(), joint_fit_make_fc_surf(), make_fc_nus_surfs_nersc_2018(), make_fc_nus_surfs_nersc_2019(), make_fc_points(), make_fc_slice(), make_fc_surf(), make_nus17_fc_surfs(), make_nus_fc_surfs(), make_xs(), make_xs_1D(), MakeExtrapSurface(), MakeHBar(), makeMatrixElementSurface(), MakeNusPrediction(), ana::MichelDecomp::MCToDCMPComp(), ana::PredictionExtendToPeripheral::MergePeripheral(), monoprob_plot(), mrbrem_get_reweighted_spectra(), mrbrem_plots(), plot_datamcpred(), PlotNus17Prediction(), PlotNus17PredSystsData(), PlotNus18Sideband(), PlotNusSensAna01(), ana::PlotSpectra(), PlotSysts(), ana::PredictionNumuFAHadE::PredictComponentSyst(), ana::PredictionExtendToPeripheral::ReduceHelperNC(), selection_story_plots(), sensitivity(), sensitivity_slices(), ana::PredictionInterp::ShiftSpectrum(), ana::SingleSampleExperiment::SingleSampleExperiment(), slices(), slices_paper(), timingPeak(), ana::UnfoldSVD::Truth(), ana::UnfoldTikhonov::Truth(), and ana::PredictionTemplateShift::Weight().

266 {return fLivetime;}
double fLivetime
Definition: Spectrum.h:320
std::unique_ptr< Spectrum > ana::Spectrum::LoadFrom ( TDirectory *  dir)
static

Definition at line 1066 of file Spectrum.cxx.

References ana::assert(), ana::bins, genie::utils::style::Format(), ana::Binning::FromTAxis(), MECModelEnuComparisons::i, label, PandAna.Demos.pi0_spectra::labels, ana::Binning::LoadFrom(), runNovaSAM::ret, cvnie::subdir, and getGoodRuns4SAM::tag.

Referenced by Analyse_GetEfficiency(), Analyse_GetEfficiency_UseNEntries(), bdtstudyplotter(), BlessedPlotsAnaByPeriod(), CalcRWithSysts(), calculateComponentsNumu(), calculateWrongSignNue(), calculateWrongSignNumuQ1(), calculateWrongSignNumuQ2(), calculateWrongSignNumuQ3(), calculateWrongSignNumuQ4(), CalculateXSec(), ana::CompareNDDataOneMC(), ana::CompareNDDataTwoMC(), ana::ComparisonTable(), ana::CovMxManager::CovMxManager(), CutTableAna(), CVNphotonHist(), CVNphotonSplitHist(), demo2p5b(), DoThePlots(), doUnfolding(), EHadVisMECpairs(), FDDataMC(), FDDataMCSystBandAna(), FidOptHist(), FillFlavorContainers(), FitParamEffectsAna(), FitSystEffectsAna(), FOMCalc(), GeniePredictionToRoot(), get_data_histogram(), get_numu_data_histogram(), GetCosmics(), Plotter::GetDataPlots(), GetHist(), getHists_FNEX(), GetHistVectors(), Plotter::GetMCPlots(), ana::GetNDComponents(), ana::GetNumuCosmics2020(), GetNumuCosmicsFuture(), GetNumuData2017(), GetNumuData2018(), GetNumuData2019(), GetSpectToHist(), ana::InteractionSpectra::InteractionSpectra(), joint_fit_make_experiments(), Load1DHistFromSpec(), ana::CountingExperiment::LoadFrom(), jw::TrivialPrediction::LoadFrom(), ana::TrivialPrediction::LoadFrom(), ana::SingleSampleExperiment::LoadFrom(), ana::CrossSectionSpectra::LoadFrom(), ana::CutOptimization::LoadFrom(), ana::TrivialCrossSectionAnalysis::LoadFrom(), ana::Multiverse::LoadFrom(), ana::SpectrumComponents::LoadFrom(), ana::DataMCPair::LoadFrom(), ana::RecoReweight::LoadFrom(), ana::FluxReweight::LoadFrom(), ana::LoadFromUpDownSpectra(), LoadMaps(), make_dataMC(), make_eff_plots_areaNorm(), make_estimate_energy(), make_fc_points(), make_muonid_opt(), make_nominal_xs(), Make_NuMuCC_Inc_XS(), Make_NuMuCC_Inc_XS_v2(), make_vertex_optimiz(), MakeCutFlow(), makeEnergyEstimator(), makeFlatWeight(), MakePlots(), makeResolutionPlots(), MakeSurface(), MakeThePlots(), makeXSecPlots1D(), makeXSecPlots2D(), makeXSecPlots_TemplateFit(), mec_tuning_fitter_2020(), MRDiFStudy_FHC_Step2(), MRDiFStudy_RHC_Step2(), MuonCatcherComp_ProdPlots(), nc_bkgd_by_interaction_mode(), NDDataMC(), NDDataMCSystBandAna(), nue_bg_stat_err_calc(), nue_data_mc_validation(), nue_decomp_scales(), nue_fd_mc_validation(), numu_data_mc_validation(), OverrideLivetime(), plot_DataMCComp_numu(), plot_ND_DataMC(), plot_ND_DataMC_energybinning(), plot_nd_spectra_2018(), plot_paper_nd_datamc(), plot_recoE_numu(), plot_sa_results(), plot_spectra_2dplots(), plot_uncertainty(), plotHist_SpectrumCVNID(), PlotResolution(), Plotsidebandfittest(), Plotting_Data2DataComp(), Plotting_Data2DataComp_SingleCanvas(), Plotting_DataAndPrediction(), Plotting_DataSpectra_MakeTGraph(), Plotting_OverlayStudies(), ppfx_smooth_weights_make(), preselection_cutflow(), ProduceCompPlots(), ReMIdHist(), resolutionplotter(), ana::ResolutionScan::ResolutionScan(), SaveHistogramsFD(), SaveHistogramsND(), ShwZOptHist(), Spec2DToHist(), Spec2DtoHist(), SpecToHist(), SpectrumParamEffectsAna(), twodvtxcontplotter(), Unfold1D(), Unfold3D(), vertexstudyploter(), xsec_tot_uncert_optimization(), and xsec_uncertainty_per_bin().

1067  {
1068  DontAddDirectory guard;
1069 
1070  TObjString* tag = (TObjString*)dir->Get("type");
1071  assert(tag);
1072  assert(tag->GetString() == "Spectrum");
1073  delete tag;
1074 
1075  TH1D* spectD = 0;
1076  TH1F* spectF = 0;
1077  dir->GetObject("hist", spectD);
1078  dir->GetObject("hist", spectF);
1079  THnSparseD* spectSparse = (THnSparseD*)dir->Get("hist_sparse");
1080  assert(spectD || spectF || spectSparse);
1081  TH1* hPot = (TH1*)dir->Get("pot");
1082  assert(hPot);
1083  TH1* hLivetime = (TH1*)dir->Get("livetime");
1084  assert(hLivetime);
1085 
1086  std::vector<std::string> labels;
1087  std::vector<Binning> bins;
1088  for(int i = 0; ; ++i){
1089  TDirectory* subdir = dir->GetDirectory(TString::Format("bins%d", i));
1090  if(!subdir) break;
1091  bins.push_back(*Binning::LoadFrom(subdir));
1092  TObjString* label = (TObjString*)dir->Get(TString::Format("label%d", i));
1093  labels.push_back(label ? label->GetString().Data() : "");
1094  delete subdir;
1095  delete label;
1096  }
1097 
1098  if(bins.empty() && labels.empty()){
1099  // Must be an old file. Make an attempt at backwards compatibility.
1100  if(spectD){
1101  bins.push_back(Binning::FromTAxis(spectD->GetXaxis()));
1102  labels.push_back(spectD->GetXaxis()->GetTitle());
1103  }
1104  else{
1105  bins.push_back(Binning::FromTAxis(spectSparse->GetAxis(0)));
1106  labels.push_back(spectSparse->GetAxis(0)->GetTitle());
1107  }
1108  }
1109 
1110  if(spectSparse){
1111  std::unique_ptr<Spectrum> ret = std::make_unique<Spectrum>((TH1*)0, labels, bins, hPot->GetBinContent(1), hLivetime->GetBinContent(1));
1112  ret->fHistSparse = spectSparse;
1113 
1114  delete spectD;
1115  delete spectF;
1116  delete hPot;
1117  delete hLivetime;
1118  return ret;
1119  }
1120  else{
1121  std::unique_ptr<Spectrum> ret;
1122  if(spectD)
1123  ret = std::make_unique<Spectrum>(std::unique_ptr<TH1D>(spectD), labels, bins, hPot->GetBinContent(1), hLivetime->GetBinContent(1));
1124  else
1125  ret = std::make_unique<Spectrum>(std::unique_ptr<TH1F>(spectF), labels, bins, hPot->GetBinContent(1), hLivetime->GetBinContent(1));
1126  delete spectSparse;
1127  delete hPot;
1128  delete hLivetime;
1129  return ret;
1130  }
1131  }
subdir
Definition: cvnie.py:7
static Binning FromTAxis(const TAxis *ax)
Definition: Binning.cxx:122
const char * label
const Binning bins
Definition: NumuCC_CPiBin.h:8
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
static std::unique_ptr< Binning > LoadFrom(TDirectory *dir)
Definition: Binning.cxx:208
double ana::Spectrum::Mean ( ) const

Return mean of 1D histogram.

Definition at line 775 of file Spectrum.cxx.

References fHistD, fHistF, and make_syst_table_plots::h.

Referenced by ana::DataMCPair::CreateSystTable(), and ToTH1().

776  {
777  // Allow GetMean() to work even if this histogram never had any explicit
778  // Fill() calls made.
779  TH1* h = fHistD ? (TH1*)fHistD : (TH1*)fHistF;
780  if(h->GetEntries() == 0) h->SetEntries(1);
781  return h->GetMean();
782  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
cout<< t1-> GetEntries()
Definition: plottest35.C:29
if(dump)
Spectrum ana::Spectrum::MockData ( double  pot,
int  idx = 0 
) const

Mock data is FakeData with Poisson fluctuations applied.

Use for low-budget MDCs, or just getting a sense of the expected scale of statistical variation

Definition at line 798 of file Spectrum.cxx.

References FakeData(), fHistD, fHistF, fHistSparse, make_syst_table_plots::h, MECModelEnuComparisons::i, runNovaSAM::ret, and generate_hists::rnd.

Referenced by demo4(), demo5(), FCTutorial2020(), fd_plot(), fill_col(), ana2019::fakedata::Get2019Prediction(), GetMockData(), goodness_of_fit(), joint_fit_2017_make_fc_slice(), joint_fit_2017_make_fc_surf(), joint_fit_make_fc_slice(), joint_fit_make_fc_surf(), make_fc_mass_and_oct_nersc_2018(), make_fc_mass_and_oct_nersc_2019(), make_fc_mh_nersc_2018(), make_fc_mh_nersc_2019(), make_fc_nus_surfs_nersc_2018(), make_fc_nus_surfs_nersc_2019(), make_fc_oct_nersc_2018(), make_fc_oct_nersc_2019(), make_fc_points(), make_fc_slice(), make_fc_slices_nersc_2018(), make_fc_slices_nersc_2018_stats(), make_fc_slices_nersc_2019(), make_fc_surf(), make_fc_surfaces_2020_validation(), make_fc_surfaces_nersc_2018(), make_fc_surfaces_nersc_2018_stats(), make_fc_surfaces_nersc_2019(), make_mockdata_syst_contours(), make_nus17_fc_surfs(), make_nus_fc_surfs(), selection_story_plots(), syst_plot_test(), test_saloaders(), and ToTH1().

799  {
801 
802  TRandom3 rnd(idx); // zero seeds randomly
803 
804  if(ret.fHistD || ret.fHistF){
805  TH1* h = ret.fHistD ? (TH1*)ret.fHistD : (TH1*)ret.fHistF;
806  for(int i = 0; i < h->GetNbinsX()+2; ++i){
807  h->SetBinContent(i, rnd.Poisson(h->GetBinContent(i)));
808  }
809  }
810  if(ret.fHistSparse){
811  for(int i = 0; i < ret.fHistSparse->GetNbins(); ++i)
812  ret.fHistSparse->SetBinContent(i, rnd.Poisson(ret.fHistSparse->GetBinContent(i)));
813  }
814 
815  // Drop old errors, which are based on the MC statistics, and create new
816  // ones that are based on the prediction for the data
817  if(ret.fHistD){
818  ret.fHistD->Sumw2(false);
819  ret.fHistD->Sumw2();
820  }
821  if(ret.fHistF){
822  ret.fHistF->Sumw2(false);
823  ret.fHistF->Sumw2();
824  }
825 
826  return ret;
827  }
Spectrum FakeData(double pot) const
Fake data is a MC spectrum scaled to the POT expected in the data.
Definition: Spectrum.cxx:830
#define pot
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
unsigned int ana::Spectrum::NDimensions ( ) const
inline

Definition at line 297 of file Spectrum.h.

References fLabels.

Referenced by ana::SpectrumComponents::NDimensions(), ana::CutOptimization::OptimizedSigmaOverSigma(), ana::Multiverse::ToHist(), and ana::CutOptimization::ToHist().

297 {return fLabels.size();}
std::vector< std::string > fLabels
Definition: Spectrum.h:325
Spectrum ana::Spectrum::operator* ( const Ratio rhs) const

Definition at line 1016 of file Spectrum.cxx.

References runNovaSAM::ret.

Referenced by OverrideLivetime().

1017  {
1018  Spectrum ret = *this;
1019  ret *= rhs;
1020  return ret;
1021  }
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
Spectrum & ana::Spectrum::operator*= ( const Ratio rhs)

Definition at line 1008 of file Spectrum.cxx.

References ana::Ratio::fHist, fHistD, fHistF, and make_syst_table_plots::h.

Referenced by OverrideLivetime().

1009  {
1010  TH1* h = fHistD ? (TH1*)fHistD : (TH1*)fHistF;
1011  h->Multiply(rhs.fHist);
1012  return *this;
1013  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
Spectrum ana::Spectrum::operator+ ( const Spectrum rhs) const

Definition at line 986 of file Spectrum.cxx.

References runNovaSAM::ret.

Referenced by OverrideLivetime().

987  {
988  Spectrum ret = *this;
989  ret += rhs;
990  return ret;
991  }
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
Spectrum & ana::Spectrum::operator+= ( const Spectrum rhs)

Definition at line 980 of file Spectrum.cxx.

References PlusEqualsHelper().

Referenced by OverrideLivetime().

981  {
982  return PlusEqualsHelper(rhs, +1);
983  }
Spectrum & PlusEqualsHelper(const Spectrum &rhs, int sign)
Helper for operator+= and operator-=.
Definition: Spectrum.cxx:905
Spectrum ana::Spectrum::operator- ( const Spectrum rhs) const

Definition at line 1000 of file Spectrum.cxx.

References runNovaSAM::ret.

Referenced by OverrideLivetime().

1001  {
1002  Spectrum ret = *this;
1003  ret -= rhs;
1004  return ret;
1005  }
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
Spectrum & ana::Spectrum::operator-= ( const Spectrum rhs)

Definition at line 994 of file Spectrum.cxx.

References PlusEqualsHelper().

Referenced by OverrideLivetime().

995  {
996  return PlusEqualsHelper(rhs, -1);
997  }
Spectrum & PlusEqualsHelper(const Spectrum &rhs, int sign)
Helper for operator+= and operator-=.
Definition: Spectrum.cxx:905
Spectrum ana::Spectrum::operator/ ( const Ratio rhs) const

Definition at line 1032 of file Spectrum.cxx.

References runNovaSAM::ret.

Referenced by OverrideLivetime().

1033  {
1034  Spectrum ret = *this;
1035  ret /= rhs;
1036  return ret;
1037  }
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
Spectrum & ana::Spectrum::operator/= ( const Ratio rhs)

Definition at line 1024 of file Spectrum.cxx.

References ana::Ratio::fHist, fHistD, fHistF, and make_syst_table_plots::h.

Referenced by OverrideLivetime().

1025  {
1026  TH1* h = fHistD ? (TH1*)fHistD : (TH1*)fHistF;
1027  h->Divide(rhs.fHist);
1028  return *this;
1029  }
TH1D * fHistD
Definition: Spectrum.h:316
ratio_hxv Divide(hxv, goal_hxv)
TH1F * fHistF
Definition: Spectrum.h:317
Spectrum & ana::Spectrum::operator= ( const Spectrum rhs)

Definition at line 426 of file Spectrum.cxx.

References ana::assert(), ana::HistCache::Copy(), ana::HistCache::Delete(), fBins, fHistD, fHistF, fHistSparse, fLabels, fLivetime, fLoaderCount, fPOT, and GetMultiDBinning().

427  {
428  if(this == &rhs) return *this;
429 
430  DontAddDirectory guard;
431 
434  delete fHistSparse;
435 
436  assert(rhs.fHistD || rhs.fHistF || rhs.fHistSparse);
437 
438  if(rhs.fHistD){
439  fHistD = HistCache::Copy(rhs.fHistD, rhs.GetMultiDBinning());
440  fHistF = 0;
441  fHistSparse = 0;
442  }
443 
444  if(rhs.fHistF){
445  fHistF = HistCache::Copy(rhs.fHistF, rhs.GetMultiDBinning());
446  fHistD = 0;
447  fHistSparse = 0;
448  }
449 
450  if(rhs.fHistSparse){
451  fHistSparse = (THnSparseD*)rhs.fHistSparse->Clone();
452  fHistD = 0;
453  fHistF = 0;
454  }
455 
456  fPOT = rhs.fPOT;
457  fLivetime = rhs.fLivetime;
458  fLabels = rhs.fLabels;
459  fBins = rhs.fBins;
460 
461  assert( fLoaderCount.empty() ); // Copying with pending loads is unexpected
462 
463  return *this;
464  }
TH1D * fHistD
Definition: Spectrum.h:316
static TH1D * Copy(const TH1D *h)
Definition: HistCache.cxx:138
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
std::set< SpectrumLoaderBase * > fLoaderCount
This count is maintained by SpectrumLoader, as a sanity check.
Definition: Spectrum.h:323
static void Delete(TH1D *&h)
Definition: HistCache.cxx:220
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
Binning GetMultiDBinning() const
Definition: Spectrum.cxx:510
std::vector< Binning > fBins
Definition: Spectrum.h:326
assert(nhit_max >=nhit_nbins)
Spectrum & ana::Spectrum::operator= ( Spectrum &&  rhs)

Definition at line 467 of file Spectrum.cxx.

References ana::assert(), ana::HistCache::Delete(), fBins, fHistD, fHistF, fHistSparse, fLabels, fLivetime, fLoaderCount, fPOT, GetMultiDBinning(), and demo0::loader.

468  {
469  if(this == &rhs) return *this;
470 
473  delete fHistSparse;
474 
475  assert(rhs.fHistD || rhs.fHistF || rhs.fHistSparse);
476 
477  fHistD = rhs.fHistD;
478  fHistF = rhs.fHistF;
479  fHistSparse = rhs.fHistSparse;
480 
481  fPOT = rhs.fPOT;
482  fLivetime = rhs.fLivetime;
483  fLabels = rhs.fLabels;
484  fBins = rhs.fBins;
485 
486  rhs.fHistD = 0;
487  rhs.fHistF = 0;
488  rhs.fHistSparse = 0;
489 
490  for (auto & loader : rhs.fLoaderCount)
491  {
492  loader->ReplaceSpectrum(&rhs, this);
493  fLoaderCount.insert(loader);
494  }
495  rhs.fLoaderCount.clear();
496 
497  return *this;
498  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
std::vector< std::string > fLabels
Definition: Spectrum.h:325
std::set< SpectrumLoaderBase * > fLoaderCount
This count is maintained by SpectrumLoader, as a sanity check.
Definition: Spectrum.h:323
static void Delete(TH1D *&h)
Definition: HistCache.cxx:220
double fLivetime
Definition: Spectrum.h:320
loader
Definition: demo0.py:10
THnSparseD * fHistSparse
Definition: Spectrum.h:318
Binning GetMultiDBinning() const
Definition: Spectrum.cxx:510
std::vector< Binning > fBins
Definition: Spectrum.h:326
assert(nhit_max >=nhit_nbins)
Spectrum & ana::Spectrum::operator= ( const SpectrumStan rhs)

Definition at line 501 of file Spectrum.cxx.

References Spectrum(), and ~Spectrum().

502  {
503  // use placement new to just overwrite this object using the relevant constructor
504  this->~Spectrum();
505  new (this) Spectrum(rhs);
506  return *this;
507  }
virtual ~Spectrum()
Definition: Spectrum.cxx:324
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:47
void ana::Spectrum::OverrideLivetime ( double  newlive)
inline

DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN'T A BETTER WAY!

Definition at line 272 of file Spectrum.h.

References make_syst_table_plots::c, Clear(), dir, fLivetime, LoadFrom(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), SaveTo(), and Scale().

Referenced by getBNBPlots(), make_fc_nus_surfs_nersc_2019(), make_fc_points(), sensitivity(), sensitivity_slices(), and timingPeak().

272 {fLivetime = newlive;}
double fLivetime
Definition: Spectrum.h:320
void ana::Spectrum::OverridePOT ( double  newpot)
inline
Spectrum & ana::Spectrum::PlusEqualsHelper ( const Spectrum rhs,
int  sign 
)
protected

Helper for operator+= and operator-=.

Definition at line 905 of file Spectrum.cxx.

References ana::AlmostEqual(), om::cout, allTimeWatchdog::endl, fHistD, fHistF, fHistSparse, fLivetime, fPOT, make_syst_table_plots::h, and rh.

Referenced by GetBinnings(), operator+=(), and operator-=().

906  {
907  // In this case it would be OK to have no POT/livetime
908  if(rhs.fHistD && rhs.fHistD->Integral(0, -1) == 0) return *this;
909  if(rhs.fHistF && rhs.fHistF->Integral(0, -1) == 0) return *this;
910 
911  if((!fPOT && !fLivetime) || (!rhs.fPOT && !rhs.fLivetime)){
912  std::cout << "Error: can't sum Spectrum with no POT or livetime."
913  << std::endl;
914  abort();
915  }
916 
917  if(!fLivetime && !rhs.fPOT){
918  std::cout << "Error: can't sum Spectrum with POT ("
919  << fPOT << ") but no livetime and Spectrum with livetime ("
920  << rhs.fLivetime << " sec) but no POT." << std::endl;
921  abort();
922  }
923 
924  if(!fPOT && !rhs.fLivetime){
925  std::cout << "Error: can't sum Spectrum with livetime ("
926  << fLivetime << " sec) but no POT and Spectrum with POT ("
927  << rhs.fPOT << ") but no livetime." << std::endl;
928  abort();
929  }
930 
931  // And now there are still a bunch of good cases to consider
932 
933  if(fPOT && rhs.fPOT){
934  // Scale by POT when possible
935  TH1* h = fHistD ? (TH1*)fHistD : (TH1*)fHistF;
936  TH1* rh = rhs.fHistD ? (TH1*)rhs.fHistD : (TH1*)rhs.fHistF;
937  if(rh) h->Add(rh, sign*fPOT/rhs.fPOT);
938  if(rhs.fHistSparse) fHistSparse->Add(rhs.fHistSparse, sign*fPOT/rhs.fPOT);
939 
940  if(fLivetime && rhs.fLivetime){
941  // If POT/livetime ratios match, keep regular lifetime, otherwise zero
942  // it out.
943  if(AlmostEqual(fLivetime*rhs.fPOT, rhs.fLivetime*fPOT))
944  fLivetime = 0;
945  }
946  if(!fLivetime && rhs.fLivetime){
947  // If the RHS has a livetime and we don't, copy it in (suitably scaled)
948  fLivetime = rhs.fLivetime * fPOT/rhs.fPOT;
949  }
950  // Otherwise, keep our own livetime (if any)
951 
952  return *this;
953  }
954 
955  if(fLivetime && rhs.fLivetime){
956  // Scale by livetime, the only thing in common
957  TH1* h = fHistD ? (TH1*)fHistD : (TH1*)fHistF;
958  TH1* rh = rhs.fHistD ? (TH1*)rhs.fHistD : (TH1*)rhs.fHistF;
959  if(rh) h->Add(rh, sign*fLivetime/rhs.fLivetime);
960  if(rhs.fHistSparse) fHistSparse->Add(rhs.fHistSparse, sign*fLivetime/rhs.fLivetime);
961 
962  if(!fPOT && rhs.fPOT){
963  // If the RHS has a POT and we don't, copy it in (suitably scaled)
964  fPOT = rhs.fPOT * fLivetime/rhs.fLivetime;
965  }
966  // Otherwise, keep our own POT (if any)
967 
968  return *this;
969  }
970 
971  // That should have been all the cases. I definitely want to know what
972  // happened if it wasn't.
973  std::cout << "Spectrum::operator+=(). How did we get here? "
974  << fPOT << " " << fLivetime << " "
975  << rhs.fPOT << " " << rhs.fLivetime << std::endl;
976  abort();
977  }
TH1D * fHistD
Definition: Spectrum.h:316
TH2 * rh
Definition: drawXsec.C:5
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
if(dump)
double fLivetime
Definition: Spectrum.h:320
bool AlmostEqual(double a, double b)
Definition: Utilities.cxx:732
THnSparseD * fHistSparse
Definition: Spectrum.h:318
def sign(x)
Definition: canMan.py:204
OStream cout
Definition: OStream.cxx:6
double ana::Spectrum::POT ( ) const
inline

Definition at line 263 of file Spectrum.h.

References fPOT.

Referenced by ana::nueccinc::NueCCIncCrossSectionAnalysis::AddEnhancedSample(), ana::DataMCPair::AddExposure(), ana::SpectrumLoaderMockData::AddSpectrum(), alternate_cosrej_table(), caf_numu_fd_validation_data(), CalcChi2(), CalcR(), CalcRWithSystsNus17(), calculate_avg_nslcs(), calculateComponentsNumu(), calculateWrongSignNue(), calculateWrongSignNumuQ1(), calculateWrongSignNumuQ2(), calculateWrongSignNumuQ3(), calculateWrongSignNumuQ4(), ana::CountingExperiment::ChiSq(), ana::SingleSampleExperiment::ChiSq(), ana::CovMxExperiment::ChiSq(), compare_pid_cut_sens(), CompareDecompDataMC(), ComputeEfficiency(), Cumulative(), ana::DataMCAreaNormalizedRatio(), ana::DataMCComparison(), Plotter::DataMCComparison(), ana::DataMCComparisonAreaNormalized(), ana::DataMCComparisonComponents(), ana::TwoSampleDecomp::Decomp(), ana::FakeDecomp::Decompose(), demo6(), ana::SingleSampleExperiment::Derivative(), draw_decomp_plots(), ana::DataMCPair::DrawData(), ana::SpectrumComponents::DrawLegend(), ana::DataMCPair::DrawMCComponents(), ana::DataMCPair::DrawMCNormSyst(), DataMCPair::DrawMCNormSyst(), ana::DataMCPair::DrawMCSyst(), drawPlot(), ana::TwoSampleDecomp::DrawSigBkgOverlay(), ana::TwoSampleDecomp::DrawTwoSamplesWithRatios(), EHadVisMECpairs(), fa_nd_mc_prediction_full_syst(), FCContour(), fd_plot(), fd_plot_bless(), fill_col(), ana::FluxMultiverseSyst::FindSigmaBoundaries(), FitParamEffectsAna(), ana::PredictionInterp::FitSumComponent(), FitSystEffectsAna(), GetExtrap(), getHists_FNEX(), ana::Multiverse::GetNSigmaShift(), GetNueData2017(), GetNueData2018(), GetNueData2019(), ana::GetNueData2020(), ana::GetNumuData2020(), GetSpectra(), ana::MichelDecomp::GetSum(), ana::MichelDecomp::GetTemplateContent(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplateShapeOnly1D(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplateShapeOnly3D(), ana::PredictionNueRebinSA::Inflate(), ana::PredictionInterp::InitFits(), joint_fit_make_fc_slice(), joint_fit_make_fc_surf(), ana::SingleSampleExperiment::LogLikelihood(), Make2DPlot(), make_fc_points(), make_fc_slice(), make_fc_surf(), make_muonid_opt(), make_nus17_fc_surfs(), make_nus_fc_surfs(), make_plots(), make_vertex_optimiz(), make_xs(), make_xs_1D(), makeEnergyEstimator(), makeFlatWeight(), MakeHBar(), makeMatrixElementSurface(), MakePlot(), MakePlots(), ana::MakeQuantileHistogram(), ana::FluxDecomp::MakeWeightsNumuFromKaon(), ana::BENDecomp::MakeWeightsNumuFromKaon(), ana::FluxDecomp::MakeWeightsNumuFromPion(), ana::BENDecomp::MakeWeightsNumuFromPion(), ana::MichelDecomp::MCToDCMPComp(), mec_tuning_fitter_2020(), ana::PredictionExtendToPeripheral::MergePeripheral(), MichelDecompTest(), mrbrem_get_reweighted_spectra(), mrbrem_plots(), mre_blessed(), mre_comp_split(), mre_example(), nd_plot_bless(), ana::GenieMultiverseNormalizedSpectra::NormalizeSpectra(), nue_bg_stat_err_calc(), nue_cosrej_study(), nue_decomp_scales(), nue_decomp_scales_forMakeMichel(), ana::FluxDecomp::NueEstimate(), ana::BENDecomp::NueEstimate(), ana::FluxDecomp::NueEstimateFromKa(), ana::BENDecomp::NueEstimateFromKa(), ana::FluxDecomp::NueEstimateFromPi(), ana::BENDecomp::NueEstimateFromPi(), ana::CutOptimization::OptimizedSigmaOverSigma(), plot(), plot_2d(), plot_2d_vars(), plot_3NDvsFD(), plot_3NDvsFD_FHC(), plot_3NDvsFD_RHC(), plot_datamc_ND_numu(), plot_datamc_ND_numu_REW(), plot_datamcpred(), plot_diff(), plot_fa_results(), plot_nd_data_mc(), plot_ND_numu_NOMvsREW(), plot_NDvsFD_REW(), plot_NDvsFD_weights(), plot_NDvsFD_weights_FHC(), plot_NDvsFD_weights_RHC(), plot_predictions(), plot_recoE_numu(), plot_time(), ana::PlotAllSelectionDecomposition(), ana::PlotAllSignalEstimates(), ana::CrossSectionAnalysis::PlotBackgroundEstimate(), ana::NumuCCIncAnalysis::PlotBackgroundEstimate(), ana::SingleNucAnalysis::PlotBackgroundEstimate2D(), ana::NumuCC2p2hAnalysis::PlotBackgroundEstimate2D(), ana::CrossSectionAnalysis::PlotData(), ana::NumuCCIncAnalysis::PlotData(), ana::SingleNucAnalysis::PlotData2D(), ana::NumuCC2p2hAnalysis::PlotData2D(), ana::CutOptimization::PlotDebug(), PlotNueDecompFourBins(), PlotNus17PredSystsData(), PlotNus18Sideband(), PlotNusSensAna01(), ana::CrossSectionAnalysis::PlotRecoToTrueMatrix(), ana::SingleNucAnalysis::PlotRecoToTrueMatrix2D(), ana::NumuCC2p2hAnalysis::PlotRecoToTrueMatrix2D(), ana::CrossSectionAnalysis::PlotSignalEstimate(), ana::SingleNucAnalysis::PlotSignalEstimate2D(), ana::NumuCC2p2hAnalysis::PlotSignalEstimate2D(), ana::PlotSpectra(), PlotStack(), ana::PlotStack(), PlotSyst(), PlotSysts(), ana::CrossSectionAnalysis::PlotUnfoldedSignal(), ana::SingleNucAnalysis::PlotUnfoldedSignal2D(), ana::NumuCC2p2hAnalysis::PlotUnfoldedSignal2D(), PlotVertices(), ana::SingleSampleExperiment::PredHistIncCosmics(), ana::NDPredictionSterile::Predict(), ana::NDPredictionSterile::PredictComponent(), ana::PredictionNumuFAHadE::PredictComponentSyst(), PrintEventCounts(), ana::TwoSampleDecomp::RatioCalc(), reco_minus_true_panels(), ana::PredictionNueRebinSA::Reduce(), ana::PredictionExtendToPeripheral::ReduceHelperNC(), ana::CrossSectionAnalysis::Result(), ana::NumuCCIncAnalysis::Result(), ana::NumuCC2p2hAnalysis::Result1DFluxInt(), ana::SingleNucAnalysis::Result2D(), ana::NumuCC2p2hAnalysis::Result2D(), ana::NumuCCIncAnalysis::Result2D(), ana::NumuCCIncAnalysis::ReturnHists(), ana::MichelDecomp::SaveCompPlots(), ana::FluxDecomp::SavePlots(), ana::BENDecomp::SavePlots(), ana::TruthReweight::SavePlots(), ana::RecoReweight::SavePlots(), ana::FluxDecomp::SavePlotsKa(), ana::BENDecomp::SavePlotsKa(), ana::FluxDecomp::SavePlotsPi(), ana::BENDecomp::SavePlotsPi(), saveS(), saveS1(), ana::MichelDecomp::SaveTempPlots(), selection_story_plots(), sensitivity(), ana::PredictionInterp::ShiftSpectrum(), ana::SimpleFOM(), SpectrumParamEffectsAna(), ana::SpectrumStan::SpectrumStan(), TableNueNDComponents(), TableNueNDDataMC(), test_beam_errorband(), test_micheldecomp(), test_sam(), test_sam_project(), test_stanfit_systpulls(), ana::Multiverse::ToHist(), ana::CutOptimization::ToHist(), ana::ICrossSectionAnalysis::ToHist(), ana::UnfoldIterative::Truth(), ana::UnfoldSVD::Truth(), ana::UnfoldTikhonov::Truth(), and ana::PredictionTemplateShift::Weight().

263 {return fPOT;}
double fPOT
Definition: Spectrum.h:319
void ana::Spectrum::RemoveLoader ( SpectrumLoaderBase p)
protected

Definition at line 897 of file Spectrum.cxx.

References fLoaderCount.

Referenced by GetBinnings().

898  { fLoaderCount.erase(p); }
const char * p
Definition: xmltok.h:285
std::set< SpectrumLoaderBase * > fLoaderCount
This count is maintained by SpectrumLoader, as a sanity check.
Definition: Spectrum.h:323
void ana::Spectrum::SaveTo ( TDirectory *  dir) const

Definition at line 1040 of file Spectrum.cxx.

References fBins, fHistD, fHistF, fHistSparse, fLabels, fLivetime, genie::utils::style::Format(), fPOT, MECModelEnuComparisons::i, and tmp.

Referenced by Ana2017_box_opening_macro(), Ana2017_sb_opening_macro(), Ana2018_box_opening_macro(), angle(), bdtstudyspectrums(), BlessedPlotsLoad(), caf_nue_data_mc(), ccpiinc_mc_studies(), containmentstudy(), CosmicPred(), ana::CovMxManager::CovMxManager(), CutTableLoad(), CVNphoton(), CVNphotonSplit(), datamc_ND_numu_kinematics(), datamc_ND_numu_kinematics_FHC(), datamc_ND_numu_kinematics_FHC_REW(), datamc_ND_numu_kinematics_REW(), datamc_ND_numu_kinematics_RHC(), datamc_ND_numu_kinematics_RHC_REW(), dataprocess_numuccinc(), estimate_energy(), fd_data_mc(), FDDataMCSystBandLoad(), FidOpt(), FidWShwCuts(), FillSpectra(), FitSystEffectsLoad(), get_cosmic_spectra(), get_data_and_cosmic(), get_data_histogram(), get_numi_data_histogram(), getData(), getFlatWeightSpectra(), GetNDDataMC(), getSpectra_ForFitting(), make_fd_data_spec(), make_mockdata_syst_contours(), make_nue_fd_datamc(), make_nue_firstana_exposure(), make_pi0_xcheck(), make_pid(), MakeCosmics(), MakeFakeData(), makeFakeDataFluxes(), MakeNus17Prediction(), MakeNus18SidebandPred(), MakeNusPrediction(), makeRealDataFluxes(), makeXSecPlots_TemplateFit(), mrbrem_get_initial_spectra(), mrbrem_get_reweighted_spectra(), MRDiFStudy_FHC_Step1(), MRDiFStudy_RHC_Step1(), mre_blessed(), mre_comp_split(), mre_sel_efficiency(), ncpi0HistoGrid2(), nd_data_mc(), ND_DataMC(), NDDataMCSystBandLoad(), nue_bg_stat_errs_load(), nue_decomp_scales(), nus17_box_opening(), nus17_fd_cut_tables(), nus17_fd_cut_tables2D(), nus18_box_opening(), nus_ana01_box_opening(), nus_ana01_sideband_box_opening(), OverrideLivetime(), pion_multiverse(), plot_fa_results(), preselection_cutflow(), ReMId(), resolutionscript(), resolutionstudy(), sa_box_opening_macro(), sa_fd_cut_tables(), sa_hesideband_box_opening_macro(), saveFDMCHists(), saveSpectraForUnf(), ana::xsec::UnfoldingVariable::SaveSpectrums(), ana::PredictionXSecTuning::SaveTo(), ana::CountingExperiment::SaveTo(), ana::PredictionNoOsc::SaveTo(), ana::PredictionNueRebinSA::SaveTo(), jw::TrivialPrediction::SaveTo(), ana::CheatDecomp::SaveTo(), ana::FitInAnaBinsBkgdEstimator::SaveTo(), ana::NumuCC2p2hBkgdEstimator::SaveTo(), ana::nueccinc::NueCCIncMRECorrection::SaveTo(), ana::NCDecomp::SaveTo(), ana::NueDecomp::SaveTo(), ana::TrivialPrediction::SaveTo(), ana::SingleSampleExperiment::SaveTo(), ana::CrossSectionSpectra::SaveTo(), ana::NumuDecomp::SaveTo(), ana::PredictionScaleComp::SaveTo(), ana::ProportionalDecomp::SaveTo(), ana::CutOptimization::SaveTo(), ana::TrivialCrossSectionAnalysis::SaveTo(), ana::FakeDecomp::SaveTo(), ana::TrivialExtrap::SaveTo(), ana::CrossSectionAnalysis::SaveTo(), ana::TwoSampleDecomp::SaveTo(), ana::SpectrumComponents::SaveTo(), ana::NumuCCIncAnalysis::SaveTo(), ana::FluxDecomp::SaveTo(), ana::nueccinc::NueCCIncCrossSectionAnalysis::SaveTo(), ana::MichelDecomp::SaveTo(), ana::BENDecomp::SaveTo(), ana::DataMCPair::SaveTo(), ana::RecoReweight::SaveTo(), ana::nueccinc::NueCCIncEnhancedSamples::SaveTo(), ana::FluxReweight::SaveTo(), ShwZOpt(), sidebandfittest(), test_beam_errorband(), test_fluxhadr_prod_weights_Flux(), test_genieweights(), test_predictionscalecomp(), twodstudyvtxcont(), validationscript(), and vertexstudy().

1041  {
1042  TDirectory* tmp = gDirectory;
1043  dir->cd();
1044 
1045  TObjString("Spectrum").Write("type");
1046 
1047  if(fHistD) fHistD->Write("hist");
1048  if(fHistF) fHistF->Write("hist");
1049  if(fHistSparse) fHistSparse->Write("hist_sparse");
1050  TH1D hPot("", "", 1, 0, 1);
1051  hPot.Fill(.5, fPOT);
1052  hPot.Write("pot");
1053  TH1D hLivetime("", "", 1, 0, 1);
1054  hLivetime.Fill(.5, fLivetime);
1055  hLivetime.Write("livetime");
1056 
1057  for(unsigned int i = 0; i < fBins.size(); ++i){
1058  TObjString(fLabels[i].c_str()).Write(TString::Format("label%d", i).Data());
1059  fBins[i].SaveTo(dir->mkdir(TString::Format("bins%d", i)));
1060  }
1061 
1062  tmp->cd();
1063  }
TH1D * fHistD
Definition: Spectrum.h:316
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
Float_t tmp
Definition: plot.C:36
std::vector< std::string > fLabels
Definition: Spectrum.h:325
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
TDirectory * dir
Definition: macro.C:5
std::vector< Binning > fBins
Definition: Spectrum.h:326
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
void ana::Spectrum::Scale ( double  c)
TH1D * ana::Spectrum::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.

Parameters
exposurePOT or livetime (seconds)
colHistogram color (default black)
styleHistogram line style (default solid)
expotypeHow to interpret exposure (kPOT (default) or kLivetime)

Definition at line 564 of file Spectrum.cxx.

References ana::HistCache::Copy(), om::cout, allTimeWatchdog::endl, fBins, fHistD, fHistF, fHistSparse, fLabels, fLivetime, fPOT, GetMultiDBinning(), MECModelEnuComparisons::i, ana::kBinDensity, ana::kLivetime, ana::kPOT, submit_hadd::l, label, livetime, ana::HistCache::New(), pot, and runNovaSAM::ret.

Referenced by ana::nueccinc::NueCCIncCrossSectionAnalysis::AddEnhancedSample(), ana::AddErrorInQuadrature(), ana::PredictionSystJoint2018::AddNormSyst(), ana::PredictionSystJointDemo::AddNormSyst(), ana::PredictionSyst3Flavor2020::AddNormSyst(), ana::PredictionSystNueSecondAna::AddNormSysts(), ana::PredictionSystNue2017::AddNormSysts(), ana::PredictionSystNumu2017::AddNormSysts(), alternate_cosrej_table(), AnalyzeNus18Pred(), ana::FitInAnaBinsBkgdEstimator::Background(), ana::NumuCC2p2hBkgdEstimator::Background(), bin_composition_pie_chart(), caf_numu_fd_validation_data(), caf_numu_fd_validation_MC(), caf_numu_fd_validation_MC_no_tau(), calcAlphaBetaEachBin(), CalcChi2(), ana::nueccinc::NueCCIncMRECorrection::CalcEfficiencyCorrection(), CalcR(), CalcRWithSystsNus17(), calculate_avg_nslcs(), calculateComponentsNumu(), calculateWrongSignNue(), calculateWrongSignNumuQ1(), calculateWrongSignNumuQ2(), calculateWrongSignNumuQ3(), calculateWrongSignNumuQ4(), cc(), check_predinterp(), check_predinterp_numu(), ana::OscCovMxExperiment::ChiSq(), ana::SingleSampleExperiment::ChiSq(), ana::CovMxExperiment::ChiSq(), Compare(), compare_pid_cut_sens(), CompareDecompDataMC(), CompareMCCompPrediction(), ComparePredictions(), ana::ComparePredictions(), ana::ModularExtrapComponent::ComparisonPlot(), ana::ComparisonTable(), ana::PredictionInterp::ComponentDerivative(), Cumulative(), CVNCuts(), ana::DataMCComparison(), Plotter::DataMCComparison(), ana::DataMCComparisonAreaNormalized(), ana::DataMCComparisonComponents(), ana::TwoSampleDecomp::Decomp(), ana::FakeDecomp::Decompose(), ana::MichelDecomp::Decompose(), demo1(), demo3(), demo5(), demo6(), demo_flat(), demo_nueNumuSysts(), ana::PredictionAddRock::Derivative(), ana::SingleSampleExperiment::Derivative(), ana::DataMCPair::DrawData(), drawPlot(), ana::TwoSampleDecomp::DrawSigBkgOverlay(), DrawSurface(), drawSystsShiftingNDdata(), drawSystsShiftingNDdata_updatedAna(), ana::TwoSampleDecomp::DrawTwoSamplesWithRatios(), efficiency(), efficiencySA(), EHadVisMECpairs(), fa_fd_data_mc_systs(), fa_nd_mc_prediction_full_syst(), FCContour(), fd_plot(), fd_plot_bless(), fill_col(), ana::FluxMultiverseSyst::FindSigmaBoundaries(), first_ana_proj(), FitParamEffectsAna(), ana::PredictionInterp::FitSumComponent(), FitSystEffectsAna(), ana::ModularExtrapComponent::FormSmartRatio(), GenerateFutureData(), GeniePredictionToRoot(), GetBackgroundStatisticalUncertainty(), GetBackgroundSystematicUncertainty(), ana::GetBFSystBands(), GetBG(), ana::GetBG(), getBNBPlots(), getContProf(), getContProf_Sensitivity(), GetDenominator(), ana::nueccinc::NueCCIncMRECorrection::getEfficiency1D(), GetEfficiencyDenominator(), GetEfficiencySystematicUncertainty(), GetExtrap(), GetFakeData(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getFlux1D(), GetFluxError(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getFullTemplate(), getHists_FNEX(), GetNC(), ana::GetNC(), ana::GetNDComponents(), ana::GetNDCompsFromDecomp(), ana::GetNDDecompsFromDecomp(), ana::Multiverse::GetNSigmaShift(), GetNueCosmics2017(), GetNueCosmics2018(), GetNueCosmics2019(), GetNueCosmicsFuture(), GetNumuCosmicsFuture(), ana::nueccinc::NueCCIncMRECorrection::getPreselected1D(), GetQuantilePredictionHist(), ana::nueccinc::NueCCIncMRECorrection::getSelected1D(), GetSelectedStatisticalUncertainty(), GetSig(), GetSpectra(), ana::GetSpectrum(), ana::GetSystBands(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplateShapeOnly1D(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplateShapeOnly3D(), getTimePeakPlots(), ana::PredictionNueRebinSA::Inflate(), Integral(), joint_fit_make_fc_slice(), joint_fit_make_fc_surf(), ana::SingleSampleExperiment::LogLikelihood(), make_extrap_figure(), make_fc_nus_surfs_nersc_2018(), make_fc_points(), make_fc_slice(), make_fc_surf(), make_muonid_opt(), make_nus17_fc_surfs(), make_nus_fc_surfs(), make_plots(), make_vertex_optimiz(), make_xs_1D(), MakeCovMx(), makeEnergyEstimator(), makeFlatWeight(), makeMatrixElementSurface(), MakePeriCutPlot(), MakePlot(), MakePlots(), MakeResultPlot(), MakeSurface(), MakeTable(), ana::FluxDecomp::MakeWeightsNumuFromKaon(), ana::BENDecomp::MakeWeightsNumuFromKaon(), makeXSecPlots1D(), makeXSecPlots2D(), ana::MichelDecomp::MCToDCMPComp(), ana::PredictionExtendToPeripheral::MergePeripheral(), MichelDecompTest(), mrbrem_get_reweighted_spectra(), mrbrem_plots(), mre_blessed(), mre_comp_split(), myPlotWithSystErrorBand(), nd_plot_bless(), NDHists(), nhits(), nue_ana_basic(), nue_bg_stat_err_calc(), nue_cosrej_study(), nue_decomp_scales(), nue_decomp_scales_forMakeMichel(), nue_pid_effs(), nue_pid_effs_miniprod(), nue_pid_effs_paper_numu_neweff(), ana::FluxDecomp::NueEstimate(), ana::BENDecomp::NueEstimate(), ana::BENDecomp::NueEstimateFromKa(), numu_cut_flow(), numu_demo_split_plot(), PeripheralCuts(), pi0_xcheck(), plot(), plot_3NDvsFD(), plot_3NDvsFD_FHC(), plot_3NDvsFD_RHC(), plot_datamc_ND_numu(), plot_datamc_ND_numu_REW(), plot_datamcpred(), plot_diff(), plot_fa_results(), plot_fd_datamc(), plot_kinematics_cafana(), plot_nd_data_mc(), plot_ND_numu_NOMvsREW(), plot_NDvsFD_REW(), plot_NDvsFD_weights(), plot_NDvsFD_weights_FHC(), plot_NDvsFD_weights_RHC(), plot_nue_xsec_pred(), plot_nueFD_Signal_REWvsNOM_FHC(), plot_nueFD_Signal_REWvsNOM_pTExtrap_FHC(), plot_nueFD_Signal_REWvsNOM_pTExtrap_RHC(), plot_nueFD_Signal_REWvsNOM_RHC(), plot_pi0_xcheck(), plot_pid(), plot_predictions(), plot_recoE_numu(), plot_sa_results(), plot_time(), ana::PlotAllSelectionDecomposition(), ana::PlotAllSignalEstimates(), ana::CrossSectionAnalysis::PlotBackgroundEstimate(), ana::NumuCCIncAnalysis::PlotBackgroundEstimate(), PlotComp(), ana::CrossSectionAnalysis::PlotData(), ana::NumuCCIncAnalysis::PlotData(), ana::CutOptimization::PlotDebug(), ana::CrossSectionAnalysis::PlotFluxEstimate(), ana::SingleNucAnalysis::PlotFluxEstimate2D(), ana::NumuCC2p2hAnalysis::PlotFluxEstimate2D(), PlotNuePredictionFourBins(), PlotNumuPredData(), PlotNus17PredSystsData(), PlotNus18Sideband(), PlotNusSensAna01(), PlotPionPlots(), PlotPurEff(), ana::PlotPurEff(), plots(), ana::PlotSpectra(), PlotStack(), ana::PlotStack(), PlotSyst(), PlotSysts(), Plotting_DataAndPrediction(), ana::CrossSectionAnalysis::PlotUnfoldedSignal(), ana::PlotWithSystErrorBand(), ana::PlotWithSystErrorBand_Quant(), ana::PlotWithSystErrorBandTwoPreds(), ana::SingleSampleExperiment::PredHistIncCosmics(), ana::PredictionCombinePeriods::PredictComponentSyst(), ana::PredictionNumuFAHadE::PredictComponentSyst(), PredictCosmic(), preselection_cutflow(), printline(), ana::SpectrumComponents::Purity(), ana::Ratio::Ratio(), ratio(), ana::TwoSampleDecomp::RatioCalc(), reco_minus_true_panels(), ana::PredictionNueRebinSA::Reduce(), ana::PredictionExtendToPeripheral::ReduceHelperNC(), resolution2018(), ana::CrossSectionAnalysis::Result(), ana::NumuCCIncAnalysis::Result(), ana::NumuCC2p2hAnalysis::Result1DFluxInt(), ana::NumuCC2p2hAnalysis::Result2D(), ana::SingleNucAnalysis::Result2D(), ana::NumuCCIncAnalysis::Result2D(), ana::NumuCCIncAnalysis::ReturnHists(), rhc_sensitivity(), ana::MichelDecomp::SaveCompPlots(), SaveDCMPPlots(), SaveOscPrediction(), ana::FluxDecomp::SavePlots(), ana::BENDecomp::SavePlots(), ana::TruthReweight::SavePlots(), ana::RecoReweight::SavePlots(), ana::FluxReweight::SavePlots(), ana::FluxDecomp::SavePlotsKa(), ana::BENDecomp::SavePlotsKa(), ana::BENDecomp::SavePlotsPi(), saveS(), selection_story_plots(), ana::PredictionInterp::ShiftSpectrum(), ana::SimpleFOM(), ana::SingleSampleExperiment::SingleSampleExperiment(), SpectrumParamEffectsAna(), ana::SpectrumStan::SpectrumStan(), spects(), sterile_demo(), syst_plot_test(), TableNuePredictionFourBins(), template_basic(), test_ana(), test_beam_errorband(), test_fluxhadr_prod_weights_Flux(), test_genie_systs(), test_genieweights(), test_micheldecomp(), test_nue2017Prediction(), test_nue2018_fitter(), test_nueextrapsyst(), test_nuwro(), test_saloaders(), test_sam(), test_sam_project(), test_stanfit_systpulls(), TestPred(), timingPeak(), ana::FluxMultiverseSyst::ToAreaNormalizedTH1(), ana::GenieMultiverseSpectra::ToAreaNormalizedTH1(), ana::Multiverse::ToHist(), ana::CutOptimization::ToHist(), ana::ICrossSectionAnalysis::ToHist(), ana::FluxMultiverseSyst::ToTH1(), ana::GenieMultiverseSpectra::ToTH1(), ToTH1(), ana::ToTH2(), ana::ToTH3(), Toy_analyses(), ana::UnfoldSVD::Truth(), ana::UnfoldTikhonov::Truth(), Unfold1D(), Unfold3D(), UnfoldInOut(), and ana::PredictionTemplateShift::Weight().

567  {
568  // Could have a file temporarily open
569  DontAddDirectory guard;
570 
571  TH1D* ret = 0;
572  if(fHistD){
574  }
575  else if(fHistF){
576  ret = HistCache::New(fHistF->GetTitle(), GetMultiDBinning());
577  ret->Add(fHistF);
578  }
579  else{
580  ret = fHistSparse->Projection(0);
581  }
582 
583  if(expotype == kPOT){
584  const double pot = exposure;
585  if(fPOT){
586  ret->Scale(pot/fPOT);
587  }
588  else{
589  // Allow zero POT if there are also zero events
590  if(ret->Integral() > 0){
591  std::cout << "Error: Spectrum with " << ret->Integral()
592  << " entries has zero POT, no way to scale to "
593  << exposure << " POT.";
594  if(fLivetime > 0){
595  std::cout << " Spectrum has " << fLivetime << " seconds livetime. "
596  << "Did you mean to pass kLivetime to ToTH1()?";
597  }
598  std::cout << std::endl;
599  abort();
600  }
601  }
602  }
603  if(expotype == kLivetime){
604  const double livetime = exposure;
605  if(fLivetime){
606  ret->Scale(livetime/fLivetime);
607  }
608  else{
609  // Allow zero exposure if there are also zero events
610  if(ret->Integral() > 0){
611  std::cout << "Error: Spectrum with " << ret->Integral()
612  << " entries has zero livetime, no way to scale to "
613  << livetime << " seconds.";
614  if(fPOT > 0){
615  std::cout << " Spectrum has " << fPOT << " POT. "
616  << "Did you mean to pass kPOT to ToTH1()?";
617  }
618  std::cout << std::endl;
619  abort();
620  }
621  }
622  }
623 
625  for(const std::string& l: fLabels) label += l + " and ";
626  label.resize(label.size()-5); // drop the last "and"
627  ret->GetXaxis()->SetTitle(label.c_str());
628 
629  if(fBins.size() == 1){
630  for(unsigned int i = 0; i < fBins[0].Labels().size(); ++i){
631  ret->GetXaxis()->SetBinLabel(i+1, fBins[0].Labels()[i].c_str());
632  }
633  }
634 
635  ret->GetYaxis()->SetTitle("Events");
636 
637 
638  ret->SetLineColor(col);
639  ret->SetMarkerColor(col);
640  ret->SetLineStyle(style);
641 
642  if(bintype == kBinDensity) ret->Scale(1, "width");
643 
644  // Allow GetMean() and friends to work even if this histogram never had any
645  // explicit Fill() calls made.
646  if(ret->GetEntries() == 0) ret->SetEntries(1);
647 
648  return ret;
649  }
TH1D * fHistD
Definition: Spectrum.h:316
static TH1D * Copy(const TH1D *h)
Definition: HistCache.cxx:138
Divide bin contents by bin widths.
Definition: Utilities.h:45
TH1F * fHistF
Definition: Spectrum.h:317
double fPOT
Definition: Spectrum.h:319
const char * label
std::vector< std::string > fLabels
Definition: Spectrum.h:325
Int_t col[ntarg]
Definition: Style.C:29
#define pot
double fLivetime
Definition: Spectrum.h:320
THnSparseD * fHistSparse
Definition: Spectrum.h:318
OStream cout
Definition: OStream.cxx:6
Binning GetMultiDBinning() const
Definition: Spectrum.cxx:510
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::vector< Binning > fBins
Definition: Spectrum.h:326
static TH1D * New(const std::string &title, const Binning &bins)
Definition: HistCache.cxx:22
TH1D* ana::Spectrum::ToTH1 ( double  exposure,
EExposureType  expotype,
EBinType  bintype = kBinContent 
) const
inline

Histogram made from this Spectrum, scaled to some exposure.

Parameters
exposurePOT or livetime (seconds)
expotypeHow to interpret exposure (kPOT (default) or kLivetime)

Definition at line 221 of file Spectrum.h.

References FakeData(), compare_h5_caf::idx, Integral(), ana::kBinContent, ana::kPOT, Mean(), MockData(), ToTH1(), ToTH2(), ToTH2NormX(), and ToTH3().

224  {
225  return ToTH1(exposure, kBlack, kSolid, expotype, bintype);
226  }
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.
Definition: Spectrum.cxx:564
TH2 * ana::Spectrum::ToTH2 ( double  exposure,
EExposureType  expotype = kPOT,
EBinType  bintype = kBinContent 
) const

Spectrum must be 2D to obtain TH2.

Definition at line 652 of file Spectrum.cxx.

References visualisationForPaperMasterPlot::ax, om::cout, allTimeWatchdog::endl, fBins, fLabels, MECModelEnuComparisons::i, ana::kBinDensity, runNovaSAM::ret, and ana::ToTH2().

Referenced by ana::nueccinc::NueCCIncMRECorrection::CalcEfficiencyCorrection(), demo6(), ana::nueccinc::NueCCIncCrossSectionAnalysis::doUnfolding1D(), ana::nueccinc::NueCCIncCrossSectionAnalysis::doUnfolding2D(), drawLongTerm(), drawTimePlots(), drawVsPOT(), FD_Data_PosComp(), FD_plots(), GetHistsFD(), GetHistsND(), GetSpectra2D(), getTimePeakPlots(), ana::nueccinc::NueCCIncCrossSectionAnalysis::getUnfoldingMatrix(), HadEFit(), Make2DPlot(), make_quantiles_histogram_2020(), makeEnergyEstimator(), MakePlots(), ana::MakeQuantileHistogram(), mec_tuning(), mec_tuning_fitter_2020(), MichelDecompTest(), mre_example(), MuonFit(), plot_2d(), plot_2d_vars(), plot_pi0_xcheck(), ana::SingleNucAnalysis::PlotBackgroundEstimate2D(), ana::NumuCC2p2hAnalysis::PlotBackgroundEstimate2D(), ana::SingleNucAnalysis::PlotData2D(), ana::NumuCC2p2hAnalysis::PlotData2D(), ana::SingleNucAnalysis::PlotUnfoldedSignal2D(), ana::NumuCC2p2hAnalysis::PlotUnfoldedSignal2D(), PlotVertices(), PositionComparison(), print_tables(), PrintPlot(), saveS1(), ana::Multiverse::ToHist(), ana::CutOptimization::ToHist(), ana::ICrossSectionAnalysis::ToHist(), ToTH1(), ana::GenieMultiverseSpectra::ToTH2(), and ToTH2NormX().

653  {
654  if(fBins.size() != 2){
655  std::cout << "Error: This Spectrum does not appear to be 2D." << std::endl;
656  abort();
657  }
658 
659  TH2* ret = ana::ToTH2(*this, exposure, expotype, fBins[0], fBins[1]);
660 
661  for(int iax = 0; iax < 2; ++iax){
662  TAxis* ax = ret->GetXaxis();
663  if(iax == 1) ax = ret->GetYaxis();
664 
665  ax->SetTitle(fLabels[iax].c_str());
666 
667  for(unsigned int i = 0; i < fBins[iax].Labels().size(); ++i){
668  ax->SetBinLabel(i+1, fBins[iax].Labels()[i].c_str());
669  }
670  }
671 
672  if(bintype == kBinDensity) ret->Scale(1, "width");
673 
674  // Allow GetMean() and friends to work even if this histogram never had any
675  // explicit Fill() calls made.
676  if(ret->GetEntries() == 0) ret->SetEntries(1);
677 
678  return ret;
679  }
Divide bin contents by bin widths.
Definition: Utilities.h:45
std::vector< std::string > fLabels
Definition: Spectrum.h:325
TH2 * ToTH2(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
Definition: Utilities.cxx:374
OStream cout
Definition: OStream.cxx:6
std::vector< Binning > fBins
Definition: Spectrum.h:326
TH2 * ana::Spectrum::ToTH2NormX ( double  exposure,
EExposureType  expotype = kPOT 
) const

Spectrum must be 2D to obtain TH2. Normalized to X axis.

If no entries in the column, skip normalization

Definition at line 682 of file Spectrum.cxx.

References fBins, MECModelEnuComparisons::i, calib::j, nbinsx, norm, and ToTH2().

Referenced by ToTH1().

683  {
684  TH2* xyhist = ToTH2(exposure, expotype);
685  if(!xyhist) return nullptr;
686 
687  const int nbinsx = fBins[0].NBins();
688  const int nbinsy = fBins[1].NBins();
689 
690  // Normalize 2D histogram to X-axis spectrum
691  for(int i=1; i<=nbinsx; ++i){
692  double norm = 0.0;
693  for(int j=1; j<=nbinsy; ++j){
694  norm += xyhist->GetBinContent(i, j);
695  }
696  /// If no entries in the column, skip normalization
697  if(norm < 0.0000001) continue;
698 
699  norm = 1.0 / norm;
700  for(int j=1; j<=nbinsy; ++j){
701  xyhist->SetBinContent(i,j, xyhist->GetBinContent(i, j) * norm);
702  }
703  }
704 
705  // Allow GetMean() and friends to work even if this histogram never had any
706  // explicit Fill() calls made.
707  if(xyhist->GetEntries() == 0) xyhist->SetEntries(1);
708 
709  return xyhist;
710  }
TH2 * ToTH2(double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Spectrum must be 2D to obtain TH2.
Definition: Spectrum.cxx:652
const double j
Definition: BetheBloch.cxx:29
Float_t norm
Int_t nbinsx
Definition: plot.C:23
std::vector< Binning > fBins
Definition: Spectrum.h:326
TH3 * ana::Spectrum::ToTH3 ( double  exposure,
EExposureType  expotype = kPOT,
EBinType  bintype = kBinContent 
) const

Spectrum must be 3D to obtain TH3.

Definition at line 713 of file Spectrum.cxx.

References visualisationForPaperMasterPlot::ax, om::cout, allTimeWatchdog::endl, fBins, fLabels, MECModelEnuComparisons::i, ana::kBinDensity, runNovaSAM::ret, and ana::ToTH3().

Referenced by ana::FluxDecomp::MakeWeightsNumuFromPion(), ana::BENDecomp::MakeWeightsNumuFromPion(), ana::FluxDecomp::NueEstimateFromPi(), ana::BENDecomp::NueEstimateFromPi(), ana::FluxDecomp::SavePlotsPi(), ana::BENDecomp::SavePlotsPi(), ana::Multiverse::ToHist(), ana::CutOptimization::ToHist(), ana::ICrossSectionAnalysis::ToHist(), and ToTH1().

714  {
715  if(fBins.size() != 3){
716  std::cout << "Error: This Spectrum does not appear to be 3D." << std::endl;
717  abort();
718  }
719 
720  TH3* ret = ana::ToTH3(*this, exposure, expotype,
721  fBins[0], fBins[1], fBins[2]);
722 
723  for(int iax = 0; iax < 3; ++iax){
724  TAxis* ax = ret->GetXaxis();
725  if(iax == 1) ax = ret->GetYaxis();
726  if(iax == 2) ax = ret->GetZaxis();
727 
728  ax->SetTitle(fLabels[iax].c_str());
729 
730  for(unsigned int i = 0; i < fBins[iax].Labels().size(); ++i){
731  ax->SetBinLabel(i+1, fBins[iax].Labels()[i].c_str());
732  }
733  }
734 
735  if(bintype == kBinDensity) ret->Scale(1, "width");
736 
737  // Allow GetMean() and friends to work even if this histogram never had any
738  // explicit Fill() calls made.
739  if(ret->GetEntries() == 0) ret->SetEntries(1);
740 
741  return ret;
742  }
Divide bin contents by bin widths.
Definition: Utilities.h:45
std::vector< std::string > fLabels
Definition: Spectrum.h:325
OStream cout
Definition: OStream.cxx:6
std::vector< Binning > fBins
Definition: Spectrum.h:326
TH3 * ToTH3(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
Definition: Utilities.cxx:424

Friends And Related Function Documentation

friend class NullLoader
friend

Definition at line 43 of file Spectrum.h.

friend class SpectrumLoader
friend

Definition at line 42 of file Spectrum.h.

friend class SpectrumLoaderBase
friend

Definition at line 41 of file Spectrum.h.

friend class SpectrumStan
friend

Definition at line 40 of file Spectrum.h.

Member Data Documentation

std::vector<Binning> ana::Spectrum::fBins
protected

Definition at line 326 of file Spectrum.h.

Referenced by GetBinnings(), GetMultiDBinning(), operator=(), SaveTo(), ToTH1(), ToTH2(), ToTH2NormX(), and ToTH3().

TH1D* ana::Spectrum::fHistD
protected
TH1F* ana::Spectrum::fHistF
protected
THnSparseD* ana::Spectrum::fHistSparse
protected
std::vector<std::string> ana::Spectrum::fLabels
protected

Definition at line 325 of file Spectrum.h.

Referenced by GetLabels(), NDimensions(), operator=(), SaveTo(), ToTH1(), ToTH2(), and ToTH3().

double ana::Spectrum::fLivetime
protected
std::set<SpectrumLoaderBase*> ana::Spectrum::fLoaderCount
protected

This count is maintained by SpectrumLoader, as a sanity check.

Definition at line 323 of file Spectrum.h.

Referenced by AddLoader(), operator=(), RemoveLoader(), Spectrum(), ana::SpectrumStan::SpectrumStan(), and ~Spectrum().

double ana::Spectrum::fPOT
protected

The documentation for this class was generated from the following files: