laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauLASSBWRes.cc
Go to the documentation of this file.
1 
2 /*
3 Copyright 2008 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 
29 #include <iostream>
30 
31 #include "LauConstants.hh"
32 #include "LauLASSBWRes.hh"
33 #include "LauResonanceInfo.hh"
34 
36 
37 
38 LauLASSBWRes::LauLASSBWRes(LauResonanceInfo* resInfo, const Int_t resPairAmpInt, const LauDaughters* daughters) :
39  LauAbsResonance(resInfo, resPairAmpInt, daughters),
40  q0_(0.0),
41  mDaugSum_(0.0),
42  mDaugSumSq_(0.0),
43  mDaugDiff_(0.0),
44  mDaugDiffSq_(0.0),
45  resMassSq_(0.0),
46  r_(0),
47  a_(0)
48 {
49  // Default values for LASS parameters
50  const Double_t rVal = 3.32;
51  const Double_t aVal = 2.07;
52 
53  const TString& parNameBase = this->getSanitisedName();
54 
55  TString rName(parNameBase);
56  rName += "_r";
57  r_ = resInfo->getExtraParameter( rName );
58  if ( r_ == 0 ) {
59  r_ = new LauParameter( rName, rVal, 0.0, 10.0, kTRUE );
60  r_->secondStage(kTRUE);
61  resInfo->addExtraParameter( r_ );
62  }
63 
64  TString aName(parNameBase);
65  aName += "_a";
66  a_ = resInfo->getExtraParameter( aName );
67  if ( a_ == 0 ) {
68  a_ = new LauParameter( aName, aVal, 0.0, 10.0, kTRUE );
69  a_->secondStage(kTRUE);
70  resInfo->addExtraParameter( a_ );
71  }
72 }
73 
75 {
76 }
77 
79 {
80  // Create the mass sums and differences
81  Double_t massDaug1 = this->getMassDaug1();
82  Double_t massDaug2 = this->getMassDaug2();
83 
84  mDaugSum_ = massDaug1 + massDaug2;
86 
87  mDaugDiff_ = massDaug1 - massDaug2;
89 
90  Int_t resSpin = this->getSpin();
91  if (resSpin != 0) {
92  std::cerr << "WARNING in LauLASSBWRes::amplitude : Resonance spin is " << resSpin << "." << std::endl;
93  std::cerr << " : LASS amplitude is only for scalers, resetting spin to 0." << std::endl;
94  this->changeResonance( -1.0, -1.0, 0 );
95  }
96 
97  this->calcQ0();
98 }
99 
101 {
102  // Decay momentum of either daughter in the resonance rest frame
103  // when resonance mass = rest-mass value, m_0 (PDG value)
104 
105  resMass_ = this->getMass();
107 
108  q0_ = TMath::Sqrt((resMassSq_ - mDaugSumSq_)*(resMassSq_ - mDaugDiffSq_))/(2.0*resMass_);
109 }
110 
111 LauComplex LauLASSBWRes::resAmp(Double_t mass, Double_t /*spinTerm*/)
112 {
113  LauComplex resAmplitude(0.0, 0.0);
114 
115  if (mass < 1e-10) {
116  std::cerr << "WARNING in LauLASSBWRes::amplitude : mass < 1e-10." << std::endl;
117  return LauComplex(0.0, 0.0);
118  }
119 
120  // Calculate the width of the resonance (as a function of mass)
121  // q is the momentum of either daughter in the resonance rest-frame
122  const Double_t q = this->getQ();
123  const Double_t resMass = this->getMass();
124  const Double_t resWidth = this->getWidth();
125 
126  // If the mass is floating and their value have changed
127  // we need to recalculate everything that assumes this value
128  if ( (!this->fixMass()) && resMass != resMass_ ) {
129  this->calcQ0();
130  }
131 
132  Double_t qRatio = q/q0_;
133  Double_t totWidth = resWidth*qRatio*(resMass/mass);
134 
135  Double_t massSq = mass*mass;
136  Double_t massSqTerm = resMassSq_ - massSq;
137 
138  // Compute the complex amplitude
139  resAmplitude = LauComplex(massSqTerm, resMass*totWidth);
140 
141  // Scale by the denominator factor
142  resAmplitude.rescale((resMassSq_*resWidth/q0_)/(massSqTerm*massSqTerm + resMassSq_*totWidth*totWidth));
143 
144  // Calculate the phase shift term
145  const Double_t rVal = this->getEffectiveRange();
146  const Double_t aVal = this->getScatteringLength();
147  const Double_t tandeltaB = (2.0*aVal*q)/(2.0 + aVal*rVal*q*q);
148  const Double_t tanSq = tandeltaB*tandeltaB;
149  const Double_t cos2PhaseShift = (1.0 - tanSq) / (1.0 + tanSq);
150  const Double_t sin2PhaseShift = 2.0*tandeltaB / (1.0 + tanSq);
151  LauComplex phaseShift(cos2PhaseShift, sin2PhaseShift);
152 
153  // Multiply by the phase shift
154  resAmplitude = resAmplitude * phaseShift;
155 
156  return resAmplitude;
157 }
158 
159 const std::vector<LauParameter*>& LauLASSBWRes::getFloatingParameters()
160 {
161  this->clearFloatingParameters();
162 
163  if ( ! this->fixMass() ) {
164  this->addFloatingParameter( this->getMassPar() );
165  }
166 
167  if ( ! this->fixWidth() ) {
168  this->addFloatingParameter( this->getWidthPar() );
169  }
170 
171  if ( ! this->fixEffectiveRange() ) {
172  this->addFloatingParameter( r_ );
173  }
174 
175  if ( ! this->fixScatteringLength() ) {
176  this->addFloatingParameter( a_ );
177  }
178 
179  return this->getParameters();
180 }
181 
182 void LauLASSBWRes::setResonanceParameter(const TString& name, const Double_t value)
183 {
184  // Set various parameters for the LASS lineshape dynamics
185  if (name == "a") {
186  this->setScatteringLength(value);
187  std::cout << "INFO in LauLASSBWRes::setResonanceParameter : Setting LASS Scattering Length = " << this->getScatteringLength() << std::endl;
188  } else if (name == "r") {
189  this->setEffectiveRange(value);
190  std::cout << "INFO in LauLASSBWRes::setResonanceParameter : Setting LASS Effective Range = " << this->getEffectiveRange() << std::endl;
191  } else {
192  std::cerr << "WARNING in LauLASSBWRes::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
193  }
194 }
195 
197 {
198  if (name == "a") {
199  if ( a_->fixed() ) {
200  a_->fixed( kFALSE );
201  this->addFloatingParameter( a_ );
202  } else {
203  std::cerr << "WARNING in LauLASSBWRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
204  }
205  } else if (name == "r") {
206  if ( r_->fixed() ) {
207  r_->fixed( kFALSE );
208  this->addFloatingParameter( r_ );
209  } else {
210  std::cerr << "WARNING in LauLASSBWRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
211  }
212  } else {
213  std::cerr << "WARNING in LauLASSBWRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
214  }
215 }
216 
218 {
219  if (name == "a") {
220  return a_;
221  } else if (name == "r") {
222  return r_;
223  } else {
224  std::cerr << "WARNING in LauLASSBWRes::getResonanceParameter: Parameter name not reconised." << std::endl;
225  return 0;
226  }
227 }
228 
229 void LauLASSBWRes::setEffectiveRange(const Double_t r)
230 {
231  r_->value( r );
232  r_->genValue( r );
233  r_->initValue( r );
234 }
235 
236 void LauLASSBWRes::setScatteringLength(const Double_t a)
237 {
238  a_->value( a );
239  a_->genValue( a );
240  a_->initValue( a );
241 }
242 
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:74
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:44
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:47
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:78
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:49
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.
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:45
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:299
Double_t initValue() const
The initial value of the parameter.
File containing LauConstants namespace.
Class for defining a complex number.
Definition: LauComplex.hh:61
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.
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.
void clearFloatingParameters()
Clear list of floating parameters.