Public Member Functions | Private Attributes | Friends | List of all members
cmf::Parameter Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/CovarianceMatrixFit/dataProducts/Parameter.h"

Public Member Functions

 Parameter ()
 
 Parameter (std::string const &name, cmf::DetType_t const &det, double const &val, bool const &fixed, float const &sigmaSize, float const &cv, float const &variance, bool const &nuisance, bool const &constrained, float const &lowerBound, float const &upperBound)
 
std::string const Name () const
 
double const & Value () const
 
uint8_t const & Key () const
 
cmf::DetType_t const Detector () const
 
float const & CentralValue () const
 
float const & Sigma () const
 
float const & Variance () const
 
bool const & IsFixed () const
 
bool const & IsOscPar () const
 
bool const & IsConstrained () const
 
bool const & IsNuisance () const
 
float const & LowerBound () const
 
float const & UpperBound () const
 
void SetValue (double const &val)
 
bool operator< (cmf::Parameter const &other) const
 
bool operator== (cmf::Parameter const &other) const
 

Private Attributes

uint8_t fKey
 key for this parameter More...
 
uint8_t fDetector
 which detector is this parameter for? More...
 
double fVal
 current value for the parameter in the fit More...
 
float fCentralVal
 central value for the parameter More...
 
float fSigmaSize
 size of 1 sigma More...
 
float fVariance
 amount parameter can vary when making random universes More...
 
bool fIsFixed
 is this parameter fixed during fits? More...
 
bool fIsOscPar
 is this parameter for oscillations or systematics? More...
 
bool fIsNuisance
 is this parameter treated as a nuisance parameter? More...
 
bool fIsConstrained
 is this parameter constrained in allowed values? More...
 
float fLowerBound
 lower bound for the constrained parameter More...
 
float fUpperBound
 upper bound for the constrained parameter More...
 

Friends

std::ostream & operator<< (std::ostream &o, cmf::Parameter const &par)
 

Detailed Description

Definition at line 81 of file Parameter.h.

Constructor & Destructor Documentation

cmf::Parameter::Parameter ( )

Definition at line 11 of file Parameter.cxx.

15 // , fPosition (0 )
16 // , fNumSigmaWgts (0 )
17  , fSigmaSize (1.e-5 )
18  , fVariance (1.e-5 )
19  , fIsFixed (false )
20  , fIsOscPar (false )
21  , fIsNuisance (false )
22  , fIsConstrained(false )
25  {
26  }
float fSigmaSize
size of 1 sigma
Definition: Parameter.h:128
static const double kGarbageDouble
Definition: Constants.h:22
float fCentralVal
central value for the parameter
Definition: Parameter.h:125
bool fIsConstrained
is this parameter constrained in allowed values?
Definition: Parameter.h:133
float fUpperBound
upper bound for the constrained parameter
Definition: Parameter.h:135
bool fIsOscPar
is this parameter for oscillations or systematics?
Definition: Parameter.h:131
float fLowerBound
lower bound for the constrained parameter
Definition: Parameter.h:134
static const float kGarbageFloat
Definition: Constants.h:23
uint8_t fDetector
which detector is this parameter for?
Definition: Parameter.h:123
bool fIsNuisance
is this parameter treated as a nuisance parameter?
Definition: Parameter.h:132
double fVal
current value for the parameter in the fit
Definition: Parameter.h:124
float fVariance
amount parameter can vary when making random universes
Definition: Parameter.h:129
bool fIsFixed
is this parameter fixed during fits?
Definition: Parameter.h:130
Float_t e
Definition: plot.C:35
cmf::Parameter::Parameter ( std::string const &  name,
cmf::DetType_t const &  det,
double const &  val,
bool const &  fixed,
float const &  sigmaSize,
float const &  cv,
float const &  variance,
bool const &  nuisance,
bool const &  constrained,
float const &  lowerBound,
float const &  upperBound 
)

Definition at line 29 of file Parameter.cxx.

References e, fIsFixed, fIsNuisance, fIsOscPar, fKey, fVariance, cmf::IsOscillationParameter(), LOG_WARNING, cmf::StringToOscParmType(), and cmf::VarNameToKey().

