PredictionCombinePeriods.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace ana
6 {
7  /// \brief Sum MC predictions from different periods scaled according to data POT targets
8  ///
9  /// Be sure you understand how putting one of these in a
10  /// SingleSampleExperiment differs from putting regular predictions for the
11  /// different periods into a MultiExperiment. This calculates
12  /// chisq(data1+data2|mc1+mc2), whereas the MultiExperiment is
13  /// chisq(data1|mc1)+chisq(data2+mc2).
15  {
16  public:
17  /// \param preds List of predictions to combine, along with the POT target
18  /// for that period. Should be like:
19  /// {{pred1, data1.POT()}, {pred2, data2.POT()}}
20  PredictionCombinePeriods(const std::vector<std::pair<const IPrediction*, double>>& preds);
22 
23  // un-hide inherited method stubs so we don't get warnings from the compiler
28 
29  Spectrum Predict(osc::IOscCalc* calc) const override;
31  const SystShifts& syst) const override;
32 
34  Flavors::Flavors_t flav,
36  Sign::Sign_t sign) const override;
37 
39  const SystShifts& syst,
40  Flavors::Flavors_t flav,
41  Current::Current_t curr,
42  Sign::Sign_t sign) const override;
43 
44  OscillatableSpectrum ComponentCC(int from, int to) const override;
45  //nc
46  Spectrum ComponentNCTotal() const override;
47  Spectrum ComponentNC() const override;
48  Spectrum ComponentNCAnti() const override;
49  //end nc
50  void SaveTo(TDirectory* dir, const std::string& name) const override;
51 
52  static std::unique_ptr<PredictionCombinePeriods> LoadFrom(TDirectory* dir, const std::string& name);
53 
54 
55  unsigned int NPredictions() const {return fPreds.size();}
56  const IPrediction* GetPrediction(int i) const {return fPreds[i].first;}
57  double GetPOT(int i) const {return fPreds[i].second;}
58 
59  protected:
60  std::vector<std::pair<const IPrediction*, double>> fPreds;
61  };
62 }
const XML_Char * name
Definition: expat.h:151
OscillatableSpectrum ComponentCC(int from, int to) const override
Spectrum PredictSyst(osc::IOscCalc *calc, const SystShifts &syst) const override
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
static std::unique_ptr< PredictionCombinePeriods > LoadFrom(TDirectory *dir, const std::string &name)
virtual Spectrum Predict(osc::IOscCalc *calc) const =0
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
General interface to oscillation calculators.
Definition: StanTypedefs.h:22
virtual Spectrum PredictComponentSyst(osc::IOscCalc *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
Definition: IPrediction.cxx:79
PredictionCombinePeriods(const std::vector< std::pair< const IPrediction *, double >> &preds)
Spectrum ComponentNCTotal() const override
osc::OscCalcDumb calc
std::vector< std::pair< const IPrediction *, double > > fPreds
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
Spectrum PredictComponentSyst(osc::IOscCalc *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
virtual Spectrum PredictSyst(osc::IOscCalc *calc, const SystShifts &syst) const
Definition: IPrediction.cxx:49
Spectrum ComponentNCAnti() const override
Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
TDirectory * dir
Definition: macro.C:5
const IPrediction * GetPrediction(int i) const
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
Sum MC predictions from different periods scaled according to data POT targets.
Spectrum with true energy information, allowing it to be oscillated
void SaveTo(TDirectory *dir, const std::string &name) const override
def sign(x)
Definition: canMan.py:197
Spectrum Predict(osc::IOscCalc *calc) const override
enum BeamMode string