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