42  : fDetector (det )
43  , fVal (val )
44  , fCentralVal (cv )
45 // , fPosition (pos )
46 // , fNumSigmaWgts (numSigmaWgts)
47  , fSigmaSize (sigmaSize )
48  , fVariance (variance )
49  , fIsFixed (fixed )
50  , fIsOscPar (false )
51  , fIsNuisance (nuisance )
52  , fIsConstrained(constrained )
53  , fLowerBound (lowerBound )
54  , fUpperBound (upperBound )
55  {
56  if(fVariance < 1.e-5) fVariance = 1.e-5;
57 
59  fIsOscPar = true;
61  }
62  else
64 
65  // sanity check warning - if the parameter is fixed and labeled as nuisance,
66  // tell the user that the fixed part wins
67  if(fIsFixed && fIsNuisance){
68  LOG_WARNING("Parameter")
69  << name
70  << " is set to be fixed but is also set to be a nuisance parameter, "
71  << "assume that leaving it fixed is correct and set IsNuisance to "
72  << " false";
73 
74  fIsNuisance = false;
75  }
76 
77  }
const XML_Char * name
Definition: expat.h:151
float fSigmaSize
size of 1 sigma
Definition: Parameter.h:128
float fCentralVal
central value for the parameter
Definition: Parameter.h:125
bool fIsConstrained
is this parameter constrained in allowed values?
Definition: Parameter.h:133
float fUpperBound
upper bound for the constrained parameter
Definition: Parameter.h:135
bool fIsOscPar
is this parameter for oscillations or systematics?
Definition: Parameter.h:131
static uint8_t VarNameToKey(std::string const &name)
Definition: StaticFuncs.h:385
float fLowerBound
lower bound for the constrained parameter
Definition: Parameter.h:134
const std::string cv[Ncv]
uint8_t fDetector
which detector is this parameter for?
Definition: Parameter.h:123
bool fIsNuisance
is this parameter treated as a nuisance parameter?
Definition: Parameter.h:132
double fVal
current value for the parameter in the fit
Definition: Parameter.h:124
#define LOG_WARNING(category)
static bool IsOscillationParameter(std::string const &str)
float fVariance
amount parameter can vary when making random universes
Definition: Parameter.h:129
bool fIsFixed
is this parameter fixed during fits?
Definition: Parameter.h:130
uint8_t fKey
key for this parameter
Definition: Parameter.h:122
Float_t e
Definition: plot.C:35
double variance(Eigen::VectorXd x)
static cmf::OscParm_t StringToOscParmType(std::string const &str)

Member Function Documentation

float const& cmf::Parameter::CentralValue ( ) const
inline

Definition at line 104 of file Parameter.h.

104 { return fCentralVal; }
float fCentralVal
central value for the parameter
Definition: Parameter.h:125
cmf::DetType_t const cmf::Parameter::Detector ( ) const
inline

Definition at line 103 of file Parameter.h.

Referenced by cmf::Location::InsertParameter().

103 { return (cmf::DetType_t)fDetector; }
enum cmf::det_type DetType_t
uint8_t fDetector
which detector is this parameter for?
Definition: Parameter.h:123
bool const& cmf::Parameter::IsConstrained ( ) const
inline

Definition at line 109 of file Parameter.h.

Referenced by cmf::CovarianceFitHelper::InitializeMinimizer(), and cmf::operator<<().

109 { return fIsConstrained; }
bool fIsConstrained
is this parameter constrained in allowed values?
Definition: Parameter.h:133
bool const& cmf::Parameter::IsFixed ( ) const
inline

Definition at line 107 of file Parameter.h.

Referenced by cmf::operator<<().

107 { return fIsFixed; }
bool fIsFixed
is this parameter fixed during fits?
Definition: Parameter.h:130
bool const& cmf::Parameter::IsNuisance ( ) const
inline

Definition at line 110 of file Parameter.h.

Referenced by cmf::ChiSqrCalculator::ChiSqrNuisance(), and cmf::operator<<().

110 { return fIsNuisance; }
bool fIsNuisance
is this parameter treated as a nuisance parameter?
Definition: Parameter.h:132
bool const& cmf::Parameter::IsOscPar ( ) const
inline

Definition at line 108 of file Parameter.h.

Referenced by cmf::operator<<().

108 { return fIsOscPar; }
bool fIsOscPar
is this parameter for oscillations or systematics?
Definition: Parameter.h:131
uint8_t const& cmf::Parameter::Key ( ) const
inline

Definition at line 102 of file Parameter.h.

Referenced by operator<(), and operator==().

102 { return fKey; }
uint8_t fKey
key for this parameter
Definition: Parameter.h:122
float const& cmf::Parameter::LowerBound ( ) const
inline

Definition at line 111 of file Parameter.h.

Referenced by cmf::operator<<().

111 { return fLowerBound; }
float fLowerBound
lower bound for the constrained parameter
Definition: Parameter.h:134
std::string const cmf::Parameter::Name ( ) const
inline

Definition at line 100 of file Parameter.h.

References cmf::cOscParams_Strings, and cmf::KeyToVarName().

