Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ana::SigmaDelta Class Reference

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

Public Member Functions

 SigmaDelta (osc::OscCalcCPT *osc, const IConstrainedFitVar &x, const IConstrainedFitVar &y)
 

Private Member Functions

double GetSigma (const osc::IOscCalcAdjustable *osc) const
 
double GetDelta (const osc::IOscCalcAdjustable *osc) const
 
void SetSigma (osc::IOscCalcAdjustable *osc, double val)
 
void SetDelta (osc::IOscCalcAdjustable *osc, double val)
 
double SigmaPenalty (double val, osc::IOscCalcAdjustable *) const
 
double DeltaPenalty (double val) const
 
void SetFitVars (osc::OscCalcCPT *)
 

Private Attributes

const IConstrainedFitVarfXvar
 
const IConstrainedFitVarfYvar
 
const double fCenterDelta
 
const double fCenterSigma
 

Friends

class FitSigmaCPT
 
class FitDeltaCPT
 

Detailed Description

Helper class, allows FitVar pairs like var1+var2, var1-var2 Requires CPT calculator to cache data when parallelized

Definition at line 246 of file FitVarsCPT.h.

Constructor & Destructor Documentation

ana::SigmaDelta::SigmaDelta ( osc::OscCalcCPT osc,
const IConstrainedFitVar x,
const IConstrainedFitVar y 
)

Definition at line 103 of file FitVarsCPT.cxx.

References ana::assert(), fCenterDelta, fCenterSigma, osc::OscCalcCPT::fSigDel, fXvar, fYvar, ana::IFitVar::GetValue(), ana::IConstrainedFitVar::HighLimit(), and ana::IConstrainedFitVar::LowLimit().

106  : fXvar(x), fYvar(y),
109  {
110  // Check to make sure the allowed area is square. If not, the logic is
111  // more complicated, but most pairs of CPT FitVars have matched ranges.
114  osc->fSigDel[this] = {fXvar.GetValue(osc)+fYvar.GetValue(osc),
115  fXvar.GetValue(osc)-fYvar.GetValue(osc)};
116  }
const double fCenterSigma
Definition: FitVarsCPT.h:265
virtual double HighLimit() const =0
virtual double LowLimit() const =0
const double fCenterDelta
Definition: FitVarsCPT.h:264
const IConstrainedFitVar & fYvar
Definition: FitVarsCPT.h:262
assert(nhit_max >=nhit_nbins)
const IConstrainedFitVar & fXvar
Definition: FitVarsCPT.h:261
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const =0

Member Function Documentation

double ana::SigmaDelta::DeltaPenalty ( double  val) const
private

Definition at line 137 of file FitVarsCPT.cxx.

138  {
139  return 0; //have to check both vars, so just apply the penalty in sigma
140  }
double ana::SigmaDelta::GetDelta ( const osc::IOscCalcAdjustable osc) const
private

Definition at line 120 of file FitVarsCPT.cxx.

References osc::DowncastToCPT(), and osc::OscCalcCPT::fSigDel.

121  { return osc::DowncastToCPT(osc)->fSigDel[this].second; }
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
double ana::SigmaDelta::GetSigma ( const osc::IOscCalcAdjustable osc) const
private

Definition at line 118 of file FitVarsCPT.cxx.

References osc::DowncastToCPT(), and osc::OscCalcCPT::fSigDel.

119  { return osc::DowncastToCPT(osc)->fSigDel[this].first; }
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
void ana::SigmaDelta::SetDelta ( osc::IOscCalcAdjustable osc,
double  val 
)
private

Definition at line 130 of file FitVarsCPT.cxx.

References osc::DowncastToCPT(), osc::OscCalcCPT::fSigDel, SetFitVars(), and febshutoff_auto::val.

131  {
133  cpt->fSigDel[this].second = val;
134  SetFitVars(cpt);
135  }
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
void SetFitVars(osc::OscCalcCPT *)
Definition: FitVarsCPT.cxx:155
void ana::SigmaDelta::SetFitVars ( osc::OscCalcCPT osc)
private

Definition at line 155 of file FitVarsCPT.cxx.

References delta, fCenterDelta, fCenterSigma, osc::OscCalcCPT::fSigDel, fXvar, fYvar, ana::IFitVar::GetValue(), ana::IFitVar::SetValue(), and sigma().

