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