laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauAbsCoeffSet.hh
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 
36 #ifndef LAU_ABS_COEFF_SET
37 #define LAU_ABS_COEFF_SET
38 
39 #include <iosfwd>
40 #include <vector>
41 
42 #include "TString.h"
43 
44 class TRandom;
45 class LauComplex;
46 class LauParameter;
47 
48 
50 
51  public:
53  enum CloneOption {
54  All,
60  };
61 
63  virtual ~LauAbsCoeffSet(){}
64 
66 
69  virtual std::vector<LauParameter*> getParameters() = 0;
70 
72  virtual void printParValues() const = 0;
73 
75 
78  virtual void printTableHeading(std::ostream& stream) const = 0;
79 
81 
84  virtual void printTableRow(std::ostream& stream) const = 0;
85 
87  virtual void randomiseInitValues() = 0;
88 
90  virtual void finaliseValues() = 0;
91 
93 
96  virtual const LauComplex& particleCoeff() = 0;
97 
99 
102  virtual const LauComplex& antiparticleCoeff() = 0;
103 
105 
110  virtual void setCoeffValues( const LauComplex& coeff, const LauComplex& coeffBar, Bool_t init ) = 0;
111 
113 
116  virtual LauParameter acp() = 0;
117 
119 
125  virtual LauAbsCoeffSet* createClone(const TString& newName, CloneOption cloneOption = All, Double_t constFactor = 1.0) = 0;
126 
128 
132  virtual TString name() const {return name_;}
133 
135 
139  virtual void name(const TString& theName) {name_ = theName;}
140 
142 
147  virtual const TString& baseName() const {return basename_;}
148 
150 
155  virtual void baseName(const TString& theBasename) {basename_ = theBasename;}
156 
158 
161  virtual UInt_t index() const {return index_;}
162 
164 
167  virtual void index(UInt_t newIndex);
168 
170 
175  virtual void setParameterValue(const TString& parName, Double_t value, Bool_t init);
176 
178 
183  virtual void setParameterError(const TString& parName, Double_t error);
184 
186 
189  virtual void fixParameter(const TString& parName);
190 
192 
195  virtual void floatParameter(const TString& parName);
196 
198 
205  virtual void blindParameter(const TString& parName, const TString& blindingString, const Double_t width);
206 
208 
213  virtual void addGaussianConstraint(const TString& parName, const Double_t mean, const Double_t width);
214 
216 
220  virtual void addSuffixToParameterName(const TString& parName, const TString& suffix);
221 
223 
227  static void setMagnitudeRange(Double_t minMag, Double_t maxMag) { minMagnitude_ = minMag; maxMagnitude_ = maxMag; }
228 
230 
234  static void setPhaseRange(Double_t minPhase, Double_t maxPhase) { minPhase_ = minPhase; maxPhase_ = maxPhase; }
235 
237 
241  static void setRealImagRange(Double_t minPar, Double_t maxPar) { minRealImagPart_ = minPar; maxRealImagPart_ = maxPar; }
242 
244 
248  static void setCPParRange(Double_t minPar, Double_t maxPar) { minDelta_ = minPar; maxDelta_ = maxPar; }
249 
251 
257  static void setRandomiser(TRandom* randomiser) { randomiser_ = randomiser; }
258 
260 
263  static TRandom* getRandomiser();
264 
265  protected:
267 
271  LauAbsCoeffSet(const TString& theName, const TString& theBaseName = "A");
272 
274 
278  LauParameter* findParameter(const TString& parName);
279 
281 
285  virtual void adjustName(LauParameter* par, const TString& oldBaseName);
286 
288  static Double_t minMagnitude_;
290  static Double_t maxMagnitude_;
292  static Double_t minPhase_;
294  static Double_t maxPhase_;
296  static Double_t minRealImagPart_;
298  static Double_t maxRealImagPart_;
300  static Double_t minDelta_;
302  static Double_t maxDelta_;
303 
305 
308  LauAbsCoeffSet(const LauAbsCoeffSet& rhs);
309 
311 
315 
316  private:
318  static TRandom* randomiser_;
319 
321  TString name_;
322 
324  TString basename_;
325 
327  UInt_t index_;
328 
329  ClassDef(LauAbsCoeffSet, 0)
330 
331 };
332 
333 #endif
virtual void blindParameter(const TString &parName, const TString &blindingString, const Double_t width)
Blind the named parameter.
virtual void randomiseInitValues()=0
Randomise the starting values of the parameters for a fit.
static Double_t maxPhase_
Maximum allowed value of phase parameters.
static void setMagnitudeRange(Double_t minMag, Double_t maxMag)
Set the allowed range for magnitude parameters.
static Double_t minDelta_
Minimum allowed value of CP-violating real/imaginary part parameters.
virtual LauAbsCoeffSet * createClone(const TString &newName, CloneOption cloneOption=All, Double_t constFactor=1.0)=0
Create a clone of the coefficient set.
virtual void setParameterValue(const TString &parName, Double_t value, Bool_t init)
Set the value of the named parameter.
virtual void setCoeffValues(const LauComplex &coeff, const LauComplex &coeffBar, Bool_t init)=0
Set the parameters based on the complex coefficients for particles and antiparticles.
virtual LauParameter acp()=0
Calculate the CP asymmetry.
virtual void printTableHeading(std::ostream &stream) const =0
Print the column headings for a results table.
static TRandom * randomiser_
Random number generator to use for randomising parameter starting values.
virtual void addGaussianConstraint(const TString &parName, const Double_t mean, const Double_t width)
Add Gaussian constraint to the named parameter.
static Double_t maxRealImagPart_
Maximum allowed value of real/imaginary part parameters.
static void setRealImagRange(Double_t minPar, Double_t maxPar)
Set the allowed range for real/imaginary part parameters.
static Double_t maxDelta_
Maximum allowed value of CP-violating real/imaginary part parameters.
virtual void printParValues() const =0
Print the current values of the parameters.
LauAbsCoeffSet & operator=(const LauAbsCoeffSet &rhs)
Copy assignment operator.
UInt_t index_
The index number of the coefficient set.
virtual void fixParameter(const TString &parName)
Set the named parameter to be fixed in the fit.
virtual void setParameterError(const TString &parName, Double_t error)
Set the error of the named parameter.
static void setRandomiser(TRandom *randomiser)
Set the randomiser.
virtual void addSuffixToParameterName(const TString &parName, const TString &suffix)
Add suffix to the name of the given parameter.
LauParameter * findParameter(const TString &parName)
Find the parameter with the given name.
virtual UInt_t index() const
Retrieve the index number of the coefficient set.
CloneOption
Options for cloning operation.
static void setPhaseRange(Double_t minPhase, Double_t maxPhase)
Set the allowed range for phase parameters.
static Double_t maxMagnitude_
Maximum allowed value of magnitude parameters.
TString basename_
The base name of the coefficient set.
virtual void name(const TString &theName)
Set the name of the coefficient set.
Class for defining the abstract interface for complex coefficient classes.
virtual void finaliseValues()=0
Make sure values are in &quot;standard&quot; ranges, e.g. phases should be between -pi and pi.
virtual ~LauAbsCoeffSet()
Destructor.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:49
virtual void printTableRow(std::ostream &stream) const =0
Print the parameters of the complex coefficient as a row in the results table.
static Double_t minRealImagPart_
Minimum allowed value of real/imaginary part parameters.
virtual void baseName(const TString &theBasename)
Set the base name of the coefficient set.
virtual const LauComplex & antiparticleCoeff()=0
Retrieve the complex coefficient for an antiparticle.
virtual const LauComplex & particleCoeff()=0
Retrieve the complex coefficient for a particle.
static void setCPParRange(Double_t minPar, Double_t maxPar)
Set the allowed range for CP-violating parameters.
virtual void floatParameter(const TString &parName)
Set the named parameter to float in the fit.
Class for defining a complex number.
Definition: LauComplex.hh:61
virtual TString name() const
Retrieve the name of the coefficient set.
static Double_t minPhase_
Minimum allowed value of phase parameters.
virtual std::vector< LauParameter * > getParameters()=0
Retrieve the parameters of the coefficient so that they can be loaded into a fit. ...
static Double_t minMagnitude_
Minimum allowed value of magnitude parameters.
virtual const TString & baseName() const
Retrieve the base name of the coefficient set.
static TRandom * getRandomiser()
Access the randomiser.
TString name_
The name of the coefficient set.
virtual void adjustName(LauParameter *par, const TString &oldBaseName)
Prepend the base name and index to the name of a parameter.
LauAbsCoeffSet(const TString &theName, const TString &theBaseName="A")
Constructor.