laura is hosted by Hepforge, IPPP Durham
Laura++  v3r2
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 }
89 
91 {
92 }
93 
95 {
96  // Get the information from the kinematics object
97  const Double_t m13Sq = kinematics->getm13Sq();
98  const Double_t m23Sq = kinematics->getm23Sq();
99  const Double_t m13 = kinematics->getm13();
100  const Double_t m23 = kinematics->getm23();
101 
102  // Calculate the magnitude
103  Double_t magnitude = TMath::Sqrt( m13 * m23 *
104  this->f(m23Sq, c1_->unblindValue(), p1_->unblindValue()) *
105  this->f(m13Sq, c2_->unblindValue(), p2_->unblindValue()) *
106  TMath::Exp( -1.0 * d_->unblindValue() * m13Sq*m13Sq * m23Sq*m23Sq )
107  );
108 
109  // return the amplitude
110  LauComplex resAmplitude(magnitude, 0.0);
111  return resAmplitude;
112 }
113 
114 LauComplex LauNRAmplitude::resAmp(Double_t mass, Double_t spinTerm)
115 {
116  std::cerr << "ERROR in LauNRAmplitude::resAmp : This method shouldn't get called." << std::endl;
117  std::cerr << " Returning zero amplitude for mass = " << mass << " and spinTerm = " << spinTerm << "." << std::endl;
118  return LauComplex(0.0, 0.0);
119 }
120 
121 Double_t LauNRAmplitude::f(const Double_t s, const Double_t c, const Double_t p) const
122 {
123  return 1.0 / (1.0 + TMath::Exp( c * (s-p) ));
124 }
125 
126 const std::vector<LauParameter*>& LauNRAmplitude::getFloatingParameters()
127 {
128  this->clearFloatingParameters();
129 
130  if ( ! this->fixdParameter() ) {
131  this->addFloatingParameter( d_ );
132  }
133 
134  if ( ! this->fixc1Parameter() ) {
135  this->addFloatingParameter( c1_ );
136  }
137 
138  if ( ! this->fixc2Parameter() ) {
139  this->addFloatingParameter( c2_ );
140  }
141 
142  if ( ! this->fixp1Parameter() ) {
143  this->addFloatingParameter( p1_ );
144  }
145 
146  if ( ! this->fixp2Parameter() ) {
147  this->addFloatingParameter( p2_ );
148  }
149 
150  return this->getParameters();
151 }
152 
153 void LauNRAmplitude::setResonanceParameter(const TString& name, const Double_t value)
154 {
155  // Set various parameters for the NRAmplitude lineshape dynamics
156  if (name == "d") {
157  this->setdParameter(value);
158  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude d = " << this->getdParameter() << std::endl;
159  } else if (name == "c1") {
160  this->setc1Parameter(value);
161  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude c1 = " << this->getc1Parameter() << std::endl;
162  } else if (name == "c2") {
163  this->setc2Parameter(value);
164  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude c2 = " << this->getc2Parameter() << std::endl;
165  } else if (name == "p1") {
166  this->setp1Parameter(value);
167  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude p1 = " << this->getp1Parameter() << std::endl;
168  } else if (name == "p2") {
169  this->setp2Parameter(value);
170  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude p2 = " << this->getp2Parameter() << std::endl;
171  } else {
172  std::cerr << "WARNING in LauNRAmplitude::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
173  }
174 }
175 
177 {
178  if (name == "d") {
179  if ( d_->fixed() ) {
180  d_->fixed( kFALSE );
181  this->addFloatingParameter( d_ );
182  } else {
183  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
184  }
185  } else if (name == "c1") {
186  if ( c1_->fixed() ) {
187  c1_->fixed( kFALSE );
188  this->addFloatingParameter( c1_ );
189  } else {
190  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
191  }
192  } else if (name == "c2") {
193  if ( c2_->fixed() ) {
194  c2_->fixed( kFALSE );
195  this->addFloatingParameter( c2_ );
196  } else {
197  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
198  }
199  } else if (name == "p1") {
200  if ( p1_->fixed() ) {
201  p1_->fixed( kFALSE );
202  this->addFloatingParameter( p1_ );
203  } else {
204  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
205  }
206  } else if (name == "p2") {
207  if ( p2_->fixed() ) {
208  p2_->fixed( kFALSE );
209  this->addFloatingParameter( p2_ );
210  } else {
211  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
212  }
213  } else {
214  std::cerr << "WARNING in LauNRAmplitude::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
215  }
216 }
217 
219 {
220  if (name == "d") {
221  return d_;
222  } else if (name == "c1") {
223  return c1_;
224  } else if (name == "c2") {
225  return c2_;
226  } else if (name == "p1") {
227  return p1_;
228  } else if (name == "p2") {
229  return p2_;
230  } else {
231  std::cerr << "WARNING in LauNRAmplitude::getResonanceParameter: Parameter name not reconised." << std::endl;
232  return 0;
233  }
234 }
235 
236 void LauNRAmplitude::setdParameter(const Double_t d)
237 {
238  d_->value( d );
239  d_->genValue( d );
240  d_->initValue( d );
241 }
242 
243 void LauNRAmplitude::setc1Parameter(const Double_t c1)
244 {
245  c1_->value( c1 );
246  c1_->genValue( c1 );
247  c1_->initValue( c1 );
248 }
249 
250 void LauNRAmplitude::setc2Parameter(const Double_t c2)
251 {
252  c2_->value( c2 );
253  c2_->genValue( c2 );
254  c2_->initValue( c2 );
255 }
256 
257 void LauNRAmplitude::setp1Parameter(const Double_t p1)
258 {
259  p1_->value( p1 );
260  p1_->genValue( p1 );
261  p1_->initValue( p1 );
262 }
263 
264 void LauNRAmplitude::setp2Parameter(const Double_t p2)
265 {
266  p2_->value( p2 );
267  p2_->genValue( p2 );
268  p2_->initValue( p2 );
269 }
270 
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:35
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.
Double_t unblindValue() const
The unblinded 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.