laura is hosted by Hepforge, IPPP Durham
Laura++  v3r0
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  delete r_;
63  delete a_;
64 }
65 
67 {
68  // Create the mass sums and differences
69  Double_t massDaug1 = this->getMassDaug1();
70  Double_t massDaug2 = this->getMassDaug2();
71 
72  mDaugSum_ = massDaug1 + massDaug2;
74 
75  mDaugDiff_ = massDaug1 - massDaug2;
77 
78  Int_t resSpin = this->getSpin();
79  if (resSpin != 0) {
80  std::cerr << "WARNING in LauLASSBWRes::amplitude : Resonance spin is " << resSpin << "." << std::endl;
81  std::cerr << " : LASS amplitude is only for scalers, resetting spin to 0." << std::endl;
82  this->changeResonance( -1.0, -1.0, 0 );
83  }
84 
85  this->calcQ0();
86 }
87 
89 {
90  // Decay momentum of either daughter in the resonance rest frame
91  // when resonance mass = rest-mass value, m_0 (PDG value)
92 
93  resMass_ = this->getMass();
95 
96  q0_ = TMath::Sqrt((resMassSq_ - mDaugSumSq_)*(resMassSq_ - mDaugDiffSq_))/(2.0*resMass_);
97 }
98 
99 LauComplex LauLASSBWRes::resAmp(Double_t mass, Double_t /*spinTerm*/)
100 {
101  LauComplex resAmplitude(0.0, 0.0);
102 
103  if (mass < 1e-10) {
104  std::cerr << "WARNING in LauLASSBWRes::amplitude : mass < 1e-10." << std::endl;
105  return LauComplex(0.0, 0.0);
106  }
107 
108  // Calculate the width of the resonance (as a function of mass)
109  // q is the momentum of either daughter in the resonance rest-frame
110  const Double_t q = this->getQ();
111  const Double_t resMass = this->getMass();
112  const Double_t resWidth = this->getWidth();
113 
114  // If the mass is floating and their value have changed
115  // we need to recalculate everything that assumes this value
116  if ( (!this->fixMass()) && resMass != resMass_ ) {
117  this->calcQ0();
118  }
119 
120  Double_t qRatio = q/q0_;
121  Double_t totWidth = resWidth*qRatio*(resMass/mass);
122 
123  Double_t massSq = mass*mass;
124  Double_t massSqTerm = resMassSq_ - massSq;
125 
126  // Compute the complex amplitude
127  resAmplitude = LauComplex(massSqTerm, resMass*totWidth);
128 
129  // Scale by the denominator factor
130  resAmplitude.rescale((resMassSq_*resWidth/q0_)/(massSqTerm*massSqTerm + resMassSq_*totWidth*totWidth));
131 
132  // Calculate the phase shift term
133  const Double_t rVal = this->getEffectiveRange();
134  const Double_t aVal = this->getScatteringLength();
135  const Double_t tandeltaB = (2.0*aVal*q)/(2.0 + aVal*rVal*q*q);
136  const Double_t tanSq = tandeltaB*tandeltaB;
137  const Double_t cos2PhaseShift = (1.0 - tanSq) / (1.0 + tanSq);
138  const Double_t sin2PhaseShift = 2.0*tandeltaB / (1.0 + tanSq);
139  LauComplex phaseShift(cos2PhaseShift, sin2PhaseShift);
140 
141  // Multiply by the phase shift
142  resAmplitude = resAmplitude * phaseShift;
143 
144  return resAmplitude;
145 }
146 
147 const std::vector<LauParameter*>& LauLASSBWRes::getFloatingParameters()
148 {
149  this->clearFloatingParameters();
150 
151  if ( ! this->fixMass() ) {
152  this->addFloatingParameter( this->getMassPar() );
153  }
154 
155  if ( ! this->fixWidth() ) {
156  this->addFloatingParameter( this->getWidthPar() );
157  }
158 
159  if ( ! this->fixEffectiveRange() ) {
160  this->addFloatingParameter( r_ );
161  }
162 
163  if ( ! this->fixScatteringLength() ) {
164  this->addFloatingParameter( a_ );
165  }
166 
167  return this->getParameters();
168 }
169 
170 void LauLASSBWRes::setResonanceParameter(const TString& name, const Double_t value)
171 {
172  // Set various parameters for the LASS lineshape dynamics
173  if (name == "a") {
174  this->setScatteringLength(value);
175  std::cout << "INFO in LauLASSBWRes::setResonanceParameter : Setting LASS Scattering Length = " << this->getScatteringLength() << std::endl;
176  } else if (name == "r") {
177  this->setEffectiveRange(value);
178  std::cout << "INFO in LauLASSBWRes::setResonanceParameter : Setting LASS Effective Range = " << this->getEffectiveRange() << std::endl;
179  } else {
180  std::cerr << "WARNING in LauLASSBWRes::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
181  }
182 }
183 
185 {
186  if (name == "a") {
187  if ( a_->fixed() ) {
188  a_->fixed( kFALSE );
189  this->addFloatingParameter( a_ );
190  } else {
191  std::cerr << "WARNING in LauLASSBWRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
192  }
193  } else if (name == "r") {
194  if ( r_->fixed() ) {
195  r_->fixed( kFALSE );
196  this->addFloatingParameter( r_ );
197  } else {
198  std::cerr << "WARNING in LauLASSBWRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
199  }
200  } else {
201  std::cerr << "WARNING in LauLASSBWRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
202  }
203 }
204 
206 {
207  if (name == "a") {
208  return a_;
209  } else if (name == "r") {
210  return r_;
211  } else {
212  std::cerr << "WARNING in LauLASSBWRes::getResonanceParameter: Parameter name not reconised." << std::endl;
213  return 0;
214  }
215 }
216 
217 void LauLASSBWRes::setEffectiveRange(const Double_t r)
218 {
219  r_->value( r );
220  r_->genValue( r );
221  r_->initValue( r );
222 }
223 
224 void LauLASSBWRes::setScatteringLength(const Double_t a)
225 {
226  a_->value( a );
227  a_->genValue( a );
228  a_->initValue( a );
229 }
230 
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:66
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:34
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:99
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:88
void clearFloatingParameters()
Clear list of floating parameters.