Geant4 10.7.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, const 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 36 of file G4PDGCodeChecker.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
NumberOfQuarkFlavor 

Definition at line 64 of file G4PDGCodeChecker.hh.

Constructor & Destructor Documentation

◆ G4PDGCodeChecker()

G4PDGCodeChecker::G4PDGCodeChecker ( )

Definition at line 39 of file G4PDGCodeChecker.cc.

40 : verboseLevel(1)
41{
42 // clear QuarkContents
43 for (G4int flavor=0; flavor<NumberOfQuarkFlavor; ++flavor)
44 {
45 theQuarkContent[flavor] = 0;
46 theAntiQuarkContent[flavor] = 0;
47 }
48}
int G4int
Definition: G4Types.hh:85

◆ ~G4PDGCodeChecker()

G4PDGCodeChecker::~G4PDGCodeChecker ( )

Definition at line 51 of file G4PDGCodeChecker.cc.

52{
53}

Member Function Documentation

◆ CheckCharge()

G4bool G4PDGCodeChecker::CheckCharge ( G4double  charge) const

Definition at line 384 of file G4PDGCodeChecker.cc.

385{
386 // check charge
387 G4double totalCharge = 0.0;
388 for (G4int flavor= 0; flavor<NumberOfQuarkFlavor-1; flavor+=2)
389 {
390 totalCharge += (-1./3.)*eplus*theQuarkContent[flavor];
391 totalCharge += 1./3.*eplus*theAntiQuarkContent[flavor];
392 totalCharge += 2./3.*eplus*theQuarkContent[flavor+1];
393 totalCharge += (-2./3.)*eplus*theAntiQuarkContent[flavor+1];
394 }
395
396 if (std::fabs(totalCharge-thePDGCharge)>0.1*eplus)
397 {
398#ifdef G4VERBOSE
399 if (verboseLevel>0)
400 {
401 G4cout << " G4PDGCodeChecker::CheckCharge : ";
402 G4cout << " illegal electric charge " << thePDGCharge/eplus;
403 G4cout << " PDG code=" << code <<G4endl;
404 }
405#endif
406 return false;
407 }
408 return true;
409}
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
Definition: inftrees.h:24

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ CheckPDGCode()

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

Definition at line 56 of file G4PDGCodeChecker.cc.

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

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ GetAntiQuarkContent()

G4int G4PDGCodeChecker::GetAntiQuarkContent ( G4int  flavor) const
inline

Definition at line 115 of file G4PDGCodeChecker.hh.

116{
117 G4int value = 0;
118 if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor))
119 {
120 value = theAntiQuarkContent[flavor];
121 }
122 return value;
123}

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ GetExotic()

G4int G4PDGCodeChecker::GetExotic ( ) const
inline

Definition at line 138 of file G4PDGCodeChecker.hh.

139{
140 return exotic;
141}

◆ GetMultiplet()

G4int G4PDGCodeChecker::GetMultiplet ( ) const
inline

Definition at line 150 of file G4PDGCodeChecker.hh.

151{
152 return multiplet;
153}

◆ GetQuarkContent()

G4int G4PDGCodeChecker::GetQuarkContent ( G4int  flavor) const
inline

Definition at line 104 of file G4PDGCodeChecker.hh.

105{
106 G4int value = 0;
107 if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor))
108 {
109 value = theQuarkContent[flavor];
110 }
111 return value;
112}

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ GetQuarkFlavor()

G4int G4PDGCodeChecker::GetQuarkFlavor ( G4int  idx) const
inline

Definition at line 127 of file G4PDGCodeChecker.hh.

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}

◆ GetRadial()

G4int G4PDGCodeChecker::GetRadial ( ) const
inline

Definition at line 144 of file G4PDGCodeChecker.hh.

145{
146 return radial;
147}

◆ GetSpin()

G4int G4PDGCodeChecker::GetSpin ( ) const
inline

Definition at line 156 of file G4PDGCodeChecker.hh.

157{
158 return spin;
159}

Referenced by G4ParticleDefinition::FillQuarkContents().

◆ GetVerboseLevel()

G4int G4PDGCodeChecker::GetVerboseLevel ( ) const
inline

Definition at line 174 of file G4PDGCodeChecker.hh.

175{
176 return verboseLevel;
177}

◆ IsAntiParticle()

G4bool G4PDGCodeChecker::IsAntiParticle ( ) const
inline

Definition at line 162 of file G4PDGCodeChecker.hh.

163{
164 return (code <0);
165}

◆ SetVerboseLevel()

void G4PDGCodeChecker::SetVerboseLevel ( G4int  verbose)
inline

Definition at line 168 of file G4PDGCodeChecker.hh.

169{
170 verboseLevel = value;
171}

Referenced by G4ParticleDefinition::FillQuarkContents().


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