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/N20-12-03/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 std::string &name) const override
 

Static Public Member Functions

static std::unique_ptr< ProportionalDecompLoadFrom (TDirectory *dir, const std::string &name)
 

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 17 of file ProportionalDecomp.cxx.

26  : ProportionalDecomp(loaderMC,
27  loaderData,
29  cut,
30  shiftMC,
31  shiftData,
32  wei)
33  {}
_HistAxis< Var > HistAxis
Definition: HistAxis.h:103
const char * label
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
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 36 of file ProportionalDecomp.cxx.

43  : fData (loaderData, axis, cut, shiftData, wei),
44  // nc
45  fNCTot (loaderMC, axis, cut && kIsNC, shiftMC, wei),
46  fNC (loaderMC, axis, cut && kIsNC && !kIsAntiNu, shiftMC, wei),
47  fNCAnti (loaderMC, axis, cut && kIsNC && kIsAntiNu, shiftMC, wei),
48  //end nc
49  fNue (loaderMC, axis, cut && kIsBeamNue&&!kIsAntiNu, shiftMC, wei),
50  fAntiNue (loaderMC, axis, cut && kIsBeamNue&& kIsAntiNu, shiftMC, wei),
51  fNumu (loaderMC, axis, cut && kIsNumuCC &&!kIsAntiNu, shiftMC, wei),
52  fAntiNumu(loaderMC, axis, cut && kIsNumuCC && kIsAntiNu, shiftMC, wei),
53  fTotal (loaderMC, axis, cut && kHasNu, shiftMC, wei)
54  {}
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 57 of file ProportionalDecomp.cxx.

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

Member Function Documentation

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

Implements ana::IDecomp.

Definition at line 108 of file ProportionalDecomp.cxx.

References fAntiNue, fData, and fTotal.

Referenced by nue_decomp_scales_for_make_decomp().

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

Implements ana::IDecomp.

Definition at line 79 of file ProportionalDecomp.cxx.

References fAntiNumu, fData, and fTotal.

Referenced by nue_decomp_scales_for_make_decomp().

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

Reimplemented from ana::IDecomp.

Definition at line 65 of file ProportionalDecomp.h.

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

Referenced by nue_decomp_scales_for_make_decomp().

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

Definition at line 143 of file ProportionalDecomp.cxx.

References ana::assert(), dir, ana::Spectrum::LoadFrom(), and runNovaSAM::ret.

Referenced by BlessedPlotsAna(), BlessedPlotsAnaByPeriod(), CutTableAna(), Data_Component(), plot_nominal_spectra(), and PlotNus17Prediction().

144  {
145  dir = dir->GetDirectory(name.c_str()); // switch to subdir
146  assert(dir);
147 
148  std::unique_ptr<ProportionalDecomp> ret(new ProportionalDecomp);
149 
150  // nc
151  ret->fNCTot = *Spectrum::LoadFrom(dir, "nc_tot_comp");
152  ret->fNC = *Spectrum::LoadFrom(dir, "nc_comp");
153  ret->fNCAnti = *Spectrum::LoadFrom(dir, "nc_anti_comp");
154  //end nc
155  ret->fData = *Spectrum::LoadFrom(dir, "data_comp");
156  ret->fNue = *Spectrum::LoadFrom(dir, "nue_comp");
157  ret->fAntiNue = *Spectrum::LoadFrom(dir, "antinue_comp");
158  ret->fNumu = *Spectrum::LoadFrom(dir, "numu_comp");
159  ret->fAntiNumu = *Spectrum::LoadFrom(dir, "antinumu_comp");
160  ret->fTotal = *Spectrum::LoadFrom(dir, "total_comp");
161 
162  delete dir;
163 
164  return ret;
165  }
const XML_Char * name
Definition: expat.h:151
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Spectrum.cxx:535
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
Spectrum ana::ProportionalDecomp::MC_AntiNueComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 60 of file ProportionalDecomp.h.

References fAntiNue.

Referenced by nue_decomp_scales_for_make_decomp().

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

Reimplemented from ana::IDecomp.

Definition at line 58 of file ProportionalDecomp.h.

References fAntiNumu.

Referenced by nue_decomp_scales_for_make_decomp().

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.

