laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauFormulaPar.hh
Go to the documentation of this file.
1 
2 /*
3 Copyright 2014 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 
37 #ifndef LAU_FORMULAPAR
38 #define LAU_FORMULAPAR
39 
40 #include "LauAbsRValue.hh"
41 #include "LauParameter.hh"
42 
43 #include "TFormula.h"
44 #include "TString.h"
45 
46 #include <map>
47 #include <vector>
48 
49 class LauFormulaPar : public LauAbsRValue {
50 
51  public:
53 
58  LauFormulaPar( const TString& forName,
59  const TString& formula,
60  const std::vector<LauParameter*>& params );
61 
62  // Destructor
63  virtual ~LauFormulaPar();
64 
66  LauFormulaPar( const LauFormulaPar& rhs );
67 
69  LauFormulaPar& operator=( const LauFormulaPar& rhs );
70 
72 
75  Double_t value() const;
76 
78 
81  Double_t unblindValue() const;
82 
84 
87  Double_t genValue() const;
88 
90 
93  Double_t initValue() const;
94 
96 
99  inline const TString& name() const { return name_; }
100 
102 
105  inline void name( const TString& newName ) { name_ = newName; };
106 
108 
111  std::vector<LauParameter*> getPars() { return paramVec_; }
112 
114 
117  inline Bool_t isLValue() const { return kFALSE; }
118 
120 
123  Bool_t fixed() const;
124 
126 
129  Bool_t blind() const;
130 
132 
135  inline Bool_t gaussConstraint() const { return gaussConstraint_; }
136 
138 
141  Double_t constraintPenalty() const;
142 
144 
148  void addGaussianConstraint( Double_t newGaussMean, Double_t newGaussWidth );
149 
152 
154  void generateConstraintMean();
155 
156  protected:
157 
158  private:
160  TString name_;
161 
163  mutable TFormula formula_;
164 
166  std::vector<LauParameter*> paramVec_;
167 
169  Double_t* paramArray_;
170 
176  Double_t constraintMean_;
179 
180  ClassDef( LauFormulaPar, 0 )
181 };
182 
183 #endif
Double_t constraintWidth_
Width of the Gaussian constraint.
TString name_
The parameter name.
Double_t initValue() const
The initial value of the parameter.
Class for defining combinations of fit parameter objects.
Double_t genValue() const
The value generated for the parameter.
Bool_t isLValue() const
Boolean to say it is not an L value.
void name(const TString &newName)
Set the parameter name.
Bool_t gaussConstraint() const
Check whether a Gaussian constraints is applied.
File containing declaration of LauParameter class.
Bool_t fixed() const
Boolean to say if the LauFormulaPar is fixed.
Double_t value() const
Return the value of the LauFormalaPar.
Double_t unblindValue() const
The unblinded value of the parameter.
File containing declaration of LauAbsRValue class.
LauFormulaPar & operator=(const LauFormulaPar &rhs)
Copy assignment operator.
void addGaussianConstraint(Double_t newGaussMean, Double_t newGaussWidth)
Add a Gaussian constraint (or modify an existing one)
LauFormulaPar(const TString &forName, const TString &formula, const std::vector< LauParameter * > &params)
Constructor.
void removeGaussianConstraint()
Remove the Gaussian constraint.
std::vector< LauParameter * > paramVec_
Vector of LauParameters in the formula.
const TString & name() const
The parameter name.
Bool_t blind() const
The blinding state.
Pure abstract base class for defining a parameter containing an R value.
Definition: LauAbsRValue.hh:45
void generateConstraintMean()
Generate per-experiment constraint mean.
Double_t constraintPenalty() const
The penalty term from the Gaussian constraint.
Double_t constraintTrueMean_
True mean of the Gaussian constraint.
std::vector< LauParameter * > getPars()
Get the LauParameters used in LauFormulaPar.
TFormula formula_
The formula.
Double_t * paramArray_
Array to hold parameter values to pass to formula.
Double_t constraintMean_
Mean value of the Gaussian constraint.
Bool_t gaussConstraint_
Choice to use Gaussian constraint.