All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ana::SystComponentScale Class Reference

Uncertainty in the scale of a single component of the spectrum. More...

#include <SystComponentScale.h>

Inheritance diagram for ana::SystComponentScale:
ana::ISyst

Public Types

enum  ESystType { kLinear, kExponential }
 

Public Member Functions

 SystComponentScale (const std::string &shortName, const std::string &latexName, const Cut &cut, double oneSigma, ESystType type=kExponential)
 
 ~SystComponentScale ()
 
double OneSigmaScale () const
 Scaling this component between 1/(1+x) and (1+x) is the 1-sigma range. More...
 
const CutGetCut () const
 
void Shift (double sigma, caf::SRSliceProxy *slc, double &weight) const override
 Perform the systematic shift. More...
 
virtual void SaveTo (TDirectory *dir) const
 
- Public Member Functions inherited from ana::ISyst
 ISyst (const std::string &shortName, const std::string &latexName, bool applyPenalty=true, double min=-3, double max=+3)
 
 ISyst (const ISyst &)=delete
 
 ISyst (ISyst &&rhs)=delete
 
virtual ~ISyst ()
 
void operator= (const ISyst &)=delete
 
void operator= (ISyst &&)=delete
 
virtual std::string ShortName () const final
 The name printed out to the screen. More...
 
virtual std::string LatexName () const final
 The name used on plots (ROOT's TLatex syntax) More...
 
virtual double Penalty (double x) const
 
virtual bool ApplyPenalty () const
 Should a penalty be applied for this shift? More...
 
virtual double Min () const
 Return the min/max value for this syst. More...
 
virtual double Max () const
 
virtual int PredInterpMaxNSigma () const
 

Static Public Member Functions

static std::unique_ptr
< SystComponentScale
LoadFrom (TDirectory *dir)
 

Protected Attributes

Cut fCut
 
double fOneSigma
 
ESystType fType
 

Detailed Description

Uncertainty in the scale of a single component of the spectrum.

Definition at line 9 of file SystComponentScale.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

ana::SystComponentScale::SystComponentScale ( const std::string &  shortName,
const std::string &  latexName,
const Cut cut,
double  oneSigma,
ESystType  type = kExponential 
)
inline
Parameters
cutSelect the component to be scaled

Definition at line 15 of file SystComponentScale.h.

20  : ISyst(shortName, latexName),
21  fCut(cut), fOneSigma(oneSigma), fType(type)
22  {
23  }
ISyst(const std::string &shortName, const std::string &latexName, bool applyPenalty=true, double min=-3, double max=+3)
Definition: ISyst.cxx:9
ana::SystComponentScale::~SystComponentScale ( )

Definition at line 12 of file SystComponentScale.cxx.

13  {
14  }

Member Function Documentation

const Cut& ana::SystComponentScale::GetCut ( ) const
inline

Definition at line 30 of file SystComponentScale.h.

std::unique_ptr< SystComponentScale > ana::SystComponentScale::LoadFrom ( TDirectory *  dir)
static

Definition at line 33 of file SystComponentScale.cxx.

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  }
BEGIN_PROLOG could also be cerr
tuple dir
Definition: dropbox.py:28
double ana::SystComponentScale::OneSigmaScale ( ) const
inline

Scaling this component between 1/(1+x) and (1+x) is the 1-sigma range.

Definition at line 28 of file SystComponentScale.h.

28 {return fOneSigma;}
virtual void ana::SystComponentScale::SaveTo ( TDirectory *  dir) const
inlinevirtual

Definition at line 39 of file SystComponentScale.h.

39 {assert(0 && "unimplemented");}
void ana::SystComponentScale::Shift ( double  sigma,
caf::SRSliceProxy sr,
double &  weight 
) const
overridevirtual

Perform the systematic shift.

Parameters
sigmaNumber of sigma to shift record by
srThe record to inspect and alter
weightScale this weight for reweighting systematics

Implements ana::ISyst.

Definition at line 17 of file SystComponentScale.cxx.

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  }

Member Data Documentation

Cut ana::SystComponentScale::fCut
protected

Definition at line 42 of file SystComponentScale.h.

double ana::SystComponentScale::fOneSigma
protected

Definition at line 43 of file SystComponentScale.h.

ESystType ana::SystComponentScale::fType
protected

Definition at line 44 of file SystComponentScale.h.


The documentation for this class was generated from the following files: