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

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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-01/3FlavorAna/Decomp/NumuDecomp.h"

Inheritance diagram for ana::NumuDecomp:
ana::IDecomp

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

 NumuDecomp ()
 

Protected Attributes

Spectrum fData
 
Spectrum fNCTot
 
Spectrum fNue
 
Spectrum fAntiNue
 
Spectrum fNumu
 
Spectrum fAntiNumu
 
Spectrum fNotNumu
 

Detailed Description

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

Definition at line 10 of file NumuDecomp.h.

Constructor & Destructor Documentation

ana::NumuDecomp::NumuDecomp ( 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 NumuDecomp.cxx.

27  : NumuDecomp(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::NumuDecomp::NumuDecomp ( 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 NumuDecomp.cxx.

40  : fData (loaderData, axis, cut, shiftData, wei),
41  //nc
42  fNCTot (loaderMC, axis, cut && kIsNC, shiftMC, wei),
43  //end nc
44  fNue (loaderMC, axis, cut && kIsBeamNue&&!kIsAntiNu, shiftMC, wei),
45  fAntiNue (loaderMC, axis, cut && kIsBeamNue&& kIsAntiNu, shiftMC, wei),
46  fNumu (loaderMC, axis, cut && kIsNumuCC &&!kIsAntiNu, shiftMC, wei),
47  fAntiNumu(loaderMC, axis, cut && kIsNumuCC && kIsAntiNu, shiftMC, wei),
48  fNotNumu (loaderMC, axis, cut && !kIsNumuCC&& kHasNu, shiftMC, wei)
49  {
50  }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
Spectrum fAntiNumu
Definition: NumuDecomp.h:74
Spectrum fData
Definition: NumuDecomp.h:66
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 fAntiNue
Definition: NumuDecomp.h:71
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 fNCTot
Definition: NumuDecomp.h:69
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 fNotNumu
Definition: NumuDecomp.h:76
Spectrum fNue
Definition: NumuDecomp.h:70
Spectrum fNumu
Definition: NumuDecomp.h:73
ana::NumuDecomp::NumuDecomp ( Loaders loaders,
const HistAxis axis,
const Cut cut,
const SystShifts shiftMC = kNoShift,
const SystShifts shiftData = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 53 of file NumuDecomp.cxx.

61  axis, cut, shiftMC, shiftData, wei)
62  {
63  }
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::NumuDecomp::NumuDecomp ( )
inlineprotected

Definition at line 58 of file NumuDecomp.h.

Member Function Documentation

Spectrum ana::NumuDecomp::AntiNueComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 44 of file NumuDecomp.h.

References fAntiNue.

44 {return fAntiNue;}
Spectrum fAntiNue
Definition: NumuDecomp.h:71
Spectrum ana::NumuDecomp::AntiNumuComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 74 of file NumuDecomp.cxx.

References fAntiNumu, fData, fNotNumu, and fNumu.

75  {
76  return (fAntiNumu/(fNumu+fAntiNumu))*(fData-fNotNumu);
77  }
Spectrum fAntiNumu
Definition: NumuDecomp.h:74
Spectrum fData
Definition: NumuDecomp.h:66
Spectrum fNotNumu
Definition: NumuDecomp.h:76
Spectrum fNumu
Definition: NumuDecomp.h:73
Spectrum ana::NumuDecomp::Data_Component ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 52 of file NumuDecomp.h.

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

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

Definition at line 108 of file NumuDecomp.cxx.

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

Referenced by Data_Component().

109  {
110  dir = dir->GetDirectory(name.c_str()); // switch to subdir
111  assert(dir);
112 
113  std::unique_ptr<NumuDecomp> ret(new NumuDecomp);
114 
115  ret->fNCTot = *Spectrum::LoadFrom(dir, "nc_tot_comp");
116  ret->fData = *Spectrum::LoadFrom(dir, "data_comp");
117  ret->fNue = *Spectrum::LoadFrom(dir, "nue_comp");
118  ret->fAntiNue = *Spectrum::LoadFrom(dir, "antinue_comp");
119  ret->fNumu = *Spectrum::LoadFrom(dir, "numu_comp");
120  ret->fAntiNumu = *Spectrum::LoadFrom(dir, "antinumu_comp");
121  ret->fNotNumu = *Spectrum::LoadFrom(dir, "notnumu_comp");
122 
123  delete dir;
124 
125  return ret;
126  }
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::NumuDecomp::MC_AntiNueComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 49 of file NumuDecomp.h.

References fAntiNue.

49 {return fAntiNue;}
Spectrum fAntiNue
Definition: NumuDecomp.h:71
Spectrum ana::NumuDecomp::MC_AntiNumuComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 47 of file NumuDecomp.h.

References fAntiNumu.

47 {return fAntiNumu;}
Spectrum fAntiNumu
Definition: NumuDecomp.h:74
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::NumuDecomp::MC_NCTotalComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 50 of file NumuDecomp.h.

References fNCTot.

50 {return fNCTot;}
Spectrum fNCTot
Definition: NumuDecomp.h:69
Spectrum ana::NumuDecomp::MC_NueComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 48 of file NumuDecomp.h.

References fNue.

48 {return fNue;}
Spectrum fNue
Definition: NumuDecomp.h:70
Spectrum ana::NumuDecomp::MC_NumuComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 46 of file NumuDecomp.h.

References fNumu.

46 {return fNumu;}
Spectrum fNumu
Definition: NumuDecomp.h:73
Spectrum ana::NumuDecomp::NCAntiComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 81 of file NumuDecomp.cxx.

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

Referenced by NCTotalComponent().

81 {std::cout << "NumuDecomp::NCAntiComponent() not implemented" << std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
Spectrum ana::NumuDecomp::NCComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 80 of file NumuDecomp.cxx.

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

Referenced by NCTotalComponent().

80 {std::cout << "NumuDecomp::NCComponent() not implemented" <<std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
Spectrum ana::NumuDecomp::NCTotalComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 40 of file NumuDecomp.h.

References fNCTot, NCAntiComponent(), and NCComponent().

40 {return fNCTot;}
Spectrum fNCTot
Definition: NumuDecomp.h:69
Spectrum ana::NumuDecomp::NueComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 43 of file NumuDecomp.h.

References fNue.

43 {return fNue;}
Spectrum fNue
Definition: NumuDecomp.h:70
Spectrum ana::NumuDecomp::NumuComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 66 of file NumuDecomp.cxx.

References fAntiNumu, fData, fNotNumu, and fNumu.

67  {
68  // Subtract backgrounds from data using MC, then split into nu/antinu
69  // components using MC ratio
70  return (fNumu/(fNumu+fAntiNumu))*(fData-fNotNumu);
71  }
Spectrum fAntiNumu
Definition: NumuDecomp.h:74
Spectrum fData
Definition: NumuDecomp.h:66
Spectrum fNotNumu
Definition: NumuDecomp.h:76
Spectrum fNumu
Definition: NumuDecomp.h:73
void ana::NumuDecomp::SaveTo ( TDirectory *  dir,
const std::string name 
) const
overridevirtual

Implements ana::IDecomp.

Definition at line 84 of file NumuDecomp.cxx.

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

Referenced by Data_Component().

85  {
86  TDirectory* tmp = gDirectory;
87 
88  dir = dir->mkdir(name.c_str()); // switch to subdir
89  dir->cd();
90 
91  TObjString("NumuDecomp").Write("type");
92 
93  fNCTot.SaveTo(dir, "nc_tot_comp");
94  fData.SaveTo(dir, "data_comp");
95  fNue.SaveTo(dir, "nue_comp");
96  fAntiNue.SaveTo(dir, "antinue_comp");
97  fNumu.SaveTo(dir, "numu_comp");
98  fAntiNumu.SaveTo(dir, "antinumu_comp");
99  fNotNumu.SaveTo(dir, "notnumu_comp");
100 
101  dir->Write();
102  delete dir;
103 
104  tmp->cd();
105  }
const XML_Char * name
Definition: expat.h:151
Spectrum fAntiNumu
Definition: NumuDecomp.h:74
Spectrum fData
Definition: NumuDecomp.h:66
Float_t tmp
Definition: plot.C:36
Spectrum fAntiNue
Definition: NumuDecomp.h:71
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
Spectrum fNCTot
Definition: NumuDecomp.h:69
TDirectory * dir
Definition: macro.C:5
Spectrum fNotNumu
Definition: NumuDecomp.h:76
Spectrum fNue
Definition: NumuDecomp.h:70
Spectrum fNumu
Definition: NumuDecomp.h:73

Member Data Documentation

Spectrum ana::NumuDecomp::fAntiNue
protected

Definition at line 71 of file NumuDecomp.h.

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

Spectrum ana::NumuDecomp::fAntiNumu
protected

Definition at line 74 of file NumuDecomp.h.

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

Spectrum ana::NumuDecomp::fData
protected

Definition at line 66 of file NumuDecomp.h.

Referenced by AntiNumuComponent(), Data_Component(), NumuComponent(), and SaveTo().

Spectrum ana::NumuDecomp::fNCTot
protected

Definition at line 69 of file NumuDecomp.h.

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

Spectrum ana::NumuDecomp::fNotNumu
protected

Definition at line 76 of file NumuDecomp.h.

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

Spectrum ana::NumuDecomp::fNue
protected

Definition at line 70 of file NumuDecomp.h.

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

Spectrum ana::NumuDecomp::fNumu
protected

Definition at line 73 of file NumuDecomp.h.

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


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