laura is hosted by Hepforge, IPPP Durham
Laura++  v3r4
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 <iostream>
30 
31 #include "LauConstants.hh"
32 #include "LauLASSNRRes.hh"
33 #include "LauResonanceInfo.hh"
34 
36 
37 
38 LauLASSNRRes::LauLASSNRRes(LauResonanceInfo* resInfo, const Int_t resPairAmpInt, 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 << "." << std::endl;
79  std::cerr << " : LASS amplitude is only for scalers, resetting spin to 0." << std::endl;
80  this->changeResonance( -1.0, -1.0, 0 );
81  }
82 }
83 
84 LauComplex LauLASSNRRes::resAmp(Double_t mass, Double_t /*spinTerm*/)
85 {
86  LauComplex bkgAmplitude(0.0, 0.0);
87 
88  if (mass < 1e-10) {
89  std::cerr << "WARNING in LauLASSNRRes::amplitude : mass < 1e-10." << std::endl;
90  return LauComplex(0.0, 0.0);
91  }
92 
93  if (mass < cutOff_) {
94  // q is the momentum of either daughter in the resonance rest-frame
95  const Double_t q = this->getQ();
96 
97  // Calculate the phase shift term
98  const Double_t rVal = this->getEffectiveRange();
99  const Double_t aVal = this->getScatteringLength();
100  const Double_t qcotdeltaB = 1.0/aVal + (rVal*q*q)/2.0;
101 
102  // Compute the complex amplitude
103  bkgAmplitude = LauComplex(qcotdeltaB, q);
104 
105  // Scale by the numerator and denominator factors
106  bkgAmplitude.rescale(mass/(qcotdeltaB*qcotdeltaB + q*q));
107  }
108 
109  return bkgAmplitude;
110 
111 }
112 
113 const std::vector<LauParameter*>& LauLASSNRRes::getFloatingParameters()
114 {
115  this->clearFloatingParameters();
116 
117  if ( ! this->fixMass() ) {
118  this->addFloatingParameter( this->getMassPar() );
119  }
120 
121  if ( ! this->fixWidth() ) {
122  this->addFloatingParameter( this->getWidthPar() );
123  }
124 
125  if ( ! this->fixEffectiveRange() ) {
126  this->addFloatingParameter( r_ );
127  }
128 
129  if ( ! this->fixScatteringLength() ) {
130  this->addFloatingParameter( a_ );
131  }
132 
133  return this->getParameters();
134 }
135 
136 void LauLASSNRRes::setResonanceParameter(const TString& name, const Double_t value)
137 {
138  // Set various parameters for the LASS lineshape dynamics
139  if (name == "a") {
140  this->setScatteringLength(value);
141  std::cout << "INFO in LauLASSNRRes::setResonanceParameter : Setting LASS Scattering Length = " << this->getScatteringLength() << std::endl;
142  } else if (name == "r") {
143  this->setEffectiveRange(value);
144  std::cout << "INFO in LauLASSNRRes::setResonanceParameter : Setting LASS Effective Range = " << this->getEffectiveRange() << std::endl;
145  } else {
146  std::cerr << "WARNING in LauLASSNRRes::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
147  }
148 }
149 
151 {
152  if (name == "a") {
153  if ( a_->fixed() ) {
154  a_->fixed( kFALSE );
155  this->addFloatingParameter( a_ );
156  } else {
157  std::cerr << "WARNING in LauLASSNRRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
158  }
159  } else if (name == "r") {
160  if ( r_->fixed() ) {
161  r_->fixed( kFALSE );
162  this->addFloatingParameter( r_ );
163  } else {
164  std::cerr << "WARNING in LauLASSNRRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
165  }
166  } else {
167  std::cerr << "WARNING in LauLASSNRRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
168  }
169 }
170 
172 {
173  if (name == "a") {
174  return a_;
175  } else if (name == "r") {
176  return r_;
177  } else {
178  std::cerr << "WARNING in LauLASSNRRes::getResonanceParameter: Parameter name not reconised." << std::endl;
179  return 0;
180  }
181 }
182 
183 void LauLASSNRRes::setEffectiveRange(const Double_t r)
184 {
185  r_->value( r );
186  r_->genValue( r );
187  r_->initValue( r );
188 }
189 
190 void LauLASSNRRes::setScatteringLength(const Double_t a)
191 {
192  a_->value( a );
193  a_->genValue( a );
194  a_->initValue( a );
195 }
196 
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:44
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:47
virtual LauComplex resAmp(Double_t mass, Double_t spinTerm)
Complex resonant amplitude.
Definition: LauLASSNRRes.cc:84
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:45
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:49
virtual ~LauLASSNRRes()
Destructor.
Definition: LauLASSNRRes.cc:70
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:74
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.
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.