MINT2
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
MINT::FitParameter Class Reference

#include <FitParameter.h>

Inheritance diagram for MINT::FitParameter:
MINT::NamedParameterBase MINT::IMinuitParameter MINT::IReturnReal MINT::INamedParameter

Public Types

enum  FIX_OR_WHAT { FIT =0, HIDE =1, FIX =2 }
 
- Public Types inherited from MINT::NamedParameterBase
enum  VERBOSITY { VERBOSE =0, QUIET =1 }
 

Public Member Functions

virtual double blinding () const
 
void invertBlinding ()
 
 FitParameter (const std::string &name, const char *fname=0, MinuitParameterSet *pset=0, FIX_OR_WHAT fow=FIX, NamedParameterBase::VERBOSITY fb=VERBOSE)
 
 FitParameter (const std::string &name, int fix, double mean, double step, double mi=0, double ma=0, MinuitParameterSet *pset=0, NamedParameterBase::VERBOSITY fb=VERBOSE, const char *fname=0, const std::vector< double > &blindingPars=std::vector< double >())
 
 FitParameter (const std::string &name, MinuitParameterSet *pset, FIX_OR_WHAT fow=FIX, NamedParameterBase::VERBOSITY fb=VERBOSE)
 
virtual ~FitParameter ()
 
bool addToParSet (MinuitParameterSet *ps)
 
virtual const MinuitParameterSetparSet () const
 
virtual MinuitParameterSetparSet ()
 
virtual int parSetIndex () const
 
virtual bool setFromParsedLine (const ParsedParameterLine &line)
 
virtual double getCurrentFitVal () const
 
virtual void setCurrentFitVal (double fv)
 
void setResult (double fitMean, double fitErr, double fitErrPos, double fitErrNeg)
 
void setCurrentValToInit ()
 
void resetToInit ()
 
void setInit (double init)
 
int iFixInit () const
 
bool hidden () const
 
bool scan () const
 
double scanMin () const
 
double scanMax () const
 
virtual const std::string & name () const
 
double meanInit () const
 
double stepInit () const
 
double minInit () const
 
double maxInit () const
 
double valAtLastFCNCall () const
 
double mean () const
 
double blindedMean () const
 
double min () const
 
double max () const
 
double errPos ()
 
double errNeg ()
 
double err () const
 
void fix ()
 
void fixToInit ()
 
void fixAndHide ()
 
void fixToInitAndHide ()
 
void unFix ()
 
double RealVal ()
 
 operator double () const
 
FitParameteroperator= (double d)
 
template<typename T >
operator * (const T &rhs) const
 
template<typename T >
operator * (const MINT::NamedParameter< T > &rhs) const
 
double operator * (const MINT::FitParameter &rhs) const
 
template<typename T >
operator+ (const T &rhs) const
 
template<typename T >
operator+ (const MINT::NamedParameter< T > &rhs) const
 
double operator+ (const MINT::FitParameter &rhs) const
 
template<typename T >
operator/ (const T &rhs) const
 
template<typename T >
operator/ (const MINT::NamedParameter< T > &rhs) const
 
double operator/ (const MINT::FitParameter &rhs) const
 
template<typename T >
operator- (const T &rhs) const
 
template<typename T >
operator- (const MINT::NamedParameter< T > &rhs) const
 
double operator- (const MINT::FitParameter &rhs) const
 
void defaultInit ()
 
virtual void print (std::ostream &os=std::cout) const
 
virtual void printVal (std::ostream &os=std::cout) const
 
virtual void printResultVsInput (std::ostream &os=std::cout) const
 
- Public Member Functions inherited from MINT::NamedParameterBase
bool setPPF (ParsedParameterFile *ppF_in=0)
 
bool read ()
 
bool read (std::istream &is)
 
bool read (const std::string &fname)
 
bool reloadFile (const std::string &id)
 
bool setFromInitString (const std::string &str)
 
bool setFromInitStringNoName (const std::string &str_in)
 
 NamedParameterBase (const std::string &name_in="", const char *fname=0, VERBOSITY=VERBOSE)
 
 NamedParameterBase (const NamedParameterBase &other)
 
virtual ~NamedParameterBase ()
 
