Public Member Functions | Protected Attributes | List of all members
PredictionHandler Class Referenceabstract

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-04-09/NuXAna/macros/Nus20/Selection/PredictionHandler.h"

Inheritance diagram for PredictionHandler:
FDPredictionHandler NDPredictionHandler

Public Member Functions

 PredictionHandler (std::string predOpt, bool isData=false, Loaders *loaders=nullptr)
 
virtual ~PredictionHandler ()
 
virtual void AddVar (std::string name, HistAxis axis, Cut cuts, SystShifts shift, Var weight, bool cutdata=true)=0
 
virtual void AddVar (std::string name, std::string label, Var var, Binning binning, Cut cuts, SystShifts shift, Var weight, bool cutdata=true)=0
 
virtual void AddVar (std::string name, std::string labelx, std::string labely, Var varx, Var vary, Binning binningx, Binning binningy, Cut cuts, SystShifts shift, Var weight, bool cutdata=true)=0
 
virtual void AddVar (std::string name, std::string labelx, std::string labely, std::string labelz, Var varx, Var vary, Var varz, Binning binningx, Binning binningy, Binning binningz, Cut cuts, SystShifts shift, Var weight, bool cutdata=true)=0
 
virtual void Save (TFile *outFile)=0
 
void AddLoaders (Loaders *loaders)
 
void AddData (SpectrumLoader *loadersData)
 
void AddSystematics (std::vector< const ISyst * > systs, osc::OscCalcSterile *calc)
 

Protected Attributes

LoadersfLoaders
 
SpectrumLoaderfLoadersData
 
SpectrumLoaderfLoadersCos
 
std::vector< const ISyst * > fSysts
 
osc::OscCalcSterilefOscCalc
 
std::map< std::string, IPrediction * > fPredictions
 
std::map< std::string, Spectrum * > fSpectra
 
std::map< std::string, Spectrum * > fCosSpec
 
std::map< std::string, CheatDecomp * > fDecompositions
 
std::map< std::string, std::map< std::string, std::pair< Spectrum *, Spectrum * > > > fShiftedSpectra
 
std::string fPredOpt
 
bool fData
 
bool fRunSysts
 
bool fCosmics
 

Detailed Description

Definition at line 37 of file PredictionHandler.h.

Constructor & Destructor Documentation

PredictionHandler::PredictionHandler ( std::string  predOpt,
bool  isData = false,
Loaders loaders = nullptr 
)

Definition at line 93 of file PredictionHandler.h.

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

95  :
96  fPredOpt (predOpt),
97  fLoaders (loaders),
98  fData (isData) ,
99  fRunSysts (false) ,
100  fCosmics (false)
101 {
102 
103  if (fPredOpt != "Extrap" && fPredOpt != "FDExtrap" && fPredOpt != "NoExtrap" && fPredOpt != "Decomp")
104  {
105  std::cout << "PredictionHandler not set up for "
106  << fPredOpt
107  << "\nCurrent allowed options are:"
108  << "\n- FD: "
109  << "\n-- Extrap"
110  << "\n-- FDExtrap"
111  << "\n-- NoExtrap"
112  << "\n-- Decomp"
113  << std::endl;
114  std::abort();
115  }
116 }
OStream cout
Definition: OStream.cxx:6
PredictionHandler::~PredictionHandler ( )
virtual

Definition at line 118 of file PredictionHandler.h.

References std::cos(), plot_validation_datamc_2018::decomp, fCosSpec, fDecompositions, fPredictions, fShiftedSpectra, fSpectra, and plot_validation_datamc::pred.

119 {
120  for (const auto& pred : fPredictions)
121  delete pred.second;
122  for (const auto& cos : fCosSpec)
123  delete cos.second;
124  for (const auto& spectrum : fSpectra)
125  delete spectrum.second;
126  for (const auto& decomp : fDecompositions)
127  delete decomp.second;
128  for (const auto& shift : fShiftedSpectra) {
129  for (const auto& syst : shift.second) {
130  delete syst.second.first;
131  delete syst.second.second;
132  }
133  }
134 }
std::map< std::string, Spectrum * > fSpectra
std::map< std::string, CheatDecomp * > fDecompositions
std::map< std::string, Spectrum * > fCosSpec
T cos(T number)
Definition: d0nt_math.hpp:78
std::map< std::string, IPrediction * > fPredictions
std::map< std::string, std::map< std::string, std::pair< Spectrum *, Spectrum * > > > fShiftedSpectra

