laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
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 "TString.h"
40 
41 #include <iosfwd>
42 #include <vector>
43 
44 class TRandom;
45 class LauComplex;
46 class LauParameter;
47 
49 
50  public:
52  enum CloneOption {
53  All,
58  TieCPPars
59  };
60 
62  virtual ~LauAbsCoeffSet() {}
63 
65 
68  virtual std::vector<LauParameter*> getParameters() = 0;
69 
71  virtual void printParValues() const = 0;
72 
74 
77  virtual void printTableHeading( std::ostream& stream ) const = 0;
78 
80 
83  virtual void printTableRow( std::ostream& stream ) const = 0;
84 
86  virtual void randomiseInitValues() = 0;
87 
89  virtual void finaliseValues() = 0;
90 
92 
95  virtual const LauComplex& particleCoeff() = 0;
96 
98 
101  virtual const LauComplex& antiparticleCoeff() = 0;
102 
104 
109  virtual void setCoeffValues( const LauComplex& coeff, const LauComplex& coeffBar, Bool_t init ) = 0;
110 
112 
115  virtual LauParameter acp() = 0;
116 
118 
124  virtual LauAbsCoeffSet* createClone( const TString& newName,
125  CloneOption cloneOption = All,
126  Double_t constFactor = 1.0 ) = 0;
127 
129 
134  virtual TString name() const { return name_; }
135 
137 
142  virtual void name( const TString& theName ) { name_ = theName; }
143 
145 
151  virtual const TString& baseName() const { return basename_; }
152 
154 
160  virtual void baseName( const TString& theBasename ) { basename_ = theBasename; }
161 
163 
166  virtual UInt_t index() const { return index_; }
167 
169 
172  virtual void index( UInt_t newIndex );
173 
175 
180  virtual void setParameterValue( const TString& parName, Double_t value, Bool_t init );
181 
183 
189  virtual void setParameterError( const TString& parName, Double_t error );
190 
192 
195  virtual void fixParameter( const TString& parName );
196 
198 
201  virtual void floatParameter( const TString& parName );
202 
204 
211  virtual void blindParameter( const TString& parName,
212  const TString& blindingString,
213  const Double_t width );
214 
216 
221  virtual void addGaussianConstraint( const TString& parName,
222  const Double_t mean,
223  const Double_t width );
224 
226 
230  virtual void addSuffixToParameterName( const TString& parName, const TString& suffix );
231 
233 
237  static void setMagnitudeRange( Double_t minMag, Double_t maxMag )
238  {
239  minMagnitude_ = minMag;
240  maxMagnitude_ = maxMag;
241  }
242 
244 
248  static void setPhaseRange( Double_t minPhase, Double_t maxPhase )
249  {
250  minPhase_ = minPhase;
251  maxPhase_ = maxPhase;
252  }
253 
255 
259  static void setRealImagRange( Double_t minPar, Double_t maxPar )
260  {
261  minRealImagPart_ = minPar;
262  maxRealImagPart_ = maxPar;
263  }
264 
266 
270  static void setCPParRange( Double_t minPar, Double_t maxPar )
271  {
272  minDelta_ = minPar;
273  maxDelta_ = maxPar;
274  }
275 
277 
283  static void setRandomiser( TRandom* randomiser ) { randomiser_ = randomiser; }
284 
286 
289  static TRandom* getRandomiser();
290 
291  protected:
293 
297  LauAbsCoeffSet( const TString& theName, const TString& theBaseName = "A" );
298 
300 
304  LauParameter* findParameter( const TString& parName );
305 
307 
311  virtual void adjustName( LauParameter* par, const TString& oldBaseName );
312 
314  static Double_t minMagnitude_;
316  static Double_t maxMagnitude_;
318  static Double_t minPhase_;
320  static Double_t maxPhase_;
322  static Double_t minRealImagPart_;
324  static Double_t maxRealImagPart_;
326  static Double_t minDelta_;
328  static Double_t maxDelta_;
329 
331 
334  LauAbsCoeffSet( const LauAbsCoeffSet& rhs );
335 
337 
340  LauAbsCoeffSet& operator=( const LauAbsCoeffSet& rhs );
341 
342  private:
344  static TRandom* randomiser_;
345 
347  TString name_;
348 
350  TString basename_;
351 
353  UInt_t index_;
354 
355  ClassDef( LauAbsCoeffSet, 0 )
356 };
357 
358 #endif
virtual void printParValues() const =0
Print the current values of the parameters.
virtual void printTableRow(std::ostream &stream) const =0
Print the parameters of the complex coefficient as a row in the results table.
static void setRandomiser(TRandom *randomiser)
Set the randomiser.
Class for defining the abstract interface for complex coefficient classes.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:49
virtual void name(const TString &theName)
Set the name of the coefficient set.
virtual void randomiseInitValues()=0
Randomise the starting values of the parameters for a fit.
virtual TString name() const
Retrieve 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.
virtual void floatParameter(const TString &parName)
Set the named parameter to float in the fit.
static void setMagnitudeRange(Double_t minMag, Double_t maxMag)
Set the allowed range for magnitude parameters.
static void setPhaseRange(Double_t minPhase, Double_t maxPhase)
Set the allowed range for phase parameters.
TString basename_
The base name of the coefficient set.
static Double_t maxPhase_
Maximum allowed value of phase parameters.
virtual void setParameterValue(const TString &parName, Double_t value, Bool_t init)
Set the value of the named parameter.
LauAbsCoeffSet(const TString &theName, const TString &theBaseName="A")
Constructor.
virtual void baseName(const TString &theBasename)
Set the base name of the coefficient set.
static Double_t maxMagnitude_
Maximum allowed value of magnitude parameters.
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.
TString name_
The name of the coefficient set.
static Double_t minDelta_
Minimum allowed value of CP-violating real/imaginary part parameters.
virtual const LauComplex & antiparticleCoeff()=0
Retrieve the complex coefficient for an antiparticle.
virtual const TString & baseName() const
Retrieve the base name of the coefficient set.
Class for defining a complex number.
Definition: LauComplex.hh:61
virtual const LauComplex & particleCoeff()=0
Retrieve the complex coefficient for a particle.
virtual void fixParameter(const TString &parName)
Set the named parameter to be fixed in the fit.
static TRandom * randomiser_
Random number generator to use for randomising parameter starting values.
static void setCPParRange(Double_t minPar, Double_t maxPar)
Set the allowed range for CP-violating 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 blindParameter(const TString &parName, const TString &blindingString, const Double_t width)
Blind the named parameter.
virtual void addGaussianConstraint(const TString &parName, const Double_t mean, const Double_t width)
Add Gaussian constraint to the named parameter.
virtual ~LauAbsCoeffSet()
Destructor.
virtual LauParameter acp()=0
Calculate the CP asymmetry.
static void setRealImagRange(Double_t minPar, Double_t maxPar)
Set the allowed range for real/imaginary part parameters.
static TRandom * getRandomiser()
Access the randomiser.
virtual UInt_t index() const
Retrieve the index number of the coefficient set.
CloneOption
Options for cloning operation.
static Double_t maxRealImagPart_
Maximum allowed value of real/imaginary part parameters.
virtual void printTableHeading(std::ostream &stream) const =0
Print the column headings for a results table.
LauParameter * findParameter(const TString &parName)
Find the parameter with the given name.
virtual void finaliseValues()=0
Make sure values are in "standard" ranges, e.g. phases should be between -pi and pi.
UInt_t index_
The index number of the coefficient set.
LauAbsCoeffSet & operator=(const LauAbsCoeffSet &rhs)
Copy assignment operator.
static Double_t minMagnitude_
Minimum allowed value of magnitude parameters.
virtual void addSuffixToParameterName(const TString &parName, const TString &suffix)
Add suffix to the name of the given parameter.
static Double_t minRealImagPart_
Minimum allowed value of real/imaginary part parameters.
virtual void setParameterError(const TString &parName, Double_t error)
Set the error of the named parameter.
static Double_t minPhase_
Minimum allowed value of phase parameters.
static Double_t maxDelta_
Maximum allowed value of CP-violating real/imaginary part parameters.
virtual std::vector< LauParameter * > getParameters()=0
Retrieve the parameters of the coefficient so that they can be loaded into a fit.