43 theQuarkContent[flavor] = 0;
44 theAntiQuarkContent[flavor] = 0;
51 theParticleType = particleType;
55 theQuarkContent[flavor] = 0;
56 theAntiQuarkContent[flavor] = 0;
60 if ((theParticleType ==
"nucleus") || (theParticleType ==
"anti_nucleus")) {
61 return CheckForNuclei();
68 if (theParticleType ==
"quarks") {
69 return CheckForQuarks();
71 if (theParticleType ==
"diquarks") {
72 return CheckForDiQuarks();
74 if (theParticleType ==
"gluons") {
77 if (theParticleType ==
"meson") {
78 return CheckForMesons();
80 if (theParticleType ==
"baryon") {
81 return CheckForBaryons();
87G4int G4PDGCodeChecker::CheckForBaryons()
91 if ((quark1 == 0) || (quark2 == 0) || (quark3 == 0)) {
93 if (verboseLevel > 0) {
94 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
95 G4cout <<
" meson has three quark ";
103 if (std::abs(tempPDGcode) % 10000 == 3122) {
109 else if (std::abs(tempPDGcode) % 10000 == 3124) {
115 else if (std::abs(tempPDGcode) % 10000 == 3126) {
121 else if (std::abs(tempPDGcode) % 10000 == 3128) {
127 else if (std::abs(tempPDGcode) % 10000 == 4122) {
133 else if (std::abs(tempPDGcode) % 10000 == 5122) {
139 else if (std::abs(tempPDGcode) % 10000 == 4132) {
145 else if (std::abs(tempPDGcode) % 10000 == 4232) {
151 else if (std::abs(tempPDGcode) % 10000 == 5132) {
157 else if (std::abs(tempPDGcode) % 10000 == 5232) {
163 else if (std::abs(tempPDGcode) % 10000 == 2122) {
169 else if (std::abs(tempPDGcode) % 10000 == 1212) {
175 else if (std::abs(tempPDGcode) % 10000 == 2126) {
181 else if (std::abs(tempPDGcode) % 10000 == 1216) {
187 else if (std::abs(tempPDGcode) % 10000 == 2128) {
193 else if (std::abs(tempPDGcode) % 10000 == 1218) {
199 else if (std::abs(tempPDGcode) % 10000 == 2124) {
205 else if (std::abs(tempPDGcode) % 10000 == 1214) {
213 if ((quark1 < quark2) || (quark2 < quark3) || (quark1 < quark3)) {
215 if (verboseLevel > 0) {
216 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
217 G4cout <<
" illegal code for baryon ";
225 if (verboseLevel > 0) {
226 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
227 G4cout <<
" ??? unknown quark ";
235 if (tempPDGcode > 0) {
236 theQuarkContent[quark1 - 1]++;
237 theQuarkContent[quark2 - 1]++;
238 theQuarkContent[quark3 - 1]++;
241 theAntiQuarkContent[quark1 - 1]++;
242 theAntiQuarkContent[quark2 - 1]++;
243 theAntiQuarkContent[quark3 - 1]++;
249G4int G4PDGCodeChecker::CheckForMesons()
254 if (tempPDGcode == 310) spin = 0;
255 if (tempPDGcode == 130)
262 if ((quark1 != 0) || (quark2 == 0) || (quark3 == 0)) {
264 if (verboseLevel > 0) {
265 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
266 G4cout <<
" meson has only quark and anti-quark pair";
272 if (quark2 < quark3) {
274 if (verboseLevel > 0) {
275 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
276 G4cout <<
" illegal code for meson ";
286 if (verboseLevel > 0) {
287 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
288 G4cout <<
" ??? unknown quark ";
296 if ((quark2 & 1) != 0) {
298 if (tempPDGcode > 0) {
299 theQuarkContent[quark3 - 1] = 1;
300 theAntiQuarkContent[quark2 - 1] = 1;
303 theQuarkContent[quark2 - 1] = 1;
304 theAntiQuarkContent[quark3 - 1] = 1;
309 if (tempPDGcode > 0) {
310 theQuarkContent[quark2 - 1] = 1;
311 theAntiQuarkContent[quark3 - 1] = 1;
314 theQuarkContent[quark3 - 1] = 1;
315 theAntiQuarkContent[quark2 - 1] = 1;
321G4int G4PDGCodeChecker::CheckForDiQuarks()
323 if ((quark1 == 0) || (quark2 == 0) || (quark3 != 0)) {
328 if (quark1 < quark2) {
334 if (verboseLevel > 0) {
335 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
336 G4cout <<
" ??? unknown quark ";
345 theQuarkContent[quark1 - 1] += 1;
346 theQuarkContent[quark2 - 1] += 1;
349 theAntiQuarkContent[quark1 - 1] += 1;
350 theAntiQuarkContent[quark2 - 1] += 1;
356G4int G4PDGCodeChecker::CheckForQuarks()
358 quark1 = std::abs(
code);
362 if (verboseLevel > 0) {
363 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
364 G4cout <<
" ??? unknown quark ";
374 theQuarkContent[quark1 - 1] = 1;
377 theAntiQuarkContent[quark1 - 1] = 1;
387 totalCharge += (-1. / 3.) * eplus * theQuarkContent[flavor];
388 totalCharge += 1. / 3. * eplus * theAntiQuarkContent[flavor];
389 totalCharge += 2. / 3. * eplus * theQuarkContent[flavor + 1];
390 totalCharge += (-2. / 3.) * eplus * theAntiQuarkContent[flavor + 1];
393 if (std::fabs(totalCharge - thePDGCharge) > 0.1 * eplus) {
395 if (verboseLevel > 0) {
396 G4cout <<
" G4PDGCodeChecker::CheckCharge : ";
397 G4cout <<
" illegal electric charge " << thePDGCharge / eplus;
406G4int G4PDGCodeChecker::CheckForNuclei()
409 if (pcode < 1000000000) {
415 G4int LL = pcode / 10000000;
416 pcode -= 10000000 * LL;
417 G4int Z = pcode / 10000;
425 if (verboseLevel > 0) {
426 G4cout <<
" G4PDGCodeChecker::CheckPDGCode : ";
427 G4cout <<
" ??? Illegal PDG encoding for nucleus ";
434 G4int n_up = 2 * Z + (
A - Z - LL) + LL;
435 G4int n_down = Z + 2 * (
A - Z - LL) + LL;
440 theQuarkContent[0] = n_up;
441 theQuarkContent[1] = n_down;
442 theQuarkContent[2] = n_s;
446 theAntiQuarkContent[0] = n_up;
447 theAntiQuarkContent[1] = n_down;
448 theAntiQuarkContent[2] = n_s;
453void G4PDGCodeChecker::GetDigits(
G4int PDGcode)
455 G4int temp = std::abs(PDGcode);
457 higherSpin = temp / 10000000;
458 temp -=
G4int(higherSpin * 10000000);
460 exotic = temp / 1000000;
461 temp -=
G4int(exotic * 1000000);
463 radial = temp / 100000;
464 temp -=
G4int(radial * 100000);
466 multiplet = temp / 10000;
467 temp -=
G4int(multiplet * 10000);
469 quark1 = temp / 1000;
470 temp -=
G4int(quark1 * 1000);
473 temp -=
G4int(quark2 * 100);
476 temp -=
G4int(quark3 * 10);
479 if ((spin == 0) && (higherSpin != 0)) {
480 spin = higherSpin - 1;
G4GLOB_DLL std::ostream G4cout
G4int CheckPDGCode(G4int code, const G4String &type)
G4bool CheckCharge(G4double charge) const