laura is hosted by Hepforge, IPPP Durham
Laura++  v3r2
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauParticlePDG.cc
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2008 - 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 using std::cerr;
17 using std::endl;
18 
19 #include "TMath.h"
20 #include "TParticlePDG.h"
21 
22 #include "LauConstants.hh"
23 #include "LauDatabasePDG.hh"
24 #include "LauParticlePDG.hh"
25 
26 
28 
29 LauParticlePDG::LauParticlePDG(const TParticlePDG* particle) :
30  theParticle_(particle),
31  antiParticle_(0),
32  mass_(0.0),
33  kaon_(kFALSE),
34  pion_(kFALSE),
35  ks_(kFALSE),
36  pi0_(kFALSE),
37  D_(kFALSE),
38  B_(kFALSE)
39 {
40  // store the mass and kaon? and pion?
41  if ( TMath::Abs(this->code()) == 211 ) { // charged pion
42  mass_ = LauConstants::mPi;
43  pion_ = kTRUE;
44  } else if ( this->code() == 111 ) { // neutral pion
45  mass_ = LauConstants::mPi0;
46  pion_ = kTRUE;
47  pi0_ = kTRUE;
48  } else if ( TMath::Abs(this->code()) == 321 ) { // charged kaon
49  mass_ = LauConstants::mK;
50  kaon_ = kTRUE;
51  } else if ( this->code() == 130 || this->code() == 310 || TMath::Abs(this->code()) == 311 ) { // neutral kaon
52  mass_ = LauConstants::mK0;
53  kaon_ = kTRUE;
54  if ( this->code() == 310 ) {
55  ks_ = kTRUE;
56  }
57  } else if ( this->code() == 221 ) { // eta
58  mass_ = LauConstants::mEta;
59  } else if ( this->code() == 331 ) { // eta'
61  } else if ( TMath::Abs(this->code()) == 411 ) { // charged D
62  mass_ = LauConstants::mD;
63  D_ = kTRUE;
64  } else if ( TMath::Abs(this->code()) == 421 ) { // neutral D
65  mass_ = LauConstants::mD0;
66  D_ = kTRUE;
67  } else if ( TMath::Abs(this->code()) == 431) { // charged D_s
68  mass_ = LauConstants::mDs;
69  D_ = kTRUE;
70  } else if ( TMath::Abs(this->code()) == 511 ) { // neutral B
71  mass_ = LauConstants::mB0;
72  B_ = kTRUE;
73  } else if ( TMath::Abs(this->code()) == 521 ) { // charged B
74  mass_ = LauConstants::mB;
75  B_ = kTRUE;
76  } else if ( TMath::Abs(this->code()) == 531 ) { // neutral B_s
77  mass_ = LauConstants::mBs0;
78  B_ = kTRUE;
79  }
80 }
81 
83 {
84 }
85 
86 Int_t LauParticlePDG::code() const
87 {
88  if (theParticle_ == 0) {
89  cerr<<"ERROR in LauParticlePDG::code : Null pointer."<<endl;
90  return -999;
91  }
92  return theParticle_->PdgCode();
93 }
94 
96 {
97  if (antiParticle_ == 0) {
98  cerr<<"ERROR in LauParticlePDG::conjugateCode : Null pointer."<<endl;
99  return -999;
100  }
101  return antiParticle_->code();
102 }
103 
105 {
106  if (theParticle_ == 0) {
107  cerr<<"ERROR in LauParticlePDG::charge : Null pointer."<<endl;
108  return -999;
109  }
110  Double_t chargeTimesThree = theParticle_->Charge();
111  Int_t theCharge = static_cast<Int_t>(chargeTimesThree/3.0);
112  return theCharge;
113 }
114 
115 TString LauParticlePDG::string() const
116 {
117  if (theParticle_ == 0) {
118  cerr<<"ERROR in LauParticlePDG::string : Null pointer."<<endl;
119  return "";
120  }
121  return theParticle_->GetName();
122 }
123 
125 {
126  TString name = this->string();
127  name.ReplaceAll("*","st");
128  name.ReplaceAll("_","");
129  name.ReplaceAll("(","");
130  name.ReplaceAll(")","");
131  name.ReplaceAll("+","p");
132  name.ReplaceAll("-","m");
133  return name;
134 }
135 
TString string() const
Particle name.
const Double_t mEta
Mass of eta (GeV/c^2)
Definition: LauConstants.hh:48
Class for storing particle properties.
virtual ~LauParticlePDG()
Destructor.
Int_t charge() const
The charge of the particle.
const TParticlePDG * theParticle_
The particle.
ClassImp(LauAbsCoeffSet)
const Double_t mK0
Mass of K0 (GeV/c^2)
Definition: LauConstants.hh:46
const TString & name() const
The parameter name.
const Double_t mDs
Mass of Ds (GeV/c^2)
Definition: LauConstants.hh:32
const Double_t mD0
Mass of neutral D (GeV/c^2)
Definition: LauConstants.hh:30
const Double_t mBs0
Mass of neutral B_s (GeV/c^2)
Definition: LauConstants.hh:38
const LauParticlePDG * antiParticle_
The antiparticle.
const Double_t mB0
Mass of neutral B_d (GeV/c^2)
Definition: LauConstants.hh:36
const Double_t mPi
Mass of pi+- (GeV/c^2)
Definition: LauConstants.hh:40
const Double_t mB
Mass of charged B (GeV/c^2)
Definition: LauConstants.hh:34
TString stringAlphaNum() const
Particle name, containing only alphanumeric characters.
File containing declaration of LauDatabasePDG class.
File containing declaration of LauParticlePDG class.
const Double_t mEtaPrime
Mass of eta&#39; (GeV/c^2)
Definition: LauConstants.hh:50
File containing LauConstants namespace.
const Double_t mD
Mass of charged D (GeV/c^2)
Definition: LauConstants.hh:28
Int_t conjugateCode() const
The anti-particle PDG code.
Int_t code() const
The particle PDG code.
const Double_t mK
Mass of K+- (GeV/c^2)
Definition: LauConstants.hh:44
const Double_t mPi0
Mass of pi0 (GeV/c^2)
Definition: LauConstants.hh:42