9 #include "TDirectory.h"
10 #include "TObjString.h"
24 const std::vector<const SystComponentScale*>& systs,
31 assert(!systs.empty() &&
"Please give at least one systematic.");
34 spillcut, cut && syst->GetCut(),
shift, wei));
49 const std::vector<const SystComponentScale*>& systs,
54 assert(!systs.empty() &&
"Please give at least one systematic.");
57 axis, spillcut, cut && syst->GetCut(),
shift, wei));
61 axis, spillcut, cut, shift, wei);
71 const std::vector<const SystComponentScale*>& systs,
75 assert(0 &&
"unimplemented");
97 const std::vector<const IPrediction*>& preds,
98 const std::vector<const SystComponentScale*>& systs)
126 for(
unsigned int i = 0; i <
fPreds.size(); ++i){
127 const double x = shift.
GetShift(fSysts[i]);
133 si.
Scale(pow(1+fSysts[i]->OneSigmaScale(), x) - 1);
146 for(
unsigned int i = 0; i <
fSysts.size(); ++i){
150 std::cout <<
"PredictionScaleComp::PredictCategory(): Unknown systematic " << syst->
ShortName() << std::endl;
157 TDirectory* tmp = gDirectory;
160 TObjString(
"PredictionScaleComp").Write(
"type");
164 for(
unsigned int i = 0; i <
fPreds.size(); ++i){
168 for(
unsigned int i = 0; i <
fSysts.size(); ++i){
180 std::vector<const IPrediction*> preds;
181 for(
unsigned int i = 0; ; ++i){
182 TDirectory* di = dir->GetDirectory((
"pred"+
std::to_string(i)).c_str());
188 std::vector<const SystComponentScale*> systs;
189 for(
unsigned int i = 0; ; ++i){
190 TDirectory* si = dir->GetDirectory((
"syst"+
std::to_string(i)).c_str());
193 systs.push_back(ana::LoadFrom<SystComponentScale>(si).release());
const Cut kNoCut([](const caf::SRSliceProxy *){return true;})
The simplest possible cut: pass everything, used as a default.
Spectrum PredictCategory(osc::IOscCalc *osc, const SystComponentScale *syst) const
static std::unique_ptr< PredictionScaleComp > LoadFrom(TDirectory *dir)
virtual Spectrum PredictComponentSyst(osc::IOscCalc *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
void SetShift(const ISyst *syst, double shift)
Shifts are 0=nominal, -1,+1 = 1 sigma shifts.
process_name opflash particleana ie x
Uncertainty in the scale of a single component of the spectrum.
virtual void SaveTo(TDirectory *dir) const
Simple record of shifts applied to systematic parameters.
PredictionScaleComp(SpectrumLoaderBase &loader, const HistAxis &axis, SpillCut spillcut, Cut cut, const std::vector< const SystComponentScale * > &systs, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
process_name opflashCryoW ana
Encapsulate code to systematically shift a caf::StandardRecord.
void Scale(double c)
Multiply this spectrum by a constant c.
virtual std::string ShortName() const final
The name printed out to the screen.
virtual void SaveTo(TDirectory *dir) const override
Representation of a spectrum in any variable, with associated POT.
std::vector< const SystComponentScale * > fSysts
virtual Spectrum PredictSyst(osc::IOscCalc *calc, const SystShifts &syst) const
double GetShift(const ISyst *syst) const
virtual ~PredictionScaleComp()
Base class for the various types of spectrum loader.
std::unique_ptr< IPrediction > LoadFrom< IPrediction >(TDirectory *dir)
std::string to_string(WindowPattern const &pattern)
then echo File list $list not found else cat $list while read file do echo $file sed s
Standard interface to all prediction techniques.
const IPrediction * fTotal
std::vector< const IPrediction * > fPreds
BEGIN_PROLOG could also be cout
Prediction that wraps a simple Spectrum.