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

$ \Delta m^2_{32}\times10^3{\rm eV}^2 $ More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/CAFAna/Vars/FitVars.h"

Inheritance diagram for ana::FitDmSq32Scaled:
ana::StanFitSupport< IConstrainedFitVar > ana::IConstrainedFitVar ana::IFitVar ana::FitDmSq32ScaledCPT

Public Member Functions

 FitDmSq32Scaled ()
 
double GetValue (const osc::IOscCalcAdjustable *osc) const override
 
stan::math::var GetValue (const osc::IOscCalcAdjustableStan *osc) const override
 
void SetValue (osc::IOscCalcAdjustable *osc, double val) const override
 
void SetValue (osc::IOscCalcAdjustableStan *osc, stan::math::var val) const override
 
double LowLimit () const override
 
double HighLimit () const override
 
virtual stan::math::var Prior (const stan::math::var &var, const osc::IOscCalcAdjustableStan *calc) const
 
virtual stan::math::var LogPrior (const stan::math::var &var, const osc::IOscCalcAdjustableStan *calc) const
 
double Penalty (double val, osc::IOscCalcAdjustable *) const override
 Override the default implementation with one that pushes back towards the center of the constrained space. More...
 
const std::stringShortName () const
 
const std::stringLatexName () const
 

Protected Member Functions

template<typename T >
T Clamp (T val) const
 

Detailed Description

$ \Delta m^2_{32}\times10^3{\rm eV}^2 $

Definition at line 167 of file FitVars.h.

Constructor & Destructor Documentation

ana::FitDmSq32Scaled::FitDmSq32Scaled ( )
inline

Definition at line 170 of file FitVars.h.

References ana::FitTheta13::GetValue(), ana::FitTheta13::SetValue(), and febshutoff_auto::val.

171  : StanFitSupport<IConstrainedFitVar>("dmsq32scaled", "#Deltam^{2}_{32} (10^{-3} eV^{2})")
172  {}

Member Function Documentation

template<typename T >
T ana::IConstrainedFitVar::Clamp ( T  val) const
inlineprotectedinherited
double ana::FitDmSq32Scaled::GetValue ( const osc::IOscCalcAdjustable osc) const
overridevirtual

Implements ana::IFitVar.

Reimplemented in ana::FitDmSq32ScaledCPT.

Definition at line 183 of file FitVars.cxx.

References osc::_IOscCalcAdjustable< T >::GetDmsq32().

Referenced by ana::FitDmSq32ScaledCPT::FitDmSq32ScaledCPT().

184  {
185  return osc->GetDmsq32()*1000.0;
186  }
virtual T GetDmsq32() const
Definition: IOscCalc.h:91
stan::math::var ana::FitDmSq32Scaled::GetValue ( const osc::IOscCalcAdjustableStan osc) const
overridevirtual

Implements ana::StanFitSupport< IConstrainedFitVar >.

Definition at line 189 of file FitVars.cxx.

References osc::_IOscCalcAdjustable< T >::GetDmsq32().

190  {
191  return osc->GetDmsq32()*1000.0;;
192  }
virtual T GetDmsq32() const
Definition: IOscCalc.h:91
double ana::FitDmSq32Scaled::HighLimit ( ) const
inlineoverridevirtual

Implements ana::IConstrainedFitVar.

Definition at line 183 of file FitVars.h.

References ana::kFitDmSq32Scaled.

183 {return +1000;};
const std::string& ana::IFitVar::LatexName ( ) const
inlineinherited
virtual stan::math::var ana::StanFitSupport< IConstrainedFitVar >::LogPrior ( const stan::math::var var,
const osc::IOscCalcAdjustableStan calc 
) const
inlinevirtualinherited

Log of the prior probability density. Default implementation just does log(Prior()), but this can be overridden if there optimizations that speed up the calculation.

Definition at line 102 of file IFitVar.h.

