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

FitSinSqTheta23CPT, but forcing octant. More...

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

Inheritance diagram for ana::FitSinSqTheta23CPTOctant:
ana::FitSinSqTheta23CPT ana::FitSinSqTheta23 ana::StanFitSupport< IConstrainedFitVar > ana::IConstrainedFitVar ana::IFitVar

Public Member Functions

 FitSinSqTheta23CPTOctant (osc::ENuSign nuSign, bool second=false)
 
double LowLimit () const override
 
double HighLimit () const override
 
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
 
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
 

Protected Attributes

const bool fSecond
 
const osc::ENuSign fNuSign
 

Detailed Description

FitSinSqTheta23CPT, but forcing octant.

Definition at line 172 of file FitVarsCPT.h.

Constructor & Destructor Documentation

ana::FitSinSqTheta23CPTOctant::FitSinSqTheta23CPTOctant ( osc::ENuSign  nuSign,
bool  second = false 
)
inlineexplicit

Definition at line 175 of file FitVarsCPT.h.

176  : StanFitSupport<IConstrainedFitVar>( ((nuSign==osc::ENuSign::kNu) ? "ssth23_nu" : "ssth23_nubar")
177  + std::string(second ? "_UO" : "_LO"),
178  ((nuSign==osc::ENuSign::kNu) ? "sin^{2}#theta_{23}"
179  : "sin^{2}#bar{#theta}_{23}")
180  + std::string(second ? " UO" : " LO")),
181 
183  {}
FitSinSqTheta23CPT(osc::ENuSign nuSign)
Definition: FitVarsCPT.h:145
enum BeamMode string

Member Function Documentation

template<typename T >
T ana::IConstrainedFitVar::Clamp ( T  val) const
inlineprotectedinherited
stan::math::var ana::FitSinSqTheta23::GetValue ( const osc::IOscCalcAdjustableStan osc) const
overridevirtualinherited

Implements ana::StanFitSupport< IConstrainedFitVar >.

Definition at line 98 of file FitVars.cxx.

References osc::_IOscCalcAdjustable< T >::GetTh23(), std::sin(), and util::sqr().

99  {
100  return util::sqr(sin(osc->GetTh23()));
101  }
virtual T GetTh23() const
Definition: IOscCalc.h:94
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
T sin(T number)
Definition: d0nt_math.hpp:132
double ana::FitSinSqTheta23CPT::GetValue ( const osc::IOscCalcAdjustable osc) const
overridevirtualinherited

Reimplemented from ana::FitSinSqTheta23.

Definition at line 73 of file FitVarsCPT.cxx.

References osc::DowncastToCPT(), ana::FitDmSq21CPT::fNuSign, std::sin(), and util::sqr().

75  { return util::sqr(sin( osc::DowncastToCPT(osc)->GetTh23(fNuSign) )); }
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
const osc::ENuSign fNuSign
Definition: FitVarsCPT.h:160
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
T sin(T number)
Definition: d0nt_math.hpp:132
double ana::FitSinSqTheta23CPTOctant::HighLimit ( ) const
inlineoverridevirtual

Reimplemented from ana::FitSinSqTheta23.

Definition at line 185 of file FitVarsCPT.h.

185 { return !fSecond ? kSinsqtheta23Limit : 1; }
constexpr double kSinsqtheta23Limit
Definition: FitVarsCPT.h:169
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::FitSinSqTheta23CPTOctant::LowLimit ( ) const
inlineoverridevirtual

Reimplemented from ana::FitSinSqTheta23.

Definition at line 184 of file FitVarsCPT.h.

References ana::kSinsqtheta23Limit.

184 { return !fSecond ? 0 : kSinsqtheta23Limit; }
constexpr double kSinsqtheta23Limit
Definition: FitVarsCPT.h:169
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::FitSinSqTheta23::SetValue ( osc::IOscCalcAdjustableStan osc,
stan::math::var  val 
) const
overridevirtualinherited

Implements ana::StanFitSupport< IConstrainedFitVar >.

Definition at line 110 of file FitVars.cxx.

References std::asin(), lem::Clamp(), osc::_IOscCalcAdjustable< T >::SetTh23(), and std::sqrt().

111  {
112  osc->SetTh23(asin(sqrt(this->Clamp(val))));
113  }
T sqrt(T number)
Definition: d0nt_math.hpp:156
T Clamp(T val) const
Definition: IFitVar.h:60
virtual void SetTh23(const T &th23)=0
T asin(T number)
Definition: d0nt_math.hpp:60
void ana::FitSinSqTheta23CPT::SetValue ( osc::IOscCalcAdjustable osc,
double  val 
) const
overridevirtualinherited

Reimplemented from ana::FitSinSqTheta23.

Definition at line 77 of file FitVarsCPT.cxx.

References std::asin(), ana::IConstrainedFitVar::Clamp(), osc::DowncastToCPT(), ana::FitDmSq21CPT::fNuSign, osc::OscCalcCPT::SetTh23(), and std::sqrt().

const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
T sqrt(T number)
Definition: d0nt_math.hpp:156
const osc::ENuSign fNuSign
Definition: FitVarsCPT.h:160
T Clamp(T val) const
Definition: IFitVar.h:60
void SetTh23(const double &th23) override
Definition: OscCalcCPT.h:74
T asin(T number)
Definition: d0nt_math.hpp:60
const std::string& ana::IFitVar::ShortName ( ) const
inlineinherited

Member Data Documentation

const osc::ENuSign ana::FitSinSqTheta23CPT::fNuSign
protectedinherited

Definition at line 160 of file FitVarsCPT.h.

const bool ana::FitSinSqTheta23CPTOctant::fSecond
protected

Definition at line 187 of file FitVarsCPT.h.


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