All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MultiExperimentSBN.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "OscLib/IOscCalc.h"
6 
7 #include <memory>
8 #include <vector>
9 
10 namespace ana
11 {
12  /// Combine multiple component experiments
14  {
15  public:
16  // We may want to rewrite this as a pair<extp, L>, but this works for now
17  // also, to prevent mistakes it's probably best to define
18  // kSBND, kUBoone and kIcarus somewhere. But again, works for now
19  MultiExperimentSBN(std::vector<const IExperiment*> expts = {},
20  std::vector<int> exptnames = {})
21  : fExpts(expts), fExptNames(exptnames)
22  {
23  fSystCorrelations.resize(expts.size());
24  }
25 
26  void Add(const IExperiment* expt, float l){
27  fExpts.push_back(expt);
28  fExptNames.push_back(l);
29  }
30 
31  virtual double ChiSq(osc::IOscCalcAdjustable* osc,
32  const SystShifts& syst = SystShifts::Nominal()) const override;
33 
34  /// For the subexperiment \a idx, set up a mapping between systematics
35  ///
36  /// Each element in the vector is a pair from a "primary" systematic to a
37  /// "secondary". When this MultiExperiment is called with a primary
38  /// systematic shifted, the sub-experiment will be called with the
39  /// secondary systematic set to the same value (and the primary unset).
40  ///
41  /// You can pass NULL for a secondary to indicate that the systematic
42  /// simply has no effect on the experiment in question and should be
43  /// filtered out.
44  void SetSystCorrelations(int idx,
45  const std::vector<std::pair<const ISyst*,
46  const ISyst*>>& corrs);
47 
48  virtual void SaveTo(TDirectory* dir) const override;
49  static std::unique_ptr<MultiExperimentSBN> LoadFrom(TDirectory* dir);
50 
51  protected:
52  std::vector<const IExperiment*> fExpts;
53  std::vector<int> fExptNames;
54  std::vector<std::vector<std::pair<const ISyst*, const ISyst*>>> fSystCorrelations;
55  };
56 }
static std::unique_ptr< MultiExperimentSBN > LoadFrom(TDirectory *dir)
MultiExperimentSBN(std::vector< const IExperiment * > expts={}, std::vector< int > exptnames={})
std::vector< std::vector< std::pair< const ISyst *, const ISyst * > > > fSystCorrelations
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:16
process_name opflashCryoW ana
static SystShifts Nominal()
Definition: SystShifts.h:23
Encapsulate code to systematically shift a caf::StandardRecord.
Definition: ISyst.h:14
virtual double ChiSq(osc::IOscCalcAdjustable *osc, const SystShifts &syst=SystShifts::Nominal()) const override
virtual void SaveTo(TDirectory *dir) const override
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
std::vector< const IExperiment * > fExpts
void SetSystCorrelations(int idx, const std::vector< std::pair< const ISyst *, const ISyst * >> &corrs)
std::vector< int > fExptNames
tuple dir
Definition: dropbox.py:28
Base class defining interface for experiments.
Definition: IExperiment.h:21
void Add(const IExperiment *expt, float l)
Combine multiple component experiments.