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

Just return the ND truth spectra as the decomposition. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-08-04/CAFAna/Decomp/CheatDecomp.h"

Inheritance diagram for ana::CheatDecomp:
ana::IDecomp

Public Member Functions

 CheatDecomp (SpectrumLoaderBase &loader, std::string label, const Binning &bins, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 CheatDecomp (SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
Spectrum NCTotalComponent () const override
 
Spectrum NCComponent () const override
 
Spectrum NCAntiComponent () const override
 
Spectrum NumuComponent () const override
 
Spectrum NueComponent () const override
 
Spectrum AntiNumuComponent () const override
 
Spectrum AntiNueComponent () const override
 
Spectrum TotalMC ()
 
void SaveTo (TDirectory *dir) const override
 
virtual Spectrum Data_Component () const
 
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< CheatDecompLoadFrom (TDirectory *dir)
 

Protected Member Functions

 CheatDecomp ()
 

Protected Attributes

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

Detailed Description

Just return the ND truth spectra as the decomposition.

Definition at line 10 of file CheatDecomp.h.

Constructor & Destructor Documentation

ana::CheatDecomp::CheatDecomp ( SpectrumLoaderBase loader,
std::string  label,
const Binning bins,
const Var var,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 14 of file CheatDecomp.cxx.

21  : CheatDecomp(loader, HistAxis(label, bins, var), cut, shift, wei)
22  {
23  }
const char * label
loader
Definition: demo0.py:10
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
GenericHistAxis< Var > HistAxis
Definition: HistAxis.h:95
ana::CheatDecomp::CheatDecomp ( SpectrumLoaderBase loader,
const HistAxis axis,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 26 of file CheatDecomp.cxx.

31  : //nc
32  fNCTot (loader, axis, cut && kIsNC, shift, wei),
33  fNC (loader, axis, cut && kIsNC && !kIsAntiNu, shift, wei),
34  fNCAnti (loader, axis, cut && kIsNC && kIsAntiNu, shift, wei),
35  //end nc
36  fNumu (loader, axis, cut && kIsNumuCC && !kIsAntiNu, shift, wei),
37  fNue (loader, axis, cut && kIsBeamNue && !kIsAntiNu, shift, wei),
38  fAntiNumu(loader, axis, cut && kIsNumuCC && kIsAntiNu, shift, wei),
39  fAntiNue (loader, axis, cut && kIsBeamNue && kIsAntiNu, shift, wei)
40  {
41  }
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 .
Spectrum fNumu
Definition: CheatDecomp.h:59
Spectrum fNCAnti
Definition: CheatDecomp.h:57
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 fAntiNumu
Definition: CheatDecomp.h:61
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
Spectrum fNCTot
Definition: CheatDecomp.h:52
Spectrum fAntiNue
Definition: CheatDecomp.h:62
ana::CheatDecomp::CheatDecomp ( )
inlineprotected

Definition at line 41 of file CheatDecomp.h.

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

42  :
43  //nc
44  fNCTot (0, {}, {}, 0, 0),
45  fNC (0, {}, {}, 0, 0),
46  fNCAnti (0, {}, {}, 0, 0),
47  //end nc
48  fNumu (0, {}, {}, 0, 0),
49  fNue (0, {}, {}, 0, 0),
50  fAntiNumu(0, {}, {}, 0, 0),
51  fAntiNue (0, {}, {}, 0, 0)
52  {};
Spectrum fNumu
Definition: CheatDecomp.h:59
Spectrum fNCAnti
Definition: CheatDecomp.h:57
Spectrum fAntiNumu
Definition: CheatDecomp.h:61
Spectrum fNCTot
Definition: CheatDecomp.h:52
Spectrum fAntiNue
Definition: CheatDecomp.h:62

Member Function Documentation

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

Implements ana::IDecomp.

Definition at line 34 of file CheatDecomp.h.

References fAntiNue.

Referenced by make_plots(), PlotSyst(), and test_beam_errorband().

34 {return fAntiNue;}
Spectrum fAntiNue
Definition: CheatDecomp.h:62
Spectrum ana::CheatDecomp::AntiNumuComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 33 of file CheatDecomp.h.

References fAntiNumu.

Referenced by make_plots(), PlotSyst(), and test_beam_errorband().

33 {return fAntiNumu;}
Spectrum fAntiNumu
Definition: CheatDecomp.h:61
Spectrum ana::IDecomp::Data_Component ( ) const
virtualinherited

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

Definition at line 25 of file IDecomp.cxx.

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

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

26  {
27  std::cout<<"IDecomp::Data_Componet() is not implemented for this class, check your Decomp"<<std::endl;
28  abort();
29  }
OStream cout
Definition: OStream.cxx:6
std::unique_ptr< CheatDecomp > ana::CheatDecomp::LoadFrom ( TDirectory *  dir)
static

Definition at line 66 of file CheatDecomp.cxx.

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

Referenced by ana::LoadFrom< IDecomp >(), make_dataMC(), NDDataMC(), NDDataMCSystBandAna(), nue_data_mc_validation(), numu_data_mc_validation(), and TotalMC().

67  {
68  std::unique_ptr<CheatDecomp> ret(new CheatDecomp);
69 
70  // This is a lot of repetitive typing. Define some macros
71 #define LOAD_SPECT(FIELD, LABEL) assert(dir->GetDirectory(LABEL)); ret->FIELD = *Spectrum::LoadFrom(dir->GetDirectory(LABEL));
72  //nc
73  LOAD_SPECT(fNCTot, "nc_tot_comp");
74  LOAD_SPECT(fNC, "nc_comp");
75  LOAD_SPECT(fNCAnti, "nc_anti_comp");
76  //end nc
77  LOAD_SPECT(fNumu, "numu_comp");
78  LOAD_SPECT(fNue, "nue_comp");
79  LOAD_SPECT(fAntiNumu, "antinumu_comp");
80  LOAD_SPECT(fAntiNue, "antinue_comp");
81 
82  return ret;
83  }
#define LOAD_SPECT(FIELD, LABEL)
Spectrum fNumu
Definition: CheatDecomp.h:59
Spectrum fNCAnti
Definition: CheatDecomp.h:57
Spectrum fAntiNumu
Definition: CheatDecomp.h:61
Spectrum fNCTot
Definition: CheatDecomp.h:52
Spectrum fAntiNue
Definition: CheatDecomp.h:62
virtual Spectrum ana::IDecomp::MC_AntiNueComponent ( ) const
inlinevirtualinherited

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

Definition at line 33 of file IDecomp.h.

References om::cout, dir, allTimeWatchdog::endl, and ana::IDecomp::SaveTo().

Referenced by ana::GetNDCompsFromDecomp().

33 {std::cout<<"IDecomp hates you."<<std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IDecomp::MC_AntiNumuComponent ( ) const
inlinevirtualinherited

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

Definition at line 31 of file IDecomp.h.

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

Referenced by ana::GetNDCompsFromDecomp().

31 {std::cout<<"IDecomp hates you."<<std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IDecomp::MC_NCAntiComponent ( ) const
inlinevirtualinherited

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

Definition at line 29 of file IDecomp.h.

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

29 {std::cout<<"IDecomp hates you."<<std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IDecomp::MC_NCComponent ( ) const
inlinevirtualinherited

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

Definition at line 28 of file IDecomp.h.

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

28 {std::cout<<"IDecomp hates you."<<std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IDecomp::MC_NCTotalComponent ( ) const
inlinevirtualinherited

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

Definition at line 27 of file IDecomp.h.

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

Referenced by ana::GetNDCompsFromDecomp().

27 {std::cout<<"IDecomp hates you."<<std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IDecomp::MC_NueComponent ( ) const
inlinevirtualinherited

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

Definition at line 32 of file IDecomp.h.

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

Referenced by ana::GetNDCompsFromDecomp().

32 {std::cout<<"IDecomp hates you."<<std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IDecomp::MC_NumuComponent ( ) const
inlinevirtualinherited

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

Definition at line 30 of file IDecomp.h.

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

Referenced by ana::GetNDCompsFromDecomp().

30 {std::cout<<"IDecomp hates you."<<std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
Spectrum ana::CheatDecomp::NCAntiComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 29 of file CheatDecomp.h.

References fNCAnti.

29 {return fNCAnti;}
Spectrum fNCAnti
Definition: CheatDecomp.h:57
Spectrum ana::CheatDecomp::NCComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 28 of file CheatDecomp.h.

References fNC.

Referenced by make_plots().

28 {return fNC;}
Spectrum ana::CheatDecomp::NCTotalComponent ( ) const
inlineoverridevirtual

Reimplemented from ana::IDecomp.

Definition at line 27 of file CheatDecomp.h.

References fNCTot.

Referenced by make_plots(), PlotSyst(), and test_beam_errorband().

27 {return fNCTot;}
Spectrum fNCTot
Definition: CheatDecomp.h:52
Spectrum ana::CheatDecomp::NueComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 32 of file CheatDecomp.h.

References fNue.

Referenced by make_plots(), PlotSyst(), and test_beam_errorband().

32 {return fNue;}
Spectrum ana::CheatDecomp::NumuComponent ( ) const
inlineoverridevirtual

Implements ana::IDecomp.

Definition at line 31 of file CheatDecomp.h.

References fNumu.

Referenced by make_plots(), PlotSyst(), and test_beam_errorband().

31 {return fNumu;}
Spectrum fNumu
Definition: CheatDecomp.h:59
void ana::CheatDecomp::SaveTo ( TDirectory *  dir) const
overridevirtual

Implements ana::IDecomp.

Definition at line 44 of file CheatDecomp.cxx.

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

Referenced by NDDataMCSystBandLoad(), test_beam_errorband(), and TotalMC().

45  {
46  TDirectory* tmp = gDirectory;
47 
48  dir->cd();
49 
50  TObjString("CheatDecomp").Write("type");
51 
52  // nc
53  fNCTot.SaveTo(dir->mkdir("nc_tot_comp"));
54  fNC.SaveTo(dir->mkdir("nc_comp"));
55  fNCAnti.SaveTo(dir->mkdir("nc_anti_comp"));
56  //end nc
57  fNumu.SaveTo(dir->mkdir("numu_comp"));
58  fNue.SaveTo(dir->mkdir("nue_comp"));
59  fAntiNumu.SaveTo(dir->mkdir("antinumu_comp"));
60  fAntiNue.SaveTo(dir->mkdir("antinue_comp"));
61 
62  tmp->cd();
63  }
Float_t tmp
Definition: plot.C:36
Spectrum fNumu
Definition: CheatDecomp.h:59
Spectrum fNCAnti
Definition: CheatDecomp.h:57
Spectrum fAntiNumu
Definition: CheatDecomp.h:61
TDirectory * dir
Definition: macro.C:5
Spectrum fNCTot
Definition: CheatDecomp.h:52
Spectrum fAntiNue
Definition: CheatDecomp.h:62
void SaveTo(TDirectory *dir) const
Definition: Spectrum.cxx:1040
Spectrum ana::CheatDecomp::TotalMC ( )
inline

Definition at line 35 of file CheatDecomp.h.

References dir, fAntiNue, fAntiNumu, fNCTot, fNue, fNumu, LoadFrom(), and SaveTo().

Spectrum fNumu
Definition: CheatDecomp.h:59
Spectrum fAntiNumu
Definition: CheatDecomp.h:61
Spectrum fNCTot
Definition: CheatDecomp.h:52
Spectrum fAntiNue
Definition: CheatDecomp.h:62

Member Data Documentation

Spectrum ana::CheatDecomp::fAntiNue
protected

Definition at line 62 of file CheatDecomp.h.

Referenced by AntiNueComponent(), CheatDecomp(), LoadFrom(), SaveTo(), and TotalMC().

Spectrum ana::CheatDecomp::fAntiNumu
protected

Definition at line 61 of file CheatDecomp.h.

Referenced by AntiNumuComponent(), CheatDecomp(), LoadFrom(), SaveTo(), and TotalMC().

Spectrum ana::CheatDecomp::fNC
protected

Definition at line 56 of file CheatDecomp.h.

Referenced by CheatDecomp(), LoadFrom(), NCComponent(), and SaveTo().

Spectrum ana::CheatDecomp::fNCAnti
protected

Definition at line 57 of file CheatDecomp.h.

Referenced by CheatDecomp(), LoadFrom(), NCAntiComponent(), and SaveTo().

Spectrum ana::CheatDecomp::fNCTot
protected

Definition at line 52 of file CheatDecomp.h.

Referenced by LoadFrom(), NCTotalComponent(), SaveTo(), and TotalMC().

Spectrum ana::CheatDecomp::fNue
protected

Definition at line 60 of file CheatDecomp.h.

Referenced by CheatDecomp(), LoadFrom(), NueComponent(), SaveTo(), and TotalMC().

Spectrum ana::CheatDecomp::fNumu
protected

Definition at line 59 of file CheatDecomp.h.

Referenced by CheatDecomp(), LoadFrom(), NumuComponent(), SaveTo(), and TotalMC().


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