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

Uses MC for $ \nu_\mu $ CC and NC components, assigns remainder of data to $ \nu_e $ CC. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/3FlavorAna/Decomp/NueDecomp.h"

Inheritance diagram for ana::NueDecomp:
ana::IDecomp

Public Member Functions

 NueDecomp (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)
 
 NueDecomp (SpectrumLoaderBase &loaderMC, SpectrumLoaderBase &loaderData, const HistAxis &axis, const Cut &cut, const SystShifts &shiftMC=kNoShift, const SystShifts &shiftData=kNoShift, const Var &wei=kUnweighted)
 
 NueDecomp (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 Data_Component () const override
 
void SaveTo (TDirectory *dir, const std::string &name) const override
 
virtual Spectrum MC_NCTotalComponent () const
 
virtual Spectrum MC_NCComponent () const
 
virtual Spectrum MC_NCAntiComponent () const
 
virtual Spectrum MC_NumuComponent () const
 
virtual Spectrum MC_AntiNumuComponent () const
 
virtual Spectrum MC_NueComponent () const
 
virtual Spectrum MC_AntiNueComponent () const
 

Static Public Member Functions

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

Protected Member Functions

 NueDecomp ()
 

Protected Attributes

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

Detailed Description

Uses MC for $ \nu_\mu $ CC and NC components, assigns remainder of data to $ \nu_e $ CC.

Definition at line 10 of file NueDecomp.h.

Constructor & Destructor Documentation

ana::NueDecomp::NueDecomp ( 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 18 of file NueDecomp.cxx.

27  : NueDecomp(loaderMC, loaderData, HistAxis(label, bins, var),
28  cut, shiftMC, shiftData, wei)
29  {
30  }
_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::NueDecomp::NueDecomp ( 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 NueDecomp.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  fNotNue (loaderMC, axis, cut && !kIsBeamNue&& kHasNu, shiftMC, wei)
51  {
52  }
Spectrum fData
Definition: NueDecomp.h:65
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
Spectrum fNCTot
Definition: NueDecomp.h:69
Spectrum fNCAnti
Definition: NueDecomp.h:71
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 .
Spectrum fAntiNumu
Definition: NueDecomp.h:78
Spectrum fAntiNue
Definition: NueDecomp.h:75
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
Spectrum fNumu
Definition: NueDecomp.h:77
Spectrum fNue
Definition: NueDecomp.h:74
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
Spectrum fNotNue
Definition: NueDecomp.h:80
Spectrum fNC
Definition: NueDecomp.h:70
ana::NueDecomp::NueDecomp ( Loaders loaders,
const HistAxis axis,
const Cut cut,
const SystShifts shiftMC = kNoShift,
const SystShifts shiftData = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 55 of file NueDecomp.cxx.

63  axis, cut, shiftMC, shiftData, wei)
64  {
65  }
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::NueDecomp::NueDecomp ( )
inlineprotected

Definition at line 53 of file NueDecomp.h.

55  //nc
59  //end nc
65  {};
Spectrum fData
Definition: NueDecomp.h:65
Spectrum fNCTot
Definition: NueDecomp.h:69
Spectrum fNCAnti
Definition: NueDecomp.h:71
Spectrum fAntiNumu
Definition: NueDecomp.h:78
static Spectrum Uninitialized()
Definition: Spectrum.h:145
Spectrum fAntiNue
Definition: NueDecomp.h:75
Spectrum fNumu
Definition: NueDecomp.h:77
Spectrum fNue
Definition: NueDecomp.h:74
Spectrum fNotNue
Definition: NueDecomp.h:80
Spectrum fNC
Definition: NueDecomp.h:70

Member Function Documentation

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

Implements ana::IDecomp.

Definition at line 77 of file NueDecomp.cxx.

References fAntiNue, fData, fNotNue, and fNue.

Referenced by NCAntiComponent().

78  {
79  return (fAntiNue/(fNue+fAntiNue))*(fData-fNotNue);
80  }
Spectrum fData
Definition: NueDecomp.h:65
Spectrum fAntiNue
Definition: NueDecomp.h:75
Spectrum fNue
Definition: NueDecomp.h:74
Spectrum fNotNue
Definition: NueDecomp.h:80
Spectrum ana::NueDecomp::AntiNumuComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 39 of file NueDecomp.h.

References fAntiNumu.

39 {return fAntiNumu;}
Spectrum fAntiNumu
Definition: NueDecomp.h:78
Spectrum ana::NueDecomp::Data_Component ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 47 of file NueDecomp.h.

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

47 {return fData;}
Spectrum fData
Definition: NueDecomp.h:65
std::unique_ptr< NueDecomp > ana::NueDecomp::LoadFrom ( TDirectory *  dir,
const std::string name 
)
static

Definition at line 110 of file NueDecomp.cxx.

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

Referenced by Data_Component().

111  {
112  dir = dir->GetDirectory(name.c_str()); // switch to subdir
113  assert(dir);
114 
115  std::unique_ptr<NueDecomp> ret(new NueDecomp);
116 
117  // nc
118  ret->fNCTot = *Spectrum::LoadFrom(dir, "nc_tot_comp");
119  ret->fNC = *Spectrum::LoadFrom(dir, "nc_comp");
120  ret->fNCAnti = *Spectrum::LoadFrom(dir, "nc_anti_comp");
121  //end nc
122  ret->fData = *Spectrum::LoadFrom(dir, "data_comp");
123  ret->fNue = *Spectrum::LoadFrom(dir, "nue_comp");
124  ret->fAntiNue = *Spectrum::LoadFrom(dir, "antinue_comp");
125  ret->fNumu = *Spectrum::LoadFrom(dir, "numu_comp");
126  ret->fAntiNumu = *Spectrum::LoadFrom(dir, "antinumu_comp");
127  ret->fNotNue = *Spectrum::LoadFrom(dir, "notnue_comp");
128 
129  delete dir;
130 
131  return ret;
132  }
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::IDecomp::MC_AntiNueComponent ( ) const
virtualinherited

Reimplemented in ana::BENDecomp, ana::MichelDecomp, ana::FluxDecomp, ana::ProportionalDecomp, and ana::NumuDecomp.

Definition at line 46 of file IDecomp.cxx.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::GetNDCompsFromDecomp(), and ana::IDecomp::NCTotalComponent().

47  {
48  std::cout << "IDecomp: not implemented" << std::endl; abort();
49  }
OStream cout
Definition: OStream.cxx:6
Spectrum ana::IDecomp::MC_AntiNumuComponent ( ) const
virtualinherited

Reimplemented in ana::BENDecomp, ana::MichelDecomp, ana::FluxDecomp, ana::ProportionalDecomp, and ana::NumuDecomp.

Definition at line 38 of file IDecomp.cxx.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::GetNDCompsFromDecomp(), and ana::IDecomp::NCTotalComponent().

39  {
40  std::cout << "IDecomp: not implemented" << std::endl; abort();
41  }
OStream cout
Definition: OStream.cxx:6
Spectrum ana::IDecomp::MC_NCAntiComponent ( ) const
virtualinherited

Reimplemented in ana::MichelDecomp, ana::FluxDecomp, and ana::ProportionalDecomp.

Definition at line 30 of file IDecomp.cxx.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::IDecomp::NCTotalComponent().

31  {
32  std::cout << "IDecomp: not implemented" << std::endl; abort();
33  }
OStream cout
Definition: OStream.cxx:6
Spectrum ana::IDecomp::MC_NCComponent ( ) const
virtualinherited

Reimplemented in ana::MichelDecomp, ana::FluxDecomp, and ana::ProportionalDecomp.

Definition at line 26 of file IDecomp.cxx.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::IDecomp::NCTotalComponent().

27  {
28  std::cout << "IDecomp: not implemented" << std::endl; abort();
29  }
OStream cout
Definition: OStream.cxx:6
Spectrum ana::IDecomp::MC_NCTotalComponent ( ) const
virtualinherited

Reimplemented in ana::BENDecomp, ana::MichelDecomp, ana::FluxDecomp, ana::ProportionalDecomp, and ana::NumuDecomp.

Definition at line 22 of file IDecomp.cxx.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::GetNDCompsFromDecomp(), and ana::IDecomp::NCTotalComponent().

23  {
24  std::cout << "IDecomp: not implemented" << std::endl; abort();
25  }
OStream cout
Definition: OStream.cxx:6
Spectrum ana::IDecomp::MC_NueComponent ( ) const
virtualinherited

Reimplemented in ana::BENDecomp, ana::MichelDecomp, ana::FluxDecomp, ana::ProportionalDecomp, and ana::NumuDecomp.

Definition at line 42 of file IDecomp.cxx.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::GetNDCompsFromDecomp(), and ana::IDecomp::NCTotalComponent().

43  {
44  std::cout << "IDecomp: not implemented" << std::endl; abort();
45  }
OStream cout
Definition: OStream.cxx:6
Spectrum ana::IDecomp::MC_NumuComponent ( ) const
virtualinherited

Reimplemented in ana::BENDecomp, ana::MichelDecomp, ana::FluxDecomp, ana::ProportionalDecomp, and ana::NumuDecomp.

Definition at line 34 of file IDecomp.cxx.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::GetNDCompsFromDecomp(), and ana::IDecomp::NCTotalComponent().

35  {
36  std::cout << "IDecomp: not implemented" << std::endl; abort();
37  }
OStream cout
Definition: OStream.cxx:6
Spectrum ana::NueDecomp::NCAntiComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 43 of file NueDecomp.h.

References AntiNueComponent(), fNCAnti, and NueComponent().

43 {return fNCAnti;}
Spectrum fNCAnti
Definition: NueDecomp.h:71
Spectrum ana::NueDecomp::NCComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 42 of file NueDecomp.h.

References fNC.

42 {return fNC;}
Spectrum fNC
Definition: NueDecomp.h:70
Spectrum ana::NueDecomp::NCTotalComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 41 of file NueDecomp.h.

References fNCTot.

41 {return fNCTot;}
Spectrum fNCTot
Definition: NueDecomp.h:69
Spectrum ana::NueDecomp::NueComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 68 of file NueDecomp.cxx.

References fAntiNue, fData, fNotNue, and fNue.

Referenced by NCAntiComponent().

69  {
70  // Subtract backgrounds from data using MC, then split into nu/antinu
71  // components using MC ratio
72  return (fNue/(fNue+fAntiNue))*(fData-fNotNue);
73  }
Spectrum fData
Definition: NueDecomp.h:65
Spectrum fAntiNue
Definition: NueDecomp.h:75
Spectrum fNue
Definition: NueDecomp.h:74
Spectrum fNotNue
Definition: NueDecomp.h:80
Spectrum ana::NueDecomp::NumuComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 38 of file NueDecomp.h.

References fNumu.

38 {return fNumu;}
Spectrum fNumu
Definition: NueDecomp.h:77
void ana::NueDecomp::SaveTo ( TDirectory *  dir,
const std::string name 
) const
overridevirtual

Implements ana::IDecomp.

Definition at line 83 of file NueDecomp.cxx.

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

Referenced by Data_Component().

84  {
85  TDirectory* tmp = gDirectory;
86 
87  dir = dir->mkdir(name.c_str()); // switch to subdir
88  dir->cd();
89 
90  TObjString("NueDecomp").Write("type");
91  //nc
92  fNCTot.SaveTo(dir, "nc_tot_comp");
93  fNC.SaveTo(dir, "nc_comp");
94  fNCAnti.SaveTo(dir, "nc_anti_comp");
95  //end nc
96  fData.SaveTo(dir, "data_comp");
97  fNue.SaveTo(dir, "nue_comp");
98  fAntiNue.SaveTo(dir, "antinue_comp");
99  fNumu.SaveTo(dir, "numu_comp");
100  fAntiNumu.SaveTo(dir, "antinumu_comp");
101  fNotNue.SaveTo(dir, "notnue_comp");
102 
103  dir->Write();
104  delete dir;
105 
106  tmp->cd();
107  }
Spectrum fData
Definition: NueDecomp.h:65
const XML_Char * name
Definition: expat.h:151
Spectrum fNCTot
Definition: NueDecomp.h:69
Spectrum fNCAnti
Definition: NueDecomp.h:71
Float_t tmp
Definition: plot.C:36
Spectrum fAntiNumu
Definition: NueDecomp.h:78
Spectrum fAntiNue
Definition: NueDecomp.h:75
Spectrum fNumu
Definition: NueDecomp.h:77
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
Spectrum fNue
Definition: NueDecomp.h:74
TDirectory * dir
Definition: macro.C:5
Spectrum fNotNue
Definition: NueDecomp.h:80
Spectrum fNC
Definition: NueDecomp.h:70

Member Data Documentation

Spectrum ana::NueDecomp::fAntiNue
protected

Definition at line 75 of file NueDecomp.h.

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

Spectrum ana::NueDecomp::fAntiNumu
protected

Definition at line 78 of file NueDecomp.h.

Referenced by AntiNumuComponent(), and SaveTo().

Spectrum ana::NueDecomp::fData
protected

Definition at line 65 of file NueDecomp.h.

Referenced by AntiNueComponent(), Data_Component(), NueComponent(), and SaveTo().

Spectrum ana::NueDecomp::fNC
protected

Definition at line 70 of file NueDecomp.h.

Referenced by NCComponent(), and SaveTo().

Spectrum ana::NueDecomp::fNCAnti
protected

Definition at line 71 of file NueDecomp.h.

Referenced by NCAntiComponent(), and SaveTo().

Spectrum ana::NueDecomp::fNCTot
protected

Definition at line 69 of file NueDecomp.h.

Referenced by NCTotalComponent(), and SaveTo().

Spectrum ana::NueDecomp::fNotNue
protected

Definition at line 80 of file NueDecomp.h.

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

Spectrum ana::NueDecomp::fNue
protected

Definition at line 74 of file NueDecomp.h.

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

Spectrum ana::NueDecomp::fNumu
protected

Definition at line 77 of file NueDecomp.h.

Referenced by NumuComponent(), and SaveTo().


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