laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauLASSNRRes.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 "LauLASSNRRes.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  r_( 0 ),
41  a_( 0 ),
42  cutOff_( 0.0 )
43 {
44  // Default values for LASS parameters
45  cutOff_ = 1.8;
46  const Double_t rVal = 3.32;
47  const Double_t aVal = 2.07;
48 
49  const TString& parNameBase = this->getSanitisedName();
50 
51  TString rName( parNameBase );
52  rName += "_r";
53  r_ = resInfo->getExtraParameter( rName );
54  if ( r_ == 0 ) {
55  r_ = new LauParameter( rName, rVal, 0.0, 10.0, kTRUE );
56  r_->secondStage( kTRUE );
57  resInfo->addExtraParameter( r_ );
58  }
59 
60  TString aName( parNameBase );
61  aName += "_a";
62  a_ = resInfo->getExtraParameter( aName );
63  if ( a_ == 0 ) {
64  a_ = new LauParameter( aName, aVal, 0.0, 10.0, kTRUE );
65  a_->secondStage( kTRUE );
66  resInfo->addExtraParameter( a_ );
67  }
68 }
69 
71 {
72 }
73 
75 {
76  Int_t resSpin = this->getSpin();
77  if ( resSpin != 0 ) {
78  std::cerr << "WARNING in LauLASSNRRes::amplitude : Resonance spin is " << resSpin << "."
79  << std::endl;
80  std::cerr << " : LASS amplitude is only for scalers, resetting spin to 0."
81  << std::endl;
82  this->changeResonance( -1.0, -1.0, 0 );
83  }
84 }
85 
86 LauComplex LauLASSNRRes::resAmp( Double_t mass, Double_t /*spinTerm*/ )
87 {
88  LauComplex bkgAmplitude( 0.0, 0.0 );
89 
90  if ( mass < 1e-10 ) {
91  std::cerr << "WARNING in LauLASSNRRes::amplitude : mass < 1e-10." << std::endl;
92  return LauComplex( 0.0, 0.0 );
93  }
94 
95  if ( mass < cutOff_ ) {
96  // q is the momentum of either daughter in the resonance rest-frame
97  const Double_t q = this->getQ();
98 
99  // Calculate the phase shift term
100  const Double_t rVal = this->getEffectiveRange();
101  const Double_t aVal = this->getScatteringLength();
102  const Double_t qcotdeltaB = 1.0 / aVal + ( rVal * q * q ) / 2.0;
103 
104  // Compute the complex amplitude
105  bkgAmplitude = LauComplex( qcotdeltaB, q );
106 
107  // Scale by the numerator and denominator factors
108  bkgAmplitude.rescale( mass / ( qcotdeltaB * qcotdeltaB + q * q ) );
109  }
110 
111  return bkgAmplitude;
112 }
113 
114 const std::vector<LauParameter*>& LauLASSNRRes::getFloatingParameters()
115 {
116  this->clearFloatingParameters();
117 
118  if ( ! this->fixMass() ) {
119  this->addFloatingParameter( this->getMassPar() );
120  }
121 
122  if ( ! this->fixWidth() ) {
123  this->addFloatingParameter( this->getWidthPar() );
124  }
125 
126  if ( ! this->fixEffectiveRange() ) {
127  this->addFloatingParameter( r_ );
128  }
129 
130  if ( ! this->fixScatteringLength() ) {
131  this->addFloatingParameter( a_ );
132  }
133 
134  return this->getParameters();
135 }
136 
137 void LauLASSNRRes::setResonanceParameter( const TString& name, const Double_t value )
138 {
139  // Set various parameters for the LASS lineshape dynamics
140  if ( name == "a" ) {
141  this->setScatteringLength( value );
142  std::cout << "INFO in LauLASSNRRes::setResonanceParameter : Setting LASS Scattering Length = "
143  << this->getScatteringLength() << std::endl;
144  } else if ( name == "r" ) {
145  this->setEffectiveRange( value );
146  std::cout << "INFO in LauLASSNRRes::setResonanceParameter : Setting LASS Effective Range = "
147  << this->getEffectiveRange() << std::endl;
148  } else {
149  std::cerr << "WARNING in LauLASSNRRes::setResonanceParameter: Parameter name not reconised. No parameter changes made."
150  << std::endl;
151  }
152 }
153 
155 {
156  if ( name == "a" ) {
157  if ( a_->fixed() ) {
158  a_->fixed( kFALSE );
159  this->addFloatingParameter( a_ );
160  } else {
161  std::cerr << "WARNING in LauLASSNRRes::floatResonanceParameter: Parameter already floating. No parameter changes made."
162  << std::endl;
163  }
164  } else if ( name == "r" ) {
165  if ( r_->fixed() ) {
166  r_->fixed( kFALSE );
167  this->addFloatingParameter( r_ );
168  } else {
169  std::cerr << "WARNING in LauLASSNRRes::floatResonanceParameter: Parameter already floating. No parameter changes made."
170  << std::endl;
171  }
172  } else {
173  std::cerr << "WARNING in LauLASSNRRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made."
174  << std::endl;
175  }
176 }
177 
179 {
180  if ( name == "a" ) {
181  return a_;
182  } else if ( name == "r" ) {
183  return r_;
184  } else {
185  std::cerr << "WARNING in LauLASSNRRes::getResonanceParameter: Parameter name not reconised."
186  << std::endl;
187  return 0;
188  }
189 }
190 
191 void LauLASSNRRes::setEffectiveRange( const Double_t r )
192 {
193  r_->value( r );
194  r_->genValue( r );
195  r_->initValue( r );
196 }
197 
198 void LauLASSNRRes::setScatteringLength( const Double_t a )
199 {
200  a_->value( a );
201  a_->genValue( a );
202  a_->initValue( a );
203 }
File containing declaration of LauResonanceInfo class.
const TString & getSanitisedName() const
Get the name of the resonance.
virtual ~LauLASSNRRes()
Destructor.
Definition: LauLASSNRRes.cc:70
virtual LauParameter * getResonanceParameter(const TString &name)
Access the given resonance parameter.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:49
LauParameter * getMassPar()
Get the mass parameter of the resonance.
Double_t getScatteringLength() const
Get the scattering length range parameter.
Double_t value() const
The value of the parameter.
virtual LauComplex resAmp(Double_t mass, Double_t spinTerm)
Complex resonant amplitude.
Definition: LauLASSNRRes.cc:86
std::vector< LauParameter * > & getParameters()
Access the list of floating parameters.
LauParameter * r_
LASS effective range parameter.
Double_t getEffectiveRange() const
Get the effective range parameter.
LauParameter * getExtraParameter(const TString &parName)
Retrieve an extra parameter of the resonance.
void setEffectiveRange(const Double_t r)
Set the effective range parameter value.
Int_t getSpin() const
Get the spin of the resonance.
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.
Bool_t fixEffectiveRange() const
See if the effective range parameter is fixed or floating.
virtual void floatResonanceParameter(const TString &name)
Allow the various parameters to float in the fit.
Bool_t fixWidth() const
Get the status of resonance width (fixed or released)
Double_t cutOff_
LASS cut off.
void addExtraParameter(LauParameter *param, const Bool_t independentPar=kFALSE)
Add an extra parameter of the resonance.
void setScatteringLength(const Double_t a)
Set the scattering length parameter value.
Bool_t fixed() const
Check whether the parameter is fixed or floated.
LauParameter()
Default constructor.
Definition: LauParameter.cc:40
Class for defining the properties of a resonant particle.
virtual const std::vector< LauParameter * > & getFloatingParameters()
Retrieve the resonance parameters, e.g. so that they can be loaded into a fit.
virtual void initialise()
Initialise the model.
Definition: LauLASSNRRes.cc:74
File containing LauConstants namespace.
const TString & name() const
The parameter name.
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)
LauLASSNRRes(LauResonanceInfo *resInfo, const Int_t resPairAmpInt, const LauDaughters *daughters)
Constructor.
Definition: LauLASSNRRes.cc:36
virtual void setResonanceParameter(const TString &name, const Double_t value)
Set value of a resonance parameter.
Bool_t fixScatteringLength() const
See if the scattering length parameter is fixed or floating.
void clearFloatingParameters()
Clear list of floating parameters.
Abstract class for defining type for resonance amplitude models (Breit-Wigner, Flatte etc....
Double_t genValue() const
The value generated for the 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 initValue() const
The initial value of the parameter.
LauParameter * a_
LASS scattering length parameter.
File containing declaration of LauLASSNRRes class.