All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SystComponentScale.cxx
Go to the documentation of this file.
2 
3 #include "TObjString.h"
4 #include "TDirectory.h"
5 
6 #include <cmath>
7 #include <iostream>
8 
9 namespace ana
10 {
11  //----------------------------------------------------------------------
13  {
14  }
15 
16  //----------------------------------------------------------------------
17  void SystComponentScale::Shift(double sigma,
18  caf::SRSliceProxy* slc,
19  double& weight) const
20  {
21  if(!fCut(slc)) return;
22 
23  if(fType == kExponential){
24  weight *= pow(1+fOneSigma, sigma);
25  }
26  else{
27  weight *= 1+sigma*fOneSigma;
28  weight = std::max(0., weight);
29  }
30  }
31 
32  //----------------------------------------------------------------------
33  std::unique_ptr<SystComponentScale> SystComponentScale::LoadFrom(TDirectory* dir)
34  {
35  TObjString* ptag = (TObjString*)dir->Get("type");
36  assert(ptag);
37 
38  const TString tag = ptag->GetString();
39 
40  std::cerr << "Unknown SystComponentScale type '" << tag << "'" << std::endl;
41  abort();
42  }
43 }
BEGIN_PROLOG could also be cerr
static std::unique_ptr< SystComponentScale > LoadFrom(TDirectory *dir)
process_name opflashCryoW ana
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
void Shift(double sigma, caf::SRSliceProxy *slc, double &weight) const override
Perform the systematic shift.
tuple dir
Definition: dropbox.py:28