Member Function Documentation

void PredictionHandler::AddData ( SpectrumLoader loadersData)

Definition at line 140 of file PredictionHandler.h.

References fData, and fLoadersData.

Referenced by ExampleCode(), and MakeUnoscPlots().

140  {
141  fData = true;
142  fLoadersData = loadersData;
143 }
SpectrumLoader * fLoadersData
void PredictionHandler::AddLoaders ( Loaders loaders)

Definition at line 136 of file PredictionHandler.h.

References fLoaders, and loaders.

Referenced by ExampleCode(), and MakeUnoscPlots().

136  {
137  fLoaders = loaders;
138 }
std::vector< Loaders * > loaders
Definition: syst_header.h:386
void PredictionHandler::AddSystematics ( std::vector< const ISyst * >  systs,
osc::OscCalcSterile calc 
)

Definition at line 145 of file PredictionHandler.h.

References calc, fOscCalc, fRunSysts, fSysts, and systs.

147 {
148  fRunSysts = true;
149  fSysts = systs;
150  fOscCalc = calc;
151 }
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
osc::OscCalcDumb calc
osc::OscCalcSterile * fOscCalc
std::vector< const ISyst * > fSysts
virtual void PredictionHandler::AddVar ( std::string  name,
HistAxis  axis,
Cut  cuts,
SystShifts  shift,
Var  weight,
bool  cutdata = true 
)
pure virtual
virtual void PredictionHandler::AddVar ( std::string  name,
std::string  label,
Var  var,
Binning  binning,
Cut  cuts,
SystShifts  shift,
Var  weight,
bool  cutdata = true 
)
pure virtual
virtual void PredictionHandler::AddVar ( std::string  name,
std::string  labelx,
std::string  labely,
Var  varx,
Var  vary,
Binning  binningx,
Binning  binningy,
Cut  cuts,
SystShifts  shift,
Var  weight,
bool  cutdata = true 
)
pure virtual
virtual void PredictionHandler::AddVar ( std::string  name,
std::string  labelx,
std::string  labely,
std::string  labelz,
Var  varx,
Var  vary,
Var  varz,
Binning  binningx,
Binning  binningy,
Binning  binningz,
Cut  cuts,
SystShifts  shift,
Var  weight,
bool  cutdata = true 
)
pure virtual
virtual void PredictionHandler::Save ( TFile *  outFile)
pure virtual

Member Data Documentation

bool PredictionHandler::fCosmics
protected

Definition at line 89 of file PredictionHandler.h.

Referenced by FDPredictionHandler::AddVar().

std::map<std::string, Spectrum*> PredictionHandler::fCosSpec
protected

Definition at line 81 of file PredictionHandler.h.

Referenced by FDPredictionHandler::AddVar(), and ~PredictionHandler().

bool PredictionHandler::fData
protected
std::map<std::string, CheatDecomp*> PredictionHandler::fDecompositions
protected

Definition at line 82 of file PredictionHandler.h.

Referenced by NDPredictionHandler::AddVar(), and ~PredictionHandler().

Loaders* PredictionHandler::fLoaders
protected
SpectrumLoader* PredictionHandler::fLoadersCos
protected

Definition at line 72 of file PredictionHandler.h.

Referenced by FDPredictionHandler::AddVar().

SpectrumLoader* PredictionHandler::fLoadersData
protected
osc::OscCalcSterile* PredictionHandler::fOscCalc
protected

Definition at line 76 of file PredictionHandler.h.

Referenced by AddSystematics(), and FDPredictionHandler::AddVar().

std::map<std::string, IPrediction*> PredictionHandler::fPredictions
protected
std::string PredictionHandler::fPredOpt
protected
bool PredictionHandler::fRunSysts
protected
std::map<std::string, std::map<std::string, std::pair<Spectrum*, Spectrum*> > > PredictionHandler::fShiftedSpectra
protected

Definition at line 83 of file PredictionHandler.h.

Referenced by NDPredictionHandler::AddVar(), and ~PredictionHandler().

std::map<std::string, Spectrum*> PredictionHandler::fSpectra
protected
std::vector<const ISyst*> PredictionHandler::fSysts
protected

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