laura is hosted by Hepforge, IPPP Durham
Laura++  v3r0
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauNRAmplitude.cc
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2004 - 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 "LauKinematics.hh"
18 #include "LauNRAmplitude.hh"
19 #include "LauResonanceInfo.hh"
20 
22 
23 LauNRAmplitude::LauNRAmplitude(LauResonanceInfo* resInfo, const Int_t resPairAmpInt, const LauDaughters* daughters) :
24  LauAbsResonance(resInfo, resPairAmpInt, daughters),
25  d_(0),
26  c1_(0),
27  c2_(0),
28  p1_(0),
29  p2_(0)
30 {
31  // Default values for parameters, taken from arXiv:0709.0075v1 [hep-ph]
32  const Double_t dVal(1.3232e-3);
33  const Double_t c1Val(0.65);
34  const Double_t c2Val(0.55);
35  const Double_t p1Val(18.0);
36  const Double_t p2Val(15.0);
37 
38  const TString& parNameBase = this->getSanitisedName();
39 
40  TString dName(parNameBase);
41  dName += "_d";
42  d_ = resInfo->getExtraParameter( dName );
43  if ( d_ == 0 ) {
44  d_ = new LauParameter( dName, dVal, 0.0, 1.0, kTRUE );
45  d_->secondStage(kTRUE);
46  resInfo->addExtraParameter( d_ );
47  }
48 
49  TString c1Name(parNameBase);
50  c1Name += "_c1";
51  c1_ = resInfo->getExtraParameter( c1Name );
52  if ( c1_ == 0 ) {
53  c1_ = new LauParameter( c1Name, c1Val, 0.0, 2.0, kTRUE );
54  c1_->secondStage(kTRUE);
55  resInfo->addExtraParameter( c1_ );
56  }
57 
58  TString c2Name(parNameBase);
59  c2Name += "_c2";
60  c2_ = resInfo->getExtraParameter( c2Name );
61  if ( c2_ == 0 ) {
62  c2_ = new LauParameter( c2Name, c2Val, 0.0, 2.0, kTRUE );
63  c2_->secondStage(kTRUE);
64  resInfo->addExtraParameter( c2_ );
65  }
66 
67  TString p1Name(parNameBase);
68  p1Name += "_p1";
69  p1_ = resInfo->getExtraParameter( p1Name );
70  if ( p1_ == 0 ) {
71  p1_ = new LauParameter( p1Name, p1Val, 0.0, 50.0, kTRUE );
72  p1_->secondStage(kTRUE);
73  resInfo->addExtraParameter( p1_ );
74  }
75 
76  TString p2Name(parNameBase);
77  p2Name += "_p2";
78  p2_ = resInfo->getExtraParameter( p2Name );
79  if ( p2_ == 0 ) {
80  p2_ = new LauParameter( p2Name, p2Val, 0.0, 50.0, kTRUE );
81  p2_->secondStage(kTRUE);
82  resInfo->addExtraParameter( p2_ );
83  }
84 }
85 
87 {
88  delete d_;
89  delete c1_;
90  delete c2_;
91  delete p1_;
92  delete p2_;
93 }
94 
96 {
97 }
98 
100 {
101  // Get the information from the kinematics object
102  const Double_t m13Sq = kinematics->getm13Sq();
103  const Double_t m23Sq = kinematics->getm23Sq();
104  const Double_t m13 = kinematics->getm13();
105  const Double_t m23 = kinematics->getm23();
106 
107  // Calculate the magnitude
108  Double_t magnitude = TMath::Sqrt( m13 * m23 *
109  this->f(m23Sq, c1_->value(), p1_->value()) *
110  this->f(m13Sq, c2_->value(), p2_->value()) *
111  TMath::Exp( -1.0 * d_->value() * m13Sq*m13Sq * m23Sq*m23Sq )
112  );
113 
114  // return the amplitude
115  LauComplex resAmplitude(magnitude, 0.0);
116  return resAmplitude;
117 }
118 
119 LauComplex LauNRAmplitude::resAmp(Double_t mass, Double_t spinTerm)
120 {
121  std::cerr << "ERROR in LauNRAmplitude::resAmp : This method shouldn't get called." << std::endl;
122  std::cerr << " Returning zero amplitude for mass = " << mass << " and spinTerm = " << spinTerm << "." << std::endl;
123  return LauComplex(0.0, 0.0);
124 }
125 
126 Double_t LauNRAmplitude::f(const Double_t s, const Double_t c, const Double_t p) const
127 {
128  return 1.0 / (1.0 + TMath::Exp( c * (s-p) ));
129 }
130 
131 // TODO up to here!
132 const std::vector<LauParameter*>& LauNRAmplitude::getFloatingParameters()
133 {
134  this->clearFloatingParameters();
135 
136  if ( ! this->fixdParameter() ) {
137  this->addFloatingParameter( d_ );
138  }
139 
140  if ( ! this->fixc1Parameter() ) {
141  this->addFloatingParameter( c1_ );
142  }
143 
144  if ( ! this->fixc2Parameter() ) {
145  this->addFloatingParameter( c2_ );
146  }
147 
148  if ( ! this->fixp1Parameter() ) {
149  this->addFloatingParameter( p1_ );
150  }
151 
152  if ( ! this->fixp2Parameter() ) {
153  this->addFloatingParameter( p2_ );
154  }
155 
156  return this->getParameters();
157 }
158 
159 void LauNRAmplitude::setResonanceParameter(const TString& name, const Double_t value)
160 {
161  // Set various parameters for the NRAmplitude lineshape dynamics
162  if (name == "d") {
163  this->setdParameter(value);
164  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude d = " << this->getdParameter() << std::endl;
165  } else if (name == "c1") {
166  this->setc1Parameter(value);
167  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude c1 = " << this->getc1Parameter() << std::endl;
168  } else if (name == "c2") {
169  this->setc2Parameter(value);
170  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude c2 = " << this->getc2Parameter() << std::endl;
171  } else if (name == "p1") {
172  this->setp1Parameter(value);
173  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude p1 = " << this->getp1Parameter() << std::endl;
174  } else if (name == "p2") {
175  this->setp2Parameter(value);
176  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude p2 = " << this->getp2Parameter() << std::endl;
177  } else {
178  std::cerr << "WARNING in LauNRAmplitude::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
179  }
180 }
181 
183 {
184  if (name == "d") {
185  if ( d_->fixed() ) {
186  d_->fixed( kFALSE );
187  this->addFloatingParameter( d_ );
188  } else {
189  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
190  }
191  } else if (name == "c1") {
192  if ( c1_->fixed() ) {
193  c1_->fixed( kFALSE );
194  this->addFloatingParameter( c1_ );
195  } else {
196  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
197  }
198  } else if (name == "c2") {
199  if ( c2_->fixed() ) {
200  c2_->fixed( kFALSE );
201  this->addFloatingParameter( c2_ );
202  } else {
203  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
204  }
205  } else if (name == "p1") {
206  if ( p1_->fixed() ) {
207  p1_->fixed( kFALSE );
208  this->addFloatingParameter( p1_ );
209  } else {
210  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
211  }
212  } else if (name == "p2") {
213  if ( p2_->fixed() ) {
214  p2_->fixed( kFALSE );
215  this->addFloatingParameter( p2_ );
216  } else {
217  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
218  }
219  } else {
220  std::cerr << "WARNING in LauNRAmplitude::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
221  }
222 }
223 
225 {
226  if (name == "d") {
227  return d_;
228  } else if (name == "c1") {
229  return c1_;
230  } else if (name == "c2") {
231  return c2_;
232  } else if (name == "p1") {
233  return p1_;
234  } else if (name == "p2") {
235  return p2_;
236  } else {
237  std::cerr << "WARNING in LauNRAmplitude::getResonanceParameter: Parameter name not reconised." << std::endl;
238  return 0;
239  }
240 }
241 
242 void LauNRAmplitude::setdParameter(const Double_t d)
243 {
244  d_->value( d );
245  d_->genValue( d );
246  d_->initValue( d );
247 }
248 
249 void LauNRAmplitude::setc1Parameter(const Double_t c1)
250 {
251  c1_->value( c1 );
252  c1_->genValue( c1 );
253  c1_->initValue( c1 );
254 }
255 
256 void LauNRAmplitude::setc2Parameter(const Double_t c2)
257 {
258  c2_->value( c2 );
259  c2_->genValue( c2 );
260  c2_->initValue( c2 );
261 }
262 
263 void LauNRAmplitude::setp1Parameter(const Double_t p1)
264 {
265  p1_->value( p1 );
266  p1_->genValue( p1 );
267  p1_->initValue( p1 );
268 }
269 
270 void LauNRAmplitude::setp2Parameter(const Double_t p2)
271 {
272  p2_->value( p2 );
273  p2_->genValue( p2 );
274  p2_->initValue( p2 );
275 }
276 
virtual const std::vector< LauParameter * > & getFloatingParameters()
Retrieve the resonance parameters, e.g. so that they can be loaded into a fit.
Double_t getc1Parameter() const
Get the c1 parameter value.
File containing declaration of LauNRAmplitude class.
Bool_t fixed() const
Check whether the parameter is fixed or floated.
static double p1(double t, double a, double b)
virtual LauComplex resAmp(Double_t mass, Double_t spinTerm)
This is not meant to be called.
virtual ~LauNRAmplitude()
Destructor.
File containing declaration of LauResonanceInfo class.
Bool_t fixc1Parameter() const
See if the c1 parameter is fixed or floating.
virtual void setResonanceParameter(const TString &name, const Double_t value)
Set value of a resonance parameter.
ClassImp(LauAbsCoeffSet)
virtual void floatResonanceParameter(const TString &name)
Allow the various parameters to float in the fit.
LauParameter()
Default constructor.
Definition: LauParameter.cc:30
Double_t getm23() const
Get the m23 invariant mass.
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
void setc1Parameter(const Double_t c1)
Set the c1 parameter value.
LauParameter * p2_
Parameter from arXiv:0709.0075v1 [hep-ph].
Double_t getp2Parameter() const
Get the p2 parameter value.
void setp1Parameter(const Double_t p1)
Set the p1 parameter value.
void setc2Parameter(const Double_t c2)
Set the c2 parameter value.
virtual LauParameter * getResonanceParameter(const TString &name)
Access the given resonance parameter.
Double_t getm23Sq() const
Get the m23 invariant mass square.
File containing declaration of LauKinematics class.
void addFloatingParameter(LauParameter *param)
Add parameter to the list of floating parameters.
void setp2Parameter(const Double_t p2)
Set the p2 parameter value.
Class for defining the NR amplitude model.
LauParameter * c2_
Parameter from arXiv:0709.0075v1 [hep-ph].
Bool_t fixdParameter() const
See if the d parameter is fixed or floating.
Double_t getm13() const
Get the m13 invariant mass.
Double_t f(const Double_t s, const Double_t c, const Double_t p) const
Evaluate the expression 1.0 / (1.0 + TMath::Exp( c * (s-p) ))
std::vector< LauParameter * > & getParameters()
Access the list of floating parameters.
Bool_t fixc2Parameter() const
See if the c2 parameter is fixed or floating.
virtual void initialise()
Initialise the model.
LauParameter * c1_
Parameter from arXiv:0709.0075v1 [hep-ph].
static double p2(double t, double a, double b, double c)
Class for defining the fit parameter objects.
Definition: LauParameter.hh:34
Double_t getdParameter() const
Get the d parameter value.
Bool_t fixp1Parameter() const
See if the p1 parameter is fixed or floating.
LauParameter * d_
Parameter from arXiv:0709.0075v1 [hep-ph].
Abstract class for defining type for resonance amplitude models (Breit-Wigner, Flatte etc...
Double_t getm13Sq() const
Get the m13 invariant mass square.
Double_t initValue() const
The initial value of the parameter.
Class for defining a complex number.
Definition: LauComplex.hh:47
Class for calculating 3-body kinematic quantities.
Double_t value() const
The value of the parameter.
Bool_t fixp2Parameter() const
See if the p2 parameter is fixed or floating.
LauParameter * p1_
Parameter from arXiv:0709.0075v1 [hep-ph].
Double_t getc2Parameter() const
Get the c2 parameter value.
void setdParameter(const Double_t d)
Set the d parameter value.
virtual LauComplex amplitude(const LauKinematics *kinematics)
Complex resonant amplitude.
Double_t genValue() const
The value generated for the parameter.
void clearFloatingParameters()
Clear list of floating parameters.
Double_t getp1Parameter() const
Get the p1 parameter value.