Public Member Functions | Protected Attributes | List of all members
ana::GaussianConstraint Class Reference

A simple Gaussian constraint on an arbitrary IFitVar. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N19-12-08/CAFAna/Experiment/GaussianConstraint.h"

Inheritance diagram for ana::GaussianConstraint:
ana::IChiSqExperiment

Public Member Functions

 GaussianConstraint (const IFitVar *var, double mean, double sigma)
 
virtual double ChiSq (osc::IOscCalculatorAdjustable *osc, const SystShifts &shift=SystShifts::Nominal()) const override
 
virtual void Derivative (osc::IOscCalculator *calc, const SystShifts &shift, std::unordered_map< const ISyst *, double > &dchi) const override
 
virtual void SaveTo (TDirectory *dir) const
 

Protected Attributes

const IFitVarfVar
 
double fMean
 
double fSigma
 

Detailed Description

A simple Gaussian constraint on an arbitrary IFitVar.

Definition at line 11 of file GaussianConstraint.h.

Constructor & Destructor Documentation

ana::GaussianConstraint::GaussianConstraint ( const IFitVar var,
double  mean,
double  sigma 
)
inline

Member Function Documentation

double ana::GaussianConstraint::ChiSq ( osc::IOscCalculatorAdjustable osc,
const SystShifts shift = SystShifts::Nominal() 
) const
overridevirtual

Implements ana::IChiSqExperiment.

Definition at line 10 of file GaussianConstraint.cxx.

References fMean, fSigma, fVar, ana::IFitVar::GetValue(), and util::sqr().

Referenced by GaussianConstraint().

12  {
13  return util::sqr((fVar->GetValue(osc)-fMean)/fSigma);
14  }
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
virtual double GetValue(const osc::IOscCalculatorAdjustable *osc) const =0
virtual void ana::GaussianConstraint::Derivative ( osc::IOscCalculator calc,
const SystShifts shift,
std::unordered_map< const ISyst *, double > &  dchi 
) const
inlineoverridevirtual

Reimplemented from ana::IChiSqExperiment.

Definition at line 22 of file GaussianConstraint.h.

25  {
26  // Empty implementation (rather than clearing the vector) means we have
27  // zero derivative wrt systematics.
28  }
void ana::IChiSqExperiment::SaveTo ( TDirectory *  dir) const
virtualinherited

Reimplemented in ana::SingleSampleExperiment, ana::MultiExperiment, ana::SolarConstraints, ana::ReactorExperiment, and ana::CountingExperiment.

Definition at line 40 of file IChiSqExperiment.cxx.

Referenced by ana::IChiSqExperiment::Derivative().

41  {
42  assert(0 && "Not implemented");
43  }

Member Data Documentation

double ana::GaussianConstraint::fMean
protected

Definition at line 32 of file GaussianConstraint.h.

Referenced by ChiSq().

double ana::GaussianConstraint::fSigma
protected

Definition at line 32 of file GaussianConstraint.h.

Referenced by ChiSq().

const IFitVar* ana::GaussianConstraint::fVar
protected

Definition at line 31 of file GaussianConstraint.h.

Referenced by ChiSq().


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