void quiet (bool beSo=true)
 
bool gotInitialised () const
 
- Public Member Functions inherited from MINT::INamedParameter
virtual ~INamedParameter ()
 
- Public Member Functions inherited from MINT::IMinuitParameter
virtual ~IMinuitParameter ()
 
- Public Member Functions inherited from MINT::IReturnReal
virtual ~IReturnReal ()
 

Static Public Member Functions

static const char * getInitString ()
 
static void printFormat (std::ostream &os=std::cout, int pad=0)
 
static void printResultFormat (std::ostream &os=std::cout, int pad=0)
 
- Static Public Member Functions inherited from MINT::NamedParameterBase
static bool setDefaultInputFile (const std::string &fname)
 
static bool setDefaultInputStream (std::istream &str=std::cin)
 

Protected Member Functions

bool setupBlinding ()
 
virtual bool setParSet (MinuitParameterSet *ps)
 
virtual bool setParSetIndex (int psetIndex)
 
void initToResult ()
 
- Protected Member Functions inherited from MINT::NamedParameterBase
virtual bool setFromParsedFile ()
 
- Protected Member Functions inherited from MINT::INamedParameter
 INamedParameter ()
 
- Protected Member Functions inherited from MINT::IMinuitParameter
 IMinuitParameter ()
 
- Protected Member Functions inherited from MINT::IReturnReal
 IReturnReal ()
 

Protected Attributes

double _blinding
 
MinuitParameterSet_pset
 
int _psetIndex
 
int _iFixInit
 
double _meanInit
 
double _stepInit
 
double _minInit
 
double _maxInit
 
NamedParameter< double > _scanParameters
 
NamedParameter< double > _blindingParameters
 
double _meanResult
 
double _errResult
 
double _errPosResult
 
double _errNegResult
 
double _currentFitVal
 
- Protected Attributes inherited from MINT::NamedParameterBase
std::string _name
 
ParsedParameterFile_ppF
 
bool _gotInitialised
 
bool _quiet
 

Static Protected Attributes

static const char * _initString = " 1\t0.0\t0.0\t0.0\t0.0"
 
- Static Protected Attributes inherited from MINT::NamedParameterBase
static bool IveSaidItOnce =0
 
static std::string _defaultFile = ""
 
static std::istream * _defaultStreamPtr = &std::cin
 

Private Member Functions

 FitParameter (const FitParameter &other)
 

Additional Inherited Members

- Static Protected Member Functions inherited from MINT::NamedParameterBase
static ParsedParameterFileListgetFlist ()
 

Detailed Description

Definition at line 42 of file FitParameter.h.

Member Enumeration Documentation

◆ FIX_OR_WHAT

Enumerator
FIT 
HIDE 
FIX 

Definition at line 77 of file FitParameter.h.

Constructor & Destructor Documentation

◆ FitParameter() [1/4]

FitParameter::FitParameter ( const FitParameter other)
private

Definition at line 137 of file FitParameter.cpp.

138  : INamedParameter()
139  , NamedParameterBase(other)
140  , IMinuitParameter()
141  , _blinding(other._blinding)
142  // , _minPtr(other._minPtr)
143  , _pset(other._pset)
144  , _psetIndex(other._psetIndex)
145  // , _pN(other._pN)
146  , _iFixInit(other._iFixInit)
147  , _meanInit(other._meanInit)
148  , _stepInit(other._stepInit)
149  , _minInit(other._minInit)
150  , _maxInit(other._maxInit)
153  , _meanResult(other._meanResult)
154  , _errResult(other._errResult)
157 {
158  //cout << "FitParameter copy-constructed " << this->name() << endl;
159 }
NamedParameter< double > _blindingParameters
Definition: FitParameter.h:67
MinuitParameterSet * _pset
Definition: FitParameter.h:59
NamedParameter< double > _scanParameters
Definition: FitParameter.h:66
NamedParameterBase(const std::string &name_in="", const char *fname=0, VERBOSITY=VERBOSE)

◆ FitParameter() [2/4]

FitParameter::FitParameter ( const std::string &  name,
const char *  fname = 0,
MinuitParameterSet pset = 0,
FIX_OR_WHAT  fow = FIX,
NamedParameterBase::VERBOSITY  fb = VERBOSE 
)

