File indexing completed on 2025-01-18 09:58:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #ifndef G4PDGCodeChecker_hh
0031 #define G4PDGCodeChecker_hh 1
0032
0033 #include "G4ios.hh"
0034 #include "globals.hh"
0035
0036 class G4PDGCodeChecker
0037 {
0038 public:
0039 G4PDGCodeChecker();
0040 ~G4PDGCodeChecker() = default;
0041
0042 G4int CheckPDGCode(G4int code, const G4String& type);
0043
0044 inline G4int GetQuarkContent(G4int flavor) const;
0045 inline G4int GetAntiQuarkContent(G4int flavor) const;
0046
0047 inline G4bool IsAntiParticle() const;
0048
0049 inline G4int GetQuarkFlavor(G4int idx) const;
0050
0051 inline G4int GetSpin() const;
0052 inline G4int GetExotic() const;
0053 inline G4int GetRadial() const;
0054 inline G4int GetMultiplet() const;
0055
0056 G4bool CheckCharge(G4double charge) const;
0057
0058 inline G4int GetVerboseLevel() const;
0059 inline void SetVerboseLevel(G4int verbose);
0060
0061 protected:
0062 enum
0063 {
0064 NumberOfQuarkFlavor = 8
0065 };
0066
0067 private:
0068 void GetDigits(G4int code);
0069 G4int CheckForQuarks();
0070 G4int CheckForDiQuarks();
0071 G4int CheckForMesons();
0072 G4int CheckForBaryons();
0073 G4int CheckForNuclei();
0074
0075 private:
0076 G4int verboseLevel = 0;
0077
0078 G4int code = 0;
0079 G4String theParticleType = "";
0080
0081 G4int higherSpin = 0;
0082 G4int exotic = 0;
0083 G4int radial = 0;
0084 G4int multiplet = 0;
0085 G4int quark1 = 0;
0086 G4int quark2 = 0;
0087 G4int quark3 = 0;
0088 G4int spin = 0;
0089
0090 G4int theQuarkContent[NumberOfQuarkFlavor];
0091 G4int theAntiQuarkContent[NumberOfQuarkFlavor];
0092
0093
0094
0095
0096 };
0097
0098
0099
0100
0101
0102 inline G4int G4PDGCodeChecker::GetQuarkContent(G4int flavor) const
0103 {
0104 G4int value = 0;
0105 if ((flavor >= 0) && (flavor < NumberOfQuarkFlavor)) {
0106 value = theQuarkContent[flavor];
0107 }
0108 return value;
0109 }
0110
0111 inline G4int G4PDGCodeChecker::GetAntiQuarkContent(G4int flavor) const
0112 {
0113 G4int value = 0;
0114 if ((flavor >= 0) && (flavor < NumberOfQuarkFlavor)) {
0115 value = theAntiQuarkContent[flavor];
0116 }
0117 return value;
0118 }
0119
0120 inline G4int G4PDGCodeChecker::GetQuarkFlavor(G4int idx) const
0121 {
0122 G4int value;
0123 if (idx == 0)
0124 value = quark1;
0125 else if (idx == 1)
0126 value = quark2;
0127 else if (idx == 2)
0128 value = quark3;
0129 else
0130 value = -1;
0131 return value;
0132 }
0133
0134 inline G4int G4PDGCodeChecker::GetExotic() const
0135 {
0136 return exotic;
0137 }
0138
0139 inline G4int G4PDGCodeChecker::GetRadial() const
0140 {
0141 return radial;
0142 }
0143
0144 inline G4int G4PDGCodeChecker::GetMultiplet() const
0145 {
0146 return multiplet;
0147 }
0148
0149 inline G4int G4PDGCodeChecker::GetSpin() const
0150 {
0151 return spin;
0152 }
0153
0154 inline G4bool G4PDGCodeChecker::IsAntiParticle() const
0155 {
0156 return (code < 0);
0157 }
0158
0159 inline void G4PDGCodeChecker::SetVerboseLevel(G4int value)
0160 {
0161 verboseLevel = value;
0162 }
0163
0164 inline G4int G4PDGCodeChecker::GetVerboseLevel() const
0165 {
0166 return verboseLevel;
0167 }
0168
0169 #endif