NuWROSysts.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/ISyst.h"
4 
5 #include <map>
6 
7 class TH1;
8 
9 namespace ana
10 {
11  /// Reweight events to match NuWRO
12  class NuWROSyst: public ISyst
13  {
14  public:
15  /// The variable to reweight as a function of
16  enum class EReweightVar{
17  kEnu,
18  kX,
19  kY,
20  kQ2,
21  kMode
22  };
23 
24  NuWROSyst(EReweightVar rwVar);
25  ~NuWROSyst();
26 
27  /// +1 means match nuWRO, -1 moves in the opposite direction
28  void Shift(double sigma,
30  double& weight) const override;
31 
32  NuWROSyst(const NuWROSyst&) = delete;
33  NuWROSyst& operator=(const NuWROSyst&) = delete;
34  protected:
37 
39 
40  static void InitializeHistograms();
41 
42  struct Key_t
43  {
44  int pdg;
45  int mode;
46  bool cc;
48 
49  bool operator<(const Key_t k) const
50  {
51  return (std::make_tuple(pdg, mode, cc, var) <
52  std::make_tuple(k.pdg, k.mode, k.cc, k.var));
53  }
54  };
55 
56  static std::map<Key_t, TH1*> fgGenieHists, fgNuWroHists;
57  static int fgNInstances;
58  };
59 
61  extern const NuWROSyst kNuWROReweightX;
62  extern const NuWROSyst kNuWROReweightY;
65 } // namespace
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
static void InitializeHistograms()
Definition: NuWROSysts.cxx:58
const Var weight
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
static std::map< Key_t, TH1 * > fgNuWroHists
Definition: NuWROSysts.h:56
static int fgNInstances
Definition: NuWROSysts.h:57
const NuWROSyst kNuWROReweightMode(NuWROSyst::EReweightVar::kMode)
Definition: NuWROSysts.h:64
bool operator<(const Key_t k) const
Definition: NuWROSysts.h:49
NuWROSyst(EReweightVar rwVar)
Definition: NuWROSysts.cxx:28
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
+1 means match nuWRO, -1 moves in the opposite direction
Definition: NuWROSysts.cxx:153
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
const NuWROSyst kNuWROReweightQ2(NuWROSyst::EReweightVar::kQ2)
Definition: NuWROSysts.h:63
EReweightVar fReweightVar
Definition: NuWROSysts.h:38
std::string ShortNameHelper(EReweightVar v) const
Definition: NuWROSysts.cxx:127
const NuWROSyst kNuWROReweightY(NuWROSyst::EReweightVar::kY)
Definition: NuWROSysts.h:62
EReweightVar
The variable to reweight as a function of.
Definition: NuWROSysts.h:16
EReweightVar var
Definition: NuWROSysts.h:47
Reweight events to match NuWRO.
Definition: NuWROSysts.h:12
caf::StandardRecord * sr
double sigma(TH1F *hist, double percentile)
NuWROSyst & operator=(const NuWROSyst &)=delete
const NuWROSyst kNuWROReweightEnu(NuWROSyst::EReweightVar::kEnu)
Definition: NuWROSysts.h:60
static std::map< Key_t, TH1 * > fgGenieHists
Definition: NuWROSysts.h:56
const NuWROSyst kNuWROReweightX(NuWROSyst::EReweightVar::kX)
Definition: NuWROSysts.h:61
std::string LatexNameHelper(EReweightVar v) const
Definition: NuWROSysts.cxx:140
enum BeamMode string