laura is hosted by Hepforge, IPPP Durham
Laura++  v3r2
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauKappaRes.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 "LauConstants.hh"
18 #include "LauKappaRes.hh"
19 #include "LauResonanceInfo.hh"
20 
22 
23 
24 LauKappaRes::LauKappaRes(LauResonanceInfo* resInfo, const Int_t resPairAmpInt, const LauDaughters* daughters) :
25  LauAbsResonance(resInfo, resPairAmpInt, daughters),
26  mSumSq_((LauConstants::mPi+LauConstants::mK)*(LauConstants::mPi+LauConstants::mK)),
27  sAdler_(LauConstants::mKSq-0.5*LauConstants::mPiSq),
28  b1_(0),
29  b2_(0),
30  a_(0),
31  m0_(0)
32 {
33  // Default constant factors from BES data
34  const Double_t b1Val = 24.49;
35  const Double_t b2Val = 0.0;
36  const Double_t aVal = 2.5;
37  const Double_t m0Val = 3.3;
38 
39  const TString& parNameBase = this->getSanitisedName();
40 
41  TString b1Name(parNameBase);
42  b1Name += "_b1";
43  b1_ = resInfo->getExtraParameter( b1Name );
44  if ( b1_ == 0 ) {
45  b1_ = new LauParameter( b1Name, b1Val, 0.0, 100.0, kTRUE );
46  b1_->secondStage(kTRUE);
47  resInfo->addExtraParameter( b1_ );
48  }
49 
50  TString b2Name(parNameBase);
51  b2Name += "_b2";
52  b2_ = resInfo->getExtraParameter( b2Name );
53  if ( b2_ == 0 ) {
54  b2_ = new LauParameter( b2Name, b2Val, 0.0, 100.0, kTRUE );
55  b2_->secondStage(kTRUE);
56  resInfo->addExtraParameter( b2_ );
57  }
58 
59  TString aName(parNameBase);
60  aName += "_A";
61  a_ = resInfo->getExtraParameter( aName );
62  if ( a_ == 0 ) {
63  a_ = new LauParameter( aName, aVal, 0.0, 10.0, kTRUE );
64  a_->secondStage(kTRUE);
65  resInfo->addExtraParameter( a_ );
66  }
67 
68  TString m0Name(parNameBase);
69  m0Name += "_m0";
70  m0_ = resInfo->getExtraParameter( m0Name );
71  if ( m0_ == 0 ) {
72  m0_ = new LauParameter( m0Name, m0Val, 0.0, 10.0, kTRUE );
73  m0_->secondStage(kTRUE);
74  resInfo->addExtraParameter( m0_ );
75  }
76 }
77 
79 {
80 }
81 
83 {
84  this->checkDaughterTypes();
85 
86  Double_t resSpin = this->getSpin();
87  if (resSpin != 0) {
88  std::cerr << "WARNING in LauKappaRes::initialise : Resonance spin is " << resSpin << "." << std::endl;
89  std::cerr << " : Kappa amplitude is only for scalers, resetting spin to 0." << std::endl;
90  this->changeResonance( -1.0, -1.0, 0 );
91  }
92 }
93 
95 {
96  // Check that the daughter tracks are K and pi. Otherwise issue a warning.
97 
98  Int_t resPairAmpInt = this->getPairInt();
99  if (resPairAmpInt < 1 || resPairAmpInt > 3) {
100  std::cerr << "WARNING in LauKappaRes::checkDaughterTypes : resPairAmpInt = " << resPairAmpInt << " is out of the range [1,2,3]." << std::endl;
101  return;
102  }
103 
104  const TString& nameDaug1 = this->getNameDaug1();
105  const TString& nameDaug2 = this->getNameDaug2();
106  if ( !( nameDaug1.Contains("pi", TString::kIgnoreCase) && nameDaug2.Contains("k", TString::kIgnoreCase) ) ) {
107  if ( !( nameDaug2.Contains("pi", TString::kIgnoreCase) && nameDaug1.Contains("k", TString::kIgnoreCase) ) ) {
108  std::cerr << "ERROR in LauKappaRes::checkDaughterTypes : Kappa model is using daughters \"" << nameDaug1 << "\" and \"" << nameDaug2 << "\" that are not a kaon and a pion." << std::endl;
109  }
110  }
111 }
112 
113 LauComplex LauKappaRes::resAmp(Double_t mass, Double_t spinTerm)
114 {
115  // This function returns the complex dynamical amplitude for a Kappa distribution
116  // given the invariant mass and cos(helicity) values.
117 
118  // First check that the appropriate daughters are either pi+pi- or K+K-
119  // Check that the daughter tracks are the same type. Otherwise issue a warning
120  // and set the type to be pion for the Kappa distribution. Returns the
121  // integer defined by the enum LauKappaRes::KappaPartType.
122 
123  Double_t s = mass*mass; // Invariant mass squared combination for the system
124  Double_t rho(0.0); // Phase-space factor
125  if (s > mSumSq_) {rho = TMath::Sqrt(1.0 - mSumSq_/s);}
126 
127  const Double_t m0Val = this->getM0Value();
128  const Double_t m0Sq = m0Val * m0Val;
129 
130  const Double_t aVal = this->getAValue();
131  const Double_t b1Val = this->getB1Value();
132  const Double_t b2Val = this->getB2Value();
133 
134  Double_t f = b2Val*s + b1Val; // f(s) function
135  Double_t numerator = s - sAdler_;
136  Double_t denom = m0Sq - sAdler_;
137  Double_t gamma(0.0);
138  if (TMath::Abs(denom) > 1e-10 && TMath::Abs(aVal) > 1e-10) {
139  // Decay width of the system
140  gamma = rho*(numerator/denom)*f*TMath::Exp(-(s - m0Sq)/aVal);
141  }
142 
143  // Now form the complex amplitude - use relativistic BW form (without barrier factors)
144  // Note that the M factor in the denominator is not the "pole" at ~500 MeV, but is
145  // m0_ = 0.9264, the mass when the phase shift goes through 90 degrees.
146 
147  Double_t dMSq = m0Sq - s;
148  Double_t widthTerm = gamma*m0Val;
149  LauComplex resAmplitude(dMSq, widthTerm);
150 
151  Double_t denomFactor = dMSq*dMSq + widthTerm*widthTerm;
152 
153  Double_t invDenomFactor = 0.0;
154  if (denomFactor > 1e-10) {invDenomFactor = 1.0/denomFactor;}
155 
156  resAmplitude.rescale(spinTerm*invDenomFactor);
157 
158  return resAmplitude;
159 }
160 
161 const std::vector<LauParameter*>& LauKappaRes::getFloatingParameters()
162 {
163  this->clearFloatingParameters();
164 
165  if ( ! this->fixB1Value() ) {
166  this->addFloatingParameter( b1_ );
167  }
168 
169  if ( ! this->fixB2Value() ) {
170  this->addFloatingParameter( b2_ );
171  }
172 
173  if ( ! this->fixAValue() ) {
174  this->addFloatingParameter( a_ );
175  }
176 
177  if ( ! this->fixM0Value() ) {
178  this->addFloatingParameter( m0_ );
179  }
180 
181  return this->getParameters();
182 }
183 
184 void LauKappaRes::setResonanceParameter(const TString& name, const Double_t value)
185 {
186  // Set various parameters for the lineshape
187  if (name == "b1") {
188  this->setB1Value(value);
189  std::cout << "INFO in LauKappaRes::setResonanceParameter : Setting parameter b1 = " << this->getB1Value() << std::endl;
190  }
191  else if (name == "b2") {
192  this->setB2Value(value);
193  std::cout << "INFO in LauKappaRes::setResonanceParameter : Setting parameter b2 = " << this->getB2Value() << std::endl;
194  }
195  else if (name == "A") {
196  this->setAValue(value);
197  std::cout << "INFO in LauKappaRes::setResonanceParameter : Setting parameter A = " << this->getAValue() << std::endl;
198  }
199  else if (name == "m0") {
200  this->setM0Value(value);
201  std::cout << "INFO in LauKappaRes::setResonanceParameter : Setting parameter m0 = " << this->getM0Value() << std::endl;
202  }
203  else {
204  std::cerr << "WARNING in LauKappaRes::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
205  }
206 }
207 
209 {
210  if (name == "b1") {
211  if ( b1_->fixed() ) {
212  b1_->fixed( kFALSE );
213  this->addFloatingParameter( b1_ );
214  } else {
215  std::cerr << "WARNING in LauKappaRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
216  }
217  } else if (name == "b2") {
218  if ( b2_->fixed() ) {
219  b2_->fixed( kFALSE );
220  this->addFloatingParameter( b2_ );
221  } else {
222  std::cerr << "WARNING in LauKappaRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
223  }
224  } else if (name == "A") {
225  if ( a_->fixed() ) {
226  a_->fixed( kFALSE );
227  this->addFloatingParameter( a_ );
228  } else {
229  std::cerr << "WARNING in LauKappaRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
230  }
231  } else if (name == "m0") {
232  if ( m0_->fixed() ) {
233  m0_->fixed( kFALSE );
234  this->addFloatingParameter( m0_ );
235  } else {
236  std::cerr << "WARNING in LauKappaRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
237  }
238  } else {
239  std::cerr << "WARNING in LauKappaRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
240  }
241 }
242 
244 {
245  if (name == "b1") {
246  return b1_;
247  } else if (name == "b2") {
248  return b2_;
249  } else if (name == "A") {
250  return a_;
251  } else if (name == "m0") {
252  return m0_;
253  } else {
254  std::cerr << "WARNING in LauKappaRes::getResonanceParameter: Parameter name not reconised." << std::endl;
255  return 0;
256  }
257 }
258 
259 void LauKappaRes::setB1Value(const Double_t b1)
260 {
261  b1_->value( b1 );
262  b1_->genValue( b1 );
263  b1_->initValue( b1 );
264 }
265 
266 void LauKappaRes::setB2Value(const Double_t b2)
267 {
268  b2_->value( b2 );
269  b2_->genValue( b2 );
270  b2_->initValue( b2 );
271 }
272 
273 void LauKappaRes::setAValue(const Double_t A)
274 {
275  a_->value( A );
276  a_->genValue( A );
277  a_->initValue( A );
278 }
279 
280 void LauKappaRes::setM0Value(const Double_t m0)
281 {
282  m0_->value( m0 );
283  m0_->genValue( m0 );
284  m0_->initValue( m0 );
285 }
286 
LauParameter * a_
Factor from BES data.
Definition: LauKappaRes.hh:181
Bool_t fixed() const
Check whether the parameter is fixed or floated.
virtual const std::vector< LauParameter * > & getFloatingParameters()
Retrieve the resonance parameters, e.g. so that they can be loaded into a fit.
Definition: LauKappaRes.cc:161
const Double_t mSumSq_
Square of (mK + mPi)
Definition: LauKappaRes.hh:172
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.
File containing declaration of LauResonanceInfo class.
virtual void setResonanceParameter(const TString &name, const Double_t value)
Set value of the various parameters.
Definition: LauKappaRes.cc:184
ClassImp(LauAbsCoeffSet)
LauParameter()
Default constructor.
Definition: LauParameter.cc:30
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 setB2Value(const Double_t b2)
Set the b2 parameter.
Definition: LauKappaRes.cc:266
Double_t getAValue() const
Get the A parameter value.
Definition: LauKappaRes.hh:122
LauParameter * m0_
Factor from BES data.
Definition: LauKappaRes.hh:183
TString getNameDaug2() const
Get the name of the second daughter of the resonance.
virtual LauComplex resAmp(Double_t mass, Double_t spinTerm)
Complex resonant amplitude.
Definition: LauKappaRes.cc:113
Double_t getB2Value() const
Get the b2 parameter value.
Definition: LauKappaRes.hh:116
void setM0Value(const Double_t m0)
Set the m0 parameter.
Definition: LauKappaRes.cc:280
Int_t getPairInt() const
Get the integer to identify which DP axis the resonance belongs to.
void setB1Value(const Double_t b1)
Set the b1 parameter.
Definition: LauKappaRes.cc:259
LauParameter * b2_
Factor from BES data.
Definition: LauKappaRes.hh:179
LauParameter * b1_
Factor from BES data.
Definition: LauKappaRes.hh:177
const Double_t mPi
Mass of pi+- (GeV/c^2)
Definition: LauConstants.hh:40
void addFloatingParameter(LauParameter *param)
Add parameter to the list of floating parameters.
const Double_t sAdler_
Defined as mK*mK - 0.5*mPi*mPi.
Definition: LauKappaRes.hh:174
virtual void initialise()
Initialise the model.
Definition: LauKappaRes.cc:82
void setAValue(const Double_t A)
Set the A parameter.
Definition: LauKappaRes.cc:273
Bool_t fixB2Value() const
Fix the b2 parameter value.
Definition: LauKappaRes.hh:140
Class for defining the Kappa resonance model.
Definition: LauKappaRes.hh:32
Bool_t fixAValue() const
Fix the A parameter value.
Definition: LauKappaRes.hh:146
const Double_t mPiSq
Square of pi+- mass.
Definition: LauConstants.hh:65
std::vector< LauParameter * > & getParameters()
Access the list of floating parameters.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:35
virtual LauParameter * getResonanceParameter(const TString &name)
Access the given resonance parameter.
Definition: LauKappaRes.cc:243
Double_t getM0Value() const
Get the m0 parameter value.
Definition: LauKappaRes.hh:128
void checkDaughterTypes() const
Check that Kappa daughters are K and pi.
Definition: LauKappaRes.cc:94
Bool_t fixM0Value() const
Fix the m0 parameter value.
Definition: LauKappaRes.hh:152
Abstract class for defining type for resonance amplitude models (Breit-Wigner, Flatte etc...
void rescale(Double_t scaleVal)
Scale this by a factor.
Definition: LauComplex.hh:285
Double_t initValue() const
The initial value of the parameter.
virtual void floatResonanceParameter(const TString &name)
Allow the various parameters to float in the fit.
Definition: LauKappaRes.cc:208
File containing LauConstants namespace.
Class for defining a complex number.
Definition: LauComplex.hh:47
TString getNameDaug1() const
Get the name of the first daughter of the resonance.
Bool_t fixB1Value() const
Fix the b1 parameter value.
Definition: LauKappaRes.hh:134
Double_t value() const
The value of the parameter.
Double_t getB1Value() const
Get the b1 parameter value.
Definition: LauKappaRes.hh:110
Int_t getSpin() const
Get the spin of the resonance.
virtual ~LauKappaRes()
Destructor.
Definition: LauKappaRes.cc:78
Double_t genValue() const
The value generated for the parameter.
const Double_t mK
Mass of K+- (GeV/c^2)
Definition: LauConstants.hh:44
File containing declaration of LauKappaRes class.
void clearFloatingParameters()
Clear list of floating parameters.
const Double_t mKSq
Square of K+- mass.
Definition: LauConstants.hh:69