Definition at line 14 of file FitParameter.cpp.

20  : INamedParameter()
21  , NamedParameterBase(name, fname, vb)
23  // , _minPtr(0)
24  , _blinding(0)
25  , _pset(0)
26  , _psetIndex(-9999)
27  // , _pN(-1)
28  , _iFixInit((int)fow)
29  , _meanInit(0)
30  , _stepInit(0)
31  , _minInit(0)
32  , _maxInit(0)
35 {
36  defaultInit();
38  MinuitParameterSet* ps = setPtr;
39  if(0 == ps) ps = MinuitParameterSet::getDefaultSet();
40  addToParSet(ps);
41  initToResult();
42  setupBlinding();
43  // cout << "FitParameter constructed " << this->name() << endl;
44 }
NamedParameter< double > _blindingParameters
Definition: FitParameter.h:67
static MinuitParameterSet * getDefaultSet()
virtual const std::string & name() const
Definition: FitParameter.h:144
MinuitParameterSet * _pset
Definition: FitParameter.h:59
NamedParameter< double > _scanParameters
Definition: FitParameter.h:66
bool addToParSet(MinuitParameterSet *ps)
NamedParameterBase(const std::string &name_in="", const char *fname=0, VERBOSITY=VERBOSE)

◆ FitParameter() [3/4]

FitParameter::FitParameter ( const std::string &  name,
int  fix,
double  mean,
double  step,
double  mi = 0,
double  ma = 0,
MinuitParameterSet pset = 0,
NamedParameterBase::VERBOSITY  fb = VERBOSE,
const char *  fname = 0,
const std::vector< double > &  blindingPars = std::vector<double>() 
)

Definition at line 45 of file FitParameter.cpp.

56  : INamedParameter()
57  , NamedParameterBase(name, fname, vb)
59  // , _minPtr(0)
60  , _blinding(0)
61  , _pset(0)
62  , _psetIndex(-9999)
63  // , _pN(-1)
64  , _iFixInit(fix)
65  , _meanInit(mean)
66  , _stepInit(step)
67  , _minInit(mi)
68  , _maxInit(ma)
70  , _blindingParameters(name + "_Blind", blindingPars, 0, NamedParameterBase::QUIET)
71 {
72  _gotInitialised = true;
73  setFromParsedFile();// so the above values are for initialisation but over-ruled by what's in the file
74  MinuitParameterSet* ps = setPtr;
75  if(0 == ps) ps = MinuitParameterSet::getDefaultSet();
76 
77  addToParSet(ps);
78 
79  initToResult();
80  setupBlinding();
81  //cout << "FitParameter constructed a " << this->name() << endl;
82 }
NamedParameter< double > _blindingParameters
Definition: FitParameter.h:67
static MinuitParameterSet * getDefaultSet()
virtual const std::string & name() const
Definition: FitParameter.h:144
double mean() const
MinuitParameterSet * _pset
Definition: FitParameter.h:59
NamedParameter< double > _scanParameters
Definition: FitParameter.h:66
bool addToParSet(MinuitParameterSet *ps)
NamedParameterBase(const std::string &name_in="", const char *fname=0, VERBOSITY=VERBOSE)

◆ FitParameter() [4/4]

FitParameter::FitParameter ( const std::string &  name,
MinuitParameterSet pset,
FIX_OR_WHAT  fow = FIX,
NamedParameterBase::VERBOSITY  fb = VERBOSE 
)

Definition at line 84 of file FitParameter.cpp.

