EnergySysts2019.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  CorrMuEScaleSyst2019(const double scaleFD, const double scaleND,
28  const double scaleMuCat)
29  : ISyst("CorrMuEScaleSyst2019", "Corr Mu Energy Scale 2019"),
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 UnCorrNDMuEScaleSyst2019.
46  {
47  public:
49  const std::string& latexName,
50  const double scale)
51  : ISyst(shortName, latexName), fScale(scale) {}
52 
54  : ISyst("UnCorrFDMuEScaleSyst2019", "Uncorr FD Mu Energy Scale 2019"),
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  // As of 2018, a major contributor to the ND "uncorrelated" error is
73  // neutron pile-up, which is fully correlated between ND and MuCat, but
74  // not with the FD (or on second thought, I suppose it is fully correlated
75  // between all three, but negligibly very very small for the FD -- this
76  // however, is not how I have handled it). To keep the total number
77  // of systematics down, it is treated as uncorrelated between main ND
78  // and MuCat. See more discussion in doc-20816.
80  {
81  public:
83  const std::string& latexName,
84  const double scale)
85  : ISyst(shortName, latexName), fScale(scale) {}
86 
88  : ISyst("UnCorrNDMuEScaleSyst2019", "Uncorr ND Mu Energy Scale 2019"),
89  fScale(scale) {}
90 
91  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
92 
93  private:
94  const double fScale;
95  };
96 
98 
99  //----------------------------------------------------------------------
100  // The component of the muon energy scale systematic that
101  // applies only to the muon catcher.
103  {
104  public:
106  const std::string& latexName,
107  const double scale)
108  : ISyst(shortName, latexName), fScale(scale) {}
109 
111  : ISyst("UnCorrMuCatMuESyst2019", "Uncorr MuCat Mu Energy 2019"),
112  fScale(scale) {}
113 
114  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
115 
116  private:
117  const double fScale;
118  };
119 
121 
122  //----------------------------------------------------------------------
123  // The component of the muon energy scale systematic that is caused by
124  // neutron pile-up in the near detector. See discussion in doc-20816. It is
125  // fully correlated between the main detector and the Muon Catcher and causes
126  // tracks to get longer by an amount independent of their length, i.e. it is
127  // additive, not multiplicative, which is why it is not rolled into the other
128  // muon range sytematics. It affects the muon catcher more strongly mostly
129  // because the planes are farther apart on average. Also thermal neutron
130  // characteristics are different in the muon catcher.
131  //
132  // The arguments to the function give the shifts per track end. We either
133  // apply shiftND twice (for tracks contained in the main detector) or shiftND
134  // once and shiftMuCat once (for tracks that start in the main detector and
135  // end the muon catcher). Also covers the case of the track being fully
136  // contained in the Muon Catcher, even though we don't use these tracks in
137  // the analysis (at the moment).
138  class PileupMuESyst2019: public ISyst
139  {
140  public:
142  const std::string& latexName,
143  const double shiftND, const double shiftMuCat)
144  : ISyst(shortName, latexName), fShiftND(shiftND), fShiftMuCat(shiftMuCat) {}
145 
146  PileupMuESyst2019(const double shiftND, const double shiftMuCat)
147  : ISyst("PileupMuESyst2019", "Neutron Pile-up 2019"),
148  fShiftND(shiftND), fShiftMuCat(shiftMuCat) {}
149 
150  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
151  private:
152  const double fShiftND, fShiftMuCat;
153  };
154 
156 
157  //----------------------------------------------------------------------
158  // Error for not knowing whether it is correct to apply the Bodek correction
159  // and also not knowing whether it is correct to apply the Coulomb correction.
160  // See doc-20816-v20 for a discussion of this.
161  class BolombMuESyst2019: public ISyst
162  {
163  public:
165  const std::string& latexName,
166  const double shift)
167  : ISyst(shortName, latexName), fShift(shift) {}
168 
169  BolombMuESyst2019(const double shift)
170  : ISyst("BolombMuESyst2019", "Bodek and Coulomb 2019"),
171  fShift(shift) {}
172 
173  void Shift(double sigma, caf::SRProxy* sr, double& weight) const override;
174  private:
175  const double fShift;
176  };
177 
179 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
CorrMuEScaleSyst2019(const std::string &shortName, const std::string &latexName, const double scaleFD, const double scaleND, const double scaleMuCat)
const Var weight
BolombMuESyst2019(const double shift)
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
UnCorrNDMuEScaleSyst2019(const double scale)
UnCorrNDMuEScaleSyst2019(const std::string &shortName, const std::string &latexName, const double scale)
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
UnCorrMuCatMuESyst2019(const double scale)
UnCorrMuCatMuESyst2019(const std::string &shortName, const std::string &latexName, const double scale)
CorrMuEScaleSyst2019(const double scaleFD, const double scaleND, const double scaleMuCat)
Double_t scale
Definition: plot.C:25
UnCorrFDMuEScaleSyst2019(const double scale)
const UnCorrFDMuEScaleSyst2019 kUnCorrFDMuEScaleSyst2019(0.0015)
UnCorrFDMuEScaleSyst2019(const std::string &shortName, const std::string &latexName, const double scale)
const CorrMuEScaleSyst2019 kCorrMuEScaleSyst2019(0.0074, 0.0074, 0.0012)
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
const BolombMuESyst2019 kBolombMuESyst2019(-9.)
const UnCorrMuCatMuESyst2019 kUnCorrMuCatMuESyst2019(0.010)
caf::StandardRecord * sr
double sigma(TH1F *hist, double percentile)
PileupMuESyst2019(const std::string &shortName, const std::string &latexName, const double shiftND, const double shiftMuCat)
string shortName
THUMBNAIL BLOCK: We need to make a thumbnail for each.
const UnCorrNDMuEScaleSyst2019 kUnCorrNDMuEScaleSyst2019(0.0015)
BolombMuESyst2019(const std::string &shortName, const std::string &latexName, const double shift)
PileupMuESyst2019(const double shiftND, const double shiftMuCat)
const PileupMuESyst2019 kPileupMuESyst2019(0.46, 1.3)
enum BeamMode string