SystComponentScale.cxx
Go to the documentation of this file.
2 
3 #include <cmath>
4 
5 namespace ana
6 {
7  // explicitly instantiate the template for the types we know we have
8  template class GenericSystComponentScale<caf::SRProxy>;
9  template class GenericSystComponentScale<caf::SRNeutrinoProxy>;
10 
11  //----------------------------------------------------------------------
12  template<class T> void GenericSystComponentScale<T>::
13  DoShift(double sigma, T* rec, double& weight) const
14  {
15  if(!fCut(rec)) return;
16 
17  if(fType == kExponential){
18  weight *= pow(1+fOneSigma, sigma);
19  }
20  else{
21  weight *= 1+sigma*fOneSigma;
22  weight = std::max(0., weight);
23  }
24  }
25 
26  // This is a very ugly way to hook these functions up, maybe there's
27  // something better with template magic?
29  Shift(double sigma, caf::SRProxy* rec, double& weight) const
30  {
31  DoShift(sigma, rec, weight);
32  }
33 
35  Shift(double sigma, caf::SRProxy* rec, double& weight) const
36  {
37  ISyst::Shift(sigma, rec, weight);
38  }
39 
42  {
43  // Nothing
44  }
45 
48  {
49  DoShift(sigma, rec, weight);
50  }
51 }
T max(const caf::Proxy< T > &a, T b)
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var weight
Proxy for caf::SRNeutrino.
Definition: SRProxy.h:510
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
constexpr T pow(T x)
Definition: pow.h:75
caf::StandardRecord * rec
Definition: tutCAFMacro.C:20
virtual void Shift(double sigma, caf::SRProxy *sr, double &weight) const
Perform the systematic shift.
Definition: ISyst.cxx:26
void Shift(double sigma, caf::SRProxy *rec, double &weight) const override
Perform the systematic shift.
void DoShift(double sigma, T *rec, double &weight) const
double sigma(TH1F *hist, double percentile)
double T
Definition: Xdiff_gwt.C:5
void TruthShift(double sigma, caf::SRNeutrinoProxy *rec, double &weight) const override