Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ana::ProportionalDecomp Class Reference

Splits Data proportionally according to MC. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N19-12-08/CAFAna/Decomp/ProportionalDecomp.h"

Inheritance diagram for ana::ProportionalDecomp:
ana::IDecomp

Public Member Functions

 ProportionalDecomp (SpectrumLoaderBase &loaderMC, SpectrumLoaderBase &loaderData, const std::string &label, const Binning &bins, const Var &var, const Cut &cut, const SystShifts &shiftMC=kNoShift, const SystShifts &shiftData=kNoShift, const Var &wei=kUnweighted)
 
 ProportionalDecomp (SpectrumLoaderBase &loaderMC, SpectrumLoaderBase &loaderData, const HistAxis &axis, const Cut &cut, const SystShifts &shiftMC=kNoShift, const SystShifts &shiftData=kNoShift, const Var &wei=kUnweighted)
 
 ProportionalDecomp (Loaders &loaders, const HistAxis &axis, const Cut &cut, const SystShifts &shiftMC=kNoShift, const SystShifts &shiftData=kNoShift, const Var &wei=kUnweighted)
 
Spectrum NumuComponent () const override
 
Spectrum AntiNumuComponent () const override
 
Spectrum NCTotalComponent () const override
 
Spectrum NCComponent () const override
 
Spectrum NCAntiComponent () const override
 
Spectrum NueComponent () const override
 
Spectrum AntiNueComponent () const override
 
Spectrum MC_NumuComponent () const override
 
Spectrum MC_AntiNumuComponent () const override
 
Spectrum MC_NueComponent () const override
 
Spectrum MC_AntiNueComponent () const override
 
Spectrum MC_NCTotalComponent () const override
 
Spectrum MC_NCComponent () const override
 
Spectrum MC_NCAntiComponent () const override
 
Spectrum Data_Component () const override
 
void SaveTo (TDirectory *dir) const override
 

Static Public Member Functions

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

Protected Member Functions

 ProportionalDecomp ()
 

Protected Attributes

Spectrum fData
 
Spectrum fNCTot
 
Spectrum fNC
 
Spectrum fNCAnti
 
Spectrum fNue
 
Spectrum fAntiNue
 
Spectrum fNumu
 
Spectrum fAntiNumu
 
Spectrum fTotal
 

Detailed Description

Splits Data proportionally according to MC.

Definition at line 20 of file ProportionalDecomp.h.

Constructor & Destructor Documentation

