laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauDatabasePDG.hh
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 
37 #ifndef LAU_DATABASE_PDG
38 #define LAU_DATABASE_PDG
39 
40 #include "TString.h"
41 
42 #include <map>
43 
44 class TDatabasePDG;
45 class LauParticlePDG;
46 
48 
49  public:
51 
55  static const LauParticlePDG* particle( Int_t code );
56 
58 
62  static const LauParticlePDG* particle( const TString& string );
63 
65 
69  static Int_t code( const TString& string );
70 
72 
76  static TString string( Int_t code );
77 
78  private:
79  // private methods
80 
83 
85  virtual ~LauDatabasePDG();
86 
88  LauDatabasePDG( const LauDatabasePDG& other );
89 
92 
94  static LauDatabasePDG& get();
95 
97  void addMissingParticles();
98 
100 
104  const LauParticlePDG* createParticle( Int_t theCode );
105 
107 
111  const LauParticlePDG* createParticle( const TString& theString );
112 
114 
118  Int_t pdgCode( const TString& theString );
119 
121 
125  TString pdgName( Int_t theCode );
126 
127  // private data
128 
131 
133  TDatabasePDG* theDatabase_;
134 
136  typedef std::map<Int_t, const LauParticlePDG*> LauPDGList;
137 
140 
142  const Bool_t debug_;
143 
144  ClassDef( LauDatabasePDG, 0 )
145 };
146 
147 #endif
Singleton class that provides access to particle property records.
virtual ~LauDatabasePDG()
Destructor.
const LauParticlePDG * createParticle(Int_t theCode)
Create particle in the database for a given PDG code and return the new particle.
TDatabasePDG * theDatabase_
The ROOT database.
LauDatabasePDG()
Constructor.
void addMissingParticles()
Add particles to the ROOT database that are missing from the default setup.
LauDatabasePDG(const LauDatabasePDG &other)
Copy constructor (not inplemented)
static LauDatabasePDG * theInstance_
The singleton instance.
std::map< Int_t, const LauParticlePDG * > LauPDGList
The type to hold the list of wrapped particle objects.
static TString string(Int_t code)
Method to convert from a PDG code to a particle name string.
static LauDatabasePDG & get()
Get the database instance.
const Bool_t debug_
Debug flag - set in constructor.
Class for storing particle properties.
TString pdgName(Int_t theCode)
Get the associated name string for a given pdgCode.
static const LauParticlePDG * particle(Int_t code)
Get particle object based on the PDG code.
LauPDGList particles_
The list of particle objects.
LauDatabasePDG & operator=(const LauDatabasePDG &other)
Copy assignment (not implemented)
static Int_t code(const TString &string)
Method to convert from a particle name string into a PDG code.
Int_t pdgCode(const TString &theString)
Get the associated pdgCode for a given particle name string.