Referenced by cmf::Location::InsertParameter(), and cmf::operator<<().

bool fIsOscPar
is this parameter for oscillations or systematics?
Definition: Parameter.h:131
const std::string cOscParams_Strings[kNumOscParams]
Definition: Constants.h:257
uint8_t fKey
key for this parameter
Definition: Parameter.h:122
static std::string KeyToVarName(uint8_t const &key)
Definition: StaticFuncs.h:654
bool cmf::Parameter::operator< ( cmf::Parameter const &  other) const

Definition at line 80 of file Parameter.cxx.

References fKey, and Key().

80  {
81  return fKey < other.Key();
82  }
uint8_t fKey
key for this parameter
Definition: Parameter.h:122
bool cmf::Parameter::operator== ( cmf::Parameter const &  other) const

Definition at line 85 of file Parameter.cxx.

References fKey, and Key().

85  {
86  return fKey == other.Key();
87  }
uint8_t fKey
key for this parameter
Definition: Parameter.h:122
void cmf::Parameter::SetValue ( double const &  val)
inline

Definition at line 114 of file Parameter.h.

References cmf::OscPar::fVal, msf_helper::o, cmf::OscPar::operator<(), cmf::operator<<(), cmf::OscPar::operator==(), fhicl::other, par, and febshutoff_auto::val.

114 { fVal = val; }
double fVal
current value for the parameter in the fit
Definition: Parameter.h:124
float const& cmf::Parameter::Sigma ( ) const
inline
float const& cmf::Parameter::UpperBound ( ) const
inline

Definition at line 112 of file Parameter.h.

Referenced by cmf::operator<<().

112 { return fUpperBound; }
float fUpperBound
upper bound for the constrained parameter
Definition: Parameter.h:135
double const& cmf::Parameter::Value ( ) const
inline

Definition at line 101 of file Parameter.h.

References cmf::OscPar::fVal.

Referenced by cmf::Location::InsertParameter(), and cmf::operator<<().

101 { return fVal; }
double fVal
current value for the parameter in the fit
Definition: Parameter.h:124
float const& cmf::Parameter::Variance ( ) const
inline

Definition at line 106 of file Parameter.h.

106 { return fVariance; }
float fVariance
amount parameter can vary when making random universes
Definition: Parameter.h:129

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
cmf::Parameter const &  par 
)
friend

Definition at line 90 of file Parameter.cxx.

90  {
91 
92  o << "-- parameter: "
93  << std::setw(30) << par.Name() << std::setw(10)
94  << " val: " << par.Value()
95  << " fixed: " << par.IsFixed()
96  << " oscillation " << par.IsOscPar()
97  << " nuisance " << par.IsNuisance()
98  << " constrained " << par.IsConstrained()
99  << " lower: " << par.LowerBound()
100  << " upper: " << par.UpperBound()
101  << std::endl;
102 
103  return o;
104  }
Int_t par
Definition: SimpleIterate.C:24

Member Data Documentation

float cmf::Parameter::fCentralVal
private

central value for the parameter

Definition at line 125 of file Parameter.h.

uint8_t cmf::Parameter::fDetector
private

which detector is this parameter for?

Definition at line 123 of file Parameter.h.

bool cmf::Parameter::fIsConstrained
private

is this parameter constrained in allowed values?

Definition at line 133 of file Parameter.h.

bool cmf::Parameter::fIsFixed
private

is this parameter fixed during fits?

Definition at line 130 of file Parameter.h.

Referenced by Parameter().

bool cmf::Parameter::fIsNuisance
private

is this parameter treated as a nuisance parameter?

Definition at line 132 of file Parameter.h.

Referenced by Parameter().

bool cmf::Parameter::fIsOscPar
private

is this parameter for oscillations or systematics?

Definition at line 131 of file Parameter.h.

Referenced by Parameter().

uint8_t cmf::Parameter::fKey
private

key for this parameter

Definition at line 122 of file Parameter.h.

Referenced by operator<(), operator==(), and Parameter().

float cmf::Parameter::fLowerBound
private

lower bound for the constrained parameter

Definition at line 134 of file Parameter.h.

float cmf::Parameter::fSigmaSize
private

size of 1 sigma

Definition at line 128 of file Parameter.h.

float cmf::Parameter::fUpperBound
private

upper bound for the constrained parameter

Definition at line 135 of file Parameter.h.

double cmf::Parameter::fVal
private

current value for the parameter in the fit

Definition at line 124 of file Parameter.h.

float cmf::Parameter::fVariance
private

amount parameter can vary when making random universes

Definition at line 129 of file Parameter.h.

Referenced by Parameter().


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