89  : INamedParameter()
90  , NamedParameterBase(name, 0, vb)
92  // , _minPtr(0)
93  , _blinding(0)
94  , _pset(0)
95  , _psetIndex(-9999)
96  // , _pN(-1)
97  , _iFixInit((int) fow)
98  , _meanInit(0)
99  , _stepInit(0)
100  , _minInit(0)
101  , _maxInit(0)
104 {
105  defaultInit();
107  MinuitParameterSet* ps = setPtr;
108  if(0 == ps) ps = MinuitParameterSet::getDefaultSet();
109  addToParSet(ps);
110  initToResult();
111  setupBlinding();
112  //cout << "FitParameter constructed b " << this->name() << endl;
113 }
NamedParameter< double > _blindingParameters
Definition: FitParameter.h:67
static MinuitParameterSet * getDefaultSet()
virtual const std::string & name() const
Definition: FitParameter.h:144
MinuitParameterSet * _pset
Definition: FitParameter.h:59
NamedParameter< double > _scanParameters
Definition: FitParameter.h:66
bool addToParSet(MinuitParameterSet *ps)
NamedParameterBase(const std::string &name_in="", const char *fname=0, VERBOSITY=VERBOSE)

◆ ~FitParameter()

FitParameter::~FitParameter ( )
virtual

Definition at line 176 of file FitParameter.cpp.

176  {
177  //cout << "FitParameter destructor destroying " << this->name() << endl;
178  if(0 != _pset) _pset->unregister(this);
179 }
bool unregister(IMinuitParameter *patPtr)
MinuitParameterSet * _pset
Definition: FitParameter.h:59

Member Function Documentation

◆ addToParSet()

bool FitParameter::addToParSet ( MinuitParameterSet ps)

Definition at line 181 of file FitParameter.cpp.

181  {
182  // now the same as setParSet.
183  if(0 == ps) return false;
184  setParSet(ps);
185  return true;
186 }
virtual bool setParSet(MinuitParameterSet *ps)

◆ blindedMean()

double FitParameter::blindedMean ( ) const

Definition at line 316 of file FitParameter.cpp.

316  {
317  return mean() - blinding() ;
318 }
virtual double blinding() const
Definition: FitParameter.h:80
double mean() const

◆ blinding()

virtual double MINT::FitParameter::blinding ( ) const
inlinevirtual

Implements MINT::IMinuitParameter.

Definition at line 80 of file FitParameter.h.

80 {return _blinding;}

◆ defaultInit()

void FitParameter::defaultInit ( )

Definition at line 335 of file FitParameter.cpp.

335  {
336  // defaults to fixed - i.e. won't be varied in fit
337  // unless explicitly intitialised.
338  // Otherwise all set to zero.
340 }
static const char * getInitString()
bool setFromInitStringNoName(const std::string &str_in)

◆ err()

double FitParameter::err ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 331 of file FitParameter.cpp.

331  {
332  return _errResult;
333 }

◆ errNeg()

double FitParameter::errNeg ( )

Definition at line 328 of file FitParameter.cpp.

328  {
329  return _errNegResult;
330 }

◆ errPos()

double FitParameter::errPos ( )

Definition at line 325 of file FitParameter.cpp.

325  {
326  return _errPosResult;
327 }

◆ fix()

void FitParameter::fix ( )

Definition at line 392 of file FitParameter.cpp.

392  {
393  _iFixInit = 2;
394 }

◆ fixAndHide()

void FitParameter::fixAndHide ( )

Definition at line 399 of file FitParameter.cpp.

399  {
400  _iFixInit = 1;
401 }

◆ fixToInit()

void FitParameter::fixToInit ( )

Definition at line 395 of file FitParameter.cpp.

395  {
396  initToResult();
397  fix();
398 }

◆ fixToInitAndHide()

void FitParameter::fixToInitAndHide ( )

Definition at line 402 of file FitParameter.cpp.

402  {
403  initToResult();
404  fixAndHide();
405 }

◆ getCurrentFitVal()

double FitParameter::getCurrentFitVal ( ) const
virtual

Definition at line 293 of file FitParameter.cpp.

293  {
294  return _meanResult;
295 }

◆ getInitString()

const char * FitParameter::getInitString ( )
static

Definition at line 12 of file FitParameter.cpp.

12 { return _initString;}
static const char * _initString
Definition: FitParameter.h:56

◆ hidden()

bool MINT::FitParameter::hidden ( ) const
inlinevirtual

Implements MINT::IMinuitParameter.

Definition at line 139 of file FitParameter.h.

139 {return iFixInit() == 1;}
int iFixInit() const

◆ iFixInit()

int FitParameter::iFixInit ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 243 of file FitParameter.cpp.

243 { return _iFixInit;}

◆ initToResult()

