All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
ana::FluxTimesNuclei Class Reference

#include <Flux.h>

Inheritance diagram for ana::FluxTimesNuclei:
ana::Spectrum

Public Member Functions

 FluxTimesNuclei (SpectrumLoaderBase &loader, const Binning &bins, const Cut &fidvol, int pdg)
 pdg PDG code for neutrino, -14,-12,+12,14 More...
 
TH1D * ToTH1 (double exposure, Color_t col=kBlack, Style_t style=kSolid, EBinType bintype=kBinContent)
 
- Public Member Functions inherited from ana::Spectrum
 Spectrum (const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 Spectrum (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 SpillVar &var, const SpillCut &cut, const SpillVar &wei=kSpillUnweighted)
 
 Spectrum (const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const MultiVar &var, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 The only MultiVar variant available. More...
 
 Spectrum (const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const SpillMultiVar &var, const SpillCut &cut, const SpillVar &wei=kSpillUnweighted)
 
 Spectrum (SpectrumLoaderBase &loader, const HistAxis &axis, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 Spectrum (SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 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 (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 (const std::string &label, SpectrumLoaderBase &loader, const Binning &binsx, const Var &varx, const Binning &binsy, const Var &vary, const SpillCut &spillcut, 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 SpillVar &varx, const Binning &binsy, const SpillVar &vary, const SpillCut &spillcut, const SpillVar &wei=kSpillUnweighted)
 2D Spectrum of two SpillVars More...
 
 Spectrum (const std::string &label, SpectrumLoaderBase &loader, const Binning &binsx, const MultiVar &varx, const Binning &binsy, const MultiVar &vary, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 2D Spectrum of two MultiVars More...
 
 Spectrum (const std::string &label, SpectrumLoaderBase &loader, const Binning &binsx, const SpillMultiVar &varx, const Binning &binsy, const SpillMultiVar &vary, const SpillCut &spillcut, const SpillVar &wei=kSpillUnweighted)
 2D Spectrum of two SpillMultiVars More...
 
 Spectrum (SpectrumLoaderBase &loader, const HistAxis &xAxis, const HistAxis &yAxis, const SpillCut &spillcut, 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 SpillCut &spillcut, 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 SpillVar &varx, const Binning &binsy, const SpillVar &vary, const SpillCut &spillcut, const SpillVar &wei=kSpillUnweighted)
 
 Spectrum (const std::string &xLabel, const std::string &yLabel, SpectrumLoaderBase &loader, const Binning &binsx, const MultiVar &varx, const Binning &binsy, const MultiVar &vary, const SpillCut &spillcut, 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 SpillMultiVar &varx, const Binning &binsy, const SpillMultiVar &vary, const SpillCut &spillcut, const SpillVar &wei=kSpillUnweighted)
 
 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 SpillCut &spillcut, 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 SpillCut &spillcut, 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 SpillCut &spillcut, 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)
 
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...
 
TH1 * ToTHX (double exposure, bool force1D=false, EExposureType expotype=kPOT) const
 Function decides what is the appropriate projection based on fBins, and does that. 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, bool makethrow=true, int seed=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...
 
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
 

Protected Attributes

int fPdg
 
- Protected Attributes inherited from ana::Spectrum
TH1D * fHist
 
THnSparseD * fHistSparse
 
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
 

Additional Inherited Members

- Public Types inherited from ana::Spectrum
enum  ESparse { kDense, kSparse }
 
- Static Public Member Functions inherited from ana::Spectrum
static std::unique_ptr< SpectrumLoadFrom (TDirectory *dir)
 
- Protected Member Functions inherited from ana::Spectrum
 Spectrum (const std::vector< std::string > &labels, const std::vector< Binning > &bins, ESparse sparse=kDense)
 
void ConstructHistogram (ESparse sparse=kDense)
 
void RemoveLoader (SpectrumLoaderBase *)
 
void AddLoader (SpectrumLoaderBase *)
 
SpectrumPlusEqualsHelper (const Spectrum &rhs, int sign)
 Helper for operator+= and operator-=. More...
 

Detailed Description

Definition at line 11 of file Flux.h.

Constructor & Destructor Documentation

ana::FluxTimesNuclei::FluxTimesNuclei ( SpectrumLoaderBase loader,
const Binning bins,
const Cut fidvol,
int  pdg 
)

pdg PDG code for neutrino, -14,-12,+12,14

Definition at line 56 of file Flux.cxx.

60  : Spectrum("", bins, loader, SIMPLEVAR(truth.E),
61  SIMPLEVAR(truth.index) >= 0 && IsCCQEOnArgonCut(pdg) && fidvol,
63  fPdg(pdg)
64  {
65  }
var pdg
Definition: selectors.fcl:14
tuple loader
Definition: demo.py:7
const Var kInvXSec([](const caf::SRSliceProxy *sr){const double GeV2perm2=2.56819e31;return GeV2perm2/sr->truth.xsec;})
const SystShifts kNoShift
Definition: SystShifts.h:61
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
Definition: Var.h:82
Spectrum(const std::string &label, const Binning &bins, SpectrumLoaderBase &loader, const Var &var, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Definition: Spectrum.cxx:43
Cut IsCCQEOnArgonCut(int pdg)
Definition: Flux.cxx:46

Member Function Documentation

TH1D * ana::FluxTimesNuclei::ToTH1 ( double  exposure,
Color_t  col = kBlack,
Style_t  style = kSolid,
EBinType  bintype = kBinContent 
)

Definition at line 68 of file Flux.cxx.

72  {
73  TH1D* ret = Spectrum::ToTH1(exposure, col, style, kPOT, bintype);
74  ret->GetXaxis()->SetTitle("True neutrino energy (GeV)");
75 
76  std::string ytitle = "Flux #times nuclei (";
77  switch(fPdg){
78  case +12: ytitle += "#nu_e"; break;
79  case -12: ytitle += "#bar{#nu}_e"; break;
80  case +14: ytitle += "#nu_{#mu}"; break;
81  case -14: ytitle += "#bar{#nu}_{#mu}"; break;
82  }
83 
84  ytitle += "/ m^{2}";
85  if(bintype == kBinDensity) ytitle += " / GeV";
86  ytitle += ")";
87  ret->GetYaxis()->SetTitle(ytitle.c_str());
88  return ret;
89  }
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.
Divide bin contents by bin widths.
def style
Definition: util.py:237

Member Data Documentation

int ana::FluxTimesNuclei::fPdg
protected

Definition at line 23 of file Flux.h.


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