Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/particles/management/src/G4PDGCodeChecker.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /particles/management/src/G4PDGCodeChecker.cc (Version 11.3.0) and /particles/management/src/G4PDGCodeChecker.cc (Version 10.7.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4PDGCodeChecker                                26 // G4PDGCodeChecker
 27 //                                                 27 //
 28 // Author: Hisaya Kurashige, 17 August 1999        28 // Author: Hisaya Kurashige, 17 August 1999
 29 // -------------------------------------------     29 // --------------------------------------------------------------------
 30                                                    30 
 31 #include "G4PDGCodeChecker.hh"                 <<  31 #include <fstream>
                                                   >>  32 #include <iomanip>
 32                                                    33 
                                                   >>  34 #include "G4PDGCodeChecker.hh"
 33 #include "G4PhysicalConstants.hh"                  35 #include "G4PhysicalConstants.hh"
 34 #include "G4SystemOfUnits.hh"                      36 #include "G4SystemOfUnits.hh"
 35                                                    37 
 36 #include <fstream>                             <<  38 // --------------------------------------------------------------------
 37 #include <iomanip>                             <<  39 G4PDGCodeChecker::G4PDGCodeChecker()
 38                                                <<  40   : verboseLevel(1)
 39 G4PDGCodeChecker::G4PDGCodeChecker() : verbose << 
 40 {                                                  41 {
 41   // clear QuarkContents                           42   // clear QuarkContents
 42   for (G4int flavor = 0; flavor < NumberOfQuar <<  43   for (G4int flavor=0; flavor<NumberOfQuarkFlavor; ++flavor)
                                                   >>  44   {
 43     theQuarkContent[flavor] = 0;                   45     theQuarkContent[flavor] = 0;
 44     theAntiQuarkContent[flavor] = 0;               46     theAntiQuarkContent[flavor] = 0;
 45   }                                                47   }
 46 }                                                  48 }
 47                                                    49 
 48 G4int G4PDGCodeChecker::CheckPDGCode(G4int PDG <<  50 // --------------------------------------------------------------------
                                                   >>  51 G4PDGCodeChecker::~G4PDGCodeChecker()
                                                   >>  52 {
                                                   >>  53 }
                                                   >>  54 
                                                   >>  55 // --------------------------------------------------------------------
                                                   >>  56 G4int  G4PDGCodeChecker::CheckPDGCode( G4int PDGcode, 
                                                   >>  57                                        const G4String& particleType )
 49 {                                                  58 {
 50   code = PDGcode;                                  59   code = PDGcode;
 51   theParticleType = particleType;                  60   theParticleType = particleType;
 52                                                    61 
 53   // clear QuarkContents                           62   // clear QuarkContents
 54   for (G4int flavor = 0; flavor < NumberOfQuar <<  63   for (G4int flavor=0; flavor<NumberOfQuarkFlavor; ++flavor)
                                                   >>  64   {
 55     theQuarkContent[flavor] = 0;                   65     theQuarkContent[flavor] = 0;
 56     theAntiQuarkContent[flavor] = 0;               66     theAntiQuarkContent[flavor] = 0;
 57   }                                                67   }
 58                                                    68 
 59   // check code for nuclei                         69   // check code for nuclei
 60   if ((theParticleType == "nucleus") || (thePa <<  70   if ((theParticleType == "nucleus") || (theParticleType == "anti_nucleus"))
                                                   >>  71   {
 61     return CheckForNuclei();                       72     return CheckForNuclei();
 62   }                                                73   }
 63                                                    74 
 64   // get each digit number                         75   // get each digit number
 65   GetDigits(code);                                 76   GetDigits(code);
 66                                                    77 
 67   // check code                                    78   // check code
 68   if (theParticleType == "quarks") {           <<  79   if (theParticleType =="quarks")
                                                   >>  80   {
 69     return CheckForQuarks();                       81     return CheckForQuarks();
 70   }                                                82   }
 71   if (theParticleType == "diquarks") {         <<  83   else if  (theParticleType =="diquarks")
                                                   >>  84   {
 72     return CheckForDiQuarks();                     85     return CheckForDiQuarks();
 73   }                                                86   }
 74   if (theParticleType == "gluons") {           <<  87   else if (theParticleType =="gluons")
 75     return code;  // gluons, do not care about <<  88   {
                                                   >>  89     return code; // gluons, do not care about
 76   }                                                90   }
 77   if (theParticleType == "meson") {            <<  91   else if (theParticleType == "meson")
                                                   >>  92   {
 78     return CheckForMesons();                       93     return CheckForMesons();
                                                   >>  94 
 79   }                                                95   }
 80   if (theParticleType == "baryon") {           <<  96   else if (theParticleType == "baryon")
                                                   >>  97   {
 81     return CheckForBaryons();                      98     return CheckForBaryons();
 82   }                                                99   }
 83   // No check                                     100   // No check
 84   return code;                                    101   return code;
 85 }                                                 102 }
 86                                                << 103  
                                                   >> 104 // --------------------------------------------------------------------
 87 G4int G4PDGCodeChecker::CheckForBaryons()         105 G4int G4PDGCodeChecker::CheckForBaryons()
 88 {                                                 106 {
 89   G4int tempPDGcode = code;                    << 107   G4int   tempPDGcode = code;
 90                                                   108 
 91   if ((quark1 == 0) || (quark2 == 0) || (quark << 109   if ((quark1==0)||(quark2==0)||(quark3==0))
                                                   >> 110   { 
 92 #ifdef G4VERBOSE                                  111 #ifdef G4VERBOSE
 93     if (verboseLevel > 0) {                    << 112     if (verboseLevel>0)
                                                   >> 113     {
 94       G4cout << " G4PDGCodeChecker::CheckPDGCo    114       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
 95       G4cout << " meson has three quark ";        115       G4cout << " meson has three quark ";
 96       G4cout << " PDG code=" << code << G4endl << 116       G4cout << " PDG code=" << code <<G4endl;
 97     }                                             117     }
 98 #endif                                            118 #endif
 99     return 0;                                     119     return 0;
100   }                                               120   }
101                                                << 121  
102   // exceptions                                   122   // exceptions
103   if (std::abs(tempPDGcode) % 10000 == 3122) { << 123   if (std::abs(tempPDGcode)%10000 == 3122)
                                                   >> 124   { 
104     // Lambda                                     125     // Lambda
105     quark2 = 2;                                << 126     quark2=2;  quark3 = 1; spin = 1;
106     quark3 = 1;                                << 127   } else if (std::abs(tempPDGcode)%10000 == 3124) { 
107     spin = 1;                                  << 
108   }                                            << 
109   else if (std::abs(tempPDGcode) % 10000 == 31 << 
110     // Lambda*                                    128     // Lambda*
111     quark2 = 2;                                << 129     quark2=2;  quark3 = 1; spin = 3;
112     quark3 = 1;                                << 130   } else if (std::abs(tempPDGcode)%10000 == 3126) { 
113     spin = 3;                                  << 
114   }                                            << 
115   else if (std::abs(tempPDGcode) % 10000 == 31 << 
116     // Lambda*                                    131     // Lambda*
117     quark2 = 2;                                << 132     quark2=2;  quark3 = 1; spin = 5;
118     quark3 = 1;                                << 133   } else if (std::abs(tempPDGcode)%10000 == 3128) { 
119     spin = 5;                                  << 
120   }                                            << 
121   else if (std::abs(tempPDGcode) % 10000 == 31 << 
122     // Lambda*                                    134     // Lambda*
123     quark2 = 2;                                << 135     quark2=2;  quark3 = 1; spin = 7;
124     quark3 = 1;                                << 136   } else if (std::abs(tempPDGcode)%10000 == 4122) { 
125     spin = 7;                                  << 
126   }                                            << 
127   else if (std::abs(tempPDGcode) % 10000 == 41 << 
128     // Lambda_c                                   137     // Lambda_c
129     quark2 = 2;                                << 138     quark2=2;  quark3 = 1; spin = 1;
130     quark3 = 1;                                << 139   } else if (std::abs(tempPDGcode)%10000 == 5122) { 
131     spin = 1;                                  << 
132   }                                            << 
133   else if (std::abs(tempPDGcode) % 10000 == 51 << 
134     // Lambda_b                                   140     // Lambda_b
135     quark2 = 2;                                << 141     quark2=2;  quark3 = 1; spin = 1;
136     quark3 = 1;                                << 142   } else if (std::abs(tempPDGcode)%10000 == 4132) { 
137     spin = 1;                                  << 
138   }                                            << 
139   else if (std::abs(tempPDGcode) % 10000 == 41 << 
140     // Xi_c0                                      143     // Xi_c0
141     quark2 = 3;                                << 144     quark2=3;  quark3 = 1; spin = 1;
142     quark3 = 1;                                << 145   } else if (std::abs(tempPDGcode)%10000 == 4232) { 
143     spin = 1;                                  << 
144   }                                            << 
145   else if (std::abs(tempPDGcode) % 10000 == 42 << 
146     // Xi_c+                                      146     // Xi_c+
147     quark2 = 3;                                << 147     quark2=3;  quark3 = 2; spin = 1;
148     quark3 = 2;                                << 148   } else if (std::abs(tempPDGcode)%10000 == 5132) { 
149     spin = 1;                                  << 
150   }                                            << 
151   else if (std::abs(tempPDGcode) % 10000 == 51 << 
152     // Xi_b0                                      149     // Xi_b0
153     quark2 = 3;                                << 150     quark2=3;  quark3 = 1; spin = 1;
154     quark3 = 1;                                << 151   } else if (std::abs(tempPDGcode)%10000 == 5232) { 
155     spin = 1;                                  << 
156   }                                            << 
157   else if (std::abs(tempPDGcode) % 10000 == 52 << 
158     // Xi_b+                                      152     // Xi_b+
159     quark2 = 3;                                << 153     quark2=3;  quark3 = 2; spin = 1;
160     quark3 = 2;                                << 154   } else if (std::abs(tempPDGcode)%10000 == 2122) { 
161     spin = 1;                                  << 155     // Delta+ (spin 1/2) 
162   }                                            << 156     quark2=2;  quark3 = 1; spin = 1;
163   else if (std::abs(tempPDGcode) % 10000 == 21 << 157   } else if (std::abs(tempPDGcode)%10000 == 1212) { 
164     // Delta+ (spin 1/2)                       << 158     // Delta0 (spin 1/2) 
165     quark2 = 2;                                << 159     quark1=2;  quark2 = 1; spin = 1;
166     quark3 = 1;                                << 160   } else if (std::abs(tempPDGcode)%10000 == 2126) { 
167     spin = 1;                                  << 161     // Delta+ (spin 5/2) 
168   }                                            << 162     quark2=2;  quark3 = 1; spin = 5;
169   else if (std::abs(tempPDGcode) % 10000 == 12 << 163   } else if (std::abs(tempPDGcode)%10000 == 1216) { 
170     // Delta0 (spin 1/2)                       << 164     // Delta0 (spin 5/2) 
171     quark1 = 2;                                << 165     quark1=2;  quark2 = 1; spin = 5;
172     quark2 = 1;                                << 166   } else if (std::abs(tempPDGcode)%10000 == 2128) { 
173     spin = 1;                                  << 167     // Delta+ (spin 7/2) 
174   }                                            << 168     quark2=2;  quark3 = 1; spin = 7;
175   else if (std::abs(tempPDGcode) % 10000 == 21 << 169   } else if (std::abs(tempPDGcode)%10000 == 1218) { 
176     // Delta+ (spin 5/2)                       << 170     // Delta0 (spin 7/2) 
177     quark2 = 2;                                << 171     quark1=2;  quark2 = 1; spin = 7;
178     quark3 = 1;                                << 172   } else if (std::abs(tempPDGcode)%10000 == 2124) { 
179     spin = 5;                                  << 173     // N*+ (spin 3/2) 
180   }                                            << 174     quark2=2;  quark3 = 1; spin = 3;
181   else if (std::abs(tempPDGcode) % 10000 == 12 << 175   } else if (std::abs(tempPDGcode)%10000 == 1214) { 
182     // Delta0 (spin 5/2)                       << 176     // N*0 (spin 3/2) 
183     quark1 = 2;                                << 177     quark1=2;  quark2 = 1; spin = 3;
184     quark2 = 1;                                << 178   } 
185     spin = 5;                                  << 
186   }                                            << 
187   else if (std::abs(tempPDGcode) % 10000 == 21 << 
188     // Delta+ (spin 7/2)                       << 
189     quark2 = 2;                                << 
190     quark3 = 1;                                << 
191     spin = 7;                                  << 
192   }                                            << 
193   else if (std::abs(tempPDGcode) % 10000 == 12 << 
194     // Delta0 (spin 7/2)                       << 
195     quark1 = 2;                                << 
196     quark2 = 1;                                << 
197     spin = 7;                                  << 
198   }                                            << 
199   else if (std::abs(tempPDGcode) % 10000 == 21 << 
200     // N*+ (spin 3/2)                          << 
201     quark2 = 2;                                << 
202     quark3 = 1;                                << 
203     spin = 3;                                  << 
204   }                                            << 
205   else if (std::abs(tempPDGcode) % 10000 == 12 << 
206     // N*0 (spin 3/2)                          << 
207     quark1 = 2;                                << 
208     quark2 = 1;                                << 
209     spin = 3;                                  << 
210   }                                            << 
211                                                   179 
212   // check quark flavor                           180   // check quark flavor
213   if ((quark1 < quark2) || (quark2 < quark3) | << 181   if ((quark1<quark2)||(quark2<quark3)||(quark1<quark3))
                                                   >> 182   { 
214 #ifdef G4VERBOSE                                  183 #ifdef G4VERBOSE
215     if (verboseLevel > 0) {                    << 184     if (verboseLevel>0)
                                                   >> 185     {
216       G4cout << " G4PDGCodeChecker::CheckPDGCo    186       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
217       G4cout << " illegal code for baryon ";      187       G4cout << " illegal code for baryon ";
218       G4cout << " PDG code=" << code << G4endl    188       G4cout << " PDG code=" << code << G4endl;
219     }                                             189     }
220 #endif                                            190 #endif
221     return 0;                                     191     return 0;
222   }                                               192   }
223   if (quark1 > NumberOfQuarkFlavor) {          << 193   if (quark1> NumberOfQuarkFlavor)
                                                   >> 194   {
224 #ifdef G4VERBOSE                                  195 #ifdef G4VERBOSE
225     if (verboseLevel > 0) {                    << 196     if (verboseLevel>0)
                                                   >> 197     {
226       G4cout << " G4PDGCodeChecker::CheckPDGCo    198       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
227       G4cout << " ??? unknown quark ";            199       G4cout << " ??? unknown quark ";
228       G4cout << " PDG code=" << code << G4endl << 200       G4cout << " PDG code=" << code <<G4endl;
229     }                                             201     }
230 #endif                                            202 #endif
231     return 0;                                     203     return 0;
232   }                                               204   }
233                                                   205 
234   // Fill Quark contents                          206   // Fill Quark contents
235   if (tempPDGcode > 0) {                       << 207   if (tempPDGcode >0)
236     theQuarkContent[quark1 - 1]++;             << 208   {
237     theQuarkContent[quark2 - 1]++;             << 209     theQuarkContent[quark1-1] ++;
238     theQuarkContent[quark3 - 1]++;             << 210     theQuarkContent[quark2-1] ++;
239   }                                            << 211     theQuarkContent[quark3-1] ++;
240   else {                                       << 212   }
241     theAntiQuarkContent[quark1 - 1]++;         << 213   else
242     theAntiQuarkContent[quark2 - 1]++;         << 214   {
243     theAntiQuarkContent[quark3 - 1]++;         << 215     theAntiQuarkContent[quark1-1] ++;
                                                   >> 216     theAntiQuarkContent[quark2-1] ++;
                                                   >> 217     theAntiQuarkContent[quark3-1] ++;
244   }                                               218   }
245                                                   219 
246   return code;                                    220   return code;
247 }                                                 221 }
248                                                << 222  
                                                   >> 223 // --------------------------------------------------------------------
249 G4int G4PDGCodeChecker::CheckForMesons()          224 G4int G4PDGCodeChecker::CheckForMesons()
250 {                                                 225 {
251   G4int tempPDGcode = code;                       226   G4int tempPDGcode = code;
252                                                   227 
253   // -- exceptions --                             228   // -- exceptions --
254   if (tempPDGcode == 310) spin = 0;  // K0s    << 229   if (tempPDGcode == 310) spin = 0; // K0s
255   if (tempPDGcode == 130)  // K0l              << 230   if (tempPDGcode == 130)           // K0l
256   {                                               231   {
257     spin = 0;                                  << 232     spin = 0;        
258     quark2 = 3;                                   233     quark2 = 3;
259     quark3 = 1;                                   234     quark3 = 1;
260   }                                               235   }
261                                                << 236   
262   if ((quark1 != 0) || (quark2 == 0) || (quark << 237   if ((quark1 !=0)||(quark2==0)||(quark3==0))
                                                   >> 238   { 
263 #ifdef G4VERBOSE                                  239 #ifdef G4VERBOSE
264     if (verboseLevel > 0) {                    << 240     if (verboseLevel>0)
                                                   >> 241     {
265       G4cout << " G4PDGCodeChecker::CheckPDGCo    242       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
266       G4cout << " meson has only quark and ant    243       G4cout << " meson has only quark and anti-quark pair";
267       G4cout << " PDG code=" << code << G4endl << 244       G4cout << " PDG code=" << code <<G4endl;
268     }                                             245     }
269 #endif                                            246 #endif
270     return 0;                                     247     return 0;
271   }                                            << 248   } 
272   if (quark2 < quark3) {                       << 249   if (quark2<quark3)
                                                   >> 250   { 
273 #ifdef G4VERBOSE                                  251 #ifdef G4VERBOSE
274     if (verboseLevel > 0) {                    << 252     if (verboseLevel>0)
                                                   >> 253     {
275       G4cout << " G4PDGCodeChecker::CheckPDGCo    254       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
276       G4cout << " illegal code for meson ";       255       G4cout << " illegal code for meson ";
277       G4cout << " PDG code=" << code << G4endl << 256       G4cout << " PDG code=" << code <<G4endl;
278     }                                             257     }
279 #endif                                            258 #endif
280     return 0;                                     259     return 0;
281   }                                               260   }
282                                                   261 
283   // check quark flavor                           262   // check quark flavor
284   if (quark2 > NumberOfQuarkFlavor) {          << 263   if (quark2> NumberOfQuarkFlavor)
                                                   >> 264   {
285 #ifdef G4VERBOSE                                  265 #ifdef G4VERBOSE
286     if (verboseLevel > 0) {                    << 266     if (verboseLevel>0)
                                                   >> 267     {
287       G4cout << " G4PDGCodeChecker::CheckPDGCo    268       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
288       G4cout << " ??? unknown quark ";            269       G4cout << " ??? unknown quark ";
289       G4cout << " PDG code=" << code << G4endl << 270       G4cout << " PDG code=" << code <<G4endl;
290     }                                             271     }
291 #endif                                            272 #endif
292     return 0;                                     273     return 0;
293   }                                               274   }
294                                                   275 
295   // check heavier quark type                     276   // check heavier quark type
296   if ((quark2 & 1) != 0) {                     << 277   if (quark2 & 1)
                                                   >> 278   {
297     // down type qurak                            279     // down type qurak
298     if (tempPDGcode > 0) {                     << 280     if (tempPDGcode >0)
299       theQuarkContent[quark3 - 1] = 1;         << 281     {
300       theAntiQuarkContent[quark2 - 1] = 1;     << 282       theQuarkContent[quark3-1] =1;
301     }                                          << 283       theAntiQuarkContent[quark2-1] =1;
302     else {                                     << 284     }
303       theQuarkContent[quark2 - 1] = 1;         << 285     else
304       theAntiQuarkContent[quark3 - 1] = 1;     << 286     {
                                                   >> 287       theQuarkContent[quark2-1] =1;
                                                   >> 288       theAntiQuarkContent[quark3-1] =1;
305     }                                             289     }
306   }                                               290   }
307   else {                                       << 291   else
                                                   >> 292   {
308     // up type quark                              293     // up type quark
309     if (tempPDGcode > 0) {                     << 294     if (tempPDGcode >0)
310       theQuarkContent[quark2 - 1] = 1;         << 295     {
311       theAntiQuarkContent[quark3 - 1] = 1;     << 296       theQuarkContent[quark2-1] =1;
312     }                                          << 297       theAntiQuarkContent[quark3-1] =1;
313     else {                                     << 298     }
314       theQuarkContent[quark3 - 1] = 1;         << 299     else
315       theAntiQuarkContent[quark2 - 1] = 1;     << 300     {
                                                   >> 301       theQuarkContent[quark3-1] =1;
                                                   >> 302       theAntiQuarkContent[quark2-1] =1;
316     }                                             303     }
317   }                                               304   }
318   return code;                                    305   return code;
319 }                                                 306 }
320                                                   307 
                                                   >> 308 // --------------------------------------------------------------------
321 G4int G4PDGCodeChecker::CheckForDiQuarks()        309 G4int G4PDGCodeChecker::CheckForDiQuarks()
322 {                                                 310 {
323   if ((quark1 == 0) || (quark2 == 0) || (quark << 311   if ((quark1 ==0) || (quark2 ==0) || (quark3 !=0))
                                                   >> 312   {
324     // quark3 should be 0                         313     // quark3 should be 0
325     //  --- code is wrong                      << 314     //  --- code is wrong 
326     return 0;                                     315     return 0;
                                                   >> 316 
327   }                                               317   }
328   if (quark1 < quark2) {                       << 318   else if (quark1 < quark2)
329     //  --- code is wrong                      << 319   {
                                                   >> 320     //  --- code is wrong 
330     return 0;                                     321     return 0;
                                                   >> 322 
331   }                                               323   }
332   if (quark2 > NumberOfQuarkFlavor) {          << 324   else if (quark2>NumberOfQuarkFlavor)
                                                   >> 325   {
333 #ifdef G4VERBOSE                                  326 #ifdef G4VERBOSE
334     if (verboseLevel > 0) {                    << 327     if (verboseLevel>0)
                                                   >> 328     {
335       G4cout << " G4PDGCodeChecker::CheckPDGCo    329       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
336       G4cout << " ??? unknown quark ";            330       G4cout << " ??? unknown quark ";
337       G4cout << " PDG code=" << code << G4endl << 331       G4cout << " PDG code=" << code <<G4endl;
338     }                                             332     }
339 #endif                                            333 #endif
340     return 0;                                     334     return 0;
341   }                                               335   }
342                                                   336 
343   // Fill Quark Contents                          337   // Fill Quark Contents
344   if (code > 0) {                              << 338   if (code>0)
345     theQuarkContent[quark1 - 1] += 1;          << 339   {
346     theQuarkContent[quark2 - 1] += 1;          << 340     theQuarkContent[quark1-1] +=1;
347   }                                            << 341     theQuarkContent[quark2-1] +=1;
348   else {                                       << 342   }
349     theAntiQuarkContent[quark1 - 1] += 1;      << 343   else
350     theAntiQuarkContent[quark2 - 1] += 1;      << 344   {
                                                   >> 345     theAntiQuarkContent[quark1-1] +=1;
                                                   >> 346     theAntiQuarkContent[quark2-1] +=1;
351   }                                               347   }
352                                                   348 
353   return code;                                    349   return code;
354 }                                                 350 }
355                                                << 351  
                                                   >> 352 // --------------------------------------------------------------------
356 G4int G4PDGCodeChecker::CheckForQuarks()          353 G4int G4PDGCodeChecker::CheckForQuarks()
357 {                                                 354 {
358   quark1 = std::abs(code);                        355   quark1 = std::abs(code);
359                                                   356 
360   if (std::abs(quark1) > NumberOfQuarkFlavor)  << 357   if ( std::abs(quark1)>NumberOfQuarkFlavor )
                                                   >> 358   {
361 #ifdef G4VERBOSE                                  359 #ifdef G4VERBOSE
362     if (verboseLevel > 0) {                    << 360     if (verboseLevel>0)
                                                   >> 361     {
363       G4cout << " G4PDGCodeChecker::CheckPDGCo    362       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
364       G4cout << " ??? unknown quark ";            363       G4cout << " ??? unknown quark ";
365       G4cout << " PDG code=" << code << G4endl << 364       G4cout << " PDG code=" << code <<G4endl;
366     }                                             365     }
367 #endif                                            366 #endif
368     //  --- code is wrong                      << 367     //  --- code is wrong 
369     return 0;                                     368     return 0;
370   }                                            << 369   } 
371                                                   370 
372   // Fill Quark Contents                          371   // Fill Quark Contents
373   if (code > 0) {                              << 372   if (code>0)
374     theQuarkContent[quark1 - 1] = 1;           << 373   {
                                                   >> 374     theQuarkContent[quark1-1] =1;
375   }                                               375   }
376   else {                                       << 376   else
377     theAntiQuarkContent[quark1 - 1] = 1;       << 377   {
                                                   >> 378     theAntiQuarkContent[quark1-1] =1;
378   }                                               379   }
379   return code;                                    380   return code;
380 }                                                 381 }
381                                                   382 
                                                   >> 383 // --------------------------------------------------------------------
382 G4bool G4PDGCodeChecker::CheckCharge(G4double     384 G4bool G4PDGCodeChecker::CheckCharge(G4double thePDGCharge) const
383 {                                                 385 {
384   // check charge                                 386   // check charge
385   G4double totalCharge = 0.0;                     387   G4double totalCharge = 0.0;
386   for (G4int flavor = 0; flavor < NumberOfQuar << 388   for (G4int flavor= 0; flavor<NumberOfQuarkFlavor-1; flavor+=2)
387     totalCharge += (-1. / 3.) * eplus * theQua << 389   {
388     totalCharge += 1. / 3. * eplus * theAntiQu << 390     totalCharge += (-1./3.)*eplus*theQuarkContent[flavor];
389     totalCharge += 2. / 3. * eplus * theQuarkC << 391     totalCharge += 1./3.*eplus*theAntiQuarkContent[flavor];
390     totalCharge += (-2. / 3.) * eplus * theAnt << 392     totalCharge += 2./3.*eplus*theQuarkContent[flavor+1];
                                                   >> 393     totalCharge += (-2./3.)*eplus*theAntiQuarkContent[flavor+1];
391   }                                               394   }
392                                                   395 
393   if (std::fabs(totalCharge - thePDGCharge) >  << 396   if (std::fabs(totalCharge-thePDGCharge)>0.1*eplus)
                                                   >> 397   { 
394 #ifdef G4VERBOSE                                  398 #ifdef G4VERBOSE
395     if (verboseLevel > 0) {                    << 399     if (verboseLevel>0)
                                                   >> 400     {
396       G4cout << " G4PDGCodeChecker::CheckCharg    401       G4cout << " G4PDGCodeChecker::CheckCharge  : ";
397       G4cout << " illegal electric charge " << << 402       G4cout << " illegal electric charge " << thePDGCharge/eplus;
398       G4cout << " PDG code=" << code << G4endl << 403       G4cout << " PDG code=" << code <<G4endl;
399     }                                             404     }
400 #endif                                            405 #endif
401     return false;                                 406     return false;
402   }                                               407   }
403   return true;                                    408   return true;
404 }                                                 409 }
405                                                   410 
                                                   >> 411 // --------------------------------------------------------------------
406 G4int G4PDGCodeChecker::CheckForNuclei()          412 G4int G4PDGCodeChecker::CheckForNuclei()
407 {                                                 413 {
408   G4int pcode = std::abs(code);                   414   G4int pcode = std::abs(code);
409   if (pcode < 1000000000) {                    << 415   if (pcode < 1000000000)
410     // non-nuclei                              << 416   {
                                                   >> 417     // non-nuclei   
411     return 0;                                     418     return 0;
412   }                                               419   }
413                                                   420 
414   pcode -= 1000000000;                            421   pcode -= 1000000000;
415   G4int LL = pcode / 10000000;                 << 422   G4int LL = pcode/10000000;
416   pcode -= 10000000 * LL;                      << 423   pcode -= 10000000*LL;
417   G4int Z = pcode / 10000;                     << 424   G4int Z = pcode/10000;
418   pcode -= 10000 * Z;                          << 425   pcode -= 10000*Z;
419   G4int A = pcode / 10;                        << 426   G4int A = pcode/10;
420                                                << 427   
421   // Allow neutron balls                          428   // Allow neutron balls
422   // if (A < 2 || Z > A-LL || LL>A || Z<=0 ) {    429   // if (A < 2 || Z > A-LL || LL>A || Z<=0 ) {
423   if (A < 2 || Z > A - LL || LL > A) {         << 430   if (A < 2 || Z > A-LL || LL>A )
                                                   >> 431   {
424 #ifdef G4VERBOSE                                  432 #ifdef G4VERBOSE
425     if (verboseLevel > 0) {                    << 433     if (verboseLevel>0)
                                                   >> 434     {
426       G4cout << " G4PDGCodeChecker::CheckPDGCo    435       G4cout << " G4PDGCodeChecker::CheckPDGCode : ";
427       G4cout << " ???  Illegal PDG encoding fo    436       G4cout << " ???  Illegal PDG encoding for nucleus ";
428       G4cout << " PDG code=" << code << G4endl << 437       G4cout << " PDG code=" << code <<G4endl;
429     }                                             438     }
430 #endif                                            439 #endif
431     return 0;                                     440     return 0;
432   }                                               441   }
433                                                   442 
434   G4int n_up = 2 * Z + (A - Z - LL) + LL;      << 443   G4int n_up   = 2*Z +   (A-Z-LL) + LL;
435   G4int n_down = Z + 2 * (A - Z - LL) + LL;    << 444   G4int n_down =   Z + 2*(A-Z-LL) + LL;
436   G4int n_s = LL;                              << 445   G4int n_s    =   LL;
437                                                   446 
438   // Fill Quark contents                          447   // Fill Quark contents
439   if (code > 0) {                              << 448   if (code>0)
                                                   >> 449   {
440     theQuarkContent[0] = n_up;                    450     theQuarkContent[0] = n_up;
441     theQuarkContent[1] = n_down;                  451     theQuarkContent[1] = n_down;
442     theQuarkContent[2] = n_s;                     452     theQuarkContent[2] = n_s;
443   }                                               453   }
444   else {                                       << 454   else
                                                   >> 455   {
445     // anti_nucleus                               456     // anti_nucleus
446     theAntiQuarkContent[0] = n_up;                457     theAntiQuarkContent[0] = n_up;
447     theAntiQuarkContent[1] = n_down;              458     theAntiQuarkContent[1] = n_down;
448     theAntiQuarkContent[2] = n_s;                 459     theAntiQuarkContent[2] = n_s;
449   }                                               460   }
450   return code;                                    461   return code;
451 }                                                 462 }
452                                                << 463  
                                                   >> 464 // --------------------------------------------------------------------
453 void G4PDGCodeChecker::GetDigits(G4int PDGcode    465 void G4PDGCodeChecker::GetDigits(G4int PDGcode)
454 {                                                 466 {
455   G4int temp = std::abs(PDGcode);                 467   G4int temp = std::abs(PDGcode);
                                                   >> 468   
                                                   >> 469   higherSpin = temp/10000000;
                                                   >> 470   temp -= G4int(higherSpin*10000000);
456                                                   471 
457   higherSpin = temp / 10000000;                << 472   exotic = temp/1000000;
458   temp -= G4int(higherSpin * 10000000);        << 473   temp -= G4int(exotic*1000000);
459                                                   474 
460   exotic = temp / 1000000;                     << 475   radial = temp/100000;
461   temp -= G4int(exotic * 1000000);             << 476   temp -= G4int(radial*100000);
462                                                   477 
463   radial = temp / 100000;                      << 478   multiplet = temp/10000;
464   temp -= G4int(radial * 100000);              << 479   temp -= G4int(multiplet*10000);
465                                                   480 
466   multiplet = temp / 10000;                    << 481   quark1 = temp/1000;
467   temp -= G4int(multiplet * 10000);            << 482   temp -= G4int(quark1*1000);
468                                                   483 
469   quark1 = temp / 1000;                        << 484   quark2 = temp/100;
470   temp -= G4int(quark1 * 1000);                << 485   temp -= G4int(quark2*100);
471                                                   486 
472   quark2 = temp / 100;                         << 487   quark3 = temp/10;
473   temp -= G4int(quark2 * 100);                 << 488   temp -= G4int(quark3*10);
474                                                << 
475   quark3 = temp / 10;                          << 
476   temp -= G4int(quark3 * 10);                  << 
477                                                   489 
478   spin = temp;                                    490   spin = temp;
479   if ((spin == 0) && (higherSpin != 0)) {      << 491   if ((spin ==0) && ( higherSpin !=0 ))
480     spin = higherSpin - 1;                     << 492   {
                                                   >> 493     spin =  higherSpin-1;
481   }                                               494   }
482   else {                                       << 495   else
                                                   >> 496   {
483     spin -= 1;                                    497     spin -= 1;
484   }                                               498   }
485 }                                                 499 }
486                                                   500