laura is hosted by Hepforge, IPPP Durham
Laura++  v3r0
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauParameter.cc
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2006 - 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
15 #include <iostream>
16 #include <map>
17 using std::cout;
18 using std::cerr;
19 using std::endl;
20 using std::map;
21 
22 #include "TRandom.h"
23 
24 #include "LauParameter.hh"
25 #include "LauRandom.hh"
26 
28 
29 
31  name_(""),
32  value_(0.0),
33  error_(0.0),
34  negError_(0.0),
35  posError_(0.0),
36  genValue_(0.0),
37  initValue_(0.0),
38  minValue_(0.0),
39  maxValue_(0.0),
40  fixed_(kTRUE),
41  firstStage_(kFALSE),
42  secondStage_(kFALSE),
43  gaussConstraint_(kFALSE),
44  constraintMean_(0.0),
45  constraintWidth_(0.0),
46  gcc_(0.0),
47  bias_(0.0),
48  pull_(0.0),
49  clone_(kFALSE),
50  parent_(0)
51 {
52 }
53 
54 LauParameter::LauParameter(const TString& parName) :
55  name_(parName),
56  value_(0.0),
57  error_(0.0),
58  negError_(0.0),
59  posError_(0.0),
60  genValue_(0.0),
61  initValue_(0.0),
62  minValue_(0.0),
63  maxValue_(0.0),
64  fixed_(kTRUE),
65  firstStage_(kFALSE),
66  secondStage_(kFALSE),
67  gaussConstraint_(kFALSE),
68  constraintMean_(0.0),
69  constraintWidth_(0.0),
70  gcc_(0.0),
71  bias_(0.0),
72  pull_(0.0),
73  clone_(kFALSE),
74  parent_(0)
75 {
76 }
77 
78 LauParameter::LauParameter(Double_t parValue) :
79  name_(""),
80  value_(parValue),
81  error_(0.0),
82  negError_(0.0),
83  posError_(0.0),
84  genValue_(parValue),
85  initValue_(parValue),
86  minValue_(parValue-1e-6),
87  maxValue_(parValue+1e-6),
88  fixed_(kTRUE),
89  firstStage_(kFALSE),
90  secondStage_(kFALSE),
91  gaussConstraint_(kFALSE),
92  constraintMean_(0.0),
93  constraintWidth_(0.0),
94  gcc_(0.0),
95  bias_(0.0),
96  pull_(0.0),
97  clone_(kFALSE),
98  parent_(0)
99 {
100 }
101 
102 LauParameter::LauParameter(const TString& parName, Double_t parValue) :
103  name_(parName),
104  value_(parValue),
105  error_(0.0),
106  negError_(0.0),
107  posError_(0.0),
108  genValue_(parValue),
109  initValue_(parValue),
110  minValue_(parValue-1e-6),
111  maxValue_(parValue+1e-6),
112  fixed_(kTRUE),
113  firstStage_(kFALSE),
114  secondStage_(kFALSE),
115  gaussConstraint_(kFALSE),
116  constraintMean_(0.0),
117  constraintWidth_(0.0),
118  gcc_(0.0),
119  bias_(0.0),
120  pull_(0.0),
121  clone_(kFALSE),
122  parent_(0)
123 {
124 }
125 
126 LauParameter::LauParameter(Double_t parValue, Double_t min, Double_t max) :
127  name_(""),
128  value_(parValue),
129  error_(0.0),
130  negError_(0.0),
131  posError_(0.0),
132  genValue_(parValue),
133  initValue_(parValue),
134  minValue_(min),
135  maxValue_(max),
136  fixed_(kTRUE),
137  firstStage_(kFALSE),
138  secondStage_(kFALSE),
139  gaussConstraint_(kFALSE),
140  constraintMean_(0.0),
141  constraintWidth_(0.0),
142  gcc_(0.0),
143  bias_(0.0),
144  pull_(0.0),
145  clone_(kFALSE),
146  parent_(0)
147 {
148  this->checkRange();
149 }
150 
151 LauParameter::LauParameter(Double_t parValue, Double_t parError, Double_t min, Double_t max) :
152  name_(""),
153  value_(parValue),
154  error_(parError),
155  negError_(0.0),
156  posError_(0.0),
157  genValue_(parValue),
158  initValue_(parValue),
159  minValue_(min),
160  maxValue_(max),
161  fixed_(kTRUE),
162  firstStage_(kFALSE),
163  secondStage_(kFALSE),
164  gaussConstraint_(kFALSE),
165  constraintMean_(0.0),
166  constraintWidth_(0.0),
167  gcc_(0.0),
168  bias_(0.0),
169  pull_(0.0),
170  clone_(kFALSE),
171  parent_(0)
172 {
173  this->checkRange();
174 }
175 
176 LauParameter::LauParameter(Double_t parValue, Double_t min, Double_t max, Bool_t parFixed) :
177  name_(""),
178  value_(parValue),
179  error_(0.0),
180  negError_(0.0),
181  posError_(0.0),
182  genValue_(parValue),
183  initValue_(parValue),
184  minValue_(min),
185  maxValue_(max),
186  fixed_(parFixed),
187  firstStage_(kFALSE),
188  secondStage_(kFALSE),
189  gaussConstraint_(kFALSE),
190  constraintMean_(0.0),
191  constraintWidth_(0.0),
192  gcc_(0.0),
193  bias_(0.0),
194  pull_(0.0),
195  clone_(kFALSE),
196  parent_(0)
197 {
198  this->checkRange();
199 }
200 
201 LauParameter::LauParameter(const TString& parName, Double_t parValue, Double_t min, Double_t max) :
202  name_(parName),
203  value_(parValue),
204  error_(0.0),
205  negError_(0.0),
206  posError_(0.0),
207  genValue_(parValue),
208  initValue_(parValue),
209  minValue_(min),
210  maxValue_(max),
211  fixed_(kTRUE),
212  firstStage_(kFALSE),
213  secondStage_(kFALSE),
214  gaussConstraint_(kFALSE),
215  constraintMean_(0.0),
216  constraintWidth_(0.0),
217  gcc_(0.0),
218  bias_(0.0),
219  pull_(0.0),
220  clone_(kFALSE),
221  parent_(0)
222 {
223  this->checkRange();
224 }
225 
226 LauParameter::LauParameter(const TString& parName, Double_t parValue, Double_t min, Double_t max, Bool_t parFixed) :
227  name_(parName),
228  value_(parValue),
229  error_(0.0),
230  negError_(0.0),
231  posError_(0.0),
232  genValue_(parValue),
233  initValue_(parValue),
234  minValue_(min),
235  maxValue_(max),
236  fixed_(parFixed),
237  firstStage_(kFALSE),
238  secondStage_(kFALSE),
239  gaussConstraint_(kFALSE),
240  constraintMean_(0.0),
241  constraintWidth_(0.0),
242  gcc_(0.0),
243  bias_(0.0),
244  pull_(0.0),
245  clone_(kFALSE),
246  parent_(0)
247 {
248  this->checkRange();
249 }
250 
251 LauParameter::LauParameter(const TString& parName, Double_t parValue, Double_t parError, Double_t min, Double_t max) :
252  name_(parName),
253  value_(parValue),
254  error_(parError),
255  negError_(0.0),
256  posError_(0.0),
257  genValue_(parValue),
258  initValue_(parValue),
259  minValue_(min),
260  maxValue_(max),
261  fixed_(kTRUE),
262  firstStage_(kFALSE),
263  secondStage_(kFALSE),
264  gaussConstraint_(kFALSE),
265  constraintMean_(0.0),
266  constraintWidth_(0.0),
267  gcc_(0.0),
268  bias_(0.0),
269  pull_(0.0),
270  clone_(kFALSE),
271  parent_(0)
272 {
273  this->checkRange();
274 }
275 
276 LauParameter::LauParameter(const LauParameter& rhs) : TObject(rhs), LauAbsRValue(rhs),
277  name_(rhs.name_),
278  value_(rhs.value_),
279  error_(rhs.error_),
280  negError_(rhs.negError_),
281  posError_(rhs.posError_),
282  genValue_(rhs.genValue_),
283  initValue_(rhs.initValue_),
284  minValue_(rhs.minValue_),
285  maxValue_(rhs.maxValue_),
286  fixed_(rhs.fixed_),
292  gcc_(rhs.gcc_),
293  bias_(rhs.bias_),
294  pull_(rhs.pull_),
295  clone_(rhs.clone_),
296  parent_(rhs.parent_),
297  clones_(rhs.clones_)
298 {
299 }
300 
302 {
303  if (&rhs != this) {
304  TObject::operator=(rhs);
306  name_ = rhs.name_;
307  value_ = rhs.value_;
308  error_ = rhs.error_;
309  negError_ = rhs.negError_;
310  posError_ = rhs.posError_;
311  genValue_ = rhs.genValue_;
312  initValue_ = rhs.initValue_;
313  minValue_ = rhs.minValue_;
314  maxValue_ = rhs.maxValue_;
315  fixed_ = rhs.fixed_;
316  firstStage_ = rhs.firstStage_;
321  gcc_ = rhs.gcc_;
322  bias_ = rhs.bias_;
323  pull_ = rhs.pull_;
324  clone_ = rhs.clone_;
325  parent_ = rhs.parent_;
326  clones_ = rhs.clones_;
327  }
328  return *this;
329 }
330 
331 std::vector<LauParameter*> LauParameter::getPars()
332 {
333  std::vector<LauParameter*> list;
334  list.push_back(this);
335  return list;
336 }
337 
338 void LauParameter::value(Double_t newValue)
339 {
340  if (this->clone()) {
341  parent_->value(newValue);
342  } else {
343  this->checkRange(newValue,this->minValue(),this->maxValue());
344  this->updateClones(kTRUE);
345  }
346 }
347 
348 void LauParameter::error(Double_t newError)
349 {
350  if (this->clone()) {
351  parent_->error(newError);
352  } else {
353  error_ = TMath::Abs(newError);
354  this->updateClones(kFALSE);
355  }
356 }
357 
358 void LauParameter::negError(Double_t newNegError)
359 {
360  if (this->clone()) {
361  parent_->negError(newNegError);
362  } else {
363  negError_ = TMath::Abs(newNegError);
364  this->updateClones(kFALSE);
365  }
366 }
367 
368 void LauParameter::posError(Double_t newPosError)
369 {
370  if (this->clone()) {
371  parent_->posError(newPosError);
372  } else {
373  posError_ = TMath::Abs(newPosError);
374  this->updateClones(kFALSE);
375  }
376 }
377 
378 void LauParameter::errors(Double_t newError, Double_t newNegError, Double_t newPosError)
379 {
380  if (this->clone()) {
381  parent_->errors(newError,newNegError,newPosError);
382  } else {
383  error_ = TMath::Abs(newError);
384  negError_ = TMath::Abs(newNegError);
385  posError_ = TMath::Abs(newPosError);
386  this->updateClones(kFALSE);
387  }
388 }
389 
390 void LauParameter::valueAndErrors(Double_t newValue, Double_t newError, Double_t newNegError, Double_t newPosError)
391 {
392  if (this->clone()) {
393  parent_->valueAndErrors(newValue,newError,newNegError,newPosError);
394  } else {
395  this->checkRange(newValue,this->minValue(),this->maxValue());
396  error_ = TMath::Abs(newError);
397  negError_ = TMath::Abs(newNegError);
398  posError_ = TMath::Abs(newPosError);
399  this->updateClones(kFALSE);
400  }
401 }
402 
403 void LauParameter::globalCorrelationCoeff(Double_t newGCCValue)
404 {
405  if (this->clone()) {
406  parent_->globalCorrelationCoeff(newGCCValue);
407  } else {
408  gcc_ = newGCCValue;
409  this->updateClones(kFALSE);
410  }
411 }
412 
413 void LauParameter::genValue(Double_t newGenValue)
414 {
415  if (this->clone()) {
416  parent_->genValue(newGenValue);
417  } else {
418  genValue_ = newGenValue;
419  this->updateClones(kFALSE);
420  }
421 }
422 
423 void LauParameter::initValue(Double_t newInitValue)
424 {
425  if (this->clone()) {
426  parent_->initValue(newInitValue);
427  } else {
428  initValue_ = newInitValue;
429  this->updateClones(kFALSE);
430  }
431 }
432 
433 void LauParameter::minValue(Double_t newMinValue)
434 {
435  if (this->clone()) {
436  parent_->minValue(newMinValue);
437  } else {
438  this->checkRange(this->value(),newMinValue,this->maxValue());
439  this->updateClones(kFALSE);
440  }
441 }
442 
443 void LauParameter::maxValue(Double_t newMaxValue)
444 {
445  if (this->clone()) {
446  parent_->maxValue(newMaxValue);
447  } else {
448  this->checkRange(this->value(),this->minValue(),newMaxValue);
449  this->updateClones(kFALSE);
450  }
451 }
452 
453 void LauParameter::range(Double_t newMinValue, Double_t newMaxValue)
454 {
455  if (this->clone()) {
456  parent_->range(newMinValue,newMaxValue);
457  } else {
458  this->checkRange(this->value(),newMinValue,newMaxValue);
459  this->updateClones(kFALSE);
460  }
461 }
462 
463 void LauParameter::valueAndRange(Double_t newValue, Double_t newMinValue, Double_t newMaxValue)
464 {
465  if (this->clone()) {
466  parent_->valueAndRange(newValue,newMinValue,newMaxValue);
467  } else {
468  this->checkRange(newValue,newMinValue,newMaxValue);
469  this->updateClones(kFALSE);
470  }
471 }
472 
473 void LauParameter::name(const TString& newName)
474 {
475  // no need to update clones here
476  // clones are allowed to have different names
477  name_ = newName;
478 }
479 
480 void LauParameter::fixed(Bool_t parFixed)
481 {
482  if (this->clone()) {
483  parent_->fixed(parFixed);
484  } else {
485  fixed_ = parFixed;
486  this->updateClones(kFALSE);
487  }
488 }
489 
490 void LauParameter::firstStage(Bool_t firstStagePar)
491 {
492  if (this->clone()) {
493  parent_->firstStage(firstStagePar);
494  } else {
495  firstStage_ = firstStagePar;
496  this->updateClones(kFALSE);
497  }
498 }
499 
500 void LauParameter::secondStage(Bool_t secondStagePar)
501 {
502  if (this->clone()) {
503  parent_->secondStage(secondStagePar);
504  } else {
505  secondStage_ = secondStagePar;
506  this->updateClones(kFALSE);
507  }
508 }
509 
510 void LauParameter::addGaussianConstraint(Double_t newGaussMean, Double_t newGaussWidth)
511 {
512  if (this->clone()) {
513  parent_->addGaussianConstraint(newGaussMean,newGaussWidth);
514  } else {
515  gaussConstraint_ = kTRUE;
516  constraintMean_ = newGaussMean;
517  constraintWidth_ = newGaussWidth;
518  this->updateClones(kFALSE);
519  }
520 }
521 
523 {
524  if (this->clone()) {
526  } else {
527  gaussConstraint_ = kFALSE;
528  this->updateClones(kFALSE);
529  }
530 }
531 
533 {
534  if (this->clone()) {
535  (*parent_) = val;
536  } else {
537  this->checkRange(val,this->minValue(),this->maxValue());
538  this->updateClones(kTRUE);
539  }
540  return *this;
541 }
542 
544 {
545  if (this->clone()) {
546  (*parent_) += val;
547  } else {
548  this->checkRange(this->value()+val,this->minValue(),this->maxValue());
549  this->updateClones(kTRUE);
550  }
551  return *this;
552 }
553 
555 {
556  if (this->clone()) {
557  (*parent_) -= val;
558  } else {
559  this->checkRange(this->value()-val,this->minValue(),this->maxValue());
560  this->updateClones(kTRUE);
561  }
562  return *this;
563 }
564 
566 {
567  if (this->clone()) {
568  (*parent_) *= val;
569  } else {
570  this->checkRange(this->value()*val,this->minValue(),this->maxValue());
571  this->updateClones(kTRUE);
572  }
573  return *this;
574 }
575 
577 {
578  if (this->clone()) {
579  (*parent_) /= val;
580  } else {
581  this->checkRange(this->value()/val,this->minValue(),this->maxValue());
582  this->updateClones(kTRUE);
583  }
584  return *this;
585 }
586 
588 {
589  if (this->clone()) {
590  parent_->updatePull();
591  return;
592  }
593 
594  // calculate the bias
595  bias_ = value_ - genValue_;
596 
597  // if we have errors calculated then calculate
598  // the pull using the best error available
599  if ((bias_ > 0.0) && (negError_ > 1e-10)) {
600  pull_ = bias_ / negError_;
601  } else if ((bias_ < 0.0) && (posError_ > 1e-10)) {
602  pull_ = bias_ / posError_;
603  } else if (error_ > 1e-10) {
604  pull_ = bias_ / error_;
605  } else {
606  pull_ = 0.0;
607  }
608 
609  this->updateClones(kFALSE);
610 }
611 
612 void LauParameter::checkRange(Double_t val, Double_t minVal, Double_t maxVal)
613 {
614  // first check that min is less than max (or they are the same - this is allowed)
615  if (minVal > maxVal) {
616  cerr<<"ERROR in LauParameter::checkRange : minValue: "<<minVal<<" greater than maxValue: "<<maxVal<<endl;
617  if (minValue_ > maxValue_) {
619  cerr<<" : Setting both to "<<maxValue_<<"."<<endl;
620  } else {
621  cerr<<" : Not changing anything."<<endl;
622  }
623  return;
624  }
625 
626  minValue_ = minVal;
627  maxValue_ = maxVal;
628 
629  // now check that the value is still within the range
630  if ((val < minVal) || (val > maxVal)) {
631  if (name_ != "") {
632  cerr<<"ERROR in LauParameter::checkRange : value: "<<val<<" not in allowed range ["<<minVal<<" , "<<maxVal<<"] for parameter \""<<name_<<"\"."<<endl;
633  } else {
634  cerr<<"ERROR in LauParameter::checkRange : value: "<<val<<" not in allowed range ["<<minVal<<" , "<<maxVal<<"]."<<endl;
635  }
636  if (val < minVal) {
637  cerr<<" : Setting value to minValue: "<<minVal<<endl;
638  val = minVal;
639  } else {
640  cerr<<" : Setting value to maxValue: "<<maxVal<<endl;
641  val = maxVal;
642  }
643  }
644  value_ = val;
645 }
646 
648 {
649  // if we're a clone we mustn't be cloned ourselves
650  // but instead return another clone of our parent
651  // (this is so that the parent knows of all its clones)
652  if (this->clone()) {
653  LauParameter* clonePar = parent_->createClone(constFactor);
654  clonePar->name(this->name());
655  return clonePar;
656  }
657 
658  // clone ourselves using the copy-constructor
659  LauParameter* clonePar = new LauParameter(*this);
660  (*clonePar) *= constFactor;
661  clonePar->wipeClones();
662  clonePar->clone(this);
663  clones_.insert( std::make_pair( clonePar, constFactor ) );
664  return clonePar;
665 }
666 
667 LauParameter* LauParameter::createClone(const TString& newName, Double_t constFactor)
668 {
669  // self message to create the clone
670  LauParameter* clonePar = this->createClone(constFactor);
671  // set the new name
672  clonePar->name(newName);
673  // and return
674  return clonePar;
675 }
676 
677 void LauParameter::updateClones(Bool_t justValue)
678 {
679  // if we don't have any clones then there's nothing to do
680  if ( clones_.empty() ) {
681  return;
682  }
683 
684  // we have to set the values directly rather than using member functions because otherwise we'd get into an infinite loop
685  if (justValue) {
686  for (map<LauParameter*,Double_t>::iterator iter = clones_.begin(); iter != clones_.end(); ++iter) {
687  LauParameter* clonePar = iter->first;
688  Double_t constFactor = iter->second;
689  clonePar->value_ = constFactor*this->value();
690  }
691  } else {
692  for (map<LauParameter*,Double_t>::iterator iter = clones_.begin(); iter != clones_.end(); ++iter) {
693  LauParameter* clonePar = iter->first;
694  Double_t constFactor = iter->second;
695  clonePar->value_ = constFactor*this->value();
696  clonePar->error_ = constFactor*this->error();
697  clonePar->negError_ = constFactor*this->negError();
698  clonePar->posError_ = constFactor*this->posError();
699  clonePar->genValue_ = constFactor*this->genValue();
700  clonePar->initValue_ = constFactor*this->initValue();
701  clonePar->minValue_ = constFactor*this->minValue();
702  clonePar->maxValue_ = constFactor*this->maxValue();
703  clonePar->fixed_ = this->fixed();
704  clonePar->firstStage_ = this->firstStage();
705  clonePar->secondStage_ = this->secondStage();
706  clonePar->gaussConstraint_ = this->gaussConstraint();
707  clonePar->constraintMean_ = this->constraintMean();
708  clonePar->constraintWidth_ = this->constraintWidth();
709  clonePar->gcc_ = this->globalCorrelationCoeff();
710  clonePar->bias_ = this->bias();
711  clonePar->pull_ = this->pull();
712  }
713  }
714 }
715 
717 {
718  this->randomiseValue(this->minValue(), this->maxValue());
719 }
720 
721 void LauParameter::randomiseValue(Double_t minVal, Double_t maxVal)
722 {
723  // if we're fixed then do nothing
724  if (this->fixed()) {
725  return;
726  }
727 
728  // check supplied values are sensible
729  if (maxVal < minVal) {
730  cerr<<"ERROR in LauParameter::randomiseValue : Supplied maximum value smaller than minimum value."<<endl;
731  return;
732  }
733  if (maxVal > this->maxValue()) {
734  maxVal = this->maxValue();
735  }
736  if (minVal < this->minValue()) {
737  minVal = this->minValue();
738  }
739 
740  // use the zero-seed random number generator to get values that are
741  // uniformly distributed over the given range
742  Double_t randNo = LauRandom::zeroSeedRandom()->Rndm();
743  Double_t val = randNo*(maxVal - minVal) + minVal;
744  this->initValue(val);
745 }
746 
747 // various mathematical operators (non-member functions)
748 Double_t operator + (const LauParameter& lhs, Double_t rhs)
749 {
750  return (lhs.value() + rhs);
751 }
752 Double_t operator + (Double_t lhs, const LauParameter& rhs)
753 {
754  return (lhs + rhs.value());
755 }
756 Double_t operator + (const LauParameter& lhs, const LauParameter& rhs)
757 {
758  return (lhs.value() + rhs.value());
759 }
760 Double_t operator - (const LauParameter& lhs, Double_t rhs)
761 {
762  return (lhs.value() - rhs);
763 }
764 Double_t operator - (Double_t lhs, const LauParameter& rhs)
765 {
766  return (lhs - rhs.value());
767 }
768 Double_t operator - (const LauParameter& lhs, const LauParameter& rhs)
769 {
770  return (lhs.value() - rhs.value());
771 }
772 Double_t operator * (const LauParameter& lhs, Double_t rhs)
773 {
774  return (lhs.value() * rhs);
775 }
776 Double_t operator * (Double_t lhs, const LauParameter& rhs)
777 {
778  return (lhs * rhs.value());
779 }
780 Double_t operator * (const LauParameter& lhs, const LauParameter& rhs)
781 {
782  return (lhs.value() * rhs.value());
783 }
784 Double_t operator / (const LauParameter& lhs, Double_t rhs)
785 {
786  return (lhs.value() / rhs);
787 }
788 Double_t operator / (Double_t lhs, const LauParameter& rhs)
789 {
790  return (lhs / rhs.value());
791 }
792 Double_t operator / (const LauParameter& lhs, const LauParameter& rhs)
793 {
794  return (lhs.value() / rhs.value());
795 }
796 Double_t operator += (Double_t& lhs, const LauParameter& rhs)
797 {
798  lhs += rhs.value();
799  return lhs;
800 }
801 Double_t operator -= (Double_t& lhs, const LauParameter& rhs)
802 {
803  lhs -= rhs.value();
804  return lhs;
805 }
806 Double_t operator *= (Double_t& lhs, const LauParameter& rhs)
807 {
808  lhs *= rhs.value();
809  return lhs;
810 }
811 Double_t operator /= (Double_t& lhs, const LauParameter& rhs)
812 {
813  lhs /= rhs.value();
814  return lhs;
815 }
816 
817 // ostream operator
818 std::ostream& operator << (std::ostream& stream, const LauParameter& par)
819 {
820  stream << par.value();
821  return stream;
822 }
823 
Double_t range() const
The range allowed for the parameter.
Double_t genValue_
Toy generation value.
LauAbsRValue & operator=(const LauAbsRValue &)
Copy assignment operator.
Definition: LauAbsRValue.hh:42
Bool_t fixed() const
Check whether the parameter is fixed or floated.
Double_t operator+=(Double_t &lhs, const LauParameter &rhs)
std::map< LauParameter *, Double_t > clones_
The clones of this parameter.
Double_t operator*=(Double_t &lhs, const LauParameter &rhs)
Double_t constraintMean_
Mean value of the Gaussian constraint.
TRandom * zeroSeedRandom()
Access the singleton random number generator with seed set from machine clock time (within +-1 sec)...
Definition: LauRandom.cc:30
Double_t maxValue() const
The maximum value allowed for the parameter.
ClassImp(LauAbsCoeffSet)
LauParameter()
Default constructor.
Definition: LauParameter.cc:30
const TString & name() const
The parameter name.
Double_t operator/(const LauParameter &lhs, Double_t rhs)
Double_t constraintWidth() const
The width of the Gaussian constraint.
Double_t bias() const
The bias in the parameter.
LauParameter * parent_
The parent parameter.
Bool_t gaussConstraint_
Choice to use Gaussian constraint.
Double_t negError() const
The lower error on the parameter.
Double_t minValue() const
The minimum value allowed for the parameter.
Double_t maxValue_
Maximum value for the parameter.
LauParameter & operator*=(Double_t val)
Multiplication assignment operator.
Bool_t firstStage_
Flag whether it is floated only in the first stage of the fit.
Double_t operator-=(Double_t &lhs, const LauParameter &rhs)
void valueAndRange(Double_t newValue, Double_t newMinValue, Double_t newMaxValue)
Set the value and range for the parameter.
void updateClones(Bool_t justValue)
Method to update clone values.
Double_t operator/=(Double_t &lhs, const LauParameter &rhs)
Double_t bias_
Parameter bias.
Double_t operator*(const LauParameter &lhs, Double_t rhs)
Double_t posError() const
The upper error on the parameter.
Double_t error_
The error on the parameter.
Bool_t clone() const
Check whether is a clone or not.
void checkRange()
Method to check whether value provided is whithin the range and that the minimum and maximum limits m...
Double_t pull() const
The pull value for the parameter.
Bool_t firstStage() const
Check whether the parameter should be floated only in the first stage of a two stage fit...
std::ostream & operator<<(std::ostream &os, const LauComplex &z)
Definition: LauComplex.cc:43
Double_t minValue_
Minimum value for the parameter.
File containing declaration of LauParameter class.
Double_t pull_
Parameter pull.
Double_t constraintMean() const
The mean of the Gaussian constraint.
Double_t negError_
The lower error on the parameter.
Bool_t gaussConstraint() const
Check whether a Gaussian constraints is applied.
Double_t gcc_
Global correlation coefficient.
Bool_t secondStage() const
Check whether the parameter should be floated only in the second stage of a two stage fit...
std::vector< LauParameter * > getPars()
Get the LauParameter itself.
Double_t error() const
The error on the parameter.
LauParameter & operator/=(Double_t val)
Division assignment operator.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:34
void randomiseValue()
Randomise the value of the parameter (if it is floating).
void valueAndErrors(Double_t newValue, Double_t newError, Double_t newNegError=0.0, Double_t newPosError=0.0)
Set the value and errors on the parameter.
Double_t posError_
The upper error on the parameter.
Double_t operator+(const LauParameter &lhs, Double_t rhs)
File containing LauRandom namespace.
TString name_
The parameter name.
LauParameter & operator-=(Double_t val)
Subtraction assignment operator.
Double_t initValue() const
The initial value of the parameter.
Bool_t secondStage_
Flag whether it is floated only in the second stage of the fit.
Double_t value_
The parameter value.
Bool_t clone_
Flag whether the parameter is a clone.
void updatePull()
Call to update the bias and pull values.
LauParameter * createClone(Double_t constFactor=1.0)
Method to create a clone from the parent parameter using the copy constructor.
void addGaussianConstraint(Double_t newGaussMean, Double_t newGaussWidth)
Add a Gaussian constraint (or modify an existing one)
Bool_t fixed_
Fix/float option for parameter.
Double_t value() const
The value of the parameter.
void wipeClones()
Method to clear the clone parameters.
Double_t operator-(const LauParameter &lhs, Double_t rhs)
Double_t globalCorrelationCoeff() const
The parameter global correlation coefficient.
Double_t constraintWidth_
Width of the Gaussian constraint.
Pure abstract base class for defining a parameter containing an R value.
Definition: LauAbsRValue.hh:29
Double_t genValue() const
The value generated for the parameter.
void removeGaussianConstraint()
Remove the Gaussian constraint.
void errors(Double_t newError, Double_t newNegError, Double_t newPosError)
Set the error values on the parameter.
Double_t initValue_
Initial fit value.
LauParameter & operator=(const LauParameter &rhs)
Copy assignment operator.
LauParameter & operator+=(Double_t val)
Addition assignment operator.