Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PDGCodeChecker Class Reference

#include <G4PDGCodeChecker.hh>

Public Member Functions

 G4PDGCodeChecker ()
 
 ~G4PDGCodeChecker ()
 
G4int CheckPDGCode (G4int code, G4String type)
 
G4int GetQuarkContent (G4int flavor) const
 
G4int GetAntiQuarkContent (G4int flavor) const
 
G4bool IsAntiParticle () const
 
G4int GetQuarkFlavor (G4int idx) const
 
G4int GetSpin () const
 
G4int GetExotic () const
 
G4int GetRadial () const
 
G4int GetMultiplet () const
 
G4bool CheckCharge (G4double charge) const
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int verbose)
 

Protected Types

enum  { NumberOfQuarkFlavor = 8 }
 

Detailed Description

Definition at line 44 of file G4PDGCodeChecker.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
NumberOfQuarkFlavor 

Definition at line 73 of file G4PDGCodeChecker.hh.

Constructor & Destructor Documentation

◆ G4PDGCodeChecker()

G4PDGCodeChecker::G4PDGCodeChecker ( )

Definition at line 45 of file G4PDGCodeChecker.cc.

46 :code(0),theParticleType(""),
47 thePDGiSpin(0),higherSpin(0),
48 exotic(0),radial(0),multiplet(0),
49 quark1(0),quark2(0),quark3(0),spin(0)
50{
51 verboseLevel = 1;
52 // clear QuarkContents
53 G4int flavor;
54 for (flavor=0; flavor<NumberOfQuarkFlavor; flavor++){
55 theQuarkContent[flavor] =0;
56 theAntiQuarkContent[flavor] =0;
57 }
58}
int G4int
Definition: G4Types.hh:66

◆ ~G4PDGCodeChecker()

G4PDGCodeChecker::~G4PDGCodeChecker ( )
inline

Definition at line 49 of file G4PDGCodeChecker.hh.

49{};

Member Function Documentation

◆ CheckCharge()

G4bool G4PDGCodeChecker::CheckCharge ( G4double  charge) const

Definition at line 353 of file G4PDGCodeChecker.cc.

354{
355 // check charge
356 G4double totalCharge = 0.0;
357 for (G4int flavor= 0; flavor<NumberOfQuarkFlavor-1; flavor+=2){
358 totalCharge += (-1./3.)*eplus*theQuarkContent[flavor];
359 totalCharge += 1./3.*eplus*theAntiQuarkContent[flavor];
360 totalCharge += 2./3.*eplus*theQuarkContent[flavor+1];
361 totalCharge += (-2./3.)*eplus*theAntiQuarkContent[flavor+1];
362 }
363
364 if (std::fabs(totalCharge-thePDGCharge)>0.1*eplus) {
365#ifdef G4VERBOSE
366 if (verboseLevel>0) {
367 G4cout << " G4PDGCodeChecker::CheckCharge : ";
368 G4cout << " illegal electric charge " << thePDGCharge/eplus;
369 G4cout << " PDG code=" << code <<G4endl;
370 }
371#endif
372 return false;
373 }
374 return true;
375}
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ CheckPDGCode()

G4int G4PDGCodeChecker::CheckPDGCode ( G4int  code,
G4String  type 
)

Definition at line 61 of file G4PDGCodeChecker.cc.

63{
64 code = PDGcode;
65 theParticleType = particleType;
66
67 // clear QuarkContents
68 G4int flavor;
69 for (flavor=0; flavor<NumberOfQuarkFlavor; flavor++){
70 theQuarkContent[flavor] =0;
71 theAntiQuarkContent[flavor] =0;
72 }
73
74 // check code for nuclei
75 if ((theParticleType == "nucleus")||(theParticleType == "anti_nucleus")) {
76 return CheckForNuclei();
77 }
78
79 // get each digit number
80 GetDigits(code);
81
82 // check code
83 if (theParticleType =="quarks") {
84 return CheckForQuarks();
85
86 } else if (theParticleType =="diquarks") {
87 return CheckForDiQuarks();
88
89 } else if (theParticleType =="gluons") {
90 // gluons
91 // do not care about
92 return code;
93
94 } else if (theParticleType == "meson") {
95 return CheckForMesons();
96
97 } else if (theParticleType == "baryon"){
98 return CheckForBaryons();
99
100
101 }
102 // No check
103 return code;
104}

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ GetAntiQuarkContent()

G4int G4PDGCodeChecker::GetAntiQuarkContent ( G4int  flavor) const
inline

Definition at line 120 of file G4PDGCodeChecker.hh.

121{
122 G4int value = 0;
123 if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor)) {
124 value = theAntiQuarkContent[flavor];
125 }
126 return value;
127}

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ GetExotic()

G4int G4PDGCodeChecker::GetExotic ( ) const
inline

Definition at line 142 of file G4PDGCodeChecker.hh.

143{
144 return exotic;
145}

◆ GetMultiplet()

G4int G4PDGCodeChecker::GetMultiplet ( ) const
inline

Definition at line 154 of file G4PDGCodeChecker.hh.

155{
156 return multiplet;
157}

◆ GetQuarkContent()

G4int G4PDGCodeChecker::GetQuarkContent ( G4int  flavor) const
inline

Definition at line 110 of file G4PDGCodeChecker.hh.

111{
112 G4int value = 0;
113 if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor)) {
114 value = theQuarkContent[flavor];
115 }
116 return value;
117}

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ GetQuarkFlavor()

G4int G4PDGCodeChecker::GetQuarkFlavor ( G4int  idx) const
inline

Definition at line 131 of file G4PDGCodeChecker.hh.

132{
133 G4int value;
134 if (idx ==0) value = quark1;
135 else if (idx ==1) value = quark2;
136 else if (idx ==2) value = quark3;
137 else value = -1;
138 return value;
139}

◆ GetRadial()

G4int G4PDGCodeChecker::GetRadial ( ) const
inline

Definition at line 148 of file G4PDGCodeChecker.hh.

149{
150 return radial;
151}

◆ GetSpin()

G4int G4PDGCodeChecker::GetSpin ( ) const
inline

Definition at line 160 of file G4PDGCodeChecker.hh.

161{
162 return spin;
163}

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ GetVerboseLevel()

G4int G4PDGCodeChecker::GetVerboseLevel ( ) const
inline

Definition at line 178 of file G4PDGCodeChecker.hh.

179{
180 return verboseLevel;
181}

◆ IsAntiParticle()

G4bool G4PDGCodeChecker::IsAntiParticle ( ) const
inline

Definition at line 166 of file G4PDGCodeChecker.hh.

167{
168 return (code <0);
169}

◆ SetVerboseLevel()

void G4PDGCodeChecker::SetVerboseLevel ( G4int  verbose)
inline

Definition at line 172 of file G4PDGCodeChecker.hh.

173{
174 verboseLevel = value;
175}

Referenced by G4ParticleDefinition::FillQuarkContents().


The documentation for this class was generated from the following files: