laura is hosted by Hepforge, IPPP Durham
Laura++  v3r1
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauLASSBWRes.cc
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2008 - 2014.
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 
15 #include <iostream>
16 
17 #include "LauConstants.hh"
18 #include "LauLASSBWRes.hh"
19 #include "LauResonanceInfo.hh"
20 
22 
23 
24 LauLASSBWRes::LauLASSBWRes(LauResonanceInfo* resInfo, const Int_t resPairAmpInt, const LauDaughters* daughters) :
25  LauAbsResonance(resInfo, resPairAmpInt, daughters),
26  q0_(0.0),
27  mDaugSum_(0.0),
28  mDaugSumSq_(0.0),
29  mDaugDiff_(0.0),
30  mDaugDiffSq_(0.0),
31  resMassSq_(0.0),
32  r_(0),
33  a_(0)
34 {
35  // Default values for LASS parameters
36  const Double_t rVal = 3.32;
37  const Double_t aVal = 2.07;
38 
39  const TString& parNameBase = this->getSanitisedName();
40 
41  TString rName(parNameBase);
42  rName += "_r";
43  r_ = resInfo->getExtraParameter( rName );
44  if ( r_ == 0 ) {
45  r_ = new LauParameter( rName, rVal, 0.0, 10.0, kTRUE );
46  r_->secondStage(kTRUE);
47  resInfo->addExtraParameter( r_ );
48  }
49 
50  TString aName(parNameBase);
51  aName += "_a";
52  a_ = resInfo->getExtraParameter( aName );
53  if ( a_ == 0 ) {
54  a_ = new LauParameter( aName, aVal, 0.0, 10.0, kTRUE );
55  a_->secondStage(kTRUE);
56  resInfo->addExtraParameter( a_ );
57  }
58 }
59 
61 {
62 }
63 
65 {
66  // Create the mass sums and differences
67  Double_t massDaug1 = this->getMassDaug1();
68  Double_t massDaug2 = this->getMassDaug2();
69 
70  mDaugSum_ = massDaug1 + massDaug2;
72 
73  mDaugDiff_ = massDaug1 - massDaug2;
75 
76  Int_t resSpin = this->getSpin();
77  if (resSpin != 0) {
78  std::cerr << "WARNING in LauLASSBWRes::amplitude : Resonance spin is " << resSpin << "." << std::endl;
79  std::cerr << " : LASS amplitude is only for scalers, resetting spin to 0." << std::endl;
80  this->changeResonance( -1.0, -1.0, 0 );
81  }
82 
83  this->calcQ0();
84 }
85 
87 {
88  // Decay momentum of either daughter in the resonance rest frame
89  // when resonance mass = rest-mass value, m_0 (PDG value)
90 
91  resMass_ = this->getMass();
93 
94  q0_ = TMath::Sqrt((resMassSq_ - mDaugSumSq_)*(resMassSq_ - mDaugDiffSq_))/(2.0*resMass_);
95 }
96 
97 LauComplex LauLASSBWRes::resAmp(Double_t mass, Double_t /*spinTerm*/)
98 {
99  LauComplex resAmplitude(0.0, 0.0);
100 
101  if (mass < 1e-10) {
102  std::cerr << "WARNING in LauLASSBWRes::amplitude : mass < 1e-10." << std::endl;
103  return LauComplex(0.0, 0.0);
104  }
105 
106  // Calculate the width of the resonance (as a function of mass)
107  // q is the momentum of either daughter in the resonance rest-frame
108  const Double_t q = this->getQ();
109  const Double_t resMass = this->getMass();
110  const Double_t resWidth = this->getWidth();
111 
112  // If the mass is floating and their value have changed
113  // we need to recalculate everything that assumes this value
114  if ( (!this->fixMass()) && resMass != resMass_ ) {
115  this->calcQ0();
116  }
117 
118  Double_t qRatio = q/q0_;
119  Double_t totWidth = resWidth*qRatio*(resMass/mass);
120 
121  Double_t massSq = mass*mass;
122  Double_t massSqTerm = resMassSq_ - massSq;
123 
124  // Compute the complex amplitude
125  resAmplitude = LauComplex(massSqTerm, resMass*totWidth);
126 
127  // Scale by the denominator factor
128  resAmplitude.rescale((resMassSq_*resWidth/q0_)/(massSqTerm*massSqTerm + resMassSq_*totWidth*totWidth));
129 
130  // Calculate the phase shift term
131  const Double_t rVal = this->getEffectiveRange();
132  const Double_t aVal = this->getScatteringLength();
133  const Double_t tandeltaB = (2.0*aVal*q)/(2.0 + aVal*rVal*q*q);
134  const Double_t tanSq = tandeltaB*tandeltaB;
135  const Double_t cos2PhaseShift = (1.0 - tanSq) / (1.0 + tanSq);
136  const Double_t sin2PhaseShift = 2.0*tandeltaB / (1.0 + tanSq);
137  LauComplex phaseShift(cos2PhaseShift, sin2PhaseShift);
138 
139  // Multiply by the phase shift
140  resAmplitude = resAmplitude * phaseShift;
141 
142  return resAmplitude;
143 }
144 
145 const std::vector<LauParameter*>& LauLASSBWRes::getFloatingParameters()
146 {
147  this->clearFloatingParameters();
148 
149  if ( ! this->fixMass() ) {
150  this->addFloatingParameter( this->getMassPar() );
151  }
152 
153  if ( ! this->fixWidth() ) {
154  this->addFloatingParameter( this->getWidthPar() );
155  }
156 
157  if ( ! this->fixEffectiveRange() ) {
158  this->addFloatingParameter( r_ );
159  }
160 
161  if ( ! this->fixScatteringLength() ) {
162  this->addFloatingParameter( a_ );
163  }
164 
165  return this->getParameters();
166 }
167 
168 void LauLASSBWRes::setResonanceParameter(const TString& name, const Double_t value)
169 {
170  // Set various parameters for the LASS lineshape dynamics
171  if (name == "a") {
172  this->setScatteringLength(value);
173  std::cout << "INFO in LauLASSBWRes::setResonanceParameter : Setting LASS Scattering Length = " << this->getScatteringLength() << std::endl;
174  } else if (name == "r") {
175  this->setEffectiveRange(value);
176  std::cout << "INFO in LauLASSBWRes::setResonanceParameter : Setting LASS Effective Range = " << this->getEffectiveRange() << std::endl;
177  } else {
178  std::cerr << "WARNING in LauLASSBWRes::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
179  }
180 }
181 
183 {
184  if (name == "a") {
185  if ( a_->fixed() ) {
186  a_->fixed( kFALSE );
187  this->addFloatingParameter( a_ );
188  } else {
189  std::cerr << "WARNING in LauLASSBWRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
190  }
191  } else if (name == "r") {
192  if ( r_->fixed() ) {
193  r_->fixed( kFALSE );
194  this->addFloatingParameter( r_ );
195  } else {
196  std::cerr << "WARNING in LauLASSBWRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
197  }
198  } else {
199  std::cerr << "WARNING in LauLASSBWRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
200  }
201 }
202 
204 {
205  if (name == "a") {
206  return a_;
207  } else if (name == "r") {
208  return r_;
209  } else {
210  std::cerr << "WARNING in LauLASSBWRes::getResonanceParameter: Parameter name not reconised." << std::endl;
211  return 0;
212  }
213 }
214 
215 void LauLASSBWRes::setEffectiveRange(const Double_t r)
216 {
217  r_->value( r );
218  r_->genValue( r );
219  r_->initValue( r );
220 }
221 
222 void LauLASSBWRes::setScatteringLength(const Double_t a)
223 {
224  a_->value( a );
225  a_->genValue( a );
226  a_->initValue( a );
227 }
228 
Double_t getQ() const
Get the current value of the daughter momentum in the resonance rest frame.
LauParameter * getMassPar()
Get the mass parameter of the resonance.
Bool_t fixed() const
Check whether the parameter is fixed or floated.
virtual ~LauLASSBWRes()
Definition: LauLASSBWRes.cc:60
Double_t mDaugDiff_
Difference between the daughter masses.
Bool_t fixWidth() const
Get the status of resonance width (fixed or released)
Double_t getMass() const
Get the mass of the resonance.
void changeResonance(const Double_t newMass, const Double_t newWidth, const Int_t newSpin)
Allow the mass, width and spin of the resonance to be changed.
File containing declaration of LauResonanceInfo class.
virtual void setResonanceParameter(const TString &name, const Double_t value)
Set value of a resonance parameter.
Double_t getScatteringLength() const
Get the scattering length range parameter.
ClassImp(LauAbsCoeffSet)
LauParameter()
Default constructor.
Definition: LauParameter.cc:30
Class for defining the properties of a resonant particle.
const TString & name() const
The parameter name.
Class that defines the particular 3-body decay under study.
Definition: LauDaughters.hh:33
LauParameter * r_
LASS effective range parameter.
void setEffectiveRange(const Double_t r)
Set the effective range parameter value.
Double_t resMassSq_
Square of the resonance mass.
Double_t getMassDaug1() const
Get the mass of daughter 1.
virtual LauParameter * getResonanceParameter(const TString &name)
Access the given resonance parameter.
File containing declaration of LauLASSBWRes class.
Bool_t fixMass() const
Get the status of resonance mass (fixed or released)
Double_t getMassDaug2() const
Get the mass of daughter 2.
void addFloatingParameter(LauParameter *param)
Add parameter to the list of floating parameters.
Double_t mDaugDiffSq_
Square of mDaugDiff.
virtual const std::vector< LauParameter * > & getFloatingParameters()
Retrieve the resonance parameters, e.g. so that they can be loaded into a fit.
LauParameter * a_
LASS scattering length parameter.
virtual void initialise()
Initialise the model.
Definition: LauLASSBWRes.cc:64
Bool_t fixScatteringLength() const
See if the scattering length parameter is fixed or floating.
Double_t q0_
Decay momentum of either daughter in the resonance rest frame.
std::vector< LauParameter * > & getParameters()
Access the list of floating parameters.
LauParameter * getWidthPar()
Get the width parameter of the resonance.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:35
Bool_t fixEffectiveRange() const
See if the effective range parameter is fixed or floating.
virtual LauComplex resAmp(Double_t mass, Double_t spinTerm)
Complex resonant amplitude.
Definition: LauLASSBWRes.cc:97
Double_t resMass_
The resonance mass.
void setScatteringLength(const Double_t a)
Set the scattering length parameter value.
Double_t getWidth() const
Get the width of the resonance.
Double_t mDaugSum_
Sum of the daughter masses.
Double_t mDaugSumSq_
Square of mDaugSum.
Class for defining the resonant part of the LASS model.
Definition: LauLASSBWRes.hh:31
Abstract class for defining type for resonance amplitude models (Breit-Wigner, Flatte etc...
void rescale(Double_t scaleVal)
Scale this by a factor.
Definition: LauComplex.hh:285
Double_t initValue() const
The initial value of the parameter.
File containing LauConstants namespace.
Class for defining a complex number.
Definition: LauComplex.hh:47
Double_t value() const
The value of the parameter.
Int_t getSpin() const
Get the spin of the resonance.
Double_t getEffectiveRange() const
Get the effective range parameter.
Definition: LauLASSBWRes.hh:97
Double_t genValue() const
The value generated for the parameter.
virtual void floatResonanceParameter(const TString &name)
Allow the various parameters to float in the fit.
void calcQ0()
Utility function to calculate the q0 value.
Definition: LauLASSBWRes.cc:86
void clearFloatingParameters()
Clear list of floating parameters.