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