source: trunk/source/particles/management/include/G4PDGCodeChecker.hh @ 1202

Last change on this file since 1202 was 1196, checked in by garnier, 15 years ago

update CVS release candidate geant4.9.3.01

File size: 4.5 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4PDGCodeChecker.hh,v 1.9 2007/09/14 07:04:09 kurasige Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//
31// ------------------------------------------------------------
32//      GEANT 4 class header file
33//
34//      History: first implementation, based on object model of
35//      Hisaya Kurashige,  17 Aug. 1999
36//
37
38
39#ifndef G4PDGCodeChecker_h
40#define G4PDGCodeChecker_h 1
41
42#include "globals.hh"
43#include "G4ios.hh"
44
45class G4PDGCodeChecker 
46{
47
48 public:
49  G4PDGCodeChecker();
50  ~G4PDGCodeChecker(){};
51
52 public: // With Description
53  G4int  CheckPDGCode(G4int code, G4String type);
54
55  G4int  GetQuarkContent(G4int flavor) const ;
56  G4int  GetAntiQuarkContent(G4int flavor) const;
57 
58  G4bool IsAntiParticle() const;
59
60  G4int  GetQuarkFlavor(G4int idx) const;
61
62 public:
63  G4int  GetSpin() const;
64  G4int  GetExotic() const;
65  G4int  GetRadial() const;
66  G4int  GetMultiplet() const;
67
68  G4bool CheckCharge(G4double charge) const;
69
70  G4int GetVerboseLevel() const;
71  void  SetVerboseLevel(G4int verbose);
72
73 protected:
74  enum {NumberOfQuarkFlavor = 8};
75
76 private: 
77  void   GetDigits(G4int code);
78  G4int  CheckForQuarks();
79  G4int  CheckForDiQuarks();
80  G4int  CheckForMesons();
81  G4int  CheckForBaryons();
82  G4int  CheckForNuclei();
83 
84
85 private:
86  G4int verboseLevel;
87
88  G4int code;
89  G4String theParticleType;
90  G4int thePDGiSpin; 
91
92  G4int higherSpin;
93  G4int exotic;
94  G4int radial;
95  G4int multiplet;
96  G4int quark1;
97  G4int quark2;
98  G4int quark3;
99  G4int spin;
100
101  G4int  theQuarkContent[NumberOfQuarkFlavor];
102  G4int  theAntiQuarkContent[NumberOfQuarkFlavor];
103  //  the number of quark (minus Sign means anti-quark) contents
104  //  The value of flavor is assigned as follows
105  //    0:d, 1:u, 2:s, 3:c,
106  //    4:b, 5:t, 6:l(down type quark) 7:h(up type quark)
107
108};
109
110inline
111  G4int  G4PDGCodeChecker::GetQuarkContent(G4int flavor) const
112{
113  G4int value = 0;
114  if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor)) {
115    value = theQuarkContent[flavor];
116  }
117  return value;
118}
119
120inline
121  G4int  G4PDGCodeChecker::GetAntiQuarkContent(G4int flavor) const
122{
123  G4int value = 0;
124  if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor)) {
125    value = theAntiQuarkContent[flavor];
126  }
127  return value;
128}
129
130
131inline
132  G4int G4PDGCodeChecker::GetQuarkFlavor(G4int idx) const
133{
134  G4int value;
135  if (idx ==0) value = quark1;
136  else if (idx ==1) value = quark2;
137  else if (idx ==2) value = quark3;
138  else value = -1;
139  return value;
140}
141
142inline
143  G4int G4PDGCodeChecker::GetExotic() const
144{
145  return exotic;
146}
147
148inline
149  G4int G4PDGCodeChecker::GetRadial() const
150{
151  return radial;
152}
153
154inline
155  G4int G4PDGCodeChecker::GetMultiplet() const
156{
157  return multiplet;
158}
159
160inline
161  G4int G4PDGCodeChecker::GetSpin() const
162{
163  return spin;
164}
165
166inline
167  G4bool G4PDGCodeChecker::IsAntiParticle() const
168{
169  return (code <0);
170}
171
172inline 
173  void G4PDGCodeChecker::SetVerboseLevel(G4int value)
174{
175   verboseLevel = value;
176}
177
178inline 
179  G4int G4PDGCodeChecker::GetVerboseLevel() const
180{
181   return verboseLevel;
182}
183
184
185#endif
186
187
188
189
190
191
Note: See TracBrowser for help on using the repository browser.