EnergySysts2020.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/ISyst.h"
4 
5 namespace ana
6 {
7  //----------------------------------------------------------------------
8  // The component of the muon energy scale systematic which is fully
9  // correlated between all three detector components (the muon
10  // catcher, the rest of the ND, and the FD). It is a replacement for
11  // the old concept of an "absolute" muon energy scale error. In this
12  // version, while the errors are fully correlated, they need not be
13  // the same size for all detectors. Notably, errors from effects such
14  // as the uncertainty on the mass of PVC in each module are fully
15  // correlated between all three detector components, but much smaller
16  // in the muon catcher.
18  {
19  public:
21  const std::string& latexName,
22  const double scaleFD, const double scaleND,
23  const double scaleMuCat)
24  : ISyst(shortName, latexName),
25  fScaleFD(scaleFD), fScaleND(scaleND), fScaleMuCat(scaleMuCat) {}
26 
27  CorrMuEScaleSyst2020(const double scaleFD, const double scaleND,
28  const double scaleMuCat)
29  : ISyst("CorrMuEScaleSyst2020", "Corr Mu Energy Scale 2020"),
30  fScaleFD(scaleFD), fScaleND(scaleND), fScaleMuCat(scaleMuCat) {}
31 
32  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
33 
34  private:
35  const double fScaleFD;
36  const double fScaleND;
37  const double fScaleMuCat;
38  };
39 
41 
42  //----------------------------------------------------------------------
43  // The component of the muon energy scale systematic that applies only
44  // to the FD. See further commentary at UnCorrNDMuEScaleSyst2020.
46  {
47  public:
49  const std::string& latexName,
50  const double scale)
51  : ISyst(shortName, latexName), fScale(scale) {}
52 
54  : ISyst("UnCorrFDMuEScaleSyst2020", "Uncorr FD Mu Energy Scale 2020"),
55  fScale(scale) {}
56 
57  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
58 
59  private:
60  const double fScale;
61  };
62 
64 
65  //----------------------------------------------------------------------
66  // The component of the muon energy scale systematic that applies only
67  // to the non-muon catcher ND, i.e. arising from causes that have
68  // no effect no the muon catcher or FD. Because we have decided not
69  // to implement muon energy scale systematics in their fullest possible
70  // glory, this is a bit of a fudge. Some effects are correlated between
71  // two, but not three, of the three detector components (ND, FD, MuCat).
72  // This systematic does not inclulde neutron pile-up, which is handled
73  // separately. See more discussion in doc-20816.
75  {
76  public:
78  const std::string& latexName,
79  const double scale)
80  : ISyst(shortName, latexName), fScale(scale) {}
81 
83  : ISyst("UnCorrNDMuEScaleSyst2020", "Uncorr ND Mu Energy Scale 2020"),
84  fScale(scale) {}
85 
86  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
87 
88  private:
89  const double fScale;
90  };
91 
93 
94  //----------------------------------------------------------------------
95  // The component of the muon energy scale systematic that
96  // applies only to the muon catcher.
98  {
99  public:
101  const std::string& latexName,
102  const double scale)
103  : ISyst(shortName, latexName), fScale(scale) {}
104 
106  : ISyst("UnCorrMuCatMuESyst2020", "Uncorr MuCat Mu Energy 2020"),
107  fScale(scale) {}
108 
109  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
110 
111  private:
112  const double fScale;
113  };
114 
116 
117  //----------------------------------------------------------------------
118  // The component of the muon energy scale systematic that is caused by
119  // neutron pile-up in the near detector. See discussion in doc-20816. It is
120  // fully correlated between the main detector and the Muon Catcher and causes
121  // tracks to get longer by an amount independent of their length, i.e. it is
122  // additive, not multiplicative, which is why it is not rolled into the other
123  // muon range sytematics. It affects the muon catcher more strongly mostly
124  // because the planes are farther apart on average. Also thermal neutron
125  // characteristics are different in the muon catcher.
126  //
127  // The arguments to the function give the shifts per track end. We either
128  // apply shiftND twice (for tracks contained in the main detector) or shiftND
129  // once and shiftMuCat once (for tracks that start in the main detector and
130  // end the muon catcher). Also covers the case of the track being fully
131  // contained in the Muon Catcher, even though we don't use these tracks in
132  // the analysis (at the moment).
133  class PileupMuESyst2020: public ISyst
134  {
135  public:
137  const std::string& latexName,
138  const double shiftND, const double shiftMuCat)
139  : ISyst(shortName, latexName), fShiftND(shiftND), fShiftMuCat(shiftMuCat) {}
140 
141  PileupMuESyst2020(const double shiftND, const double shiftMuCat)
142  : ISyst("PileupMuESyst2020", "Neutron Pile-up 2020"),
143  fShiftND(shiftND), fShiftMuCat(shiftMuCat) {}
144 
145  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
146  private:
147  const double fShiftND, fShiftMuCat;
148  };
149 
151 }
CorrMuEScaleSyst2020(const std::string &shortName, const std::string &latexName, const double scaleFD, const double scaleND, const double scaleMuCat)
UnCorrFDMuEScaleSyst2020(const std::string &shortName, const std::string &latexName, const double scale)
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
UnCorrNDMuEScaleSyst2020(const std::string &shortName, const std::string &latexName, const double scale)
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
UnCorrMuCatMuESyst2020(const std::string &shortName, const std::string &latexName, const double scale)
const Var weight
CorrMuEScaleSyst2020(const double scaleFD, const double scaleND, const double scaleMuCat)
UnCorrMuCatMuESyst2020(const double scale)
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
const UnCorrFDMuEScaleSyst2020 kUnCorrFDMuEScaleSyst2020(0.0015)
Double_t scale
Definition: plot.C:25
UnCorrNDMuEScaleSyst2020(const double scale)
caf::StandardRecord * sr
double sigma(TH1F *hist, double percentile)
const PileupMuESyst2020 kPileupMuESyst2020(0.46, 1.3)
PileupMuESyst2020(const double shiftND, const double shiftMuCat)
const CorrMuEScaleSyst2020 kCorrMuEScaleSyst2020(0.0074, 0.0074, 0.0013)
const UnCorrNDMuEScaleSyst2020 kUnCorrNDMuEScaleSyst2020(0.0013)
string shortName
THUMBNAIL BLOCK: We need to make a thumbnail for each.
const UnCorrMuCatMuESyst2020 kUnCorrMuCatMuESyst2020(0.0048)
UnCorrFDMuEScaleSyst2020(const double scale)
PileupMuESyst2020(const std::string &shortName, const std::string &latexName, const double shiftND, const double shiftMuCat)
enum BeamMode string