#include <G4MesonSplitter.hh>
Public Member Functions | |
G4bool | SplitMeson (G4int PDGcode, G4int *aEnd, G4int *bEnd) |
Definition at line 36 of file G4MesonSplitter.hh.
Definition at line 29 of file G4MesonSplitter.cc.
References G4SwapObj(), and G4UniformRand.
00030 { 00031 G4bool result = true; 00032 G4int absPDGcode = std::abs(PDGcode); 00033 if (absPDGcode >= 1000) return false; 00034 if(absPDGcode == 22) 00035 { 00036 G4int it=1; 00037 if(G4UniformRand()<.5) it++; 00038 *aEnd = it; 00039 *bEnd = -it; 00040 } 00041 else 00042 { 00043 G4int heavy = absPDGcode/100; 00044 G4int light = (absPDGcode%100)/10; 00045 G4int anti = 1 - 2*(std::max(heavy, light)%2); 00046 if (PDGcode < 0 ) anti = -anti; 00047 heavy *= anti; 00048 light *= -anti; 00049 if ( anti < 0) G4SwapObj(&heavy, &light); 00050 *aEnd = heavy; 00051 *bEnd = light; 00052 } 00053 return result; 00054 }