FakeDecomp.h
Go to the documentation of this file.
1 //********************************************************
2 //Docdb:30405
3 //Not a real Decomp for now. As I hate to change the
4 //following Pred/Extrap frame for a flexible Type.
5 //********************************************************
6 
7 
8 #pragma once
9 
10 #include "CAFAna/Decomp/IDecomp.h"
11 
12 #include "CAFAna/Core/Loaders.h"
13 
14 namespace ana
15 {
16 
17  namespace DecompType{
19  }
20 
21  /// Uses MC for \f$ \nu_\mu \f$ CC and NC components, assigns remainder of data to \f$ \nu_e \f$ CC
22  class FakeDecomp: public IDecomp
23  {
24  public:
25 
27  SpectrumLoaderBase& loaderData,
28  const std::string& label,
29  const Binning& bins,
30  const Var& var,
31  const Cut& cut,
32  const SystShifts& shiftMC = kNoShift,
33  const SystShifts& shiftData = kNoShift,
34  const Var& wei = kUnweighted);
35 
37  SpectrumLoaderBase& loaderData,
38  const HistAxis& axis,
39  const Cut& cut,
40  const SystShifts& shiftMC = kNoShift,
41  const SystShifts& shiftData = kNoShift,
42  const Var& wei = kUnweighted);
43 
45  const HistAxis& axis,
46  const Cut& cut,
47  const SystShifts& shiftMC = kNoShift,
48  const SystShifts& shiftData = kNoShift,
49  const Var& wei = kUnweighted);
50 
51  Spectrum NumuComponent() const override;
52  Spectrum AntiNumuComponent() const override;
53  Spectrum NCTotalComponent() const override;
54  Spectrum NCComponent() const override;
55  Spectrum NCAntiComponent() const override;
56  Spectrum NueComponent() const override;
57  Spectrum AntiNueComponent() const override;
58 
59  virtual ~FakeDecomp();
60 
61  void Decompose () const;
62 
63  Spectrum Data_Component() const override {return fData;}
64  virtual Spectrum Pre_MCTotal() const{return fTotal;}
65  virtual Spectrum MCTotal() const{return NumuComponent()+AntiNumuComponent()+NCComponent()+NCAntiComponent()+NueComponent()+AntiNueComponent();}
66  virtual Spectrum Pre_NumuComponent() const{return fNumu;}
67  virtual Spectrum Pre_AntiNumuComponent() const{return fAntiNumu;}
68  virtual Spectrum Pre_NCTotalComponent() const{return fNCTot;}
69  virtual Spectrum Pre_NCComponent() const{return fNC;}
70  virtual Spectrum Pre_NCAntiComponent() const{return fNCAnti;}
71  virtual Spectrum Pre_NueComponent() const{return fNue;}
72  virtual Spectrum Pre_AntiNueComponent() const{return fAntiNue;}
73 
74  void SaveTo(TDirectory* dir, const std::string& name) const override;
75  void SetType(DecompType::Type type) const;
76 
77  static std::unique_ptr<FakeDecomp> LoadFrom(TDirectory* dir, const std::string& name);
78 
79  protected:
81  : fData(Spectrum::Uninitialized()),
82  fTotal(Spectrum::Uninitialized()),
83  fNCTot (Spectrum::Uninitialized()),
84  fNC (Spectrum::Uninitialized()),
85  fNCAnti (Spectrum::Uninitialized()),
86  fNue (Spectrum::Uninitialized()),
87  fAntiNue(Spectrum::Uninitialized()),
88  fNumu(Spectrum::Uninitialized()),
89  fAntiNumu(Spectrum::Uninitialized()),
90  fIsDecomposed(0)
91  {};
92 
95 
99 
102 
105 
106 // 1 ***********
108  mutable bool fIsSet = false;
109 // *************
110 
111 // 2 ***********
112 // mutable DecompType::Type fType = DecompType::Type::kAntiNue;
113 // mutable bool fIsSet = true;
114 //**************
115  mutable bool fIsDecomposed = false;
116  mutable std::vector<Spectrum*> fDiff;
117 
118 // mutable Spectrum fSpecCache;
119 
120  };
121 }
virtual Spectrum Pre_AntiNueComponent() const
Definition: FakeDecomp.h:72
const XML_Char * name
Definition: expat.h:151
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
virtual Spectrum MCTotal() const
Definition: FakeDecomp.h:65
void SaveTo(const osc::IOscCalc &x, TDirectory *dir, const std::string &name)
Spectrum fNC
Definition: FakeDecomp.h:97
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
Spectrum fNumu
Definition: FakeDecomp.h:103
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
Spectrum fNCTot
Definition: FakeDecomp.h:96
Spectrum fNCAnti
Definition: FakeDecomp.h:98
virtual Spectrum Pre_MCTotal() const
Definition: FakeDecomp.h:64
virtual Spectrum Pre_NumuComponent() const
Definition: FakeDecomp.h:66
virtual Spectrum Pre_NCTotalComponent() const
Definition: FakeDecomp.h:68
virtual Spectrum Pre_NCAntiComponent() const
Definition: FakeDecomp.h:70
std::unique_ptr< T > LoadFrom(TDirectory *dir, const std::string &label)
Definition: LoadFromFile.h:17
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const char * label
Spectrum fAntiNumu
Definition: FakeDecomp.h:104
Uses MC for CC and NC components, assigns remainder of data to CC.
Definition: FakeDecomp.h:22
Spectrum fData
Definition: FakeDecomp.h:91
std::vector< Spectrum * > fDiff
Definition: FakeDecomp.h:116
virtual Spectrum Pre_NueComponent() const
Definition: FakeDecomp.h:71
virtual Spectrum Pre_NCComponent() const
Definition: FakeDecomp.h:69
const SystShifts kNoShift
Definition: SystShifts.cxx:22
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
Spectrum fAntiNue
Definition: FakeDecomp.h:101
TDirectory * dir
Definition: macro.C:5
virtual Spectrum Pre_AntiNumuComponent() const
Definition: FakeDecomp.h:67
std::vector< Loaders * > loaders
Definition: syst_header.h:386
Spectrum Data_Component() const override
Definition: FakeDecomp.h:63
Standard interface to all decomposition techniques.
Definition: IDecomp.h:13
float fNC[pidBins]
Spectrum fNue
Definition: FakeDecomp.h:100
Spectrum fTotal
Definition: FakeDecomp.h:94
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
Definition: Var.h:96
enum BeamMode string