All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
toysysts.h
Go to the documentation of this file.
2 
3 using namespace ana;
4 
5 class ToyEnergyScaleSyst: public ISyst
6 {
7  public:
8  ToyEnergyScaleSyst() : ISyst("toyEScale", "Toy Energy Scale") {}
9  void Shift(double sigma,
11  double& weight) const override
12  {
13  const double scale = 1 + .05*sigma; // 5% E scale syst.
14 
15  sr->reco.reco_energy *= scale;
16  }
17 };
19 {
20  static const ToyEnergyScaleSyst eSyst;
21  return eSyst;
22 }
23 
24 class ToyNormSyst: public ISyst
25 {
26  public:
27  ToyNormSyst() : ISyst("toyNorm", "Toy Norm Scale") {}
28  void Shift(double sigma,
30  double& weight) const override
31  {
32  weight *= TMath::Max(0., 1+0.1*sigma);
33  }
34 };
36 {
37  static const ToyNormSyst nSyst;
38  return nSyst;
39 }
40 
41 // Make a vector with all (here only two) the systematics
42 std::vector<const ISyst*> allSysts{&GetESyst(), &GetNSyst()};
ToyNormSyst()
Definition: toysysts.h:27
process_name opflashCryoW ana
Encapsulate code to systematically shift a caf::StandardRecord.
Definition: ISyst.h:14
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
void Shift(double sigma, caf::SRSliceProxy *sr, double &weight) const override
Perform the systematic shift.
Definition: toysysts.h:9
const ToyEnergyScaleSyst & GetESyst()
Definition: toysysts.h:18
std::vector< const ISyst * > allSysts
Definition: toysysts.h:42
void Shift(double sigma, caf::SRSliceProxy *sr, double &weight) const override
Perform the systematic shift.
Definition: toysysts.h:28
const ToyNormSyst & GetNSyst()
Definition: toysysts.h:35