Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
protected
Enumerator
NumberOfQuarkFlavor 

Definition at line 73 of file G4PDGCodeChecker.hh.

Constructor & Destructor Documentation

G4PDGCodeChecker::G4PDGCodeChecker ( )

Definition at line 45 of file G4PDGCodeChecker.cc.

46  :code(0),theParticleType(""),
47  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:78
Definition: inftrees.h:24
G4PDGCodeChecker::~G4PDGCodeChecker ( )
inline

Definition at line 49 of file G4PDGCodeChecker.hh.

49 {};

Member Function Documentation

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 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static constexpr double eplus
Definition: G4SIunits.hh:199
Definition: inftrees.h:24
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

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 }
int G4int
Definition: G4Types.hh:78
Definition: inftrees.h:24

Here is the caller graph for this function:

G4int G4PDGCodeChecker::GetAntiQuarkContent ( G4int  flavor) const
inline

Definition at line 119 of file G4PDGCodeChecker.hh.

120 {
121  G4int value = 0;
122  if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor)) {
123  value = theAntiQuarkContent[flavor];
124  }
125  return value;
126 }
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

G4int G4PDGCodeChecker::GetExotic ( ) const
inline

Definition at line 141 of file G4PDGCodeChecker.hh.

142 {
143  return exotic;
144 }
G4int G4PDGCodeChecker::GetMultiplet ( ) const
inline

Definition at line 153 of file G4PDGCodeChecker.hh.

154 {
155  return multiplet;
156 }
G4int G4PDGCodeChecker::GetQuarkContent ( G4int  flavor) const
inline

Definition at line 109 of file G4PDGCodeChecker.hh.

110 {
111  G4int value = 0;
112  if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor)) {
113  value = theQuarkContent[flavor];
114  }
115  return value;
116 }
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

G4int G4PDGCodeChecker::GetQuarkFlavor ( G4int  idx) const
inline

Definition at line 130 of file G4PDGCodeChecker.hh.

131 {
132  G4int value;
133  if (idx ==0) value = quark1;
134  else if (idx ==1) value = quark2;
135  else if (idx ==2) value = quark3;
136  else value = -1;
137  return value;
138 }
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4int G4PDGCodeChecker::GetRadial ( ) const
inline

Definition at line 147 of file G4PDGCodeChecker.hh.

148 {
149  return radial;
150 }
G4int G4PDGCodeChecker::GetSpin ( ) const
inline

Definition at line 159 of file G4PDGCodeChecker.hh.

160 {
161  return spin;
162 }

Here is the caller graph for this function:

G4int G4PDGCodeChecker::GetVerboseLevel ( ) const
inline

Definition at line 177 of file G4PDGCodeChecker.hh.

178 {
179  return verboseLevel;
180 }
G4bool G4PDGCodeChecker::IsAntiParticle ( ) const
inline

Definition at line 165 of file G4PDGCodeChecker.hh.

166 {
167  return (code <0);
168 }
Definition: inftrees.h:24
void G4PDGCodeChecker::SetVerboseLevel ( G4int  verbose)
inline

Definition at line 171 of file G4PDGCodeChecker.hh.

172 {
173  verboseLevel = value;
174 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:


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