EnergySysts.cxx
Go to the documentation of this file.
2 
4 
5 #include "TRandom3.h"
6 
7 namespace ana
8 {
9  //----------------------------------------------------------------------
10  const HadEnergyScaleSyst kHadEnergyScaleSyst(.05);
11  const MuEnergyScaleSyst kMuEnergyScaleSyst(.02);
12  const FDHadEnergyScaleSyst kFDHadEnergyScaleSyst(.05);
13  const FDMuEnergyScaleSyst kFDMuEnergyScaleSyst(.01);
14 
15  //----------------------------------------------------------------------
17  Shift(double sigma, caf::SRProxy* sr, double& weight) const
18  {
19  const double hadE = sr->energy.numu.recotrkcchadE;
20  const double hadEnew = (1-fScale*sigma)*hadE;
21  const double difference = hadEnew - hadE;
22 
23  sr->energy.numu.trkccE += difference;
24  sr->energy.numu.E += difference;
25  }
26 
27  //----------------------------------------------------------------------
29  Shift(double sigma, caf::SRProxy* sr, double& weight) const
30  {
31  const double muE = sr->energy.numu.recomuonE;
32  const double muEnew = (1-fScale*sigma)*muE;
33  const double difference = muEnew - muE;
34 
35  sr->energy.numu.recomuonE = muEnew;
36  sr->energy.numu.trkccE += difference;
37  sr->energy.numu.E += difference;
38  }
39 
40  //----------------------------------------------------------------------
42  Shift(double sigma, caf::SRProxy* sr, double& weight) const
43  {
44  if (sr->hdr.det != caf::kFARDET) return;
45  HadEnergyScaleSyst::Shift( sigma, sr, weight);
46  }
47 
48  //----------------------------------------------------------------------
49  /// FD muon energy scale systematic
51  Shift(double sigma, caf::SRProxy* sr, double& weight) const
52  {
53  if (sr->hdr.det != caf::kFARDET) return;
54  MuEnergyScaleSyst::Shift( sigma, sr, weight);
55  }
56 }
caf::Proxy< float > trkccE
Definition: SRProxy.h:195
Far Detector at Ash River.
Definition: SREnums.h:11
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const FDMuEnergyScaleSyst kFDMuEnergyScaleSyst(.01)
Definition: EnergySysts.h:90
const FDHadEnergyScaleSyst kFDHadEnergyScaleSyst(.05)
Definition: EnergySysts.h:75
caf::Proxy< float > E
Definition: SRProxy.h:164
const Var weight
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
caf::Proxy< caf::SRNumuEnergy > numu
Definition: SRProxy.h:214
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
caf::Proxy< caf::SREnergyBranch > energy
Definition: SRProxy.h:2136
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
Definition: EnergySysts.cxx:42
const MuEnergyScaleSyst kMuEnergyScaleSyst(.02)
Definition: EnergySysts.h:60
caf::Proxy< float > recotrkcchadE
Definition: SRProxy.h:191
caf::StandardRecord * sr
double sigma(TH1F *hist, double percentile)
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
Definition: EnergySysts.cxx:29
const HadEnergyScaleSyst kHadEnergyScaleSyst(.05)
Definition: EnergySysts.h:35
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
FD muon energy scale systematic.
Definition: EnergySysts.cxx:51
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
Definition: EnergySysts.cxx:17
caf::Proxy< float > recomuonE
Definition: SRProxy.h:190
caf::Proxy< caf::Det_t > det
Definition: SRProxy.h:232