laura is hosted by Hepforge, IPPP Durham
Laura++  v3r3
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauDaughters.cc
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2004 - 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
15 #include <iostream>
16 
17 #include "TSystem.h"
18 
19 #include "LauDatabasePDG.hh"
20 #include "LauDaughters.hh"
21 #include "LauKinematics.hh"
22 #include "LauParticlePDG.hh"
23 
25 
26 
27 LauDaughters::LauDaughters(Int_t codeParent, Int_t code1, Int_t code2, Int_t code3, Bool_t useSquareDP) :
28  kinematics_(0),
29  parent_(0),
30  symmetricalDP_(kFALSE),
31  fullySymmetricDP_(kFALSE),
32  flavourConjugateDP_(kFALSE)
33 {
34  this->createParticleLists();
35 
36  TString nameParent = LauDatabasePDG::string( codeParent );
37  TString name1 = LauDatabasePDG::string( code1 );
38  TString name2 = LauDatabasePDG::string( code2 );
39  TString name3 = LauDatabasePDG::string( code3 );
40  this->setParentType(nameParent);
41  this->setDaugType(name1, name2, name3);
42 
43  // Create kinematics object
44  kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), useSquareDP, symmetricalDP_, fullySymmetricDP_);
45 }
46 
47 LauDaughters::LauDaughters(const TString& nameParent, const TString& name1, const TString& name2, const TString& name3, Bool_t useSquareDP) :
48  kinematics_(0),
49  parent_(0),
50  symmetricalDP_(kFALSE),
51  fullySymmetricDP_(kFALSE),
52  flavourConjugateDP_(kFALSE)
53 {
54  this->createParticleLists();
55 
56  this->setParentType(nameParent);
57  this->setDaugType(name1, name2, name3);
58 
59  // Create kinematics object
60  kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), useSquareDP, symmetricalDP_, fullySymmetricDP_);
61 }
62 
64 {
65  delete kinematics_; kinematics_ = 0;
66 }
67 
69  kinematics_(0),
70  parent_(0),
71  symmetricalDP_(kFALSE),
72  fullySymmetricDP_(kFALSE),
73  flavourConjugateDP_(kFALSE)
74 {
75  this->createParticleLists();
76 
77  this->setParentType( rhs.getNameParent() );
78  this->setDaugType( rhs.getNameDaug1() , rhs.getNameDaug2() , rhs.getNameDaug3() );
79 
80  // Create kinematics object
81  kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), rhs.squareDP(), rhs.gotSymmetricalDP(), rhs.gotFullySymmetricDP());
82 }
83 
85 {
86  // Create list of allowed daughters
87  allowedDaughters_.clear();
99  allowedDaughters_.push_back(LauDatabasePDG::particle("D0_bar"));
100  allowedDaughters_.push_back(LauDatabasePDG::particle("D_s+"));
101  allowedDaughters_.push_back(LauDatabasePDG::particle("D_s-"));
102 
103  // Create list of allowed parents
104  allowedParents_.clear();
105  allowedParents_.push_back(LauDatabasePDG::particle("B+"));
106  allowedParents_.push_back(LauDatabasePDG::particle("B-"));
107  allowedParents_.push_back(LauDatabasePDG::particle("B0"));
108  allowedParents_.push_back(LauDatabasePDG::particle("B0_bar"));
109  allowedParents_.push_back(LauDatabasePDG::particle("B_s0"));
110  allowedParents_.push_back(LauDatabasePDG::particle("B_s0_bar"));
111  allowedParents_.push_back(LauDatabasePDG::particle("D+"));
112  allowedParents_.push_back(LauDatabasePDG::particle("D-"));
113  allowedParents_.push_back(LauDatabasePDG::particle("D0"));
114  allowedParents_.push_back(LauDatabasePDG::particle("D0_bar"));
115  allowedParents_.push_back(LauDatabasePDG::particle("D_s+"));
116  allowedParents_.push_back(LauDatabasePDG::particle("D_s-"));
117 }
118 
119 void LauDaughters::setParentType(const TString& nameParent)
120 {
121  parent_ = 0;
122 
123  const Int_t codeParent = LauDatabasePDG::code( nameParent );
124 
125  for ( std::vector<const LauParticlePDG*>::const_iterator iter = allowedParents_.begin(); iter != allowedParents_.end(); ++iter ) {
126  const Int_t code = (*iter)->code();
127  if ( codeParent == code ) {
128  parent_ = (*iter);
129  std::cout<<"INFO in LauDaughters::setParentType : Setting parent to be "<<parent_->string()<<" == "<<parent_->code()<<std::endl;
130  break;
131  }
132  }
133 
134  if ( ! parent_ ) {
135  std::cerr<<"ERROR in LauDaughters::setParentType : Couldn't find a valid parent called \""<<nameParent<<"\"."<<std::endl;
136  gSystem->Exit(EXIT_FAILURE);
137  }
138 }
139 
140 void LauDaughters::setDaugType(const TString& name1, const TString& name2, const TString& name3)
141 {
142  const TString names[3] = { name1, name2, name3 };
143  const Int_t codes[3] = { LauDatabasePDG::code( name1 ), LauDatabasePDG::code( name2 ), LauDatabasePDG::code( name3 ) };
144 
145  daughters_.clear();
146  daughters_.resize(3);
147 
148  for ( int i(0); i<3; ++i ) {
149  for ( std::vector<const LauParticlePDG*>::const_iterator iter = allowedDaughters_.begin(); iter != allowedDaughters_.end(); ++iter ) {
150  Int_t code = (*iter)->code();
151  if ( codes[i] == code ) {
152  daughters_[i] = (*iter);
153  std::cout<<"INFO in LauDaughters::setDaugType : Setting daughter "<<i+1<<" to be "<<daughters_[i]->string()<<" == "<<daughters_[i]->code()<<std::endl;
154  break;
155  }
156  }
157  if ( ! daughters_[i] ) {
158  std::cerr<<"ERROR in LauDaughters::setDaugType : Couldn't find a valid daughter called \""<<names[i]<<"\"."<<std::endl;
159  gSystem->Exit(EXIT_FAILURE);
160  }
161  }
162 
163  // Initialise the various data members concerning particle masses
164  this->sanityCheck();
165 
166  // Check whether we have a symmetrical Dalitz plot
167  this->testDPSymmetry();
168 }
169 
171 {
172  // Check to see if we have a symmetrical or flavour-conjugate DP.
173 
174  symmetricalDP_ = kFALSE;
175  fullySymmetricDP_ = kFALSE;
176  flavourConjugateDP_ = kFALSE;
177 
178  if ( daughters_[0]->code() == daughters_[1]->code() && daughters_[0]->code() == daughters_[2]->code() ) {
179  std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a fully symmetric DP. "<<std::endl;
180  fullySymmetricDP_ = kTRUE;
181  } else if ( daughters_[0]->code() == daughters_[1]->code() ) {
182  std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a symmetrical DP. "<<std::endl;
183  symmetricalDP_ = kTRUE;
184  } else if ( daughters_[0]->code() == daughters_[2]->code() ) {
185  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;
186  gSystem->Exit(EXIT_FAILURE);
187  } else if ( daughters_[1]->code() == daughters_[2]->code() ) {
188  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;
189  gSystem->Exit(EXIT_FAILURE);
190  } else if ( daughters_[0]->type() == daughters_[1]->type() && daughters_[2]->charge() == 0 ) {
191  std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a flavour-conjugate DP. "<<std::endl;
192  flavourConjugateDP_ = kTRUE;
193  } else if ( daughters_[0]->type() == daughters_[2]->type() && daughters_[1]->charge() == 0 ) {
194  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;
195  } else if ( daughters_[1]->type() == daughters_[2]->type() && daughters_[0]->charge() == 0 ) {
196  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;
197  }
198 }
199 
201 {
202  // Check masses and charges of daughters
203 
204  Int_t totCharge(0);
205  Double_t totMass(0.0);
206 
207  for ( std::vector<const LauParticlePDG*>::const_iterator iter = daughters_.begin(); iter != daughters_.end(); ++iter ) {
208  totCharge += (*iter)->charge();
209  totMass += (*iter)->mass();
210  }
211 
212  if (totCharge != parent_->charge()) {
213  std::cerr<<"ERROR in LauDaughters::sanityCheck : Total charge of daughters ("<<totCharge<<") not equal to charge of parent ("<<parent_->charge()<<")."<<std::endl;
214  gSystem->Exit(EXIT_FAILURE);
215  }
216 
217  if (totMass > parent_->mass()) {
218  std::cerr<<"ERROR in LauDaughters::sanityCheck : Total mass of daughters ("<<totMass<<") greater than mass of parent ("<<parent_->mass()<<")."<<std::endl;
219  gSystem->Exit(EXIT_FAILURE);
220  }
221 }
222 
224 {
225  return daughters_[0]->mass();
226 }
227 
229 {
230  return daughters_[1]->mass();
231 }
232 
234 {
235  return daughters_[2]->mass();
236 }
237 
239 {
240  return parent_->mass();
241 }
242 
244 {
245  return daughters_[0]->string();
246 }
247 
249 {
250  return daughters_[1]->string();
251 }
252 
254 {
255  return daughters_[2]->string();
256 }
257 
259 {
260  return parent_->string();
261 }
262 
264 {
265  return daughters_[0]->code();
266 }
267 
269 {
270  return daughters_[1]->code();
271 }
272 
274 {
275  return daughters_[2]->code();
276 }
277 
279 {
280  return parent_->code();
281 }
282 
284 {
285  return daughters_[0]->charge();
286 }
287 
289 {
290  return daughters_[1]->charge();
291 }
292 
294 {
295  return daughters_[2]->charge();
296 }
297 
299 {
300  return parent_->charge();
301 }
302 
303 Int_t LauDaughters::getCharge(Int_t resPairAmpInt) const
304 {
305  Int_t charge = this->getChargeParent();
306  if ( resPairAmpInt>0 && resPairAmpInt<4 ) {
307  charge -= daughters_[resPairAmpInt-1]->charge();
308  }
309  return charge;
310 }
311 
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.
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:63
LauDaughters(Int_t codeParent, Int_t code1, Int_t code2, Int_t code3, Bool_t useSquareDP=kFALSE)
Constructor from PDG codes.
Definition: LauDaughters.cc:27
ClassImp(LauAbsCoeffSet)
void createParticleLists()
Create list of all the allowed parent/daughter particles.
Definition: LauDaughters.cc:84
const LauParticlePDG * parent_
The parent particle.
Class that defines the particular 3-body decay under study.
Definition: LauDaughters.hh:33
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:84
Double_t getMassDaug2() const
Get mass of second daughter particle.
File containing declaration of LauKinematics class.
Bool_t gotSymmetricalDP() const
Is Dalitz plot symmetric, i.e. 2 identical particles.
Definition: LauDaughters.hh:66
std::vector< const LauParticlePDG * > daughters_
The daughter particles.
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:72
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.