void FitParameter::initToResult ( )
protected

Definition at line 171 of file FitParameter.cpp.

171  {
172  // I once gave it this counter-intuitive name
173  // (the picture was: init->Result) keep it for compatibility.
174  resetToInit();
175 }

◆ invertBlinding()

void MINT::FitParameter::invertBlinding ( )
inline

Definition at line 82 of file FitParameter.h.

82 { _blinding = - _blinding;}

◆ max()

double FitParameter::max ( ) const

Definition at line 322 of file FitParameter.cpp.

322  {
323  return maxInit();
324 }
double maxInit() const

◆ maxInit()

double FitParameter::maxInit ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 247 of file FitParameter.cpp.

247 { return _maxInit;}

◆ mean()

double FitParameter::mean ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 312 of file FitParameter.cpp.

312  {
313  return _meanResult;
314 }

◆ meanInit()

double FitParameter::meanInit ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 244 of file FitParameter.cpp.

244 { return _meanInit;}

◆ min()

double FitParameter::min ( ) const

Definition at line 319 of file FitParameter.cpp.

319  {
320  return minInit();
321 }
double minInit() const

◆ minInit()

double FitParameter::minInit ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 246 of file FitParameter.cpp.

246 { return _minInit;}

◆ name()

virtual const std::string& MINT::FitParameter::name ( ) const
inlinevirtual

Implements MINT::IMinuitParameter.

Definition at line 144 of file FitParameter.h.

144  {
145  return NamedParameterBase::name();
146  }
virtual const std::string & name() const

◆ operator *() [1/3]

template<typename T >
T MINT::FitParameter::operator * ( const T &  rhs) const
inline

Definition at line 190 of file FitParameter.h.

190  {
191  return ((double) *this) * rhs;
192  }

◆ operator *() [2/3]

template<typename T >
T MINT::FitParameter::operator * ( const MINT::NamedParameter< T > &  rhs) const
inline

Definition at line 194 of file FitParameter.h.

194  {
195  return ((double) *this) * rhs;
196  }

◆ operator *() [3/3]

double MINT::FitParameter::operator * ( const MINT::FitParameter rhs) const
inline

Definition at line 197 of file FitParameter.h.

197  {
198  return ((double) *this) * ((double) rhs);
199  }

◆ operator double()

MINT::FitParameter::operator double ( ) const
inlinevirtual

Implements MINT::IMinuitParameter.

Definition at line 182 of file FitParameter.h.

182  {
183  return mean();
184  }
double mean() const

◆ operator+() [1/3]

template<typename T >
T MINT::FitParameter::operator+ ( const T &  rhs) const
inline

Definition at line 202 of file FitParameter.h.

202  {
203  return ((double) *this) + rhs;
204  }

◆ operator+() [2/3]

template<typename T >
T MINT::FitParameter::operator+ ( const MINT::NamedParameter< T > &  rhs) const
inline

Definition at line 206 of file FitParameter.h.

206  {
207  return ((double) *this) + rhs;
208  }

◆ operator+() [3/3]

double MINT::FitParameter::operator+ ( const MINT::FitParameter rhs) const
inline

Definition at line 209 of file FitParameter.h.

209  {
210  return ((double) *this) + ((double) rhs);
211  }

◆ operator-() [1/3]

template<typename T >
T MINT::FitParameter::operator- ( const T &  rhs) const
inline

Definition at line 226 of file FitParameter.h.

226  {
227  return ((double) *this) - rhs;
228  }

◆ operator-() [2/3]

template<typename T >
T MINT::FitParameter::operator- ( const MINT::NamedParameter< T > &  rhs) const
inline

Definition at line 230 of file FitParameter.h.

230  {
231  return ((double) *this) - rhs;
232  }

◆ operator-() [3/3]

double MINT::FitParameter::operator- ( const MINT::FitParameter rhs) const
inline

Definition at line 233 of file FitParameter.h.

233  {
234  return ((double) *this) - ((double) rhs);
235  }

◆ operator/() [1/3]

template<typename T >
T MINT::FitParameter::operator/ ( const T &  rhs) const
inline

Definition at line 214 of file FitParameter.h.

214  {
215  return ((double) *this) / rhs;
216  }