Referenced by SetDelta(), and SetSigma().

156  {
157  double sigma = osc->fSigDel[this].first;
158  double delta = osc->fSigDel[this].second;
159  //if requested value is impossible, try to at least maintain delta
160  if( (delta>fCenterDelta)==(sigma>fCenterSigma) )
161  {
162  fXvar.SetValue(osc, (sigma+delta)/2);
163  double xc = fXvar.GetValue(osc);
164  fYvar.SetValue(osc, xc-delta);
165  }
166  else
167  {
168  fYvar.SetValue(osc, (sigma-delta)/2);
169  double yc = fYvar.GetValue(osc);
170  fXvar.SetValue(osc, yc+delta);
171  }
172  }
const double fCenterSigma
Definition: FitVarsCPT.h:265
double delta
Definition: runWimpSim.h:98
const double fCenterDelta
Definition: FitVarsCPT.h:264
const IConstrainedFitVar & fYvar
Definition: FitVarsCPT.h:262
double sigma(TH1F *hist, double percentile)
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const =0
const IConstrainedFitVar & fXvar
Definition: FitVarsCPT.h:261
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const =0
void ana::SigmaDelta::SetSigma ( osc::IOscCalcAdjustable osc,
double  val 
)
private

Definition at line 123 of file FitVarsCPT.cxx.

References osc::DowncastToCPT(), osc::OscCalcCPT::fSigDel, SetFitVars(), and febshutoff_auto::val.

124  {
126  cpt->fSigDel[this].first = val;
127  SetFitVars(cpt);
128  }
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
void SetFitVars(osc::OscCalcCPT *)
Definition: FitVarsCPT.cxx:155
double ana::SigmaDelta::SigmaPenalty ( double  val,
osc::IOscCalcAdjustable osc 
) const
private

Definition at line 142 of file FitVarsCPT.cxx.

References delta, osc::DowncastToCPT(), osc::OscCalcCPT::fSigDel, fXvar, fYvar, ana::IConstrainedFitVar::HighLimit(), ana::IConstrainedFitVar::LowLimit(), and ana::IConstrainedFitVar::Penalty().

144  {
146  double delta = cpt->fSigDel[this].second;
147 
148  return ( fXvar.Penalty( (val+delta)/2 , osc)
149  + fYvar.Penalty( (val-delta)/2 , osc)
150  + 1000*(delta > (fXvar.HighLimit()-fYvar.LowLimit()) )
151  + 1000*(delta < (fXvar.LowLimit()-fYvar.HighLimit()) )
152  ); //extra 1000 is in case contour hits impossible region
153  }
virtual double HighLimit() const =0
const OscCalcCPT * DowncastToCPT(const IOscCalcAdjustable *osc)
Definition: OscCalcCPT.cxx:232
double delta
Definition: runWimpSim.h:98
virtual double LowLimit() const =0
double Penalty(double val, osc::IOscCalcAdjustable *) const override
Override the default implementation with one that pushes back towards the center of the constrained s...
Definition: IFitVar.cxx:8
const IConstrainedFitVar & fYvar
Definition: FitVarsCPT.h:262
const IConstrainedFitVar & fXvar
Definition: FitVarsCPT.h:261

Friends And Related Function Documentation

friend class FitDeltaCPT
friend

Definition at line 249 of file FitVarsCPT.h.

friend class FitSigmaCPT
friend

Definition at line 248 of file FitVarsCPT.h.

Member Data Documentation

const double ana::SigmaDelta::fCenterDelta
private

Definition at line 264 of file FitVarsCPT.h.

Referenced by SetFitVars(), and SigmaDelta().

const double ana::SigmaDelta::fCenterSigma
private

Definition at line 265 of file FitVarsCPT.h.

Referenced by SetFitVars(), and SigmaDelta().

const IConstrainedFitVar& ana::SigmaDelta::fXvar
private

Definition at line 261 of file FitVarsCPT.h.

Referenced by SetFitVars(), SigmaDelta(), and SigmaPenalty().

const IConstrainedFitVar& ana::SigmaDelta::fYvar
private

Definition at line 262 of file FitVarsCPT.h.

Referenced by SetFitVars(), SigmaDelta(), and SigmaPenalty().


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