laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauNRAmplitude.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 "LauNRAmplitude.hh"
30 
31 #include "LauKinematics.hh"
32 #include "LauResonanceInfo.hh"
33 
34 #include <iostream>
35 
37  const Int_t resPairAmpInt,
38  const LauDaughters* daughters ) :
39  LauAbsResonance( resInfo, resPairAmpInt, daughters ),
40  d_( 0 ),
41  c1_( 0 ),
42  c2_( 0 ),
43  p1_( 0 ),
44  p2_( 0 )
45 {
46  // Default values for parameters, taken from arXiv:0709.0075v1 [hep-ph]
47  const Double_t dVal( 1.3232e-3 );
48  const Double_t c1Val( 0.65 );
49  const Double_t c2Val( 0.55 );
50  const Double_t p1Val( 18.0 );
51  const Double_t p2Val( 15.0 );
52 
53  const TString& parNameBase = this->getSanitisedName();
54 
55  TString dName( parNameBase );
56  dName += "_d";
57  d_ = resInfo->getExtraParameter( dName );
58  if ( d_ == 0 ) {
59  d_ = new LauParameter( dName, dVal, 0.0, 1.0, kTRUE );
60  d_->secondStage( kTRUE );
61  resInfo->addExtraParameter( d_ );
62  }
63 
64  TString c1Name( parNameBase );
65  c1Name += "_c1";
66  c1_ = resInfo->getExtraParameter( c1Name );
67  if ( c1_ == 0 ) {
68  c1_ = new LauParameter( c1Name, c1Val, 0.0, 2.0, kTRUE );
69  c1_->secondStage( kTRUE );
70  resInfo->addExtraParameter( c1_ );
71  }
72 
73  TString c2Name( parNameBase );
74  c2Name += "_c2";
75  c2_ = resInfo->getExtraParameter( c2Name );
76  if ( c2_ == 0 ) {
77  c2_ = new LauParameter( c2Name, c2Val, 0.0, 2.0, kTRUE );
78  c2_->secondStage( kTRUE );
79  resInfo->addExtraParameter( c2_ );
80  }
81 
82  TString p1Name( parNameBase );
83  p1Name += "_p1";
84  p1_ = resInfo->getExtraParameter( p1Name );
85  if ( p1_ == 0 ) {
86  p1_ = new LauParameter( p1Name, p1Val, 0.0, 50.0, kTRUE );
87  p1_->secondStage( kTRUE );
88  resInfo->addExtraParameter( p1_ );
89  }
90 
91  TString p2Name( parNameBase );
92  p2Name += "_p2";
93  p2_ = resInfo->getExtraParameter( p2Name );
94  if ( p2_ == 0 ) {
95  p2_ = new LauParameter( p2Name, p2Val, 0.0, 50.0, kTRUE );
96  p2_->secondStage( kTRUE );
97  resInfo->addExtraParameter( p2_ );
98  }
99 }
100 
102 {
103 }
104 
106 {
107 }
108 
110 {
111  // Get the information from the kinematics object
112  const Double_t m13Sq = kinematics->getm13Sq();
113  const Double_t m23Sq = kinematics->getm23Sq();
114  const Double_t m13 = kinematics->getm13();
115  const Double_t m23 = kinematics->getm23();
116 
117  // Calculate the magnitude
118  Double_t magnitude = TMath::Sqrt(
119  m13 * m23 * this->f( m23Sq, c1_->unblindValue(), p1_->unblindValue() ) *
120  this->f( m13Sq, c2_->unblindValue(), p2_->unblindValue() ) *
121  TMath::Exp( -1.0 * d_->unblindValue() * m13Sq * m13Sq * m23Sq * m23Sq ) );
122 
123  // return the amplitude
124  LauComplex resAmplitude( magnitude, 0.0 );
125  return resAmplitude;
126 }
127 
128 LauComplex LauNRAmplitude::resAmp( Double_t mass, Double_t spinTerm )
129 {
130  std::cerr << "ERROR in LauNRAmplitude::resAmp : This method shouldn't get called." << std::endl;
131  std::cerr << " Returning zero amplitude for mass = " << mass
132  << " and spinTerm = " << spinTerm << "." << std::endl;
133  return LauComplex( 0.0, 0.0 );
134 }
135 
136 Double_t LauNRAmplitude::f( const Double_t s, const Double_t c, const Double_t p ) const
137 {
138  return 1.0 / ( 1.0 + TMath::Exp( c * ( s - p ) ) );
139 }
140 
141 const std::vector<LauParameter*>& LauNRAmplitude::getFloatingParameters()
142 {
143  this->clearFloatingParameters();
144 
145  if ( ! this->fixdParameter() ) {
146  this->addFloatingParameter( d_ );
147  }
148 
149  if ( ! this->fixc1Parameter() ) {
150  this->addFloatingParameter( c1_ );
151  }
152 
153  if ( ! this->fixc2Parameter() ) {
154  this->addFloatingParameter( c2_ );
155  }
156 
157  if ( ! this->fixp1Parameter() ) {
158  this->addFloatingParameter( p1_ );
159  }
160 
161  if ( ! this->fixp2Parameter() ) {
162  this->addFloatingParameter( p2_ );
163  }
164 
165  return this->getParameters();
166 }
167 
168 void LauNRAmplitude::setResonanceParameter( const TString& name, const Double_t value )
169 {
170  // Set various parameters for the NRAmplitude lineshape dynamics
171  if ( name == "d" ) {
172  this->setdParameter( value );
173  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude d = "
174  << this->getdParameter() << std::endl;
175  } else if ( name == "c1" ) {
176  this->setc1Parameter( value );
177  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude c1 = "
178  << this->getc1Parameter() << std::endl;
179  } else if ( name == "c2" ) {
180  this->setc2Parameter( value );
181  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude c2 = "
182  << this->getc2Parameter() << std::endl;
183  } else if ( name == "p1" ) {
184  this->setp1Parameter( value );
185  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude p1 = "
186  << this->getp1Parameter() << std::endl;
187  } else if ( name == "p2" ) {
188  this->setp2Parameter( value );
189  std::cout << "INFO in LauNRAmplitude::setResonanceParameter : Setting NRAmplitude p2 = "
190  << this->getp2Parameter() << std::endl;
191  } else {
192  std::cerr << "WARNING in LauNRAmplitude::setResonanceParameter: Parameter name not reconised. No parameter changes made."
193  << std::endl;
194  }
195 }
196 
198 {
199  if ( name == "d" ) {
200  if ( d_->fixed() ) {
201  d_->fixed( kFALSE );
202  this->addFloatingParameter( d_ );
203  } else {
204  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made."
205  << std::endl;
206  }
207  } else if ( name == "c1" ) {
208  if ( c1_->fixed() ) {
209  c1_->fixed( kFALSE );
210  this->addFloatingParameter( c1_ );
211  } else {
212  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made."
213  << std::endl;
214  }
215  } else if ( name == "c2" ) {
216  if ( c2_->fixed() ) {
217  c2_->fixed( kFALSE );
218  this->addFloatingParameter( c2_ );
219  } else {
220  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made."
221  << std::endl;
222  }
223  } else if ( name == "p1" ) {
224  if ( p1_->fixed() ) {
225  p1_->fixed( kFALSE );
226  this->addFloatingParameter( p1_ );
227  } else {
228  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made."
229  << std::endl;
230  }
231  } else if ( name == "p2" ) {
232  if ( p2_->fixed() ) {
233  p2_->fixed( kFALSE );
234  this->addFloatingParameter( p2_ );
235  } else {
236  std::cerr << "WARNING in LauNRAmplitude::floatResonanceParameter: Parameter already floating. No parameter changes made."
237  << std::endl;
238  }
239  } else {
240  std::cerr << "WARNING in LauNRAmplitude::fixResonanceParameter: Parameter name not reconised. No parameter changes made."
241  << std::endl;
242  }
243 }
244 
246 {
247  if ( name == "d" ) {
248  return d_;
249  } else if ( name == "c1" ) {
250  return c1_;
251  } else if ( name == "c2" ) {
252  return c2_;
253  } else if ( name == "p1" ) {
254  return p1_;
255  } else if ( name == "p2" ) {
256  return p2_;
257  } else {
258  std::cerr << "WARNING in LauNRAmplitude::getResonanceParameter: Parameter name not reconised."
259  << std::endl;
260  return 0;
261  }
262 }
263 
264 void LauNRAmplitude::setdParameter( const Double_t d )
265 {
266  d_->value( d );
267  d_->genValue( d );
268  d_->initValue( d );
269 }
270 
271 void LauNRAmplitude::setc1Parameter( const Double_t c1 )
272 {
273  c1_->value( c1 );
274  c1_->genValue( c1 );
275  c1_->initValue( c1 );
276 }
277 
278 void LauNRAmplitude::setc2Parameter( const Double_t c2 )
279 {
280  c2_->value( c2 );
281  c2_->genValue( c2 );
282  c2_->initValue( c2 );
283 }
284 
285 void LauNRAmplitude::setp1Parameter( const Double_t p1 )
286 {
287  p1_->value( p1 );
288  p1_->genValue( p1 );
289  p1_->initValue( p1 );
290 }
291 
292 void LauNRAmplitude::setp2Parameter( const Double_t p2 )
293 {
294  p2_->value( p2 );
295  p2_->genValue( p2 );
296  p2_->initValue( p2 );
297 }
File containing declaration of LauResonanceInfo class.
const TString & getSanitisedName() const
Get the name of the resonance.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:49
Double_t unblindValue() const
The unblinded value of the parameter.
Bool_t fixc1Parameter() const
See if the c1 parameter is fixed or floating.
Double_t value() const
The value of the parameter.
Double_t getdParameter() const
Get the d parameter value.
LauParameter * p2_
Parameter from arXiv:0709.0075v1 [hep-ph].
std::vector< LauParameter * > & getParameters()
Access the list of floating parameters.
LauParameter * p1_
Parameter from arXiv:0709.0075v1 [hep-ph].
virtual void setResonanceParameter(const TString &name, const Double_t value)
Set value of a resonance parameter.
virtual LauComplex amplitude(const LauKinematics *kinematics)
Complex resonant amplitude.
LauParameter * getExtraParameter(const TString &parName)
Retrieve an extra parameter of the resonance.
LauNRAmplitude(LauResonanceInfo *resInfo, const Int_t resPairAmpInt, const LauDaughters *daughters)
Constructor.
Bool_t fixc2Parameter() const
See if the c2 parameter is fixed or floating.
File containing declaration of LauNRAmplitude class.
LauParameter * d_
Parameter from arXiv:0709.0075v1 [hep-ph].
void setdParameter(const Double_t d)
Set the d parameter value.
Bool_t secondStage() const
Check whether the parameter should be floated only in the second stage of a two stage fit.
void setp1Parameter(const Double_t p1)
Set the p1 parameter value.
Class for defining a complex number.
Definition: LauComplex.hh:61
void addFloatingParameter(LauParameter *param)
Add parameter to the list of floating parameters.
Double_t getp2Parameter() const
Get the p2 parameter value.
Double_t getm23() const
Get the m23 invariant mass.
virtual void floatResonanceParameter(const TString &name)
Allow the various parameters to float in the fit.
virtual LauParameter * getResonanceParameter(const TString &name)
Access the given resonance parameter.
Double_t getc2Parameter() const
Get the c2 parameter value.
Bool_t fixdParameter() const
See if the d parameter is fixed or floating.
Bool_t fixp1Parameter() const
See if the p1 parameter is fixed or floating.
void setc2Parameter(const Double_t c2)
Set the c2 parameter value.
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
Double_t f(const Double_t s, const Double_t c, const Double_t p) const
Evaluate the expression 1.0 / (1.0 + TMath::Exp( c * (s-p) ))
Double_t getm13() const
Get the m13 invariant mass.
Class for defining the properties of a resonant particle.
const TString & name() const
The parameter name.
void setc1Parameter(const Double_t c1)
Set the c1 parameter value.
Double_t getp1Parameter() const
Get the p1 parameter value.
Double_t getc1Parameter() const
Get the c1 parameter value.
LauParameter * c1_
Parameter from arXiv:0709.0075v1 [hep-ph].
virtual const std::vector< LauParameter * > & getFloatingParameters()
Retrieve the resonance parameters, e.g. so that they can be loaded into a fit.
Bool_t fixp2Parameter() const
See if the p2 parameter is fixed or floating.
void clearFloatingParameters()
Clear list of floating parameters.
Abstract class for defining type for resonance amplitude models (Breit-Wigner, Flatte etc....
LauParameter * c2_
Parameter from arXiv:0709.0075v1 [hep-ph].
Class for calculating 3-body kinematic quantities.
Double_t genValue() const
The value generated for the parameter.
virtual LauComplex resAmp(Double_t mass, Double_t spinTerm)
This is not meant to be called.
virtual void initialise()
Initialise the model.
Class that defines the particular 3-body decay under study.
Definition: LauDaughters.hh:47
Double_t getm23Sq() const
Get the m23 invariant mass square.
void setp2Parameter(const Double_t p2)
Set the p2 parameter value.
Double_t getm13Sq() const
Get the m13 invariant mass square.
Double_t initValue() const
The initial value of the parameter.
virtual ~LauNRAmplitude()
Destructor.
File containing declaration of LauKinematics class.