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

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

#include "/cvmfs/"

Inheritance diagram for ana::GaussianConstraint:

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 

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  }
double sigma(TH1F *hist, double percentile)

Member Function Documentation

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

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

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

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

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

Definition at line 32 of file GaussianConstraint.h.

Referenced by ChiSq().

double ana::GaussianConstraint::fSigma

Definition at line 32 of file GaussianConstraint.h.

Referenced by ChiSq().

const IFitVar* ana::GaussianConstraint::fVar

Definition at line 31 of file GaussianConstraint.h.

Referenced by ChiSq().

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