laura is hosted by Hepforge, IPPP Durham
Laura++  v3r3
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauAbsCoeffSet.hh
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 
22 #ifndef LAU_ABS_COEFF_SET
23 #define LAU_ABS_COEFF_SET
24 
25 #include <iosfwd>
26 #include <vector>
27 
28 #include "TString.h"
29 
30 class TRandom;
31 class LauComplex;
32 class LauParameter;
33 
34 
36 
37  public:
39  enum CloneOption {
40  All,
46  };
47 
49  virtual ~LauAbsCoeffSet(){}
50 
52 
55  virtual std::vector<LauParameter*> getParameters() = 0;
56 
58  virtual void printParValues() const = 0;
59 
61 
64  virtual void printTableHeading(std::ostream& stream) const = 0;
65 
67 
70  virtual void printTableRow(std::ostream& stream) const = 0;
71 
73  virtual void randomiseInitValues() = 0;
74 
76  virtual void finaliseValues() = 0;
77 
79 
82  virtual const LauComplex& particleCoeff() = 0;
83 
85 
88  virtual const LauComplex& antiparticleCoeff() = 0;
89 
91 
96  virtual void setCoeffValues( const LauComplex& coeff, const LauComplex& coeffBar, Bool_t init ) = 0;
97 
99 
102  virtual LauParameter acp() = 0;
103 
105 
111  virtual LauAbsCoeffSet* createClone(const TString& newName, CloneOption cloneOption = All, Double_t constFactor = 1.0) = 0;
112 
114 
118  virtual TString name() const {return name_;}
119 
121 
125  virtual void name(const TString& theName) {name_ = theName;}
126 
128 
133  virtual const TString& baseName() const {return basename_;}
134 
136 
141  virtual void baseName(const TString& theBasename) {basename_ = theBasename;}
142 
144 
147  virtual UInt_t index() const {return index_;}
148 
150 
153  virtual void index(UInt_t newIndex);
154 
156 
161  virtual void setParameterValue(const TString& parName, Double_t value, Bool_t init);
162 
164 
169  virtual void setParameterError(const TString& parName, Double_t error);
170 
172 
175  virtual void fixParameter(const TString& parName);
176 
178 
181  virtual void floatParameter(const TString& parName);
182 
184 
191  virtual void blindParameter(const TString& parName, const TString& blindingString, const Double_t width);
192 
194 
199  virtual void addGaussianConstraint(const TString& parName, const Double_t mean, const Double_t width);
200 
202 
206  virtual void addSuffixToParameterName(const TString& parName, const TString& suffix);
207 
209 
213  static void setMagnitudeRange(Double_t minMag, Double_t maxMag) { minMagnitude_ = minMag; maxMagnitude_ = maxMag; }
214 
216 
220  static void setPhaseRange(Double_t minPhase, Double_t maxPhase) { minPhase_ = minPhase; maxPhase_ = maxPhase; }
221 
223 
227  static void setRealImagRange(Double_t minPar, Double_t maxPar) { minRealImagPart_ = minPar; maxRealImagPart_ = maxPar; }
228 
230 
234  static void setCPParRange(Double_t minPar, Double_t maxPar) { minDelta_ = minPar; maxDelta_ = maxPar; }
235 
237 
243  static void setRandomiser(TRandom* randomiser) { randomiser_ = randomiser; }
244 
246 
249  static TRandom* getRandomiser();
250 
251  protected:
253 
257  LauAbsCoeffSet(const TString& theName, const TString& theBaseName = "A");
258 
260 
264  LauParameter* findParameter(const TString& parName);
265 
267 
271  virtual void adjustName(LauParameter* par, const TString& oldBaseName);
272 
274  static Double_t minMagnitude_;
276  static Double_t maxMagnitude_;
278  static Double_t minPhase_;
280  static Double_t maxPhase_;
282  static Double_t minRealImagPart_;
284  static Double_t maxRealImagPart_;
286  static Double_t minDelta_;
288  static Double_t maxDelta_;
289 
291 
294  LauAbsCoeffSet(const LauAbsCoeffSet& rhs);
295 
297 
301 
302  private:
304  static TRandom* randomiser_;
305 
307  TString name_;
308 
310  TString basename_;
311 
313  UInt_t index_;
314 
315  ClassDef(LauAbsCoeffSet, 0)
316 
317 };
318 
319 #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:35
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:47
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.