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