All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SBNWeightSysts.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 #include "sbnanaobj/StandardRecord/Proxy/FwdDeclare.h"
8 
9 #include <unordered_map>
10 #include <vector>
11 
12 namespace ana
13 {
15  {
16  public:
17  UniverseWeight(const std::string& psetName, int univIdx);
18 
19  double operator()(const caf::SRSliceProxy* sr) const;
20 
21  protected:
22  std::string fPSetName;
23  mutable int fPSetIdx;
24  int fUnivIdx;
25  };
26 
27  Var GetUniverseWeight(const std::string& psetName, int univIdx)
28  {
29  return Var(UniverseWeight(psetName, univIdx));
30  }
31 
32 
33  class SBNWeightSyst: public ISyst
34  {
35  public:
36  SBNWeightSyst(const std::string& systName);
37 
38  void Shift(double x, caf::SRSliceProxy* sr, double& weight) const override;
39 
40  protected:
41  mutable int fIdx;
42 
43  struct Univs
44  {
45  int i0, i1;
46  double w0, w1;
47  };
48 
49  mutable std::unordered_map<double, Univs> fUnivs;
50 
51  Univs GetUnivs(double x) const;
52  };
53 
54  std::vector<std::string> GetSBNGenieWeightNames();
55 
56  const std::vector<const ISyst*>& GetSBNGenieWeightSysts();
57 
58  const std::vector<const ISyst*>& GetSBNBoosterFluxWeightSysts();
59  const std::vector<const ISyst*>& GetSBNWeightSysts(); // genie+flux
60 }
std::string fPSetName
process_name opflash particleana ie x
double operator()(const caf::SRSliceProxy *sr) const
const std::vector< const ISyst * > & GetSBNBoosterFluxWeightSysts()
void Shift(double x, caf::SRSliceProxy *sr, double &weight) const override
Perform the systematic shift.
UniverseWeight(const std::string &psetName, int univIdx)
process_name opflashCryoW ana
std::unordered_map< double, Univs > fUnivs
Encapsulate code to systematically shift a caf::StandardRecord.
Definition: ISyst.h:14
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
_Var< caf::SRSliceProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:73
SBNWeightSyst(const std::string &systName)
const std::vector< const ISyst * > & GetSBNGenieWeightSysts()
Univs GetUnivs(double x) const
const std::vector< const ISyst * > & GetSBNWeightSysts()
std::vector< std::string > GetSBNGenieWeightNames()
Var GetUniverseWeight(const std::string &psetName, int univIdx)