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

FitSinSq2Theta12, but for one sign only. More...

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

Inheritance diagram for ana::FitSinSq2Theta12CPT:
ana::FitSinSq2Theta12 ana::IConstrainedFitVar ana::IFitVar

Public Member Functions

 FitSinSq2Theta12CPT (osc::ENuSign nuSign)
 
double GetValue (const osc::IOscCalcAdjustable *osc) const override
 
void SetValue (osc::IOscCalcAdjustable *osc, double val) const override
 
double LowLimit () const override
 
double HighLimit () const override
 
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 osc::ENuSign fNuSign
 

Detailed Description

FitSinSq2Theta12, but for one sign only.

Definition at line 221 of file FitVarsCPT.h.

Constructor & Destructor Documentation

ana::FitSinSq2Theta12CPT::FitSinSq2Theta12CPT ( osc::ENuSign  nuSign)
inlineexplicit

Definition at line 224 of file FitVarsCPT.h.

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

225  : IConstrainedFitVar((nuSign==osc::ENuSign::kNu) ? "ss2th12_nu" : "ss2th12_nubar",
226  (nuSign==osc::ENuSign::kNu) ? "sin^{2}2#theta_{12}"
227  : "sin^{2}2#bar{#theta}_{12}"),
228  fNuSign(nuSign)
229  {}
const osc::ENuSign fNuSign
Definition: FitVarsCPT.h:235

Member Function Documentation

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

Reimplemented from ana::FitSinSq2Theta12.

Definition at line 92 of file FitVarsCPT.cxx.

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

94  { return util::sqr(sin(2*osc::DowncastToCPT(osc)->GetTh12(fNuSign) )); }
const osc::ENuSign fNuSign
Definition: FitVarsCPT.h:235
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
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::FitSinSq2Theta12::HighLimit ( ) const
inlineoverridevirtualinherited

Implements ana::IConstrainedFitVar.

Definition at line 282 of file FitVars.h.

References ana::kFitSinSq2Theta12.

282 {return 1;};
const std::string& ana::IFitVar::LatexName ( ) const
inlineinherited
double ana::FitSinSq2Theta12::LowLimit ( ) const
inlineoverridevirtualinherited

Implements ana::IConstrainedFitVar.

Definition at line 281 of file FitVars.h.

281 {return 0;};
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
void ana::FitSinSq2Theta12CPT::SetValue ( osc::IOscCalcAdjustable osc,
double  val 
) const
overridevirtual

Reimplemented from ana::FitSinSq2Theta12.

Definition at line 96 of file FitVarsCPT.cxx.

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

98  { osc::DowncastToCPT(osc)->SetTh12(asin(sqrt( Clamp(val) ))/2, fNuSign); }
const osc::ENuSign fNuSign
Definition: FitVarsCPT.h:235
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
T sqrt(T number)
Definition: d0nt_math.hpp:156
void SetTh12(const double &th12) override
Definition: OscCalcCPT.h:70
T Clamp(T val) const
Definition: IFitVar.h:60
T asin(T number)
Definition: d0nt_math.hpp:60
const std::string& ana::IFitVar::ShortName ( ) const
inlineinherited

Member Data Documentation

const osc::ENuSign ana::FitSinSq2Theta12CPT::fNuSign
protected

Definition at line 235 of file FitVarsCPT.h.


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