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