ModularExtrap.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/HistAxis.h"
6 #include <memory>
7 
8 class TDirectory;
9 
10 namespace ana
11 {
12 
13  class Loaders;
14  class SpectrumLoaderBase;
15  class IDecomp;
16  class OscillatableSpectrum;
17  class FluxDecomp;
18 
19  /// \brief Extrapolate each component using a separate ModularExtrapComponent
20  ///
21  /// This class is not constructable directly. Use one of its subclasses.
22  /// N.b.: only extrapolates one sample.
23  class ModularExtrap: public IExtrap
24  {
25 
26  public:
27 
28  // Prevent copying because we own objects on the free store.
29  ModularExtrap(const ModularExtrap&) = delete;
30  ModularExtrap& operator=(const ModularExtrap&) = delete;
31  ModularExtrap(ModularExtrap&&) = default;
33  virtual ~ModularExtrap() = default;
34 
35  void SaveTo(TDirectory* dir, const std::string& name) const override;
36  void SavePlotsNue( TDirectory* dir, double potFD ) const;
37  void SavePlotsNueRHC( TDirectory* dir, double potFD ) const;
38  void SavePlotsNumu( TDirectory* dir, double potFD ) const;
39  static std::unique_ptr<ModularExtrap> LoadFrom(TDirectory* dir, const std::string& name);
40 
41  // Override abstract methods.
54  // nc:
55  Spectrum NCTotalComponent() override;
56  Spectrum NCComponent() override;
57  Spectrum NCAntiComponent() override;
58  //end nc
59 
60  std::vector<ModularExtrapComponent*> GetModExtrapComponents() const
61  {
62  return {
63  fEEextrap.get(), fEEAntiextrap.get(),
64  fMMextrap.get(), fMMAntiextrap.get(),
65  fMEextrap.get(), fMEAntiextrap.get(),
66  fEMextrap.get(), fEMAntiextrap.get(),
67  //nc
68  fNCTotalextrap.get(), fNCextrap.get(), fNCAntiextrap.get(),
69  //end nc
70  fMTextrap.get(), fMTAntiextrap.get(),
71  fETextrap.get(), fETAntiextrap.get()
72  };
73  }
74 
75  protected:
76 
77  /// Sets up all components to use FD MC--internal use only.
78  /// Use a derived class to create a ModularExtrap.
79  /// This function is protected.
81  SpectrumLoaderBase& farMCswapLoader,
82  SpectrumLoaderBase& farMCnonswapLoader,
83  SpectrumLoaderBase& farMCtauswapLoader,
84  const HistAxis& axis,
85  const Cut& fdcut,
86  const SystShifts& shiftMC,
87  const Var& weight
88  );
89 
90  std::unique_ptr<ModularExtrapComponent> fEEextrap;
91  std::unique_ptr<ModularExtrapComponent> fEEAntiextrap;
92  std::unique_ptr<ModularExtrapComponent> fMMextrap;
93  std::unique_ptr<ModularExtrapComponent> fMMAntiextrap;
94  std::unique_ptr<ModularExtrapComponent> fMEextrap;
95  std::unique_ptr<ModularExtrapComponent> fMEAntiextrap;
96  std::unique_ptr<ModularExtrapComponent> fEMextrap;
97  std::unique_ptr<ModularExtrapComponent> fEMAntiextrap;
98  //nc
99  std::unique_ptr<ModularExtrapComponent> fNCTotalextrap;
100  std::unique_ptr<ModularExtrapComponent> fNCextrap;
101  std::unique_ptr<ModularExtrapComponent> fNCAntiextrap;
102  //end nc
103  std::unique_ptr<ModularExtrapComponent> fMTextrap;
104  std::unique_ptr<ModularExtrapComponent> fMTAntiextrap;
105  std::unique_ptr<ModularExtrapComponent> fETextrap;
106  std::unique_ptr<ModularExtrapComponent> fETAntiextrap;
107 
108  private:
109 
111 
112  };
113 
114 }
OscillatableSpectrum AntiTauFromEComponent() override
Charged current tau antineutrino appearance from electron antineutrino ( )
const XML_Char * name
Definition: expat.h:151
OscillatableSpectrum NueAppComponent() override
Charged current electron neutrino appearance ( )
std::unique_ptr< ModularExtrapComponent > fMMextrap
Definition: ModularExtrap.h:92
void SaveTo(TDirectory *dir, const std::string &name) const override
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var weight
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
Spectrum NCTotalComponent() override
Neutral currents.
std::unique_ptr< ModularExtrapComponent > fMEextrap
Definition: ModularExtrap.h:94
OscillatableSpectrum AntiNueSurvComponent() override
Charged current electron antineutrino survival ( )
void SavePlotsNueRHC(TDirectory *dir, double potFD) const
std::unique_ptr< ModularExtrapComponent > fEMAntiextrap
Definition: ModularExtrap.h:97
OscillatableSpectrum TauFromMuComponent() override
Charged current tau neutrino appearance from muon neutrino ( )
OscillatableSpectrum NumuSurvComponent() override
Charged current muon neutrino survival ( )
void SavePlotsNue(TDirectory *dir, double potFD) const
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
std::unique_ptr< ModularExtrapComponent > fNCextrap
std::unique_ptr< ModularExtrapComponent > fMTAntiextrap
std::unique_ptr< ModularExtrapComponent > fNCTotalextrap
Definition: ModularExtrap.h:99
std::unique_ptr< ModularExtrapComponent > fMEAntiextrap
Definition: ModularExtrap.h:95
OscillatableSpectrum NueSurvComponent() override
Charged current electron neutrino survival ( )
void SavePlotsNumu(TDirectory *dir, double potFD) const
ModularExtrap & operator=(const ModularExtrap &)=delete
std::vector< ModularExtrapComponent * > GetModExtrapComponents() const
Definition: ModularExtrap.h:60
OscillatableSpectrum AntiNumuSurvComponent() override
Charged current muon antineutrino survival ( )
std::unique_ptr< ModularExtrapComponent > fEMextrap
Definition: ModularExtrap.h:96
std::unique_ptr< ModularExtrapComponent > fEEAntiextrap
Definition: ModularExtrap.h:91
static std::unique_ptr< ModularExtrap > LoadFrom(TDirectory *dir, const std::string &name)
OscillatableSpectrum NumuAppComponent() override
Charged current muon neutrino appearance ( )
Base class for the various types of spectrum loader.
std::unique_ptr< ModularExtrapComponent > fNCAntiextrap
OscillatableSpectrum TauFromEComponent() override
Charged current tau neutrino appearance from electron neutrino ( )
OscillatableSpectrum AntiTauFromMuComponent() override
Charged current tau antineutrino appearance from muon antineutrino ( )
std::unique_ptr< ModularExtrapComponent > fMMAntiextrap
Definition: ModularExtrap.h:93
Interface to extrapolation procedures.
Definition: IExtrap.h:8
TDirectory * dir
Definition: macro.C:5
Spectrum NCAntiComponent() override
Spectrum NCComponent() override
OscillatableSpectrum AntiNumuAppComponent() override
Charged current muon antineutrino appearance ( )
OscillatableSpectrum AntiNueAppComponent() override
Charged current electron antineutrino appearance ( )
std::unique_ptr< ModularExtrapComponent > fETAntiextrap
Spectrum with true energy information, allowing it to be oscillated
Extrapolate each component using a separate ModularExtrapComponent.
Definition: ModularExtrap.h:23
std::unique_ptr< ModularExtrapComponent > fEEextrap
Definition: ModularExtrap.h:90
std::unique_ptr< ModularExtrapComponent > fMTextrap
std::unique_ptr< ModularExtrapComponent > fETextrap
virtual ~ModularExtrap()=default
enum BeamMode string