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