laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
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 <map>
41 #include "TString.h"
42 
43 class TDatabasePDG;
44 class LauParticlePDG;
45 
47 
48  public:
50 
54  static const LauParticlePDG* particle(Int_t code);
55 
57 
61  static const LauParticlePDG* particle(const TString& string);
62 
64 
68  static Int_t code(const TString& string);
69 
71 
75  static TString string(Int_t code);
76 
77  private:
78  // private methods
79 
82 
84  virtual ~LauDatabasePDG();
85 
87  LauDatabasePDG( const LauDatabasePDG& other );
88 
90  LauDatabasePDG& operator=( const LauDatabasePDG& other );
91 
93  static LauDatabasePDG& get();
94 
96  void addMissingParticles();
97 
99 
103  const LauParticlePDG* createParticle(Int_t theCode);
104 
106 
110  const LauParticlePDG* createParticle(const TString& theString);
111 
113 
117  Int_t pdgCode(const TString& theString);
118 
120 
124  TString pdgName(Int_t theCode);
125 
126  // private data
127 
130 
132  TDatabasePDG* theDatabase_;
133 
135  typedef std::map<Int_t,const LauParticlePDG*> LauPDGList;
136 
139 
141  const Bool_t debug_;
142 
143  ClassDef(LauDatabasePDG,0)
144 
145 };
146 
147 #endif
TDatabasePDG * theDatabase_
The ROOT database.
Class for storing particle properties.
virtual ~LauDatabasePDG()
Destructor.
TString pdgName(Int_t theCode)
Get the associated name string for a given pdgCode.
const Bool_t debug_
Debug flag - set in constructor.
LauDatabasePDG()
Constructor.
void addMissingParticles()
Add particles to the ROOT database that are missing from the default setup.
Singleton class that provides access to particle property records.
LauDatabasePDG & operator=(const LauDatabasePDG &other)
Copy assignment (not implemented)
static const LauParticlePDG * particle(Int_t code)
Get particle object based on the PDG code.
static LauDatabasePDG * theInstance_
The singleton instance.
std::map< Int_t, const LauParticlePDG * > LauPDGList
The type to hold the list of wrapped particle objects.
const LauParticlePDG * createParticle(Int_t theCode)
Create particle in the database for a given PDG code and return the new particle. ...
LauPDGList particles_
The list of particle objects.
Int_t pdgCode(const TString &theString)
Get the associated pdgCode for a given particle name string.
static Int_t code(const TString &string)
Method to convert from a particle name string into a PDG code.
static TString string(Int_t code)
Method to convert from a PDG code to a particle name string.