◆ operator/() [2/3]

template<typename T >
T MINT::FitParameter::operator/ ( const MINT::NamedParameter< T > &  rhs) const
inline

Definition at line 218 of file FitParameter.h.

218  {
219  return ((double) *this) / rhs;
220  }

◆ operator/() [3/3]

double MINT::FitParameter::operator/ ( const MINT::FitParameter rhs) const
inline

Definition at line 221 of file FitParameter.h.

221  {
222  return ((double) *this) / ((double) rhs);
223  }

◆ operator=()

FitParameter& MINT::FitParameter::operator= ( double  d)
inline

Definition at line 185 of file FitParameter.h.

185  {
186  _meanResult=d;
187  return *this;
188  }

◆ parSet() [1/2]

virtual const MinuitParameterSet* MINT::FitParameter::parSet ( ) const
inlinevirtual

Implements MINT::IMinuitParameter.

Definition at line 115 of file FitParameter.h.

115 {return _pset;}
MinuitParameterSet * _pset
Definition: FitParameter.h:59

◆ parSet() [2/2]

virtual MinuitParameterSet* MINT::FitParameter::parSet ( )
inlinevirtual

Definition at line 116 of file FitParameter.h.

116 {return _pset;}
MinuitParameterSet * _pset
Definition: FitParameter.h:59

◆ parSetIndex()

int FitParameter::parSetIndex ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 200 of file FitParameter.cpp.

200  {
201  return _psetIndex;
202 }

◆ print()

void FitParameter::print ( std::ostream &  os = std::cout) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 341 of file FitParameter.cpp.

341  {
342  // ... in a format that can be read back in
343  os << "\"" << name() << "\""
344  << "\t" << iFixInit()
345  << "\t" << blindedMean()
346  << "\t" << err()
347  << "\t" << min()
348  << "\t" << max();
349 }
int iFixInit() const
double blindedMean() const
virtual const std::string & name() const
Definition: FitParameter.h:144
double min() const
double max() const
double err() const

◆ printFormat()

void FitParameter::printFormat ( std::ostream &  os = std::cout,
int  pad = 0 
)
static

Definition at line 369 of file FitParameter.cpp.

369  { // static
370  std::string nameStr = "** name";
371  if(namelength > 0) nameStr.resize(namelength, ' ');
372  os << nameStr;
373  os << "\t" << "Fix?"
374  << "\t" << "init"
375  << "\t" << "step"
376  << "\t" << "min"
377  << "\t" << "max"
378  << std::endl;
379 }

◆ printResultFormat()

void FitParameter::printResultFormat ( std::ostream &  os = std::cout,
int  pad = 0 
)
static

Definition at line 380 of file FitParameter.cpp.

380  { // static
381  std::string nameStr = "** name";
382  if(namelength > 0) nameStr.resize(namelength, ' ');
383  os << nameStr;
384  os << "\t" << "Fix?"
385  << "\t" << "mean"
386  << "\t" << "err"
387  << "\t" << "min"
388  << "\t" << "max"
389  << std::endl;
390 }

◆ printResultVsInput()

void FitParameter::printResultVsInput ( std::ostream &  os = std::cout) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 358 of file FitParameter.cpp.

358  {
359 
360  double pull = -9999;
361  if(err() != 0) pull = (blindedMean() - meanInit() )/err();
362 
363 
364  os << "\"" << name() << "\""
365  << "\t" << iFixInit()
366  << "\t" << blindedMean() << " - " << meanInit() << " / " << err()
367  << " = \t" << pull;
368 }
double meanInit() const
int iFixInit() const
double blindedMean() const
virtual const std::string & name() const
Definition: FitParameter.h:144
double err() const

◆ printVal()

void FitParameter::printVal ( std::ostream &  os = std::cout) const
virtual

Definition at line 350 of file FitParameter.cpp.

350  {
351  // ... in a format that can be read back in, w/o the name
352  os << iFixInit()
353  << "\t" << blindedMean()
354  << "\t" << err()
355  << "\t" << min()
356  << "\t" << max();
357 }
int iFixInit() const
double blindedMean() const
double min() const
double max() const
double err() const

