EnergySysts2017.cxx
Go to the documentation of this file.
2 
4 
5 namespace ana
6 {
7  const DirectHadEScaleSyst2017 kDirectHadEScaleSyst2017(0.05);
8  const DirectRelHadEScaleSyst2017 kDirectRelHadEScaleSyst2017(0.05);
9 
10  // These are 2019 values, shoehorned into 2017 2-systematic style
11  const MuEScaleSyst2017 kMuEScaleSyst2017(0.0074, 0.0012);
12  const RelMuEScaleSyst2017 kRelMuEScaleSyst2017(0.0045, 10.5 /* cm */);
13 
14 
15  //----------------------------------------------------------------------
17  Shift(double sigma, caf::SRProxy* sr, double& weight) const
18  {
19  if (sr->trk.kalman.tracks.size()==0) return;
20 
21  if (sr->hdr.det == caf::kFARDET){
22  sr->trk.kalman.tracks[0].len = (1-fScale*sigma)*sr->trk.kalman.tracks[0].len;
23  }
24  else if (sr->hdr.det == caf::kNEARDET){
27  }
28  }
29 
30  //----------------------------------------------------------------------
32  Shift(double sigma, caf::SRProxy* sr, double& weight) const
33  {
34  if (sr->trk.kalman.tracks.size()==0) return;
35 
36  // shift Near Det *down*, shift Far Det *up*
37  if (sr->hdr.det == caf::kNEARDET){
38  sr->energy.numu.ndtrklenact *= 1-fScale/2*sigma;
39  if(sr->energy.numu.ndtrklencat > 0)
40  sr->energy.numu.ndtrklencat =
41  std::max(sr->energy.numu.ndtrklencat - fShiftMuCat/2*sigma, 0.);
42  }
43  else if (sr->hdr.det == caf::kFARDET){
44  sr->trk.kalman.tracks[0].len *= 1+fScale/2*sigma;
45  }
46  }
47 
48  //----------------------------------------------------------------------
50  Shift(double sigma, caf::SRProxy* sr, double& weight) const
51  {
53  sr->energy.numu.hadcalE = (1+fScale*sigma)*sr->energy.numu.hadcalE;
54  }
55 
56  //----------------------------------------------------------------------
58  Shift(double sigma, caf::SRProxy* sr, double& weight) const
59  {
60  if (sr->hdr.det == caf::kNEARDET){
61  sr->energy.numu.hadtrkE = (1+(fScale/2)*sigma)*sr->energy.numu.hadtrkE;
62  sr->energy.numu.hadcalE = (1+(fScale/2)*sigma)*sr->energy.numu.hadcalE;
63  }
64 
65  if (sr->hdr.det == caf::kFARDET){
66  sr->energy.numu.hadtrkE = (1-(fScale/2)*sigma)*sr->energy.numu.hadtrkE;
67  sr->energy.numu.hadcalE = (1-(fScale/2)*sigma)*sr->energy.numu.hadcalE;
68  }
69  }
70 }
Near Detector underground.
Definition: SREnums.h:10
T max(const caf::Proxy< T > &a, T b)
Far Detector at Ash River.
Definition: SREnums.h:11
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
const Var weight
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
caf::Proxy< caf::SRNumuEnergy > numu
Definition: SRProxy.h:214
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
caf::Proxy< float > hadtrkE
Definition: SRProxy.h:171
caf::Proxy< caf::SREnergyBranch > energy
Definition: SRProxy.h:2136
const MuEScaleSyst2017 kMuEScaleSyst2017(0.0074, 0.0012)
const RelMuEScaleSyst2017 kRelMuEScaleSyst2017(0.0045, 10.5)
caf::Proxy< caf::SRTrackBranch > trk
Definition: SRProxy.h:2145
caf::StandardRecord * sr
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
const DirectHadEScaleSyst2017 kDirectHadEScaleSyst2017(0.05)
caf::Proxy< float > hadcalE
Definition: SRProxy.h:169
double sigma(TH1F *hist, double percentile)
caf::Proxy< caf::SRKalman > kalman
Definition: SRProxy.h:1797
const DirectRelHadEScaleSyst2017 kDirectRelHadEScaleSyst2017(0.05)
caf::Proxy< float > ndtrklenact
Definition: SRProxy.h:186
caf::Proxy< std::vector< caf::SRKalmanTrack > > tracks
Definition: SRProxy.h:1780
caf::Proxy< float > ndtrklencat
Definition: SRProxy.h:187
caf::Proxy< caf::Det_t > det
Definition: SRProxy.h:232