ana::ProportionalDecomp::ProportionalDecomp ( SpectrumLoaderBase loaderMC,
SpectrumLoaderBase loaderData,
const std::string &  label,
const Binning bins,
const Var var,
const Cut cut,
const SystShifts shiftMC = kNoShift,
const SystShifts shiftData = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 14 of file ProportionalDecomp.cxx.

23  : ProportionalDecomp(loaderMC,
24  loaderData,
26  cut,
27  shiftMC,
28  shiftData,
29  wei)
30  {}
var
const char * label
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
GenericHistAxis< Var > HistAxis
Definition: HistAxis.h:95
ana::ProportionalDecomp::ProportionalDecomp ( SpectrumLoaderBase loaderMC,
SpectrumLoaderBase loaderData,
const HistAxis axis,
const Cut cut,
const SystShifts shiftMC = kNoShift,
const SystShifts shiftData = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 33 of file ProportionalDecomp.cxx.

40  : fData (loaderData, axis, cut, shiftData, wei),
41  // nc
42  fNCTot (loaderMC, axis, cut && kIsNC, shiftMC, wei),
43  fNC (loaderMC, axis, cut && kIsNC && !kIsAntiNu, shiftMC, wei),
44  fNCAnti (loaderMC, axis, cut && kIsNC && kIsAntiNu, shiftMC, wei),
45  //end nc
46  fNue (loaderMC, axis, cut && kIsBeamNue&&!kIsAntiNu, shiftMC, wei),
47  fAntiNue (loaderMC, axis, cut && kIsBeamNue&& kIsAntiNu, shiftMC, wei),
48  fNumu (loaderMC, axis, cut && kIsNumuCC &&!kIsAntiNu, shiftMC, wei),
49  fAntiNumu(loaderMC, axis, cut && kIsNumuCC && kIsAntiNu, shiftMC, wei),
50  fTotal (loaderMC, axis, cut && kHasNu, shiftMC, wei)
51  {}
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
const Cut kIsAntiNu([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return sr->mc.nu[0].pdg< 0;})
Is this truly an antineutrino?
Definition: TruthCuts.h:53
const Cut kIsBeamNue(CCFlavSel(12, 12))
Select CC .
const Cut kIsNC([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return!sr->mc.nu[0].iscc;})
Is this a Neutral Current event?
Definition: TruthCuts.h:8
const Cut cut
Definition: exporter_fd.C:30
const Cut kHasNu([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return true;})
Definition: TruthCuts.h:56
ana::ProportionalDecomp::ProportionalDecomp ( Loaders loaders,
const HistAxis axis,
const Cut cut,
const SystShifts shiftMC = kNoShift,
const SystShifts shiftData = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 54 of file ProportionalDecomp.cxx.

62  axis,
63  cut,
64  shiftMC,
65  shiftData,
66  wei)
67  {}
Near Detector underground.
Definition: SREnums.h:10
const Cut cut
Definition: exporter_fd.C:30
std::vector< Loaders * > loaders
Definition: syst_header.h:385
ana::ProportionalDecomp::ProportionalDecomp ( )
inlineprotected

Definition at line 72 of file ProportionalDecomp.h.

References fAntiNue, fAntiNumu, fNC, fNCAnti, fNCTot, fNue, fNumu, and fTotal.

73  : fData(0, {}, {}, 0, 0),
74  //nc
75  fNCTot (0, {}, {}, 0, 0),
76  fNC (0, {}, {}, 0, 0),
77  fNCAnti (0, {}, {}, 0, 0),
78  //end nc
79  fNue (0, {}, {}, 0, 0),
80  fAntiNue(0, {}, {}, 0, 0),
81  fNumu(0, {}, {}, 0, 0),
82  fAntiNumu(0, {}, {}, 0, 0),
83  fTotal(0, {}, {}, 0, 0)
84  {};

Member Function Documentation

Spectrum ana::ProportionalDecomp::AntiNueComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 105 of file ProportionalDecomp.cxx.

References fAntiNue, fData, and fTotal.

Spectrum ana::ProportionalDecomp::AntiNumuComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 76 of file ProportionalDecomp.cxx.

References fAntiNumu, fData, and fTotal.

Spectrum ana::ProportionalDecomp::Data_Component ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 65 of file ProportionalDecomp.h.

References dir, fData, LoadFrom(), and SaveTo().

65 {return fData;}
std::unique_ptr< ProportionalDecomp > ana::ProportionalDecomp::LoadFrom ( TDirectory *  dir)
static

Definition at line 134 of file ProportionalDecomp.cxx.

References fAntiNue, fAntiNumu, fData, fNC, fNCAnti, fNCTot, fNue, fNumu, fTotal, LOAD_SPECT, and runNovaSAM::ret.

Referenced by BlessedPlotsAna(), BlessedPlotsAnaByPeriod(), CutTableAna(), Data_Component(), ana::LoadFrom< IDecomp >(), plot_nominal_spectra(), and PlotNus17Prediction().

135  {
136  std::unique_ptr<ProportionalDecomp> ret(new ProportionalDecomp);
137 
138  // This is a lot of repetitive typing. Define a macro
139 #define LOAD_SPECT(FIELD, LABEL) assert(dir->GetDirectory(LABEL)); ret->FIELD = *Spectrum::LoadFrom(dir->GetDirectory(LABEL));
140  // nc
141  LOAD_SPECT(fNCTot, "nc_tot_comp");
142  LOAD_SPECT(fNC, "nc_comp");
143  LOAD_SPECT(fNCAnti, "nc_anti_comp");
144  //end nc
145  LOAD_SPECT(fData, "data_comp");
146  LOAD_SPECT(fNue, "nue_comp");
147  LOAD_SPECT(fAntiNue, "antinue_comp");
148  LOAD_SPECT(fNumu, "numu_comp");
149  LOAD_SPECT(fAntiNumu, "antinumu_comp");
150  LOAD_SPECT(fTotal, "total_comp");
151 
152  return ret;
153  }
#define LOAD_SPECT(FIELD, LABEL)
Spectrum ana::ProportionalDecomp::MC_AntiNueComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 60 of file ProportionalDecomp.h.

References fAntiNue.

60 {return fAntiNue;}
Spectrum ana::ProportionalDecomp::MC_AntiNumuComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 58 of file ProportionalDecomp.h.

References fAntiNumu.

58 {return fAntiNumu;}
Spectrum ana::ProportionalDecomp::MC_NCAntiComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 63 of file ProportionalDecomp.h.

References fNCAnti.

63 {return fNCAnti;}
Spectrum ana::ProportionalDecomp::MC_NCComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 62 of file ProportionalDecomp.h.

References fNC.

62 {return fNC;}
Spectrum ana::ProportionalDecomp::MC_NCTotalComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 61 of file ProportionalDecomp.h.

References fNCTot.

61 {return fNCTot;}
Spectrum ana::ProportionalDecomp::MC_NueComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 59 of file ProportionalDecomp.h.

References fNue.

59 {return fNue;}
Spectrum ana::ProportionalDecomp::MC_NumuComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 57 of file ProportionalDecomp.h.

References fNumu.

57 {return fNumu;}
Spectrum ana::ProportionalDecomp::NCAntiComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 93 of file ProportionalDecomp.cxx.

References fData, fNCAnti, and fTotal.

Spectrum ana::ProportionalDecomp::NCComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 88 of file ProportionalDecomp.cxx.

References fData, fNC, and fTotal.

Spectrum ana::ProportionalDecomp::NCTotalComponent ( ) const
overridevirtual

Reimplemented from ana::IDecomp.

Definition at line 83 of file ProportionalDecomp.cxx.

References fData, fNCTot, and fTotal.

Spectrum ana::ProportionalDecomp::NueComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 99 of file ProportionalDecomp.cxx.

References fData, fNue, and fTotal.

100  {
101  return (fNue/fTotal)*fData;
102  }
Spectrum ana::ProportionalDecomp::NumuComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 70 of file ProportionalDecomp.cxx.

References fData, fNumu, and fTotal.

void ana::ProportionalDecomp::SaveTo ( TDirectory *  dir) const
overridevirtual

Implements ana::IDecomp.

Definition at line 111 of file ProportionalDecomp.cxx.

References fAntiNue, fAntiNumu, fData, fNC, fNCAnti, fNCTot, fNue, fNumu, fTotal, ana::Spectrum::SaveTo(), and tmp.

Referenced by BlessedPlotsLoad(), CutTableLoad(), Data_Component(), make_michel(), MakeNus17Prediction(), and MakeNusPrediction().

112  {
113  TDirectory* tmp = gDirectory;
114  dir->cd();
115  TObjString("ProportionalDecomp").Write("type");
116 
117  fData.SaveTo(dir->mkdir("data_comp"));
118  //nc
119  fNCTot.SaveTo(dir->mkdir("nc_tot_comp"));
120  fNC.SaveTo(dir->mkdir("nc_comp"));
121  fNCAnti.SaveTo(dir->mkdir("nc_anti_comp"));
122  //end nc
123  fNue.SaveTo(dir->mkdir("nue_comp"));
124  fAntiNue.SaveTo(dir->mkdir("antinue_comp"));
125  fNumu.SaveTo(dir->mkdir("numu_comp"));
126  fAntiNumu.SaveTo(dir->mkdir("antinumu_comp"));
127  fTotal.SaveTo(dir->mkdir("total_comp"));
128 
129  tmp->cd();
130  }
Float_t tmp
Definition: plot.C:36
TDirectory * dir
Definition: macro.C:5
void SaveTo(TDirectory *dir) const
Definition: Spectrum.cxx:1029

Member Data Documentation

Spectrum ana::ProportionalDecomp::fAntiNue
protected
Spectrum ana::ProportionalDecomp::fAntiNumu
protected
Spectrum ana::ProportionalDecomp::fData
protected
Spectrum ana::ProportionalDecomp::fNC
protected
Spectrum ana::ProportionalDecomp::fNCAnti
protected
Spectrum ana::ProportionalDecomp::fNCTot
protected
Spectrum ana::ProportionalDecomp::fNue
protected
Spectrum ana::ProportionalDecomp::fNumu
protected
Spectrum ana::ProportionalDecomp::fTotal
protected

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