laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
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 "LauLASSBWRes.hh"
30 
31 #include "LauConstants.hh"
32 #include "LauResonanceInfo.hh"
33 
34 #include <iostream>
35 
37  const Int_t resPairAmpInt,
38  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 
74 LauLASSBWRes::~LauLASSBWRes()
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 << "."
93  << std::endl;
94  std::cerr << " : LASS amplitude is only for scalers, resetting spin to 0."
95  << 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_ ) ) /
111  ( 2.0 * resMass_ );
112 }
113 
114 LauComplex LauLASSBWRes::resAmp( Double_t mass, Double_t /*spinTerm*/ )
115 {
116  LauComplex resAmplitude( 0.0, 0.0 );
117 
118  if ( mass < 1e-10 ) {
119  std::cerr << "WARNING in LauLASSBWRes::amplitude : mass < 1e-10." << std::endl;
120  return LauComplex( 0.0, 0.0 );
121  }
122 
123  // Calculate the width of the resonance (as a function of mass)
124  // q is the momentum of either daughter in the resonance rest-frame
125  const Double_t q = this->getQ();
126  const Double_t resMass = this->getMass();
127  const Double_t resWidth = this->getWidth();
128 
129  // If the mass is floating and their value have changed
130  // we need to recalculate everything that assumes this value
131  if ( ( ! this->fixMass() ) && resMass != resMass_ ) {
132  this->calcQ0();
133  }
134 
135  Double_t qRatio = q / q0_;
136  Double_t totWidth = resWidth * qRatio * ( resMass / mass );
137 
138  Double_t massSq = mass * mass;
139  Double_t massSqTerm = resMassSq_ - massSq;
140 
141  // Compute the complex amplitude
142  resAmplitude = LauComplex( massSqTerm, resMass * totWidth );
143 
144  // Scale by the denominator factor
145  resAmplitude.rescale( ( resMassSq_ * resWidth / q0_ ) /
146  ( massSqTerm * massSqTerm + resMassSq_ * totWidth * totWidth ) );
147 
148  // Calculate the phase shift term
149  const Double_t rVal = this->getEffectiveRange();
150  const Double_t aVal = this->getScatteringLength();
151  const Double_t tandeltaB = ( 2.0 * aVal * q ) / ( 2.0 + aVal * rVal * q * q );
152  const Double_t tanSq = tandeltaB * tandeltaB;
153  const Double_t cos2PhaseShift = ( 1.0 - tanSq ) / ( 1.0 + tanSq );
154  const Double_t sin2PhaseShift = 2.0 * tandeltaB / ( 1.0 + tanSq );
155  LauComplex phaseShift( cos2PhaseShift, sin2PhaseShift );
156 
157  // Multiply by the phase shift
158  resAmplitude = resAmplitude * phaseShift;
159 
160  return resAmplitude;
161 }
162 
163 const std::vector<LauParameter*>& LauLASSBWRes::getFloatingParameters()
164 {
165  this->clearFloatingParameters();
166 
167  if ( ! this->fixMass() ) {
168  this->addFloatingParameter( this->getMassPar() );
169  }
170 
171  if ( ! this->fixWidth() ) {
172  this->addFloatingParameter( this->getWidthPar() );
173  }
174 
175  if ( ! this->fixEffectiveRange() ) {
176  this->addFloatingParameter( r_ );
177  }
178 
179  if ( ! this->fixScatteringLength() ) {
180  this->addFloatingParameter( a_ );
181  }
182 
183  return this->getParameters();
184 }
185 
186 void LauLASSBWRes::setResonanceParameter( const TString& name, const Double_t value )
187 {
188  // Set various parameters for the LASS lineshape dynamics
189  if ( name == "a" ) {
190  this->setScatteringLength( value );
191  std::cout << "INFO in LauLASSBWRes::setResonanceParameter : Setting LASS Scattering Length = "
192  << this->getScatteringLength() << std::endl;
193  } else if ( name == "r" ) {
194  this->setEffectiveRange( value );
195  std::cout << "INFO in LauLASSBWRes::setResonanceParameter : Setting LASS Effective Range = "
196  << this->getEffectiveRange() << std::endl;
197  } else {
198  std::cerr << "WARNING in LauLASSBWRes::setResonanceParameter: Parameter name not reconised. No parameter changes made."
199  << std::endl;
200  }
201 }
202 
204 {
205  if ( name == "a" ) {
206  if ( a_->fixed() ) {
207  a_->fixed( kFALSE );
208  this->addFloatingParameter( a_ );
209  } else {
210  std::cerr << "WARNING in LauLASSBWRes::floatResonanceParameter: Parameter already floating. No parameter changes made."
211  << std::endl;
212  }
213  } else if ( name == "r" ) {
214  if ( r_->fixed() ) {
215  r_->fixed( kFALSE );
216  this->addFloatingParameter( r_ );
217  } else {
218  std::cerr << "WARNING in LauLASSBWRes::floatResonanceParameter: Parameter already floating. No parameter changes made."
219  << std::endl;
220  }
221  } else {
222  std::cerr << "WARNING in LauLASSBWRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made."
223  << std::endl;
224  }
225 }
226 
228 {
229  if ( name == "a" ) {
230  return a_;
231  } else if ( name == "r" ) {
232  return r_;
233  } else {
234  std::cerr << "WARNING in LauLASSBWRes::getResonanceParameter: Parameter name not reconised."
235  << std::endl;
236  return 0;
237  }
238 }
239 
240 void LauLASSBWRes::setEffectiveRange( const Double_t r )
241 {
242  r_->value( r );
243  r_->genValue( r );
244  r_->initValue( r );
245 }
246 
247 void LauLASSBWRes::setScatteringLength( const Double_t a )
248 {
249  a_->value( a );
250  a_->genValue( a );
251  a_->initValue( a );
252 }
virtual const std::vector< LauParameter * > & getFloatingParameters()
Retrieve the resonance parameters, e.g. so that they can be loaded into a fit.
Double_t mDaugDiff_
Difference between the daughter masses.
LauLASSBWRes(LauResonanceInfo *resInfo, const Int_t resPairAmpInt, const LauDaughters *daughters)
Constructor.
Definition: LauLASSBWRes.cc:36
File containing declaration of LauResonanceInfo class.
const TString & getSanitisedName() const
Get the name of the resonance.
Double_t getWidth() const
Get the width of the resonance.
Double_t q0_
Decay momentum of either daughter in the resonance rest frame.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:49
LauParameter * getMassPar()
Get the mass parameter of the resonance.
Double_t value() const
The value of the parameter.
LauParameter * r_
LASS effective range parameter.
void setScatteringLength(const Double_t a)
Set the scattering length parameter value.
Bool_t fixEffectiveRange() const
See if the effective range parameter is fixed or floating.
std::vector< LauParameter * > & getParameters()
Access the list of floating parameters.
Double_t getScatteringLength() const
Get the scattering length range parameter.
Double_t getEffectiveRange() const
Get the effective range parameter.
Bool_t fixScatteringLength() const
See if the scattering length parameter is fixed or floating.
LauParameter * getExtraParameter(const TString &parName)
Retrieve an extra parameter of the resonance.
void setEffectiveRange(const Double_t r)
Set the effective range parameter value.
virtual void floatResonanceParameter(const TString &name)
Allow the various parameters to float in the fit.
Int_t getSpin() const
Get the spin of the resonance.
void calcQ0()
Utility function to calculate the q0 value.
Bool_t secondStage() const
Check whether the parameter should be floated only in the second stage of a two stage fit.
Class for defining a complex number.
Definition: LauComplex.hh:61
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.
void addFloatingParameter(LauParameter *param)
Add parameter to the list of floating parameters.
LauParameter * a_
LASS scattering length parameter.
void rescale(Double_t scaleVal)
Scale this by a factor.
Definition: LauComplex.hh:301
Bool_t fixWidth() const
Get the status of resonance width (fixed or released)
Double_t getMass() const
Get the mass of the resonance.
Double_t resMass_
The resonance mass.
void addExtraParameter(LauParameter *param, const Bool_t independentPar=kFALSE)
Add an extra parameter of the resonance.
Bool_t fixed() const
Check whether the parameter is fixed or floated.
LauParameter()
Default constructor.
Definition: LauParameter.cc:40
virtual void setResonanceParameter(const TString &name, const Double_t value)
Set value of a resonance parameter.
Class for defining the properties of a resonant particle.
File containing declaration of LauLASSBWRes class.
File containing LauConstants namespace.
const TString & name() const
The parameter name.
Double_t getMassDaug1() const
Get the mass of daughter 1.
Double_t getQ() const
Get the current value of the daughter momentum in the resonance rest frame.
Bool_t fixMass() const
Get the status of resonance mass (fixed or released)
virtual LauComplex resAmp(Double_t mass, Double_t spinTerm)
Complex resonant amplitude.
Double_t resMassSq_
Square of the resonance mass.
Double_t getMassDaug2() const
Get the mass of daughter 2.
void clearFloatingParameters()
Clear list of floating parameters.
Abstract class for defining type for resonance amplitude models (Breit-Wigner, Flatte etc....
Double_t mDaugSumSq_
Square of mDaugSum.
Double_t mDaugSum_
Sum of the daughter masses.
Double_t genValue() const
The value generated for the parameter.
virtual LauParameter * getResonanceParameter(const TString &name)
Access the given resonance parameter.
Class that defines the particular 3-body decay under study.
Definition: LauDaughters.hh:47
LauParameter * getWidthPar()
Get the width parameter of the resonance.
Double_t mDaugDiffSq_
Square of mDaugDiff.
Double_t initValue() const
The initial value of the parameter.
virtual void initialise()
Initialise the model.
Definition: LauLASSBWRes.cc:78