Referenced by nue_decomp_scales_for_make_decomp().

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.

Referenced by nue_decomp_scales_for_make_decomp().

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

Reimplemented from ana::IDecomp.

Definition at line 57 of file ProportionalDecomp.h.

References fNumu.

Referenced by nue_decomp_scales_for_make_decomp().

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

Implements ana::IDecomp.

Definition at line 96 of file ProportionalDecomp.cxx.

References fData, fNCAnti, and fTotal.

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

Implements ana::IDecomp.

Definition at line 91 of file ProportionalDecomp.cxx.

References fData, fNC, and fTotal.

Referenced by nue_decomp_scales_for_make_decomp().

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

Reimplemented from ana::IDecomp.

Definition at line 86 of file ProportionalDecomp.cxx.

References fData, fNCTot, and fTotal.

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

Implements ana::IDecomp.

Definition at line 102 of file ProportionalDecomp.cxx.

References fData, fNue, and fTotal.

Referenced by nue_decomp_scales_for_make_decomp().

103  {
104  return (fNue/fTotal)*fData;
105  }
Spectrum ana::ProportionalDecomp::NumuComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 73 of file ProportionalDecomp.cxx.

References fData, fNumu, and fTotal.

Referenced by nue_decomp_scales_for_make_decomp().

void ana::ProportionalDecomp::SaveTo ( TDirectory *  dir,
const std::string name 
) const
overridevirtual

Implements ana::IDecomp.

Definition at line 114 of file ProportionalDecomp.cxx.

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

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

115  {
116  TDirectory* tmp = gDirectory;
117 
118  dir = dir->mkdir(name.c_str()); // switch to subdir
119  dir->cd();
120 
121  TObjString("ProportionalDecomp").Write("type");
122 
123  fData.SaveTo(dir, "data_comp");
124  //nc
125  fNCTot.SaveTo(dir, "nc_tot_comp");
126  fNC.SaveTo(dir, "nc_comp");
127  fNCAnti.SaveTo(dir, "nc_anti_comp");
128  //end nc
129  fNue.SaveTo(dir, "nue_comp");
130  fAntiNue.SaveTo(dir, "antinue_comp");
131  fNumu.SaveTo(dir, "numu_comp");
132  fAntiNumu.SaveTo(dir, "antinumu_comp");
133  fTotal.SaveTo(dir, "total_comp");
134 
135  dir->Write();
136  delete dir;
137 
138  tmp->cd();
139  }
const XML_Char * name
Definition: expat.h:151
Float_t tmp
Definition: plot.C:36
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
TDirectory * dir
Definition: macro.C:5

Member Data Documentation

Spectrum ana::ProportionalDecomp::fAntiNue
protected

Definition at line 93 of file ProportionalDecomp.h.

Referenced by AntiNueComponent(), MC_AntiNueComponent(), and SaveTo().

Spectrum ana::ProportionalDecomp::fAntiNumu
protected

Definition at line 95 of file ProportionalDecomp.h.

Referenced by AntiNumuComponent(), MC_AntiNumuComponent(), and SaveTo().

Spectrum ana::ProportionalDecomp::fData
protected
Spectrum ana::ProportionalDecomp::fNC
protected

Definition at line 89 of file ProportionalDecomp.h.

Referenced by MC_NCComponent(), NCComponent(), and SaveTo().

Spectrum ana::ProportionalDecomp::fNCAnti
protected

Definition at line 90 of file ProportionalDecomp.h.

Referenced by MC_NCAntiComponent(), NCAntiComponent(), and SaveTo().

Spectrum ana::ProportionalDecomp::fNCTot
protected

Definition at line 88 of file ProportionalDecomp.h.

Referenced by MC_NCTotalComponent(), NCTotalComponent(), and SaveTo().

Spectrum ana::ProportionalDecomp::fNue
protected

Definition at line 92 of file ProportionalDecomp.h.

Referenced by MC_NueComponent(), NueComponent(), and SaveTo().

Spectrum ana::ProportionalDecomp::fNumu
protected

Definition at line 94 of file ProportionalDecomp.h.

Referenced by MC_NumuComponent(), NumuComponent(), and SaveTo().

Spectrum ana::ProportionalDecomp::fTotal
protected

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