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-10-26/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::IOscCalcAdjustable *osc, const SystShifts &shift=SystShifts::Nominal()) const override
 
virtual stan::math::var LogLikelihood (osc::IOscCalcAdjustableStan *osc, const SystShifts &syst=kNoShift) const
 
virtual void SaveTo (TDirectory *dir, const std::string &name) 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(), and ana::SystShifts::Nominal().

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

Member Function Documentation

double ana::GaussianConstraint::ChiSq ( osc::IOscCalcAdjustable 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::IOscCalcAdjustable *osc) const =0
virtual stan::math::var ana::IExperiment::LogLikelihood ( osc::IOscCalcAdjustableStan osc,
const SystShifts syst = kNoShift 
) const
inlinevirtualinherited

Reimplemented in test::GaussQuadExperiment, ana::SingleSampleExperiment, and ana::MultiExperiment.

Definition at line 25 of file IExperiment.h.

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

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

27  {
28  assert(false && "unimplemented");
29  return 0;
30  };
assert(nhit_max >=nhit_nbins)
void ana::IExperiment::SaveTo ( TDirectory *  dir,
const std::string &  name 
) const
virtualinherited

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

Definition at line 32 of file IExperiment.cxx.

References ana::assert().

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

33  {
34  assert(0 && "Not implemented");
35  }
assert(nhit_max >=nhit_nbins)

Member Data Documentation

double ana::GaussianConstraint::fMean
protected

Definition at line 24 of file GaussianConstraint.h.

Referenced by ChiSq().

double ana::GaussianConstraint::fSigma
protected

Definition at line 24 of file GaussianConstraint.h.

Referenced by ChiSq().

const IFitVar* ana::GaussianConstraint::fVar
protected

Definition at line 23 of file GaussianConstraint.h.

Referenced by ChiSq().


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