All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
ana::ISyst Class Referenceabstract

Encapsulate code to systematically shift a caf::StandardRecord. More...

#include <ISyst.h>

Inheritance diagram for ana::ISyst:
ana::BoosterFluxHadronSyst ana::EnergyScaleSyst ana::NuMIFluxSyst ana::SBNWeightSyst ana::SystComponentScale ToyEnergyScaleSyst ToyNormSyst

Public Member Functions

 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 void Shift (double sigma, caf::SRSliceProxy *sr, double &weight) const =0
 Perform the systematic shift. More...
 
virtual int PredInterpMaxNSigma () const
 

Private Attributes

std::string fShortName
 
std::string fLatexName
 
bool fApplyPenalty
 
double fMin
 
double fMax
 

Detailed Description

Encapsulate code to systematically shift a caf::StandardRecord.

The Shift() function alters the caf::StandardRecord or the weight associated with the event.

Definition at line 14 of file ISyst.h.

Constructor & Destructor Documentation

ana::ISyst::ISyst ( const std::string &  shortName,
const std::string &  latexName,
bool  applyPenalty = true,
double  min = -3,
double  max = +3 
)

Definition at line 9 of file ISyst.cxx.

14  : fShortName(shortName), fLatexName(latexName), fApplyPenalty(applyPenalty), fMin(min), fMax(max)
15  {
17  }
bool fApplyPenalty
Definition: ISyst.h:64
double fMin
Definition: ISyst.h:65
std::string fLatexName
Definition: ISyst.h:63
double fMax
Definition: ISyst.h:66
static void Register(const ISyst *s)
std::string fShortName
Definition: ISyst.h:62
ana::ISyst::ISyst ( const ISyst )
delete
ana::ISyst::ISyst ( ISyst &&  rhs)
delete
ana::ISyst::~ISyst ( )
virtual

Definition at line 20 of file ISyst.cxx.

21  {
22  // Normally ISysts should last for the life of the process, but in case one
23  // is deleted it's best not to leave a dangling pointer in SystRegistry.
25  }
static void UnRegister(const ISyst *s)

Member Function Documentation

virtual bool ana::ISyst::ApplyPenalty ( ) const
inlinevirtual

Should a penalty be applied for this shift?

Definition at line 38 of file ISyst.h.

38 {return fApplyPenalty;}
bool fApplyPenalty
Definition: ISyst.h:64
virtual std::string ana::ISyst::LatexName ( ) const
inlinefinalvirtual

The name used on plots (ROOT's TLatex syntax)

Definition at line 33 of file ISyst.h.

33 {return fLatexName;}
std::string fLatexName
Definition: ISyst.h:63
virtual double ana::ISyst::Max ( ) const
inlinevirtual

Definition at line 42 of file ISyst.h.

42 {return fMax;}
double fMax
Definition: ISyst.h:66
virtual double ana::ISyst::Min ( ) const
inlinevirtual

Return the min/max value for this syst.

Definition at line 41 of file ISyst.h.

41 {return fMin;}
double fMin
Definition: ISyst.h:65
void ana::ISyst::operator= ( const ISyst )
delete
void ana::ISyst::operator= ( ISyst &&  )
delete
double ana::ISyst::Penalty ( double  x) const
virtual

Definition at line 28 of file ISyst.cxx.

29  {
30  if(fApplyPenalty){
31  // Regular quadratic penalty term
32  return x*x;
33  }
34  else{
35  // Otherwise, no penalty within range, but still apply one outside
36  if(x >= Min() && x <= Max()) return 0;
37 
38  // Try to direct fit back towards centre of the space. Engineer penalty
39  // to be zero at the limits.
40  const double mean = (Min()+Max())/2;
41  const double rad = (Max()-Min())/2;
42  return util::sqr((x-mean)/rad)-1;
43  }
44  }
bool fApplyPenalty
Definition: ISyst.h:64
process_name opflash particleana ie x
virtual double Max() const
Definition: ISyst.h:42
virtual double Min() const
Return the min/max value for this syst.
Definition: ISyst.h:41
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:13
virtual int ana::ISyst::PredInterpMaxNSigma ( ) const
inlinevirtual

PredictionInterp normally interpolates between spectra made at +/-1,2,3sigma. For some systematics that's overkill. Override this function to specify different behaviour for this systematic.

Definition at line 56 of file ISyst.h.

57  {
58  return 3;
59  }
virtual void ana::ISyst::Shift ( double  sigma,
caf::SRSliceProxy sr,
double &  weight 
) const
pure virtual

Perform the systematic shift.

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

Implemented in ana::EnergyScaleSyst, ana::SBNWeightSyst, ana::SystComponentScale, ToyNormSyst, ana::NuMIFluxSyst, ana::BoosterFluxHadronSyst, and ToyEnergyScaleSyst.

virtual std::string ana::ISyst::ShortName ( ) const
inlinefinalvirtual

The name printed out to the screen.

Definition at line 30 of file ISyst.h.

30 {return fShortName;}
std::string fShortName
Definition: ISyst.h:62

Member Data Documentation

bool ana::ISyst::fApplyPenalty
private

Definition at line 64 of file ISyst.h.

std::string ana::ISyst::fLatexName
private

Definition at line 63 of file ISyst.h.

double ana::ISyst::fMax
private

Definition at line 66 of file ISyst.h.

double ana::ISyst::fMin
private

Definition at line 65 of file ISyst.h.

std::string ana::ISyst::fShortName
private

Definition at line 62 of file ISyst.h.


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