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/N20-07-07/CAFAna/Experiment/GaussianConstraint.h"

Inheritance diagram for ana::GaussianConstraint:
ana::IExperiment

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 stan::math::var LogLikelihood (osc::IOscCalculatorAdjustableStan *osc, const SystShifts &syst=kNoShift) const
 
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

Definition at line 14 of file GaussianConstraint.h.

References ChiSq(), ana::SystShifts::Nominal(), and plotSysts::shift.

15  : fVar(var), fMean(mean), fSigma(sigma)
16  {
17  }
var
double sigma(TH1F *hist, double percentile)

Member Function Documentation

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

Reimplemented from ana::IExperiment.

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::IExperiment.

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  }
virtual stan::math::var ana::IExperiment::LogLikelihood ( osc::IOscCalculatorAdjustableStan osc,
const SystShifts syst = kNoShift 
) const
inlinevirtualinherited

Reimplemented in test::GaussQuadExperiment.

Definition at line 38 of file IExperiment.h.

References ana::assert(), dir, and ana::IExperiment::SaveTo().

Referenced by ana::StanFitter::log_prob().

40  {
41  assert(false && "unimplemented");
42  return 0;
43  };
assert(nhit_max >=nhit_nbins)
void ana::IExperiment::SaveTo ( TDirectory *  dir) const
virtualinherited

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

Definition at line 40 of file IExperiment.cxx.

References ana::assert().

Referenced by ana::IExperiment::LogLikelihood().

41  {
42  assert(0 && "Not implemented");
43  }
assert(nhit_max >=nhit_nbins)

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: