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