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