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