ProportionalDecomp.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Cut.h"
4 #include "CAFAna/Core/HistAxis.h"
6 #include "CAFAna/Core/Spectrum.h"
7 #include <memory>
8 #include <string>
9 
10 class TDirectory;
11 
12 namespace ana
13 {
14 
15  class Binning;
16  class Loaders;
17  class SpectrumLoaderBase;
18 
19  /// Splits Data proportionally according to MC
21  {
22 
23  public:
25  SpectrumLoaderBase& loaderData,
26  const std::string& label,
27  const Binning& bins,
28  const Var& var,
29  const Cut& cut,
30  const SystShifts& shiftMC = kNoShift,
31  const SystShifts& shiftData = kNoShift,
32  const Var& wei = kUnweighted);
33 
35  SpectrumLoaderBase& loaderData,
36  const HistAxis& axis,
37  const Cut& cut,
38  const SystShifts& shiftMC = kNoShift,
39  const SystShifts& shiftData = kNoShift,
40  const Var& wei = kUnweighted);
41 
43  const HistAxis& axis,
44  const Cut& cut,
45  const SystShifts& shiftMC = kNoShift,
46  const SystShifts& shiftData = kNoShift,
47  const Var& wei = kUnweighted);
48 
49  Spectrum NumuComponent() const override;
50  Spectrum AntiNumuComponent() const override;
51  Spectrum NCTotalComponent() const override;
52  Spectrum NCComponent() const override;
53  Spectrum NCAntiComponent() const override;
54  Spectrum NueComponent() const override;
55  Spectrum AntiNueComponent() const override;
56 
57  Spectrum MC_NumuComponent() const override{return fNumu;}
58  Spectrum MC_AntiNumuComponent() const override{return fAntiNumu;}
59  Spectrum MC_NueComponent() const override{return fNue;}
60  Spectrum MC_AntiNueComponent() const override{return fAntiNue;}
61  Spectrum MC_NCTotalComponent() const override{return fNCTot;}
62  Spectrum MC_NCComponent() const override{return fNC;}
63  Spectrum MC_NCAntiComponent() const override{return fNCAnti;}
64 
65  Spectrum Data_Component() const override{return fData;}
66 
67 
68  void SaveTo(TDirectory* dir, const std::string& name) const override;
69  static std::unique_ptr<ProportionalDecomp> LoadFrom(TDirectory* dir, const std::string& name);
70 
71  protected:
73  : fData(Spectrum::Uninitialized()),
74  //nc
75  fNCTot (Spectrum::Uninitialized()),
76  fNC (Spectrum::Uninitialized()),
77  fNCAnti (Spectrum::Uninitialized()),
78  //end nc
79  fNue (Spectrum::Uninitialized()),
80  fAntiNue(Spectrum::Uninitialized()),
81  fNumu(Spectrum::Uninitialized()),
82  fAntiNumu(Spectrum::Uninitialized()),
83  fTotal(Spectrum::Uninitialized())
84  {};
85 
87  //nc
91  //end nc
97 
98  };
99 
100 }
const XML_Char * name
Definition: expat.h:151
Spectrum AntiNueComponent() const override
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
Spectrum Data_Component() const override
Spectrum NCAntiComponent() const override
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
Spectrum MC_NueComponent() const override
static std::unique_ptr< ProportionalDecomp > LoadFrom(TDirectory *dir, const std::string &name)
Spectrum MC_AntiNueComponent() const override
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const char * label
Spectrum MC_AntiNumuComponent() const override
Spectrum MC_NumuComponent() const override
Spectrum AntiNumuComponent() const override
Spectrum MC_NCAntiComponent() const override
Spectrum MC_NCTotalComponent() const override
const SystShifts kNoShift
Definition: SystShifts.cxx:22
void SaveTo(TDirectory *dir, const std::string &name) const override
Base class for the various types of spectrum loader.
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
Splits Data proportionally according to MC.
TDirectory * dir
Definition: macro.C:5
Spectrum NCTotalComponent() const override
std::vector< Loaders * > loaders
Definition: syst_header.h:386
Spectrum NumuComponent() const override
Standard interface to all decomposition techniques.
Definition: IDecomp.h:13
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
Definition: Var.h:96
Spectrum NCComponent() const override
Spectrum MC_NCComponent() const override
Spectrum NueComponent() const override
enum BeamMode string