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