laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
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 "LauConstants.hh"
34 #include "LauDatabasePDG.hh"
35 #include "LauParticlePDG.hh"
36 
37 #include "TMath.h"
38 #include "TParticlePDG.h"
39 
40 LauParticlePDG::LauParticlePDG( const TParticlePDG* particle ) :
41  theParticle_( particle ),
42  antiParticle_( 0 ),
43  mass_( 0.0 ),
44  kaon_( kFALSE ),
45  pion_( kFALSE ),
46  ks_( kFALSE ),
47  pi0_( kFALSE ),
48  D_( kFALSE ),
49  B_( kFALSE )
50 {
51  // store the mass and kaon? and pion?
52  if ( TMath::Abs( this->code() ) == 211 ) { // charged pion
54  pion_ = kTRUE;
55  } else if ( this->code() == 111 ) { // neutral pion
57  pion_ = kTRUE;
58  pi0_ = kTRUE;
59  } else if ( TMath::Abs( this->code() ) == 321 ) { // charged kaon
61  kaon_ = kTRUE;
62  } else if ( this->code() == 130 || this->code() == 310 ||
63  TMath::Abs( this->code() ) == 311 ) { // neutral kaon
65  kaon_ = kTRUE;
66  if ( this->code() == 310 ) {
67  ks_ = kTRUE;
68  }
69  } else if ( this->code() == 221 ) { // eta
71  } else if ( this->code() == 331 ) { // eta'
73  } else if ( TMath::Abs( this->code() ) == 411 ) { // charged D
75  D_ = kTRUE;
76  } else if ( TMath::Abs( this->code() ) == 421 ) { // neutral D
78  D_ = kTRUE;
79  } else if ( TMath::Abs( this->code() ) == 431 ) { // charged D_s
81  D_ = kTRUE;
82  } else if ( TMath::Abs( this->code() ) == 511 ) { // neutral B
84  B_ = kTRUE;
85  } else if ( TMath::Abs( this->code() ) == 521 ) { // charged B
87  B_ = kTRUE;
88  } else if ( TMath::Abs( this->code() ) == 531 ) { // neutral B_s
90  B_ = kTRUE;
91  }
92 }
93 
95 {
96 }
97 
98 Int_t LauParticlePDG::code() const
99 {
100  if ( theParticle_ == 0 ) {
101  cerr << "ERROR in LauParticlePDG::code : Null pointer." << endl;
102  return -999;
103  }
104  return theParticle_->PdgCode();
105 }
106 
108 {
109  if ( antiParticle_ == 0 ) {
110  cerr << "ERROR in LauParticlePDG::conjugateCode : Null pointer." << endl;
111  return -999;
112  }
113  return antiParticle_->code();
114 }
115 
117 {
118  if ( theParticle_ == 0 ) {
119  cerr << "ERROR in LauParticlePDG::charge : Null pointer." << endl;
120  return -999;
121  }
122  Double_t chargeTimesThree = theParticle_->Charge();
123  Int_t theCharge = static_cast<Int_t>( chargeTimesThree / 3.0 );
124  return theCharge;
125 }
126 
127 TString LauParticlePDG::string() const
128 {
129  if ( theParticle_ == 0 ) {
130  cerr << "ERROR in LauParticlePDG::string : Null pointer." << endl;
131  return "";
132  }
133  return theParticle_->GetName();
134 }
135 
137 {
138  TString name = this->string();
139  name.ReplaceAll( "*", "st" );
140  name.ReplaceAll( "_", "" );
141  name.ReplaceAll( "(", "" );
142  name.ReplaceAll( ")", "" );
143  name.ReplaceAll( "+", "p" );
144  name.ReplaceAll( "-", "m" );
145  return name;
146 }
const Double_t mDs
Mass of Ds (GeV/c^2)
Definition: LauConstants.hh:47
Bool_t D_
Flag whether the particle is a D.
LauParticlePDG(const TParticlePDG *particle)
Constructor.
Bool_t B_
Flag whether the particle is a B.
virtual ~LauParticlePDG()
Destructor.
const Double_t mD
Mass of charged D (GeV/c^2)
Definition: LauConstants.hh:43
File containing declaration of LauParticlePDG class.
TString stringAlphaNum() const
Particle name, containing only alphanumeric characters.
Double_t mass_
The mass of the particle.
const Double_t mEta
Mass of eta (GeV/c^2)
Definition: LauConstants.hh:63
Bool_t kaon_
Flag whether the particle is a kaon.
TString string() const
Particle name.
const Double_t mK0
Mass of K0 (GeV/c^2)
Definition: LauConstants.hh:61
Bool_t pi0_
Flag whether the particle is a pi0.
const Double_t mD0
Mass of neutral D (GeV/c^2)
Definition: LauConstants.hh:45
const Double_t mBs0
Mass of neutral B_s (GeV/c^2)
Definition: LauConstants.hh:53
File containing LauConstants namespace.
File containing declaration of LauDatabasePDG class.
const TString & name() const
The parameter name.
const Double_t mPi0
Mass of pi0 (GeV/c^2)
Definition: LauConstants.hh:57
Bool_t pion_
Flag whether the particle is a pion.
const Double_t mK
Mass of K+- (GeV/c^2)
Definition: LauConstants.hh:59
Bool_t ks_
Flag whether the particle is a KS.
Int_t code() const
The particle PDG code.
Int_t charge() const
The charge of the particle.
Int_t conjugateCode() const
The anti-particle PDG code.
const Double_t mB0
Mass of neutral B_d (GeV/c^2)
Definition: LauConstants.hh:51
const Double_t mPi
Mass of pi+- (GeV/c^2)
Definition: LauConstants.hh:55
const Double_t mEtaPrime
Mass of eta' (GeV/c^2)
Definition: LauConstants.hh:65
const LauParticlePDG * antiParticle_
The antiparticle.
const Double_t mB
Mass of charged B (GeV/c^2)
Definition: LauConstants.hh:49
const TParticlePDG * theParticle_
The particle.