laura is hosted by Hepforge, IPPP Durham
Laura++  v3r0p1
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauDabbaRes.cc
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2010 - 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 
16 #include <iostream>
17 
18 #include "LauConstants.hh"
19 #include "LauDabbaRes.hh"
20 #include "LauResonanceInfo.hh"
21 
23 
24 
25 LauDabbaRes::LauDabbaRes(LauResonanceInfo* resInfo, const Int_t resPairAmpInt, const LauDaughters* daughters) :
26  LauAbsResonance(resInfo, resPairAmpInt, daughters),
27  mSumSq_(0.0),
28  sAdler_(0.0),
29  b_(0),
30  alpha_(0),
31  beta_(0)
32 {
33  // Default constant factors
34  const Double_t bVal = 24.49;
35  const Double_t alphaVal = 0.1;
36  const Double_t betaVal = 0.1;
37 
38  const TString& parNameBase = this->getSanitisedName();
39 
40  TString bName(parNameBase);
41  bName += "_b";
42  b_ = resInfo->getExtraParameter( bName );
43  if ( b_ == 0 ) {
44  b_ = new LauParameter( bName, bVal, 0.0, 100.0, kTRUE );
45  b_->secondStage(kTRUE);
46  resInfo->addExtraParameter( b_ );
47  }
48 
49  TString alphaName(parNameBase);
50  alphaName += "_alpha";
51  alpha_ = resInfo->getExtraParameter( alphaName );
52  if ( alpha_ == 0 ) {
53  alpha_ = new LauParameter( alphaName, alphaVal, 0.0, 10.0, kTRUE );
54  alpha_->secondStage(kTRUE);
55  resInfo->addExtraParameter( alpha_ );
56  }
57 
58  TString betaName(parNameBase);
59  betaName += "_beta";
60  beta_ = resInfo->getExtraParameter( betaName );
61  if ( beta_ == 0 ) {
62  beta_ = new LauParameter( betaName, betaVal, 0.0, 10.0, kTRUE );
63  beta_->secondStage(kTRUE);
64  resInfo->addExtraParameter( beta_ );
65  }
66 }
67 
69 {
70 }
71 
73 {
74  // check that we have a D and a pi
75  this->checkDaughterTypes();
76 
77  // Initialise various constants
78  Double_t massDaug1 = this->getMassDaug1();
79  Double_t massDaug2 = this->getMassDaug2();
80 
81  Double_t mSum = massDaug1 + massDaug2;
82  mSumSq_ = mSum*mSum;
83 
84  Double_t massDaug1Sq = massDaug1*massDaug1;
85  Double_t massDaug2Sq = massDaug2*massDaug2;
86  sAdler_ = TMath::Max(massDaug1Sq,massDaug2Sq) - 0.5*TMath::Min(massDaug1Sq,massDaug2Sq); // Adler zero at (mD)^2 - 0.5*(mpi)^2
87 
88  Int_t resSpin = this->getSpin();
89  if (resSpin != 0) {
90  std::cerr << "WARNING in LauDabbaRes::initialise : Spin = " << resSpin << " is not zero! It will be ignored anyway!" << std::endl;
91  }
92 }
93 
95 {
96  // Check that the daughter tracks are D and pi. Otherwise issue a warning.
97  Int_t resPairAmpInt = this->getPairInt();
98  if (resPairAmpInt < 1 || resPairAmpInt > 3) {
99  std::cerr << "WARNING in LauDabbaRes::checkDaughterTypes : resPairAmpInt = " << resPairAmpInt << " is out of the range [1,2,3]." << std::endl;
100  return;
101  }
102 
103  // Check that daughter types agree
104  const TString& nameDaug1 = this->getNameDaug1();
105  const TString& nameDaug2 = this->getNameDaug2();
106  if ( !( nameDaug1.Contains("pi", TString::kIgnoreCase) && nameDaug2.Contains("d", TString::kIgnoreCase) ) ) {
107  if ( !( nameDaug2.Contains("pi", TString::kIgnoreCase) && nameDaug1.Contains("d", TString::kIgnoreCase) ) ) {
108  std::cerr << "ERROR in LauDabbaRes::checkDaughterTypes : Dabba model is using daughters \"" << nameDaug1 << "\" and \"" << nameDaug2 << "\" that are not a D meson and a pion." << std::endl;
109  }
110  }
111 }
112 
113 LauComplex LauDabbaRes::resAmp(Double_t mass, Double_t spinTerm)
114 {
115  // This function returns the complex dynamical amplitude for a Dabba distribution
116  // given the invariant mass and cos(helicity) values.
117 
118  // Invariant mass squared combination for the system
119  Double_t s = mass*mass;
120 
121  // Dabba is spin zero - so there are no helicity factors.
122  // Just set it to 1.0 in case anyone decides to use it at a later date.
123  spinTerm = 1.0;
124 
125  // Phase-space factor
126  Double_t rho(0.0);
127  Double_t sDiff = s - mSumSq_;
128  if ( sDiff > 0.0 ) {
129  rho = TMath::Sqrt(1.0 - mSumSq_/s);
130  }
131 
132  const Double_t bVal = this->getBValue();
133  const Double_t alphaVal = this->getAlphaValue();
134  const Double_t betaVal = this->getBetaValue();
135 
136  Double_t realPart = 1.0 - betaVal * sDiff;
137 
138  Double_t imagPart = bVal * TMath::Exp( - alphaVal * sDiff ) * ( s - sAdler_ ) * rho;
139 
140  LauComplex resAmplitude( realPart, imagPart );
141 
142  Double_t denomFactor = realPart*realPart + imagPart*imagPart;
143 
144  Double_t invDenomFactor = 0.0;
145  if (denomFactor > 1e-10) {invDenomFactor = 1.0/denomFactor;}
146 
147  resAmplitude.rescale(spinTerm*invDenomFactor);
148 
149  return resAmplitude;
150 }
151 
152 const std::vector<LauParameter*>& LauDabbaRes::getFloatingParameters()
153 {
154  this->clearFloatingParameters();
155 
156  if ( ! this->fixBValue() ) {
157  this->addFloatingParameter( b_ );
158  }
159 
160  if ( ! this->fixAlphaValue() ) {
161  this->addFloatingParameter( alpha_ );
162  }
163 
164  if ( ! this->fixBetaValue() ) {
165  this->addFloatingParameter( beta_ );
166  }
167 
168  return this->getParameters();
169 }
170 
171 void LauDabbaRes::setResonanceParameter(const TString& name, const Double_t value)
172 {
173  // Set various parameters for the lineshape
174  if (name == "b") {
175  this->setBValue(value);
176  std::cout << "INFO in LauDabbaRes::setResonanceParameter : Setting parameter b = " << this->getBValue() << std::endl;
177  }
178  else if (name == "alpha") {
179  this->setAlphaValue(value);
180  std::cout << "INFO in LauDabbaRes::setResonanceParameter : Setting parameter alpha = " << this->getAlphaValue() << std::endl;
181  }
182  else if (name == "beta") {
183  this->setBetaValue(value);
184  std::cout << "INFO in LauDabbaRes::setResonanceParameter : Setting parameter beta = " << this->getBetaValue() << std::endl;
185  }
186  else {
187  std::cerr << "WARNING in LauDabbaRes::setResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
188  }
189 }
190 
192 {
193  if (name == "b") {
194  if ( b_->fixed() ) {
195  b_->fixed( kFALSE );
196  this->addFloatingParameter( b_ );
197  } else {
198  std::cerr << "WARNING in LauDabbaRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
199  }
200  } else if (name == "alpha") {
201  if ( alpha_->fixed() ) {
202  alpha_->fixed( kFALSE );
203  this->addFloatingParameter( alpha_ );
204  } else {
205  std::cerr << "WARNING in LauDabbaRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
206  }
207  } else if (name == "beta") {
208  if ( beta_->fixed() ) {
209  beta_->fixed( kFALSE );
210  this->addFloatingParameter( beta_ );
211  } else {
212  std::cerr << "WARNING in LauDabbaRes::floatResonanceParameter: Parameter already floating. No parameter changes made." << std::endl;
213  }
214  } else {
215  std::cerr << "WARNING in LauDabbaRes::fixResonanceParameter: Parameter name not reconised. No parameter changes made." << std::endl;
216  }
217 }
218 
220 {
221  if (name == "b") {
222  return b_;
223  } else if (name == "alpha") {
224  return alpha_;
225  } else if (name == "beta") {
226  return beta_;
227  } else {
228  std::cerr << "WARNING in LauDabbaRes::getResonanceParameter: Parameter name not reconised." << std::endl;
229  return 0;
230  }
231 }
232 
233 void LauDabbaRes::setBValue(const Double_t b)
234 {
235  b_->value( b );
236  b_->genValue( b );
237  b_->initValue( b );
238 }
239 
240 void LauDabbaRes::setAlphaValue(const Double_t alpha)
241 {
242  alpha_->value( alpha );
243  alpha_->genValue( alpha );
244  alpha_->initValue( alpha );
245 }
246 
247 void LauDabbaRes::setBetaValue(const Double_t beta)
248 {
249  beta_->value( beta );
250  beta_->genValue( beta );
251  beta_->initValue( beta );
252 }
253 
void setBValue(const Double_t b)
Set the b parameter.
Definition: LauDabbaRes.cc:233
Bool_t fixed() const
Check whether the parameter is fixed or floated.
Double_t getBetaValue() const
Get the beta parameter value.
Definition: LauDabbaRes.hh:115
virtual const std::vector< LauParameter * > & getFloatingParameters()
Retrieve the resonance parameters, e.g. so that they can be loaded into a fit.
Definition: LauDabbaRes.cc:152
Double_t getAlphaValue() const
Get the alpha parameter value.
Definition: LauDabbaRes.hh:109
Bool_t fixBetaValue() const
Fix the beta parameter value.
Definition: LauDabbaRes.hh:133
File containing declaration of LauResonanceInfo class.
LauParameter * beta_
Constant factor.
Definition: LauDabbaRes.hh:162
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
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: LauDabbaRes.cc:113
Double_t mSumSq_
Defined as mD + mPi all squared.
Definition: LauDabbaRes.hh:153
Double_t getMassDaug1() const
Get the mass of daughter 1.
Int_t getPairInt() const
Get the integer to identify which DP axis the resonance belongs to.
Double_t getMassDaug2() const
Get the mass of daughter 2.
Bool_t fixBValue() const
Fix the b parameter value.
Definition: LauDabbaRes.hh:121
void addFloatingParameter(LauParameter *param)
Add parameter to the list of floating parameters.
LauParameter * b_
Constant factor.
Definition: LauDabbaRes.hh:158
virtual void initialise()
Initialise the model.
Definition: LauDabbaRes.cc:72
std::vector< LauParameter * > & getParameters()
Access the list of floating parameters.
File containing declaration of LauDabbaRes class.
const Double_t beta
Angle beta of the unitarity triangle.
Definition: LauConstants.hh:84
Class for defining the fit parameter objects.
Definition: LauParameter.hh:34
virtual void setResonanceParameter(const TString &name, const Double_t value)
Set value of the various parameters.
Definition: LauDabbaRes.cc:171
virtual LauParameter * getResonanceParameter(const TString &name)
Access the given resonance parameter.
Definition: LauDabbaRes.cc:219
virtual ~LauDabbaRes()
Destructor.
Definition: LauDabbaRes.cc:68
void setAlphaValue(const Double_t alpha)
Set the alpha parameter.
Definition: LauDabbaRes.cc:240
Abstract class for defining type for resonance amplitude models (Breit-Wigner, Flatte etc...
Class for defining the Dabba resonance model.
Definition: LauDabbaRes.hh:31
LauParameter * alpha_
Constant factor.
Definition: LauDabbaRes.hh:160
Double_t initValue() const
The initial value of the parameter.
void checkDaughterTypes() const
Check that the daughter particles are D and pi.
Definition: LauDabbaRes.cc:94
File containing LauConstants namespace.
Bool_t fixAlphaValue() const
Fix the alpha parameter value.
Definition: LauDabbaRes.hh:127
Double_t sAdler_
Defined as mD*mD - 0.5*mPi*mPi.
Definition: LauDabbaRes.hh:155
Class for defining a complex number.
Definition: LauComplex.hh:47
virtual void floatResonanceParameter(const TString &name)
Allow the various parameters to float in the fit.
Definition: LauDabbaRes.cc:191
TString getNameDaug1() const
Get the name of the first daughter of the resonance.
Double_t value() const
The value of the parameter.
void setBetaValue(const Double_t beta)
Set the beta parameter.
Definition: LauDabbaRes.cc:247
Double_t getBValue() const
Get the b parameter value.
Definition: LauDabbaRes.hh:103
Int_t getSpin() const
Get the spin of the resonance.
Double_t genValue() const
The value generated for the parameter.
void clearFloatingParameters()
Clear list of floating parameters.