102 {return StanLog(Prior(var, calc));}
virtual stan::math::var Prior(const stan::math::var &var, const osc::IOscCalcAdjustableStan *calc) const
Definition: IFitVar.h:98
stan::math::var StanLog(const stan::math::var &x)
Definition: IFitVar.cxx:30
double ana::FitDmSq32Scaled::LowLimit ( ) const
inlineoverridevirtual

Implements ana::IConstrainedFitVar.

Definition at line 182 of file FitVars.h.

182 {return -1000;};
double ana::IConstrainedFitVar::Penalty ( double  val,
osc::IOscCalcAdjustable  
) const
overridevirtualinherited

Override the default implementation with one that pushes back towards the center of the constrained space.

Reimplemented from ana::IFitVar.

Definition at line 8 of file IFitVar.cxx.

References hi(), ana::IConstrainedFitVar::HighLimit(), lo(), ana::IConstrainedFitVar::LowLimit(), extractScale::mean, Munits::rad, and util::sqr().

Referenced by ana::SigmaDelta::SigmaPenalty().

10  {
11  const auto lo = LowLimit();
12  const auto hi = HighLimit();
13 
14  if (val >= lo && val <= hi) return 0;
15 
16  // Try to direct fit back towards centre of the space. Engineer penalty to
17  // be zero at the limits.
18  const auto mean = (lo + hi) / 2;
19  const auto rad = (hi - lo) / 2;
20  return util::sqr((val - mean) / rad) - 1;
21 
22 
23  // if(val < lo) return util::sqr(lo-val);
24  // if(val > hi) return util::sqr(val-hi);
25  // return 0;
26  }
virtual double HighLimit() const =0
TSpline3 lo("lo", xlo, ylo, 12,"0")
virtual double LowLimit() const =0
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
TSpline3 hi("hi", xhi, yhi, 18,"0")
static constexpr Double_t rad
Definition: Munits.h:162
virtual stan::math::var ana::StanFitSupport< IConstrainedFitVar >::Prior ( const stan::math::var var,
const osc::IOscCalcAdjustableStan calc 
) const
inlinevirtualinherited

The prior probability density distribution on this variable (which can depend on others if needed). If there are optimizations that can make log(Prior()) more expensive than a direct implementation, consider implementing LogPrior() directly instead.

Definition at line 98 of file IFitVar.h.

98 {return StanExp(LogPrior(var, calc));}
stan::math::var StanExp(const stan::math::var &x)
Definition: IFitVar.cxx:29
virtual stan::math::var LogPrior(const stan::math::var &var, const osc::IOscCalcAdjustableStan *calc) const
Definition: IFitVar.h:102
void ana::FitDmSq32Scaled::SetValue ( osc::IOscCalcAdjustable osc,
double  val 
) const
overridevirtual

Implements ana::IFitVar.

Reimplemented in ana::FitDmSq32ScaledCPT.

Definition at line 195 of file FitVars.cxx.

References lem::Clamp(), and osc::_IOscCalcAdjustable< T >::SetDmsq32().

Referenced by ana::FitDmSq32ScaledCPT::FitDmSq32ScaledCPT().

196  {
197  osc->SetDmsq32(this->Clamp(val)/1000.0);
198  }
virtual void SetDmsq32(const T &dmsq32)=0
T Clamp(T val) const
Definition: IFitVar.h:60
void ana::FitDmSq32Scaled::SetValue ( osc::IOscCalcAdjustableStan osc,
stan::math::var  val 
) const
overridevirtual

Implements ana::StanFitSupport< IConstrainedFitVar >.

Definition at line 201 of file FitVars.cxx.

References lem::Clamp(), and osc::_IOscCalcAdjustable< T >::SetDmsq32().

202  {
203  osc->SetDmsq32(this->Clamp(val)/1000.0);
204  }
virtual void SetDmsq32(const T &dmsq32)=0
T Clamp(T val) const
Definition: IFitVar.h:60
const std::string& ana::IFitVar::ShortName ( ) const
inlineinherited

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