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