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

Prediction that wraps a simple Spectrum. More...

#include <PredictionNoOsc.h>

Inheritance diagram for ana::PredictionNoOsc:
ana::IPrediction

Public Member Functions

 PredictionNoOsc (SpectrumLoaderBase &loader, const HistAxis &axis, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 PredictionNoOsc (SpectrumLoaderBase &loader, const std::string &label, const Binning &bins, const Var &var, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
virtual void SaveTo (TDirectory *dir) const override
 
virtual Spectrum Predict (osc::IOscCalc *) const override
 
virtual Spectrum PredictComponent (osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
 
- Public Member Functions inherited from ana::IPrediction
virtual ~IPrediction ()
 
virtual Spectrum PredictUnoscillated () const
 
virtual Spectrum PredictSyst (osc::IOscCalc *calc, const SystShifts &syst) const
 
virtual Spectrum PredictComponentSyst (osc::IOscCalc *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual OscillatableSpectrum ComponentCC (int from, int to) const
 

Static Public Member Functions

static std::unique_ptr
< PredictionNoOsc
LoadFrom (TDirectory *dir)
 

Protected Member Functions

 PredictionNoOsc (const Spectrum &s, const Spectrum &sNC, const Spectrum &sNumu, const Spectrum &sNumubar, const Spectrum &sNue, const Spectrum &sNuebar)
 

Protected Attributes

Spectrum fSpectrum
 
Spectrum fSpectrumNC
 
Spectrum fSpectrumNumu
 
Spectrum fSpectrumNumubar
 
Spectrum fSpectrumNue
 
Spectrum fSpectrumNuebar
 

Detailed Description

Prediction that wraps a simple Spectrum.

Definition at line 9 of file PredictionNoOsc.h.

Constructor & Destructor Documentation

ana::PredictionNoOsc::PredictionNoOsc ( SpectrumLoaderBase loader,
const HistAxis axis,
const SpillCut spillcut,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 31 of file PredictionNoOsc.cxx.

37  : fSpectrum( loader, axis, spillcut, cut, shift, wei),
38  fSpectrumNC( loader, axis, spillcut, cut && kIsNC, shift, wei),
39  fSpectrumNumu( loader, axis, spillcut, cut && !kIsNC && kIsNumuCC && !kIsAntiNu, shift, wei),
40  fSpectrumNumubar(loader, axis, spillcut, cut && !kIsNC && kIsNumuCC && kIsAntiNu, shift, wei),
41  fSpectrumNue( loader, axis, spillcut, cut && !kIsNC && kIsBeamNue && !kIsAntiNu, shift, wei),
42  fSpectrumNuebar( loader, axis, spillcut, cut && !kIsNC && kIsBeamNue && kIsAntiNu, shift, wei)
43  {
44  }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
const Cut kIsNC([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.isnc;})
Is this a Neutral Current event?
tuple loader
Definition: demo.py:7
const Cut kIsBeamNue(CCFlavSel(12, 12))
Select CC .
shift
Definition: fcl_checks.sh:26
const Cut kIsAntiNu([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.pdg< 0;})
Is this truly an antineutrino?
ana::PredictionNoOsc::PredictionNoOsc ( SpectrumLoaderBase loader,
const std::string &  label,
const Binning bins,
const Var var,
const SpillCut spillcut,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 18 of file PredictionNoOsc.cxx.

26  : PredictionNoOsc(loader, HistAxis(label, bins, var), spillcut, cut, shift, wei)
27  {
28  }
_HistAxis< Var > HistAxis
Definition: HistAxis.h:62
tuple loader
Definition: demo.py:7
shift
Definition: fcl_checks.sh:26
PredictionNoOsc(SpectrumLoaderBase &loader, const HistAxis &axis, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
ana::PredictionNoOsc::PredictionNoOsc ( const Spectrum s,
const Spectrum sNC,
const Spectrum sNumu,
const Spectrum sNumubar,
const Spectrum sNue,
const Spectrum sNuebar 
)
inlineprotected

Definition at line 42 of file PredictionNoOsc.h.

46  : fSpectrum(s),
47  fSpectrumNC(sNC),
48  fSpectrumNumu(sNumu), fSpectrumNumubar(sNumubar),
49  fSpectrumNue(sNue), fSpectrumNuebar(sNuebar)
50  {
51  }
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60

Member Function Documentation

std::unique_ptr< PredictionNoOsc > ana::PredictionNoOsc::LoadFrom ( TDirectory *  dir)
static

Definition at line 101 of file PredictionNoOsc.cxx.

102  {
103  PredictionNoOsc* ret = new PredictionNoOsc(
104  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect")),
105  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_nc")),
106  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_numu")),
107  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_numubar")),
108  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_nue")),
109  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_nuebar")));
110 
111  // Can't use make_unique because constructor is protected
112  return std::unique_ptr<PredictionNoOsc>(ret);
113  }
tuple dir
Definition: dropbox.py:28
PredictionNoOsc(SpectrumLoaderBase &loader, const HistAxis &axis, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
virtual Spectrum ana::PredictionNoOsc::Predict ( osc::IOscCalc ) const
inlineoverridevirtual

Implements ana::IPrediction.

Definition at line 31 of file PredictionNoOsc.h.

32  {
33  return fSpectrum;
34  }
Spectrum ana::PredictionNoOsc::PredictComponent ( osc::IOscCalc calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtual

Implements ana::IPrediction.

Definition at line 47 of file PredictionNoOsc.cxx.

51  {
52  if(flav == Flavors::kAll &&
53  curr == Current::kBoth &&
54  sign == Sign::kBoth)
55  return Predict(0); // Faster
56 
57  if(curr & Current::kNC){
58  // We don't have NC broken down by sign or flavour
59  assert(flav & Flavors::kAll && sign & Sign::kBoth);
60  return fSpectrumNC;
61  }
62 
63  assert(curr == Current::kCC);
64 
65  using namespace Flavors;
66  using namespace Current;
67  using namespace Sign;
68 
69  Spectrum ret = fSpectrum;
70  ret.Clear();
71 
72  // Safe to assume by this point that it's 100% CC
73  if(flav & kNuMuToNuMu && sign & kNu) ret += fSpectrumNumu;
74  if(flav & kNuMuToNuMu && sign & kAntiNu) ret += fSpectrumNumubar;
75  if(flav & kNuEToNuE && sign & kNu) ret += fSpectrumNue;
76  if(flav & kNuEToNuE && sign & kAntiNu) ret += fSpectrumNuebar;
77 
78  return ret;
79  }
Antineutrinos-only.
Definition: IPrediction.h:49
(&#39;beam &#39;)
Definition: IPrediction.h:14
Charged-current interactions.
Definition: IPrediction.h:38
Interactions of both types.
Definition: IPrediction.h:41
virtual Spectrum Predict(osc::IOscCalc *) const override
Neutrinos-only.
Definition: IPrediction.h:48
(&#39; survival&#39;)
Definition: IPrediction.h:18
int sign(double val)
Definition: UtilFunc.cxx:104
Neutral-current interactions.
Definition: IPrediction.h:39
Both neutrinos and antineutrinos.
Definition: IPrediction.h:51
All neutrinos, any flavor.
Definition: IPrediction.h:25
void ana::PredictionNoOsc::SaveTo ( TDirectory *  dir) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 82 of file PredictionNoOsc.cxx.

83  {
84  TDirectory* tmp = gDirectory;
85 
86  dir->cd();
87 
88  TObjString("PredictionNoOsc").Write("type");
89 
90  fSpectrum.SaveTo(dir->mkdir("spect"));
91  fSpectrumNC.SaveTo(dir->mkdir("spect_nc"));
92  fSpectrumNumu.SaveTo(dir->mkdir("spect_numu"));
93  fSpectrumNumubar.SaveTo(dir->mkdir("spect_numubar"));
94  fSpectrumNue.SaveTo(dir->mkdir("spect_nue"));
95  fSpectrumNuebar.SaveTo(dir->mkdir("spect_nuebar"));
96 
97  tmp->cd();
98  }
tuple dir
Definition: dropbox.py:28
void SaveTo(TDirectory *dir) const

Member Data Documentation

Spectrum ana::PredictionNoOsc::fSpectrum
protected

Definition at line 53 of file PredictionNoOsc.h.

Spectrum ana::PredictionNoOsc::fSpectrumNC
protected

Definition at line 55 of file PredictionNoOsc.h.

Spectrum ana::PredictionNoOsc::fSpectrumNue
protected

Definition at line 58 of file PredictionNoOsc.h.

Spectrum ana::PredictionNoOsc::fSpectrumNuebar
protected

Definition at line 59 of file PredictionNoOsc.h.

Spectrum ana::PredictionNoOsc::fSpectrumNumu
protected

Definition at line 56 of file PredictionNoOsc.h.

Spectrum ana::PredictionNoOsc::fSpectrumNumubar
protected

Definition at line 57 of file PredictionNoOsc.h.


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