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

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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-02-25/CAFAna/Decomp/NCDecomp.h"

Inheritance diagram for ana::NCDecomp:
ana::IDecomp

Public Member Functions

 NCDecomp (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)
 
 NCDecomp (SpectrumLoaderBase &loaderMC, SpectrumLoaderBase &loaderData, const HistAxis &axis, const Cut &cut, const SystShifts &shiftMC=kNoShift, const SystShifts &shiftData=kNoShift, const Var &wei=kUnweighted)
 
 NCDecomp (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< NCDecompLoadFrom (TDirectory *dir, const std::string &name)
 

Protected Member Functions

 NCDecomp ()
 

Protected Attributes

Spectrum fData
 
Spectrum fNCTot
 
Spectrum fNue
 
Spectrum fAntiNue
 
Spectrum fNumu
 
Spectrum fAntiNumu
 
Spectrum fNotNC
 

Detailed Description

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

Definition at line 10 of file NCDecomp.h.

Constructor & Destructor Documentation

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

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

40  : fData (loaderData, axis, cut, shiftData, wei),
41  fNCTot (loaderMC, axis, cut && kIsNC, shiftMC, wei),
42  fNue (loaderMC, axis, cut && kIsBeamNue&&!kIsAntiNu, shiftMC, wei),
43  fAntiNue (loaderMC, axis, cut && kIsBeamNue&& kIsAntiNu, shiftMC, wei),
44  fNumu (loaderMC, axis, cut && kIsNumuCC &&!kIsAntiNu, shiftMC, wei),
45  fAntiNumu(loaderMC, axis, cut && kIsNumuCC && kIsAntiNu, shiftMC, wei),
46  fNotNC (loaderMC, axis, cut && !kIsNC&& kHasNu, shiftMC, wei)
47  {
48  }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
Spectrum fData
Definition: NCDecomp.h:59
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 fNumu
Definition: NCDecomp.h:66
Spectrum fAntiNumu
Definition: NCDecomp.h:67
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
Spectrum fNotNC
Definition: NCDecomp.h:69
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 fNCTot
Definition: NCDecomp.h:62
Spectrum fAntiNue
Definition: NCDecomp.h:64
Spectrum fNue
Definition: NCDecomp.h:63
ana::NCDecomp::NCDecomp ( Loaders loaders,
const HistAxis axis,
const Cut cut,
const SystShifts shiftMC = kNoShift,
const SystShifts shiftData = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 51 of file NCDecomp.cxx.

59  axis, cut, shiftMC, shiftData, wei)
60  {
61  }
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::NCDecomp::NCDecomp ( )
inlineprotected

Definition at line 51 of file NCDecomp.h.

59  {};
Spectrum fData
Definition: NCDecomp.h:59
Spectrum fNumu
Definition: NCDecomp.h:66
Spectrum fAntiNumu
Definition: NCDecomp.h:67
static Spectrum Uninitialized()
Definition: Spectrum.h:145
Spectrum fNotNC
Definition: NCDecomp.h:69
Spectrum fNCTot
Definition: NCDecomp.h:62
Spectrum fAntiNue
Definition: NCDecomp.h:64
Spectrum fNue
Definition: NCDecomp.h:63

Member Function Documentation

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

Implements ana::IDecomp.

Definition at line 44 of file NCDecomp.h.

References fAntiNue.

44 {return fAntiNue;}
Spectrum fAntiNue
Definition: NCDecomp.h:64
Spectrum ana::NCDecomp::AntiNumuComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 39 of file NCDecomp.h.

References fAntiNumu, NCAntiComponent(), NCComponent(), and NCTotalComponent().

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

Reimplemented from ana::IDecomp.

Definition at line 45 of file NCDecomp.h.

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

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

Definition at line 99 of file NCDecomp.cxx.

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

Referenced by Data_Component().

100  {
101  dir = dir->GetDirectory(name.c_str()); // switch to subdir
102  assert(dir);
103 
104  std::unique_ptr<NCDecomp> ret(new NCDecomp);
105 
106  ret->fNCTot = *Spectrum::LoadFrom(dir, "nc_tot_comp");
107  ret->fData = *Spectrum::LoadFrom(dir, "data_comp");
108  ret->fNue = *Spectrum::LoadFrom(dir, "nue_comp");
109  ret->fAntiNue = *Spectrum::LoadFrom(dir, "antinue_comp");
110  ret->fNumu = *Spectrum::LoadFrom(dir, "numu_comp");
111  ret->fAntiNumu = *Spectrum::LoadFrom(dir, "antinumu_comp");
112  ret->fNotNC = *Spectrum::LoadFrom(dir, "notnc_comp");
113 
114  delete dir;
115 
116  return ret;
117  }
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::NCDecomp::NCAntiComponent ( ) const
overridevirtual

Implements ana::IDecomp.

Definition at line 72 of file NCDecomp.cxx.

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

Referenced by AntiNumuComponent().

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

Implements ana::IDecomp.

Definition at line 71 of file NCDecomp.cxx.

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

Referenced by AntiNumuComponent().

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

Reimplemented from ana::IDecomp.

Definition at line 64 of file NCDecomp.cxx.

References fData, and fNotNC.

Referenced by AntiNumuComponent().

65  {
66  // Subtract backgrounds from data using MC, then split into nu/antinu
67  // components using MC ratio
68  return fData-fNotNC;
69  }
Spectrum fData
Definition: NCDecomp.h:59
Spectrum fNotNC
Definition: NCDecomp.h:69
Spectrum ana::NCDecomp::NueComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 43 of file NCDecomp.h.

References fNue.

43 {return fNue;}
Spectrum fNue
Definition: NCDecomp.h:63
Spectrum ana::NCDecomp::NumuComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 38 of file NCDecomp.h.

References fNumu.

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

Implements ana::IDecomp.

Definition at line 76 of file NCDecomp.cxx.

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

Referenced by Data_Component().

77  {
78  TDirectory* tmp = gDirectory;
79 
80  dir = dir->mkdir(name.c_str()); // switch to subdir
81  dir->cd();
82 
83  TObjString("NCDecomp").Write("type");
84  fNCTot.SaveTo(dir, "nc_tot_comp");
85  fData.SaveTo(dir, "data_comp");
86  fNue.SaveTo(dir, "nue_comp");
87  fAntiNue.SaveTo(dir, "antinue_comp");
88  fNumu.SaveTo(dir, "numu_comp");
89  fAntiNumu.SaveTo(dir, "antinumu_comp");
90  fNotNC.SaveTo(dir, "notnc_comp");
91 
92  dir->Write();
93  delete dir;
94 
95  tmp->cd();
96  }
const XML_Char * name
Definition: expat.h:151
Spectrum fData
Definition: NCDecomp.h:59
Float_t tmp
Definition: plot.C:36
Spectrum fNumu
Definition: NCDecomp.h:66
Spectrum fAntiNumu
Definition: NCDecomp.h:67
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
Spectrum fNotNC
Definition: NCDecomp.h:69
Spectrum fNCTot
Definition: NCDecomp.h:62
TDirectory * dir
Definition: macro.C:5
Spectrum fAntiNue
Definition: NCDecomp.h:64
Spectrum fNue
Definition: NCDecomp.h:63

Member Data Documentation

Spectrum ana::NCDecomp::fAntiNue
protected

Definition at line 64 of file NCDecomp.h.

Referenced by AntiNueComponent(), and SaveTo().

Spectrum ana::NCDecomp::fAntiNumu
protected

Definition at line 67 of file NCDecomp.h.

Referenced by AntiNumuComponent(), and SaveTo().

Spectrum ana::NCDecomp::fData
protected

Definition at line 59 of file NCDecomp.h.

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

Spectrum ana::NCDecomp::fNCTot
protected

Definition at line 62 of file NCDecomp.h.

Referenced by SaveTo().

Spectrum ana::NCDecomp::fNotNC
protected

Definition at line 69 of file NCDecomp.h.

Referenced by NCTotalComponent(), and SaveTo().

Spectrum ana::NCDecomp::fNue
protected

Definition at line 63 of file NCDecomp.h.

Referenced by NueComponent(), and SaveTo().

Spectrum ana::NCDecomp::fNumu
protected

Definition at line 66 of file NCDecomp.h.

Referenced by NumuComponent(), and SaveTo().


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