laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauDaughters.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 "TSystem.h"
32 
33 #include "LauDatabasePDG.hh"
34 #include "LauDaughters.hh"
35 #include "LauKinematics.hh"
36 #include "LauParticlePDG.hh"
37 
39 
40 
41 LauDaughters::LauDaughters(Int_t codeParent, Int_t code1, Int_t code2, Int_t code3, Bool_t useSquareDP) :
42  kinematics_(0),
43  parent_(0),
44  symmetricalDP_(kFALSE),
45  fullySymmetricDP_(kFALSE),
46  flavourConjugateDP_(kFALSE)
47 {
48  this->createParticleLists();
49 
50  TString nameParent = LauDatabasePDG::string( codeParent );
51  TString name1 = LauDatabasePDG::string( code1 );
52  TString name2 = LauDatabasePDG::string( code2 );
53  TString name3 = LauDatabasePDG::string( code3 );
54  this->setParentType(nameParent);
55  this->setDaugType(name1, name2, name3);
56 
57  // Create kinematics object
58  kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), useSquareDP, symmetricalDP_, fullySymmetricDP_);
59 }
60 
61 LauDaughters::LauDaughters(const TString& nameParent, const TString& name1, const TString& name2, const TString& name3, Bool_t useSquareDP) :
62  kinematics_(0),
63  parent_(0),
64  symmetricalDP_(kFALSE),
65  fullySymmetricDP_(kFALSE),
66  flavourConjugateDP_(kFALSE)
67 {
68  this->createParticleLists();
69 
70  this->setParentType(nameParent);
71  this->setDaugType(name1, name2, name3);
72 
73  // Create kinematics object
74  kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), useSquareDP, symmetricalDP_, fullySymmetricDP_);
75 }
76 
78 {
79  delete kinematics_; kinematics_ = 0;
80 }
81 
83  kinematics_(0),
84  parent_(0),
85  symmetricalDP_(kFALSE),
86  fullySymmetricDP_(kFALSE),
87  flavourConjugateDP_(kFALSE)
88 {
89  this->createParticleLists();
90 
91  this->setParentType( rhs.getNameParent() );
92  this->setDaugType( rhs.getNameDaug1() , rhs.getNameDaug2() , rhs.getNameDaug3() );
93 
94  // Create kinematics object
95  kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), rhs.squareDP(), rhs.gotSymmetricalDP(), rhs.gotFullySymmetricDP());
96 }
97 
99 {
100  // Create list of allowed daughters
101  allowedDaughters_.clear();
107  allowedDaughters_.push_back(LauDatabasePDG::particle("K_S0"));
109  allowedDaughters_.push_back(LauDatabasePDG::particle("eta'"));
113  allowedDaughters_.push_back(LauDatabasePDG::particle("D0_bar"));
114  allowedDaughters_.push_back(LauDatabasePDG::particle("D_s+"));
115  allowedDaughters_.push_back(LauDatabasePDG::particle("D_s-"));
116 
117  // Create list of allowed parents
118  allowedParents_.clear();
119  allowedParents_.push_back(LauDatabasePDG::particle("B+"));
120  allowedParents_.push_back(LauDatabasePDG::particle("B-"));
121  allowedParents_.push_back(LauDatabasePDG::particle("B0"));
122  allowedParents_.push_back(LauDatabasePDG::particle("B0_bar"));
123  allowedParents_.push_back(LauDatabasePDG::particle("B_s0"));
124  allowedParents_.push_back(LauDatabasePDG::particle("B_s0_bar"));
125  allowedParents_.push_back(LauDatabasePDG::particle("D+"));
126  allowedParents_.push_back(LauDatabasePDG::particle("D-"));
127  allowedParents_.push_back(LauDatabasePDG::particle("D0"));
128  allowedParents_.push_back(LauDatabasePDG::particle("D0_bar"));
129  allowedParents_.push_back(LauDatabasePDG::particle("D_s+"));
130  allowedParents_.push_back(LauDatabasePDG::particle("D_s-"));
131 }
132 
133 void LauDaughters::setParentType(const TString& nameParent)
134 {
135  parent_ = 0;
136 
137  const Int_t codeParent = LauDatabasePDG::code( nameParent );
138 
139  for ( std::vector<const LauParticlePDG*>::const_iterator iter = allowedParents_.begin(); iter != allowedParents_.end(); ++iter ) {
140  const Int_t code = (*iter)->code();
141  if ( codeParent == code ) {
142  parent_ = (*iter);
143  std::cout<<"INFO in LauDaughters::setParentType : Setting parent to be "<<parent_->string()<<" == "<<parent_->code()<<std::endl;
144  break;
145  }
146  }
147 
148  if ( ! parent_ ) {
149  std::cerr<<"ERROR in LauDaughters::setParentType : Couldn't find a valid parent called \""<<nameParent<<"\"."<<std::endl;
150  gSystem->Exit(EXIT_FAILURE);
151  }
152 }
153 
154 void LauDaughters::setDaugType(const TString& name1, const TString& name2, const TString& name3)
155 {
156  const TString names[3] = { name1, name2, name3 };
157  const Int_t codes[3] = { LauDatabasePDG::code( name1 ), LauDatabasePDG::code( name2 ), LauDatabasePDG::code( name3 ) };
158 
159  daughters_.clear();
160  daughters_.resize(3);
161 
162  for ( int i(0); i<3; ++i ) {
163  for ( std::vector<const LauParticlePDG*>::const_iterator iter = allowedDaughters_.begin(); iter != allowedDaughters_.end(); ++iter ) {
164  Int_t code = (*iter)->code();
165  if ( codes[i] == code ) {
166  daughters_[i] = (*iter);
167  std::cout<<"INFO in LauDaughters::setDaugType : Setting daughter "<<i+1<<" to be "<<daughters_[i]->string()<<" == "<<daughters_[i]->code()<<std::endl;
168  break;
169  }
170  }
171  if ( ! daughters_[i] ) {
172  std::cerr<<"ERROR in LauDaughters::setDaugType : Couldn't find a valid daughter called \""<<names[i]<<"\"."<<std::endl;
173  gSystem->Exit(EXIT_FAILURE);
174  }
175  }
176 
177  // Initialise the various data members concerning particle masses
178  this->sanityCheck();
179 
180  // Check whether we have a symmetrical Dalitz plot
181  this->testDPSymmetry();
182 }
183 
185 {
186  // Check to see if we have a symmetrical or flavour-conjugate DP.
187 
188  symmetricalDP_ = kFALSE;
189  fullySymmetricDP_ = kFALSE;
190  flavourConjugateDP_ = kFALSE;
191 
192  if ( daughters_[0]->code() == daughters_[1]->code() && daughters_[0]->code() == daughters_[2]->code() ) {
193  std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a fully symmetric DP. "<<std::endl;
194  fullySymmetricDP_ = kTRUE;
195  } else if ( daughters_[0]->code() == daughters_[1]->code() ) {
196  std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a symmetrical DP. "<<std::endl;
197  symmetricalDP_ = kTRUE;
198  } else if ( daughters_[0]->code() == daughters_[2]->code() ) {
199  std::cerr<<"ERROR in LauDaughters::testDPSymmetry : daughter 1 and daughter 3 are both "<<daughters_[0]->string()<<" but DP can only fold on daughters 1 and 2."<<std::endl;
200  gSystem->Exit(EXIT_FAILURE);
201  } else if ( daughters_[1]->code() == daughters_[2]->code() ) {
202  std::cerr<<"ERROR in LauDaughters::testDPSymmetry : daughter 2 and daughter 3 are both "<<daughters_[1]->string()<<" but DP can only fold on daughters 1 and 2."<<std::endl;
203  gSystem->Exit(EXIT_FAILURE);
204  } else if ( daughters_[0]->type() == daughters_[1]->type() && daughters_[2]->charge() == 0 ) {
205  std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a flavour-conjugate DP. "<<std::endl;
206  flavourConjugateDP_ = kTRUE;
207  } else if ( daughters_[0]->type() == daughters_[2]->type() && daughters_[1]->charge() == 0 ) {
208  std::cerr<<"WARNING in LauDaughters::testDPSymmetry : it looks like we have a flavour-conjugate DP but the "<<daughters_[0]->string()<<" and "<<daughters_[2]->string()<<" are not positioned as daughters 1 and 2." << std::endl;
209  } else if ( daughters_[1]->type() == daughters_[2]->type() && daughters_[0]->charge() == 0 ) {
210  std::cerr<<"WARNING in LauDaughters::testDPSymmetry : it looks like we have a flavour-conjugate DP but the "<<daughters_[1]->string()<<" and "<<daughters_[2]->string()<<" are not positioned as daughters 1 and 2." << std::endl;
211  }
212 }
213 
215 {
216  // Check masses and charges of daughters
217 
218  Int_t totCharge(0);
219  Double_t totMass(0.0);
220 
221  for ( std::vector<const LauParticlePDG*>::const_iterator iter = daughters_.begin(); iter != daughters_.end(); ++iter ) {
222  totCharge += (*iter)->charge();
223  totMass += (*iter)->mass();
224  }
225 
226  if (totCharge != parent_->charge()) {
227  std::cerr<<"ERROR in LauDaughters::sanityCheck : Total charge of daughters ("<<totCharge<<") not equal to charge of parent ("<<parent_->charge()<<")."<<std::endl;
228  gSystem->Exit(EXIT_FAILURE);
229  }
230 
231  if (totMass > parent_->mass()) {
232  std::cerr<<"ERROR in LauDaughters::sanityCheck : Total mass of daughters ("<<totMass<<") greater than mass of parent ("<<parent_->mass()<<")."<<std::endl;
233  gSystem->Exit(EXIT_FAILURE);
234  }
235 }
236 
238 {
239  return daughters_[0]->mass();
240 }
241 
243 {
244  return daughters_[1]->mass();
245 }
246 
248 {
249  return daughters_[2]->mass();
250 }
251 
253 {
254  return parent_->mass();
255 }
256 
258 {
259  return daughters_[0]->string();
260 }
261 
263 {
264  return daughters_[1]->string();
265 }
266 
268 {
269  return daughters_[2]->string();
270 }
271 
273 {
274  return parent_->string();
275 }
276 
278 {
279  return daughters_[0]->stringAlphaNum();
280 }
281 
283 {
284  return daughters_[1]->stringAlphaNum();
285 }
286 
288 {
289  return daughters_[2]->stringAlphaNum();
290 }
291 
293 {
294  return parent_->stringAlphaNum();
295 }
296 
298 {
299  return daughters_[0]->code();
300 }
301 
303 {
304  return daughters_[1]->code();
305 }
306 
308 {
309  return daughters_[2]->code();
310 }
311 
313 {
314  return parent_->code();
315 }
316 
318 {
319  return daughters_[0]->charge();
320 }
321 
323 {
324  return daughters_[1]->charge();
325 }
326 
328 {
329  return daughters_[2]->charge();
330 }
331 
333 {
334  return parent_->charge();
335 }
336 
337 Int_t LauDaughters::getCharge(Int_t resPairAmpInt) const
338 {
339  Int_t charge = this->getChargeParent();
340  if ( resPairAmpInt>0 && resPairAmpInt<4 ) {
341  charge -= daughters_[resPairAmpInt-1]->charge();
342  }
343  return charge;
344 }
345 
TString string() const
Particle name.
Double_t getMassParent() const
Get mass of the parent particle.
TString getNameDaug1() const
Get name of the first daughter particle.
Int_t getChargeDaug3() const
Get charge of the third daughter particle.
Double_t mass() const
The mass of the particle.
Int_t charge() const
The charge of the particle.
TString getSanitisedNameParent() const
Get sanitised name of the parent particle.
Int_t getTypeDaug1() const
Get PDG code of the first daughter particle.
Bool_t fullySymmetricDP_
Boolean flag for fully symmetric Dalitz plot.
void setParentType(const TString &nameParent)
Set the parent particle type.
virtual ~LauDaughters()
Destructor.
Definition: LauDaughters.cc:77
LauDaughters(Int_t codeParent, Int_t code1, Int_t code2, Int_t code3, Bool_t useSquareDP=kFALSE)
Constructor from PDG codes.
Definition: LauDaughters.cc:41
TString getSanitisedNameDaug3() const
Get sanitised name of the third daughter particle.
ClassImp(LauAbsCoeffSet)
void createParticleLists()
Create list of all the allowed parent/daughter particles.
Definition: LauDaughters.cc:98
const LauParticlePDG * parent_
The parent particle.
Class that defines the particular 3-body decay under study.
Definition: LauDaughters.hh:47
Int_t getTypeParent() const
Get PDG code of the parent particle.
Int_t getCharge(Int_t resPairAmpInt) const
Get charge of a particular two-daughter combination.
void testDPSymmetry()
Check whether there is a symmetrical Dalitz plot.
LauParameter * parent_
The parent parameter.
File containing declaration of LauDaughters class.
Int_t getChargeDaug1() const
Get charge of the first daughter particle.
LauKinematics * kinematics_
Dalitz plot kinematics.
Bool_t flavourConjugateDP_
Flavour-conjugate Dalitz plot.
Bool_t symmetricalDP_
Boolean flag for symmetrical Dalitz plot.
TString getNameDaug2() const
Get name of the second daughter particle.
Bool_t squareDP() const
Determine to use or not the square Dalitz plot.
Definition: LauDaughters.hh:98
Double_t getMassDaug2() const
Get mass of second daughter particle.
File containing declaration of LauKinematics class.
TString getSanitisedNameDaug1() const
Get sanitised name of the first daughter particle.
TString getSanitisedNameDaug2() const
Get sanitised name of the second daughter particle.
Bool_t gotSymmetricalDP() const
Is Dalitz plot symmetric, i.e. 2 identical particles.
Definition: LauDaughters.hh:80
std::vector< const LauParticlePDG * > daughters_
The daughter particles.
TString stringAlphaNum() const
Particle name, containing only alphanumeric characters.
Int_t getChargeDaug2() const
Get charge of the second daughter particle.
File containing declaration of LauDatabasePDG class.
std::vector< const LauParticlePDG * > allowedParents_
All possible parent types.
File containing declaration of LauParticlePDG class.
static const LauParticlePDG * particle(Int_t code)
Get particle object based on the PDG code.
Int_t getTypeDaug3() const
Get PDG code of the third daughter particle.
Int_t getTypeDaug2() const
Get PDG code of the second daughter particle.
TString getNameParent() const
Get name of the parent particle.
void setDaugType(const TString &name1, const TString &name2, const TString &name3)
Set the three daughter types.
Bool_t gotFullySymmetricDP() const
Is Dalitz plot fully symmetric, i.e. 3 identical particles.
Definition: LauDaughters.hh:86
Int_t getChargeParent() const
Get charge of the parent particle.
Double_t getMassDaug1() const
Get mass of first daughter particle.
Class for calculating 3-body kinematic quantities.
void sanityCheck()
Check masses and charges of daughters.
std::vector< const LauParticlePDG * > allowedDaughters_
All possible daughter types.
static Int_t code(const TString &string)
Method to convert from a particle name string into a PDG code.
Double_t getMassDaug3() const
Get mass of third daughter particle.
TString getNameDaug3() const
Get name of the third daughter particle.
Int_t code() const
The particle PDG code.
static TString string(Int_t code)
Method to convert from a PDG code to a particle name string.