◆ RealVal()

double MINT::FitParameter::RealVal ( )
inlinevirtual

Implements MINT::IReturnReal.

Definition at line 178 of file FitParameter.h.

178  { // promised by IReturnReal
179  return mean();
180  }
double mean() const

◆ resetToInit()

void FitParameter::resetToInit ( )

Definition at line 165 of file FitParameter.cpp.

165  {
168  _errPosResult = -9999;
169  _errNegResult = -9999;
170 }

◆ scan()

bool FitParameter::scan ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 249 of file FitParameter.cpp.

249  {
251 }
NamedParameter< double > _scanParameters
Definition: FitParameter.h:66

◆ scanMax()

double FitParameter::scanMax ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 256 of file FitParameter.cpp.

256  {
257  if(_scanParameters.size() < 2) return 0.0;
258  else return _scanParameters.getVal(1);
259 }
virtual int size() const
NamedParameter< double > _scanParameters
Definition: FitParameter.h:66
virtual const T & getVal(int i=0) const

◆ scanMin()

double FitParameter::scanMin ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 252 of file FitParameter.cpp.

252  {
253  if(_scanParameters.size() < 2) return 0.0;
254  else return _scanParameters.getVal(0);
255 }
virtual int size() const
NamedParameter< double > _scanParameters
Definition: FitParameter.h:66
virtual const T & getVal(int i=0) const

◆ setCurrentFitVal()

void FitParameter::setCurrentFitVal ( double  fv)
virtual

Implements MINT::IMinuitParameter.

Definition at line 297 of file FitParameter.cpp.

297  {
298  _meanResult = cfv;
299 }

◆ setCurrentValToInit()

void FitParameter::setCurrentValToInit ( )

Definition at line 161 of file FitParameter.cpp.

161  {
163 }

◆ setFromParsedLine()

bool FitParameter::setFromParsedLine ( const ParsedParameterLine line)
virtual

Implements MINT::NamedParameterBase.

Definition at line 204 of file FitParameter.cpp.

204  {
205  const std::vector<std::string>& vsl = line.parsedStrings();
206  if(vsl.size() < 3){
207  if(! _quiet) cout << "ERROR in FitParameter::setFromParsedLine"
208  << " need at least 3 parameters:\n"
209  << " iFix, initial mean"
210  << endl;
211  return false;
212  }
213  if(vsl[0] != _name){
214  if(! _quiet) std::cout << "ERROR in FitParameter::setFromParsedLine"
215  << " wrong parameter name. My name is " << _name
216  << " the line's first element is " << vsl[0]
217  << endl;
218  return false;
219  }
220  unsigned int start=0;
221  // if(vsl.size() >=7) ++start; // 1st parameter is index number
222  // above was for compatibility with Mikhail's code, not needed anymore
223 
224  if(vsl.size() > ++start) stringToAnything(vsl[start], _iFixInit);
225  if(vsl.size() > ++start) stringToAnything(vsl[start], _meanInit);
226  if(vsl.size() > ++start) stringToAnything(vsl[start], _stepInit);
227  if(vsl.size() > ++start) stringToAnything(vsl[start], _minInit);
228  if(vsl.size() > ++start) stringToAnything(vsl[start], _maxInit);
229  initToResult();
230 
231  return true;
232 }
void stringToAnything(const std::string &str, T &anything)
Definition: Utils.h:56
const std::vector< std::string > & parsedStrings() const

◆ setInit()

void MINT::FitParameter::setInit ( double  init)
inline

Definition at line 130 of file FitParameter.h.

130  {
131  _meanInit = init;
132  }

◆ setParSet()

bool FitParameter::setParSet ( MinuitParameterSet ps)
protectedvirtual

Implements MINT::IMinuitParameter.

Definition at line 187 of file FitParameter.cpp.

187  {
188  // if(0 == ps) return false;
189  if(ps == _pset) return true;
190  if(0 != _pset) _pset->unregister(this);
191  _pset = ps;
192  _psetIndex = -9999;
193  if(0 != ps) ps->add(this);
194  return true;
195 }
bool unregister(IMinuitParameter *patPtr)
bool add(IMinuitParameter *parPtr)
MinuitParameterSet * _pset
Definition: FitParameter.h:59

