laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauRescatteringRes.cc
Go to the documentation of this file.
1 
2 /*
3 Copyright 2018 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 "TMath.h"
32 
33 #include "TSystem.h"
34 #include "LauConstants.hh"
35 #include "LauRescatteringRes.hh"
36 #include "LauDaughters.hh"
37 #include "LauParameter.hh"
38 #include "LauResonanceInfo.hh"
39 
41 
42 
44  const Int_t resPairAmpInt, const LauDaughters* daughters) :
45  LauAbsResonance(resInfo, resPairAmpInt, daughters),
46  lambdaPiPi_(0),
47  lambdaKK_(0),
48  Mf_(0),
49  Ms_(0),
50  Mprime_(0),
51  Eps1_(0),
52  Eps2_(0),
53  C0_(0),
54  model_(resType)
55 {
56  TString parNameBase = this->getSanitisedName();
57  TString lambdaPiPiName(parNameBase);
58  lambdaPiPiName += "_lambdaPiPi";
59  lambdaPiPi_ = resInfo->getExtraParameter( lambdaPiPiName );
60  if ( lambdaPiPi_ == 0 ) {
61  lambdaPiPi_ = new LauParameter( lambdaPiPiName, 1.0, 0.0, 10.0, kTRUE );
62  lambdaPiPi_->secondStage(kTRUE);
63  resInfo->addExtraParameter( lambdaPiPi_ );
64  }
65  TString lambdaKKName(parNameBase);
66  lambdaKKName += "_lambdaKK";
67  lambdaKK_ = resInfo->getExtraParameter( lambdaKKName );
68  if ( lambdaKK_ == 0 ) {
69  lambdaKK_ = new LauParameter( lambdaKKName, 2.8, 0.0, 10.0, kTRUE );
70  lambdaKK_->secondStage(kTRUE);
71  resInfo->addExtraParameter( lambdaKK_ );
72  }
73  TString MfName(parNameBase);
74  MfName += "_Mf";
75  Mf_ = resInfo->getExtraParameter( MfName );
76  if ( Mf_ == 0 ) {
77  Mf_ = new LauParameter( MfName, 1.32, 0.0, 10.0, kTRUE );
78  Mf_->secondStage(kTRUE);
79  resInfo->addExtraParameter( Mf_ );
80  }
81  TString MsName(parNameBase);
82  MsName += "_Ms";
83  Ms_ = resInfo->getExtraParameter( MsName );
84  if ( Ms_ == 0 ) {
85  Ms_ = new LauParameter( MsName, 0.92, 0.0, 10.0, kTRUE );
86  Ms_->secondStage(kTRUE);
87  resInfo->addExtraParameter( Ms_ );
88  }
89  TString MprimeName(parNameBase);
90  MprimeName += "_Mprime";
91  Mprime_ = resInfo->getExtraParameter( MprimeName );
92  if ( Mprime_ == 0 ) {
93  Mprime_ = new LauParameter( MprimeName, 1.5, 0.0, 10.0, kTRUE );
94  Mprime_->secondStage(kTRUE);
95  resInfo->addExtraParameter( Mprime_ );
96  }
97 
98  TString Eps1Name(parNameBase);
99  Eps1Name += "_Eps1";
100  Eps1_ = resInfo->getExtraParameter( Eps1Name );
101  if ( Eps1_ == 0 ) {
102  Eps1_ = new LauParameter( Eps1Name, 2.4, 0.0, 10.0, kTRUE );
103  Eps1_->secondStage(kTRUE);
104  resInfo->addExtraParameter( Eps1_ );
105  }
106 
107  TString Eps2Name(parNameBase);
108  Eps2Name += "_Eps2";
109  Eps2_ = resInfo->getExtraParameter( Eps2Name );
110  if ( Eps2_ == 0 ) {
111  Eps2_ = new LauParameter( Eps2Name, -5.5, -10.0, 10.0, kTRUE );
112  Eps2_->secondStage(kTRUE);
113  resInfo->addExtraParameter( Eps2_ );
114  }
115 
116  TString C0Name(parNameBase);
117  C0Name += "_C0";
118  C0_ = resInfo->getExtraParameter( C0Name );
119  if ( C0_ == 0 ) {
120  C0_ = new LauParameter( C0Name, 1.3, 0.0, 10.0, kTRUE );
121  C0_->secondStage(kTRUE);
122  resInfo->addExtraParameter( C0_ );
123  }
124 }
125 
127 {
128 }
129 
131 {
132  const LauDaughters* daughters = this->getDaughters();
133  Int_t resPairAmpInt = this->getPairInt();
134  if ( daughters->gotSymmetricalDP() && resPairAmpInt != 3 ) {
135  std::cerr << "WARNING in LauRescatteringRes::initialise : Dalitz plot is symmetric - this lineshape is not appropriate." << std::endl;
136  std::cerr << "WARNING I think that this warning is not appropiate because Laura Simetrize at LauIsobarModel level." << std::endl;
137  }
138 
140  std::cerr << "WARNING in LauRescatteringRes::initialise : Unknown model requested, defaulting to exponential." << std::endl;
142  }
143 
144  if ( (model_ != LauAbsResonance::RescatteringNoInter) && (this->getSpin() != 0) ) {
145  std::cerr << "WARNING in LauRescatteringRes::initialise : Non-zero spin will be ignored for this model - perhaps you should use LauAbsResonance::BelleSymNRNoInter instead" << std::endl;
146  }
147 }
148 
149 
151 {
152  // This function returns the complex dynamical amplitude for a Reescatering distribution o original
153  // pelaez paper parameters Eq 2.15a [Pelaez et Yndúrain: arXiv:hep-ph/0411334v2 Mar 2005]
154  Double_t Mprime = this->getMprime();
155  Double_t Mf = this->getMf();
156  Double_t Ms = this->getMs();
157  Double_t eps1 = this->getEps1();
158  Double_t eps2 = this->getEps2();
159  Double_t c0 = this->getC0();
160  Double_t lambPiPi = this->getLambdaPiPi();
161  Double_t lambKK = this->getLambdaKK();
162 
163  Double_t mk = LauConstants::mK;
164 
165  // Calculate Mandelstam variables: s = m_13^2, t = m_23^2, u = m_12^2.
166  Double_t s = 0;
167  Double_t t = 0;
168  Int_t resPairAmpInt = getPairInt();
169 
170  if (resPairAmpInt == 1) {
171  s = kinematics->getm23Sq();
172  t = kinematics->getm12Sq();
173  } else if (resPairAmpInt == 2) {
174  s = kinematics->getm13Sq();
175  t = kinematics->getm23Sq();
176  } else if (resPairAmpInt == 3) {
177  s = kinematics->getm12Sq();
178  t = kinematics->getm13Sq();
179  } else {
180  std::cerr << "ERROR in LauAbsResonance::amplitude : Nonsense setup of resPairAmp array." << std::endl;
181  gSystem->Exit(EXIT_FAILURE);
182  }
183 
184  // Calculate amplitude for s variable.
185  Double_t mass_s = TMath::Sqrt(s);
186  Double_t k2Square_s = (s - 4.0*mk*mk)/4.0;
187  Double_t k2Abs_s=0;
188  if (k2Square_s > 0) k2Abs_s = TMath::Sqrt(k2Square_s);
189  else k2Abs_s = TMath::Sqrt(-1.0*k2Square_s);
190  Double_t cotdelta0_s = c0*(s - Ms*Ms)*(Mf*Mf - s)*k2Abs_s/(Mf*Mf*mass_s*k2Square_s); // Eq 2.15a
191  Double_t delta0_s = TMath::ATan(1.0/cotdelta0_s);
192  Double_t eta0_s = 1.0 - (eps1*k2Abs_s/mass_s + eps2*k2Square_s/s)*(Mprime*Mprime-s)/s; // Eq 2.15a
193 
194  if ((mass_s < 2.0*mk)||(mass_s > Mprime )) eta0_s = 1;
195  Double_t mag_s = TMath::Sqrt( 1-eta0_s*eta0_s);
196 
197  Double_t tauRe_s = mag_s*TMath::Cos(2.0*delta0_s);
198  Double_t tauIm_s = mag_s*TMath::Sin(2.0*delta0_s);
199 
200  Double_t NR1_s = 1.0/(1.0+s/(lambPiPi*lambPiPi));
201  Double_t NR2_s = 1.0/(1.0+s/(lambKK*lambKK));
202 
203  //LauComplex resAmplitude(-tauIm_s*NR1_s*NR2_s - tauIm_t*NR1_t*NR2_t, tauRe_s*NR1_s*NR2_s + tauRe_t*NR1_t*NR2_t );
205  {
206  NR1_s=0.0; NR2_s=0.0; tauRe_s=0.0; tauIm_s=0.0;
207  }
208 
209  LauComplex resAmplitude(-tauIm_s*NR1_s*NR2_s ,tauRe_s*NR1_s*NR2_s);
210 
211  return resAmplitude;
212 }
213 
214 LauComplex LauRescatteringRes::resAmp(Double_t mass, Double_t spinTerm)
215 {
216  std::cerr << "ERROR in LauRescatteringRes : This method should never be called." << std::endl;
217  std::cerr << " : Returning zero amplitude for mass = " << mass << " and spinTerm = " << spinTerm << "." << std::endl;
218  return LauComplex(0.0, 0.0);
219 }
220 
221 
222 const std::vector<LauParameter*>& LauRescatteringRes::getFloatingParameters()
223 {
224  this->clearFloatingParameters();
225 
226  if ( ! this->fixLambdaPiPi() ) {
228  }
229  if ( ! this->fixLambdaKK() ) {
231  }
232  if ( ! this->fixMf() ) {
233  this->addFloatingParameter( Mf_ );
234  }
235  if ( ! this->fixMs() ) {
236  this->addFloatingParameter( Ms_ );
237  }
238  if ( ! this->fixMprime() ) {
239  this->addFloatingParameter( Mprime_ );
240  }
241  if ( ! this->fixEps1() ) {
242  this->addFloatingParameter( Eps1_ );
243  }
244  if ( ! this->fixEps2() ) {
245  this->addFloatingParameter( Eps2_ );
246  }
247  if ( ! this->fixC0() ) {
248  this->addFloatingParameter( C0_ );
249  }
250 
251  return this->getParameters();
252 }
253 
254 void LauRescatteringRes::setResonanceParameter(const TString& name, const Double_t value)
255 {
256  // Set various parameters for the lineshape
257  if (name == "lambdaPiPi") {
258  this->setLambdaPiPi(value);
259  std::cout << "INFO in LauRescatteringRes::setResonanceParameter : Setting parameter lambdaPiPi = " << this->getLambdaPiPi() << std::endl;
260  }
261  else if (name == "lambdaKK") {
262  this->setLambdaKK(value);
263  std::cout << "INFO in LauRescatteringRes::setResonanceParameter : Setting parameter lambdaKK = " << this->getLambdaKK() << std::endl;
264  }
265  else if (name == "Mf") {
266  this->setMf(value);
267  std::cout << "INFO in LauRescatteringRes::setResonanceParameter : Setting parameter Mf = " << this->getMf() << std::endl;
268  }
269  else if (name == "Ms") {
270  this->setMs(value);
271  std::cout << "INFO in LauRescatteringRes::setResonanceParameter : Setting parameter Ms = " << this->getMs() << std::endl;
272  }
273  else if (name == "Mprime") {
274  this->setMprime(value);
275  std::cout << "INFO in LauRescatteringRes::setResonanceParameter : Setting parameter Mprime = " << this->getMprime() << std::endl;
276  }
277  else if (name == "Eps1") {
278  this->setEps1(value);
279  std::cout << "INFO in LauRescatteringRes::setResonanceParameter : Setting parameter eps1 = " << this->getEps1() << std::endl;
280  }
281  else if (name == "Eps2") {
282  this->setEps2(value);
283  std::cout << "INFO in LauRescatteringRes::setResonanceParameter : Setting parameter eps2 = " << this->getEps2() << std::endl;
284  }
285  else if (name == "C0") {
286  this->setC0(value);
287  std::cout << "INFO in LauRescatteringRes::setResonanceParameter : Setting parameter eps2 = " << this->getC0() << std::endl;
288  }
289  else {
290  std::cerr << "WARNING in LauRescatteringRes::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
291  }
292 }
293 
295 {
296  if (name == "lambdaPiPi") {
297  if ( lambdaPiPi_->fixed() ) {
298  lambdaPiPi_->fixed( kFALSE );
300  } else {
301  std::cerr << "WARNING in LauRescatteringRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
302  }
303  }
304  else if (name == "lambdaKK") {
305  if ( lambdaKK_->fixed() ) {
306  lambdaKK_->fixed( kFALSE );
308  } else {
309  std::cerr << "WARNING in LauRescatteringRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
310  }
311  }
312  else if (name == "Mf") {
313  if ( Mf_->fixed() ) {
314  Mf_->fixed( kFALSE );
315  this->addFloatingParameter( Mf_ );
316  } else {
317  std::cerr << "WARNING in LauRescatteringRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
318  }
319  }
320  else if (name == "Ms") {
321  if ( Ms_->fixed() ) {
322  Ms_->fixed( kFALSE );
323  this->addFloatingParameter( Ms_ );
324  } else {
325  std::cerr << "WARNING in LauRescatteringRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
326  }
327  }
328  else if (name == "Mprime") {
329  if ( Mprime_->fixed() ) {
330  Mprime_->fixed( kFALSE );
331  this->addFloatingParameter( Mprime_ );
332  } else {
333  std::cerr << "WARNING in LauRescatteringRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
334  }
335  }
336  else if (name == "Eps1") {
337  if ( Eps1_->fixed() ) {
338  Eps1_->fixed( kFALSE );
339  this->addFloatingParameter( Eps1_ );
340  } else {
341  std::cerr << "WARNING in LauRescatteringRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
342  }
343  }
344  else if (name == "Eps2") {
345  if ( Eps2_->fixed() ) {
346  Eps2_->fixed( kFALSE );
347  this->addFloatingParameter( Eps2_ );
348  } else {
349  std::cerr << "WARNING in LauRescatteringRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
350  }
351  }
352  else if (name == "C0") {
353  if ( C0_->fixed() ) {
354  C0_->fixed( kFALSE );
355  this->addFloatingParameter( C0_ );
356  } else {
357  std::cerr << "WARNING in LauRescatteringRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
358  }
359  }
360 
361  else {
362  std::cerr << "WARNING in LauRescatteringRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
363  }
364 }
365 
367 {
368  if (name == "lambdaPiPi") {
369  return lambdaPiPi_;
370  }
371  else if (name == "lambdaKK") {
372  return lambdaKK_;
373  }
374  if (name == "Mf") {
375  return Mf_;
376  }
377  else if (name == "Ms") {
378  return Ms_;
379  }
380  if (name == "Mprime") {
381  return Mprime_;
382  }
383  if (name == "Eps1") {
384  return Eps1_;
385  }
386  if (name == "Eps2") {
387  return Eps2_;
388  }
389  if (name == "C0") {
390  return C0_;
391  }
392  else {
393  std::cerr << "WARNING in LauRescatteringRes::getResonanceParameter: Parameter name not reconised." << std::endl;
394  return 0;
395  }
396 }
397 
398 void LauRescatteringRes::setLambdaPiPi(const Double_t lambda)
399 {
400  lambdaPiPi_->value( lambda );
401  lambdaPiPi_->genValue( lambda );
402  lambdaPiPi_->initValue( lambda );
403 }
404 
405 void LauRescatteringRes::setLambdaKK(const Double_t lambda)
406 {
407  lambdaKK_->value( lambda );
408  lambdaKK_->genValue( lambda );
409  lambdaKK_->initValue( lambda );
410 }
411 
412 void LauRescatteringRes::setMf(const Double_t Mf)
413 {
414  Mf_->value( Mf );
415  Mf_->genValue( Mf );
416  Mf_->initValue( Mf );
417 }
418 
419 void LauRescatteringRes::setMs(const Double_t Ms)
420 {
421  Ms_->value( Ms );
422  Ms_->genValue( Ms );
423  Ms_->initValue( Ms );
424 }
425 
426 void LauRescatteringRes::setMprime(const Double_t Mprime)
427 {
428  Mprime_->value( Mprime );
429  Mprime_->genValue( Mprime);
430  Mprime_->initValue( Mprime );
431 }
432 
433 void LauRescatteringRes::setEps1(const Double_t Eps1)
434 {
435  Eps1_->value( Eps1 );
436  Eps1_->genValue( Eps1 );
437  Eps1_->initValue( Eps1 );
438 }
439 
440 void LauRescatteringRes::setEps2(const Double_t Eps2)
441 {
442  Eps2_->value( Eps2 );
443  Eps2_->genValue( Eps2 );
444  Eps2_->initValue( Eps2 );
445 }
446 
447 void LauRescatteringRes::setC0(const Double_t C0)
448 {
449  C0_->value( C0 );
450  C0_->genValue( C0 );
451  C0_->initValue( C0 );
452 }
453 
454 
Bool_t fixEps2() const
See if the Eps2 parameter is fixed or floating.
Double_t getEps2() const
Get the Eps2.
Double_t getMf() const
Get the Mf.
Bool_t fixed() const
Check whether the parameter is fixed or floated.
File containing declaration of LauRescatteringRes class.
virtual void initialise()
Initialise the model.
void setLambdaPiPi(const Double_t lambda)
Set the parameter lambdaPiPi, the term for the PiPi.
LauAbsResonance::LauResonanceModel model_
The model to use.
File containing declaration of LauResonanceInfo class.
LauParameter * Eps1_
the term for the Eps1
ClassImp(LauAbsCoeffSet)
Double_t getEps1() const
Get the Eps1.
Bool_t fixLambdaKK() const
See if the lambdaKK parameter is fixed or floating.
LauParameter()
Default constructor.
Definition: LauParameter.cc:44
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 const std::vector< LauParameter * > & getFloatingParameters()
Retrieve the resonance parameters, e.g. so that they can be loaded into a fit.
Double_t getMs() const
Get the Ms.
File containing declaration of LauDaughters class.
void setEps2(const Double_t Eps2)
Set the parameter Eps2.
Double_t getm23Sq() const
Get the m23 invariant mass square.
const LauDaughters * getDaughters() const
Access the daughters object.
Int_t getPairInt() const
Get the integer to identify which DP axis the resonance belongs to.
void setMs(const Double_t Ms)
Set the parameter Ms.
void addFloatingParameter(LauParameter *param)
Add parameter to the list of floating parameters.
LauParameter * lambdaKK_
the term for the KK
Bool_t fixMprime() const
See if the Mprime parameter is fixed or floating.
Bool_t gotSymmetricalDP() const
Is Dalitz plot symmetric, i.e. 2 identical particles.
Definition: LauDaughters.hh:80
virtual void setResonanceParameter(const TString &name, const Double_t value)
Set value of the various parameters.
Bool_t fixMs() const
See if the Ms parameter is fixed or floating.
LauParameter * lambdaPiPi_
the term for the PiPi
void setLambdaKK(const Double_t lambda)
Set the parameter lambdaKK, the term for the KK.
Double_t getC0() const
Get the C0.
Double_t getLambdaKK() const
Get the lambdaKK, the term for the KK.
Double_t getLambdaPiPi() const
Get the lambdaPiPi, the term for the PiPi.
File containing declaration of LauParameter class.
LauParameter * Ms_
the term for the Ms
virtual LauComplex resAmp(Double_t mass, Double_t spinTerm)
Complex resonant amplitude.
Bool_t fixMf() const
See if the Mf parameter is fixed or floating.
LauParameter * Mf_
the term for the Mf_
void setMprime(const Double_t Mprime)
Set the parameter Mprime.
std::vector< LauParameter * > & getParameters()
Access the list of floating parameters.
void setC0(const Double_t C0)
Set the parameter C0.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:49
virtual LauComplex amplitude(const LauKinematics *kinematics)
Get the complex dynamical amplitude.
Double_t getMprime() const
Get the Mprime.
virtual void floatResonanceParameter(const TString &name)
Allow the various parameters to float in the fit.
void setMf(const Double_t Mf)
Set the parameter Mf.
virtual LauParameter * getResonanceParameter(const TString &name)
Access the given resonance parameter.
Bool_t fixLambdaPiPi() const
See if the lambdaPiPi parameter is fixed or floating.
Bool_t fixEps1() const
See if the Eps1 parameter is fixed or floating.
LauResonanceModel
Define the allowed resonance types.
Double_t getm12Sq() const
Get the m12 invariant mass square.
Class for defining the rescattering model.
virtual ~LauRescatteringRes()
Destructor.
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.
LauParameter * Eps2_
the term for the Eps2
LauParameter * C0_
the term for the C0
File containing LauConstants namespace.
Class for defining a complex number.
Definition: LauComplex.hh:61
LauParameter * Mprime_
the term for the Mprime
Class for calculating 3-body kinematic quantities.
Double_t value() const
The value of the parameter.
void setEps1(const Double_t Eps1)
Set the parameter Eps1.
Int_t getSpin() const
Get the spin of the resonance.
Double_t genValue() const
The value generated for the parameter.
const Double_t mK
Mass of K+- (GeV/c^2)
Definition: LauConstants.hh:58
void clearFloatingParameters()
Clear list of floating parameters.
Bool_t fixC0() const
See if the C0 parameter is fixed or floating.