Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4PDGCodeChecker.hh
Go to the documentation of this file.
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// G4PDGCodeChecker
27
28// Author: Hisaya Kurashige, 17 August 1999
29// --------------------------------------------------------------------
30#ifndef G4PDGCodeChecker_hh
31#define G4PDGCodeChecker_hh 1
32
33#include "globals.hh"
34#include "G4ios.hh"
35
37{
38 public:
39
42
43 G4int CheckPDGCode(G4int code, const G4String& type);
44
45 inline G4int GetQuarkContent(G4int flavor) const ;
46 inline G4int GetAntiQuarkContent(G4int flavor) const;
47
48 inline G4bool IsAntiParticle() const;
49
50 inline G4int GetQuarkFlavor(G4int idx) const;
51
52 inline G4int GetSpin() const;
53 inline G4int GetExotic() const;
54 inline G4int GetRadial() const;
55 inline G4int GetMultiplet() const;
56
57 G4bool CheckCharge(G4double charge) const;
58
59 inline G4int GetVerboseLevel() const;
60 inline void SetVerboseLevel(G4int verbose);
61
62 protected:
63
65
66 private:
67
68 void GetDigits(G4int code);
69 G4int CheckForQuarks();
70 G4int CheckForDiQuarks();
71 G4int CheckForMesons();
72 G4int CheckForBaryons();
73 G4int CheckForNuclei();
74
75 private:
76
77 G4int verboseLevel = 0;
78
79 G4int code = 0;
80 G4String theParticleType = "";
81
82 G4int higherSpin = 0;
83 G4int exotic = 0;
84 G4int radial = 0;
85 G4int multiplet = 0;
86 G4int quark1 = 0;
87 G4int quark2 = 0;
88 G4int quark3 = 0;
89 G4int spin = 0;
90
91 G4int theQuarkContent[NumberOfQuarkFlavor];
92 G4int theAntiQuarkContent[NumberOfQuarkFlavor];
93 // The number of quark (minus Sign means anti-quark) contents
94 // The value of flavor is assigned as follows
95 // 0:d, 1:u, 2:s, 3:c,
96 // 4:b, 5:t, 6:l(down type quark) 7:h(up type quark)
97};
98
99// ------------------------
100// Inline methods
101// ------------------------
102
103inline
105{
106 G4int value = 0;
107 if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor))
108 {
109 value = theQuarkContent[flavor];
110 }
111 return value;
112}
113
114inline
116{
117 G4int value = 0;
118 if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor))
119 {
120 value = theAntiQuarkContent[flavor];
121 }
122 return value;
123}
124
125
126inline
128{
129 G4int value;
130 if (idx ==0) value = quark1;
131 else if (idx ==1) value = quark2;
132 else if (idx ==2) value = quark3;
133 else value = -1;
134 return value;
135}
136
137inline
139{
140 return exotic;
141}
142
143inline
145{
146 return radial;
147}
148
149inline
151{
152 return multiplet;
153}
154
155inline
157{
158 return spin;
159}
160
161inline
163{
164 return (code <0);
165}
166
167inline
169{
170 verboseLevel = value;
171}
172
173inline
175{
176 return verboseLevel;
177}
178
179#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4bool IsAntiParticle() const
G4int GetSpin() const
G4int GetVerboseLevel() const
G4int CheckPDGCode(G4int code, const G4String &type)
G4int GetQuarkContent(G4int flavor) const
G4int GetQuarkFlavor(G4int idx) const
G4bool CheckCharge(G4double charge) const
G4int GetExotic() const
G4int GetAntiQuarkContent(G4int flavor) const
void SetVerboseLevel(G4int verbose)
G4int GetRadial() const
G4int GetMultiplet() const
Definition: inftrees.h:24