◆ setParSetIndex()

bool FitParameter::setParSetIndex ( int  psetIndex)
protectedvirtual

Implements MINT::IMinuitParameter.

Definition at line 196 of file FitParameter.cpp.

196  {
197  _psetIndex = psetIndex;
198  return true;
199 }

◆ setResult()

void FitParameter::setResult ( double  fitMean,
double  fitErr,
double  fitErrPos,
double  fitErrNeg 
)
virtual

Implements MINT::IMinuitParameter.

Definition at line 301 of file FitParameter.cpp.

304  {
305  _meanResult = fitMean;
306  _errResult = fitErr;
307  _errPosResult = fitErrPos;
308  _errNegResult = fitErrNeg;
309 
310 }

◆ setupBlinding()

bool FitParameter::setupBlinding ( )
protected

Definition at line 115 of file FitParameter.cpp.

115  {
116  if(! _blindingParameters.gotInitialised() || _blindingParameters.size() == 0) return true;
117  int seed = (int) fabs(_blindingParameters.getVal(0));
118  double min=-1, max=1;
119 
120  if(_blindingParameters.size() > 1){
122  }
123  if(_blindingParameters.size() > 2){
125  }else{
126  max = min + 1;
127  }
128 
129  TRandom3 rnd(seed + 99);
130  _blinding = rnd.Rndm()*(max - min) + min;
131  return true;
132 
133 }
virtual int size() const
NamedParameter< double > _blindingParameters
Definition: FitParameter.h:67
double min() const
double max() const
virtual const T & getVal(int i=0) const

◆ stepInit()

double FitParameter::stepInit ( ) const
virtual

Implements MINT::IMinuitParameter.

Definition at line 245 of file FitParameter.cpp.

245 { return _stepInit;}

◆ unFix()

void FitParameter::unFix ( )

Definition at line 406 of file FitParameter.cpp.

406  {
407  _iFixInit = 0;
408 }

◆ valAtLastFCNCall()

double MINT::FitParameter::valAtLastFCNCall ( ) const

Member Data Documentation

◆ _blinding

double MINT::FitParameter::_blinding
protected

Definition at line 53 of file FitParameter.h.

◆ _blindingParameters

NamedParameter<double> MINT::FitParameter::_blindingParameters
protected

Definition at line 67 of file FitParameter.h.

◆ _currentFitVal

double MINT::FitParameter::_currentFitVal
protected

Definition at line 70 of file FitParameter.h.

◆ _errNegResult

double MINT::FitParameter::_errNegResult
protected

Definition at line 69 of file FitParameter.h.

◆ _errPosResult

double MINT::FitParameter::_errPosResult
protected

Definition at line 69 of file FitParameter.h.

◆ _errResult

double MINT::FitParameter::_errResult
protected

Definition at line 69 of file FitParameter.h.

◆ _iFixInit

int MINT::FitParameter::_iFixInit
protected

Definition at line 63 of file FitParameter.h.

◆ _initString

const char * FitParameter::_initString = " 1\t0.0\t0.0\t0.0\t0.0"
staticprotected

Definition at line 56 of file FitParameter.h.

◆ _maxInit

double MINT::FitParameter::_maxInit
protected

Definition at line 64 of file FitParameter.h.

◆ _meanInit

double MINT::FitParameter::_meanInit
protected

Definition at line 64 of file FitParameter.h.

◆ _meanResult

double MINT::FitParameter::_meanResult
protected

Definition at line 69 of file FitParameter.h.

◆ _minInit

double MINT::FitParameter::_minInit
protected

Definition at line 64 of file FitParameter.h.

◆ _pset

MinuitParameterSet* MINT::FitParameter::_pset
protected

Definition at line 59 of file FitParameter.h.

◆ _psetIndex

int MINT::FitParameter::_psetIndex
protected

Definition at line 60 of file FitParameter.h.

◆ _scanParameters

NamedParameter<double> MINT::FitParameter::_scanParameters
protected

Definition at line 66 of file FitParameter.h.

◆ _stepInit

double MINT::FitParameter::_stepInit
protected

Definition at line 64 of file FitParameter.h.


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