44 std::vector<double> scalarMesonMix,
45 std::vector<double> vectorMesonMix)
47 mesonSpinMix=mesonMix;
48 barionSpinMix=barionMix;
49 scalarMesonMixings=scalarMesonMix;
50 vectorMesonMixings=vectorMesonMix;
59 Spin spin = (
G4UniformRand() < barionSpinMix) ? SpinHalf : SpinThreeHalf;
60 return Barion(black,white,spin);
65 Spin spin = (
G4UniformRand() < mesonSpinMix) ? SpinZero : SpinOne;
66 return Meson(black,white,spin);
76 return Meson(black,white, SpinZero);
79 return Barion(black,white, SpinHalf);
88 return Meson(black,white, SpinOne);
90 return Barion(black,white,SpinThreeHalf);
104 if (std::abs(charge) > 2 || std::abs(3.*charge - 3*
G4int(charge*1.001)) > perCent )
107 G4cerr <<
" Invalid total charge found for on input: "
109 G4cerr <<
" PGDcode input quark1/quark2 : " <<
119 if ( std::abs(id1) < std::abs(id2) )
126 if (std::abs(id1) > 3 )
127 throw G4HadronicException(__FILE__, __LINE__,
"G4HadronBuilder::Meson : Illegal Quark content as input");
131 if (id1 + id2 == 0) {
133 G4int imix = 2*std::abs(id1) - 1;
134 if(theSpin == SpinZero) {
135 PDGEncoding = 110*(1 + (
G4int)(rmix + scalarMesonMixings[imix - 1])
136 + (
G4int)(rmix + scalarMesonMixings[imix])
139 PDGEncoding = 110*(1 + (
G4int)(rmix + vectorMesonMixings[imix - 1])
140 + (
G4int)(rmix + vectorMesonMixings[imix])
144 PDGEncoding = 100 * std::abs(id1) + 10 * std::abs(id2) + theSpin;
145 G4bool IsUp = (std::abs(id1)&1) == 0;
147 if( (IsUp && IsAnti ) || (!IsUp && !IsAnti ) )
148 PDGEncoding = - PDGEncoding;
155 if (MesonDef == 0 ) {
156 G4cerr <<
" G4HadronBuilder - Warning: No particle for PDGcode= "
160 G4cerr <<
" G4HadronBuilder - Warning: Incorrect Charge : "
181 if (std::abs(charge) > 2 || std::abs(3.*charge - 3*
G4int(charge*1.001)) > perCent )
184 G4cerr <<
" Invalid total charge found for on input: "
186 G4cerr <<
" PGDcode input quark1/quark2 : " <<
194 if ( std::abs(id1) < std::abs(id2) )
201 if (std::abs(id1) < 1000 || std::abs(id2) > 3 )
202 throw G4HadronicException(__FILE__, __LINE__,
"G4HadronBuilder::Barion: Illegal quark content as input");
204 G4int ifl1= std::abs(id1)/1000;
205 G4int ifl2 = (std::abs(id1) - ifl1 * 1000)/100;
206 G4int diquarkSpin = std::abs(id1)%10;
214 G4int kfla = std::abs(ifl1);
215 G4int kflb = std::abs(ifl2);
216 G4int kflc = std::abs(ifl3);
218 G4int kfld = std::max(kfla,kflb);
219 kfld = std::max(kfld,kflc);
220 G4int kflf = std::min(kfla,kflb);
221 kflf = std::min(kflf,kflc);
223 G4int kfle = kfla + kflb + kflc - kfld - kflf;
226 theSpin = (kfla == kflb && kflb == kflc)? SpinThreeHalf : theSpin;
229 if(theSpin == SpinHalf && kfld > kfle && kfle > kflf) {
234 if(diquarkSpin == 1 ) {
241 if(diquarkSpin == 3 && kfla != kfld)
247 PDGEncoding = 1000 * kfld + 100 * kflf + 10 * kfle + theSpin;
249 PDGEncoding = 1000 * kfld + 100 * kfle + 10 * kflf + theSpin;
252 PDGEncoding = -PDGEncoding;
258 if (BarionDef == 0 ) {
259 G4cerr <<
" G4HadronBuilder - Warning: No particle for PDGcode= "
263 G4cerr <<
" G4HadronBuilder - Warning: Incorrect Charge : "
264 <<
" DiQuark/Quark = "
G4DLLIMPORT std::ostream G4cerr
G4ParticleDefinition * Build(G4ParticleDefinition *black, G4ParticleDefinition *white)
G4ParticleDefinition * BuildLowSpin(G4ParticleDefinition *black, G4ParticleDefinition *white)
G4HadronBuilder(G4double mesonMix, G4double barionMix, std::vector< double > scalarMesonMix, std::vector< double > vectorMesonMix)
G4ParticleDefinition * BuildHighSpin(G4ParticleDefinition *black, G4ParticleDefinition *white)
G4int GetPDGEncoding() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
const G4String & GetParticleSubType() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()