Geant4_10
G4SPBaryon.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 #include "G4SPBaryon.hh"
27 #include "Randomize.hh"
28 #include "G4ParticleTable.hh"
29 
30 // correcting numbers, HPW Dec 1999
31 
33 {
34  G4double sum = GetProbability(diQuark);
35  G4double random = G4UniformRand();
36  G4double running = 0;
37  G4int Quark(0);
38  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
39  iter i;
40  for(i = thePartonInfo.begin(); i!=thePartonInfo.end(); i++)
41  {
42  if (std::abs((*i)->GetDiQuark()) == std::abs(diQuark))
43  {
44  running += (*i)->GetProbability();
45  if (running/sum >= random)
46  {
47  Quark = (*i)->GetQuark();
48  break;
49  }
50  }
51  }
52  return Quark;
53 }
54 
56 {
57  G4double sum = 0;
58  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
59  iter i;
60  for(i = thePartonInfo.begin(); i!=thePartonInfo.end(); i++)
61  {
62  if (std::abs((*i)->GetDiQuark()) == std::abs(diQuark))
63  {
64  sum += (*i)->GetProbability();
65  }
66  }
67  return sum;
68 }
69 
71 MatchDiQuarkAndGetQuark(const G4SPBaryon & aBaryon, G4int & aDiQuark) const
72 {
73  G4int result=0;
74  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
75  iter i;
76  G4double running = 0;
77  G4double total = 0;
78  for(i = thePartonInfo.begin(); i!=thePartonInfo.end(); i++)
79  {
80  total += aBaryon.GetProbability((*i)->GetDiQuark());
81  }
82  G4double random = G4UniformRand()*total;
83  for(i = thePartonInfo.begin(); i!=thePartonInfo.end(); i++)
84  {
85  running += aBaryon.GetProbability((*i)->GetDiQuark());
86  if(random/total<running)
87  {
88  result = (*i)->GetQuark(); // (diquark annihilated)
89  aDiQuark = (*i)->GetDiQuark();
90  break;
91  }
92  }
93  return result;
94 }
95 
96 void G4SPBaryon::
97 SampleQuarkAndDiquark(G4int & quark, G4int & diQuark) const
98 {
99  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
100  G4double random = G4UniformRand();
101  G4double sum = 0;
102  iter i;
103  for(i=thePartonInfo.begin() ; i!=thePartonInfo.end(); i++)
104  {
105  sum += (*i)->GetProbability();
106  if (sum > random)
107  {
108  if (theDefinition->GetPDGEncoding() < 0)
109  {
110  quark = (*i)->GetDiQuark();
111  diQuark = (*i)->GetQuark();
112  }
113  else
114  {
115  quark = (*i)->GetQuark();
116  diQuark = (*i)->GetDiQuark();
117  }
118  break;
119  }
120  }
121 }
122 
123 void G4SPBaryon::
124 FindDiquark(G4int quark, G4int & diQuark) const
125 {
126  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
127  G4double sum = 0;
128  iter i;
129  for(i=thePartonInfo.begin() ; i!=thePartonInfo.end(); i++)
130  {
131  if (std::abs((*i)->GetQuark()) == std::abs(quark))
132  {
133  sum += (*i)->GetProbability();
134  }
135  }
136  G4double random = G4UniformRand();
137  G4double running = 0;
138  for(i=thePartonInfo.begin() ; i!=thePartonInfo.end(); i++)
139  {
140  if (std::abs((*i)->GetQuark()) == std::abs(quark))
141  {
142  running += (*i)->GetProbability();
143  if (running/sum >= random)
144  {
145  diQuark = (*i)->GetDiQuark();
146  break;
147  }
148  }
149  }
150 }
151 
152 
155 {
156  theDefinition = aProton;
157  thePartonInfo.push_back(new G4SPPartonInfo(2203, 1, 1./3.)); // uu_1, d
158  thePartonInfo.push_back(new G4SPPartonInfo(2103, 2, 1./6.)); // ud_1, u
159  thePartonInfo.push_back(new G4SPPartonInfo(2101, 2, 1./2.)); // ud_0, u
160 }
161 
163 G4SPBaryon(G4AntiProton * aAntiProton)
164 {
165  theDefinition = aAntiProton;
166  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -1, 1./3.));
167  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -2, 1./6.));
168  thePartonInfo.push_back(new G4SPPartonInfo(-2101, -2, 1./2.));
169 }
170 
173 {
174  theDefinition = aNeutron;
175  thePartonInfo.push_back(new G4SPPartonInfo(2103, 1, 1./6.)); // ud_1, d
176  thePartonInfo.push_back(new G4SPPartonInfo(2101, 1, 1./2.)); // ud_0, d
177  thePartonInfo.push_back(new G4SPPartonInfo(1103, 2, 1./3.)); // dd_1, u
178 }
179 
181 G4SPBaryon(G4AntiNeutron * aAntiNeutron)
182 {
183  theDefinition = aAntiNeutron;
184  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -1, 1./6.));
185  thePartonInfo.push_back(new G4SPPartonInfo(-2101, -1, 1./2.));
186  thePartonInfo.push_back(new G4SPPartonInfo(-1103, -2, 1./3.));
187 }
188 
191 {
192  theDefinition = aLambda;
193  thePartonInfo.push_back(new G4SPPartonInfo(2103, 3, 1./3.)); // ud_1, s
194  thePartonInfo.push_back(new G4SPPartonInfo(3203, 1, 1./4.)); // su_1, d
195  thePartonInfo.push_back(new G4SPPartonInfo(3201, 1, 1./12.)); // su_0, d
196  thePartonInfo.push_back(new G4SPPartonInfo(3103, 2, 1./4.)); // sd_1, u
197  thePartonInfo.push_back(new G4SPPartonInfo(3101, 2, 1./12.)); // sd_0, u
198 }
199 
201 G4SPBaryon(G4AntiLambda * aAntiLambda)
202 {
203  theDefinition = aAntiLambda;
204  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -3, 1./3.));
205  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -1, 1./4.));
206  thePartonInfo.push_back(new G4SPPartonInfo(-3201, -1, 1./12.));
207  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -2, 1./4.));
208  thePartonInfo.push_back(new G4SPPartonInfo(-3101, -2, 1./12.));
209 }
210 
212 G4SPBaryon(G4SigmaPlus * aSigmaPlus)
213 {
214  theDefinition = aSigmaPlus;
215  thePartonInfo.push_back(new G4SPPartonInfo(2203, 3, 1./3.));
216  thePartonInfo.push_back(new G4SPPartonInfo(3203, 2, 1./6.));
217  thePartonInfo.push_back(new G4SPPartonInfo(3201, 2, 1./2.));
218 }
219 
221 G4SPBaryon(G4AntiSigmaPlus * aAntiSigmaPlus)
222 {
223  theDefinition = aAntiSigmaPlus;
224  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -3, 1./3.));
225  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -2, 1./6.));
226  thePartonInfo.push_back(new G4SPPartonInfo(-3201, -2, 1./2.));
227 }
228 
230 G4SPBaryon(G4SigmaZero * aSigmaZero)
231 {
232  theDefinition = aSigmaZero;
233  thePartonInfo.push_back(new G4SPPartonInfo(2103, 3, 1./3.));
234  thePartonInfo.push_back(new G4SPPartonInfo(3203, 1, 1./12.));
235  thePartonInfo.push_back(new G4SPPartonInfo(3201, 1, 1./4.));
236  thePartonInfo.push_back(new G4SPPartonInfo(3103, 2, 1./12.));
237  thePartonInfo.push_back(new G4SPPartonInfo(3101, 2, 1./4.));
238 }
239 
241 G4SPBaryon(G4AntiSigmaZero * aAntiSigmaZero)
242 {
243  theDefinition = aAntiSigmaZero;
244  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -3, 1./3.));
245  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -1, 1./12.));
246  thePartonInfo.push_back(new G4SPPartonInfo(-3201, -1, 1./4.));
247  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -2, 1./12.));
248  thePartonInfo.push_back(new G4SPPartonInfo(-3101, -2, 1./4.));
249 }
250 
252 G4SPBaryon(G4SigmaMinus * aSigmaMinus)
253 {
254  theDefinition = aSigmaMinus;
255  thePartonInfo.push_back(new G4SPPartonInfo(1103, 3, 1./3.));
256  thePartonInfo.push_back(new G4SPPartonInfo(3103, 1, 1./6.));
257  thePartonInfo.push_back(new G4SPPartonInfo(3101, 1, 1./2.));
258 }
259 
261 G4SPBaryon(G4AntiSigmaMinus * aAntiSigmaMinus)
262 {
263  theDefinition = aAntiSigmaMinus;
264  thePartonInfo.push_back(new G4SPPartonInfo(-1103, -3, 1./3.));
265  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -1, 1./6.));
266  thePartonInfo.push_back(new G4SPPartonInfo(-3101, -1, 1./2.));
267 }
268 
271 {
272  theDefinition = aXiMinus;
273  thePartonInfo.push_back(new G4SPPartonInfo(3103, 3, 1./6.));
274  thePartonInfo.push_back(new G4SPPartonInfo(3101, 3, 1./2.));
275  thePartonInfo.push_back(new G4SPPartonInfo(3303, 1, 1./3.));
276 }
277 
279 G4SPBaryon(G4AntiXiMinus * aAntiXiMinus)
280 {
281  theDefinition = aAntiXiMinus;
282  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -3, 1./6.));
283  thePartonInfo.push_back(new G4SPPartonInfo(-3101, -3, 1./2.));
284  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -1, 1./3.));
285 }
286 
289 {
290  theDefinition = aXiZero;
291  thePartonInfo.push_back(new G4SPPartonInfo(3203, 3, 1./6.));
292  thePartonInfo.push_back(new G4SPPartonInfo(3201, 3, 1./2.));
293  thePartonInfo.push_back(new G4SPPartonInfo(3303, 2, 1./3.));
294 }
295 
297 G4SPBaryon(G4AntiXiZero * aAntiXiZero)
298 {
299  theDefinition = aAntiXiZero;
300  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -3, 1./6.));
301  thePartonInfo.push_back(new G4SPPartonInfo(-3201, -3, 1./2.));
302  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -2, 1./3.));
303 }
304 
306 G4SPBaryon(G4OmegaMinus * anOmegaMinus)
307 {
308  theDefinition = anOmegaMinus;
309  thePartonInfo.push_back(new G4SPPartonInfo(3303, 3, 1.));
310 }
311 
312 
314 G4SPBaryon(G4AntiOmegaMinus * anAntiOmegaMinus)
315 {
316  theDefinition = anAntiOmegaMinus;
317  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -3, 1.));
318 }
319 
320 // non static particles
323 {
324  theDefinition = aDefinition;
325  if(theDefinition ==
326  G4ParticleTable::GetParticleTable()->FindParticle(2224))// D++
327  {
328  thePartonInfo.push_back(new G4SPPartonInfo(2203, 2, 1.));
329  }
330  else if(theDefinition ==
331  G4ParticleTable::GetParticleTable()->FindParticle(-2224))// anti D++
332  {
333  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -2, 1.));
334  }
335  else if(theDefinition ==
336  G4ParticleTable::GetParticleTable()->FindParticle(2214))// D+
337  {
338  thePartonInfo.push_back(new G4SPPartonInfo(2203, 1, 1./3.));
339  thePartonInfo.push_back(new G4SPPartonInfo(2103, 2, 2./3.));
340  }
341  else if(theDefinition ==
342  G4ParticleTable::GetParticleTable()->FindParticle(-2214))// anti D+
343  {
344  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -1, 1./3.));
345  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -2, 2./3.));
346  }
347  else if(theDefinition ==
348  G4ParticleTable::GetParticleTable()->FindParticle(2114))// D0
349  {
350  thePartonInfo.push_back(new G4SPPartonInfo(2103, 1, 2./3.));
351  thePartonInfo.push_back(new G4SPPartonInfo(2103, 2, 1./3.));
352  }
353  else if(theDefinition ==
354  G4ParticleTable::GetParticleTable()->FindParticle(-2114))// anti D0
355  {
356  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -1, 2./3.));
357  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -2, 1./3.));
358  }
359  else if(theDefinition ==
360  G4ParticleTable::GetParticleTable()->FindParticle(1114))// D-
361  {
362  thePartonInfo.push_back(new G4SPPartonInfo(1103, 1, 1.));
363  }
364  else if(theDefinition ==
365  G4ParticleTable::GetParticleTable()->FindParticle(-1114))// anti D-
366  {
367  thePartonInfo.push_back(new G4SPPartonInfo(-1103, -1, 1.));
368  }
369  else if(theDefinition ==
370  G4ParticleTable::GetParticleTable()->FindParticle(3224))// S*+
371  {
372  thePartonInfo.push_back(new G4SPPartonInfo(2203, 3, 1./3.));
373  thePartonInfo.push_back(new G4SPPartonInfo(3203, 2, 2./3.));
374  }
375  else if(theDefinition ==
376  G4ParticleTable::GetParticleTable()->FindParticle(-3224))// anti S*+
377  {
378  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -3, 1./3.));
379  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -2, 2./3.));
380  }
381  else if(theDefinition ==
382  G4ParticleTable::GetParticleTable()->FindParticle(3214))// S*0
383  {
384  thePartonInfo.push_back(new G4SPPartonInfo(2103, 3, 1./3.));
385  thePartonInfo.push_back(new G4SPPartonInfo(3203, 1, 1./3.));
386  thePartonInfo.push_back(new G4SPPartonInfo(3103, 2, 1./3.));
387  }
388  else if(theDefinition ==
389  G4ParticleTable::GetParticleTable()->FindParticle(-3214))// anti S*0
390  {
391  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -3, 1./3.));
392  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -1, 1./3.));
393  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -2, 1./3.));
394  }
395  else if(theDefinition ==
396  G4ParticleTable::GetParticleTable()->FindParticle(3114))// S*-
397  {
398  thePartonInfo.push_back(new G4SPPartonInfo(1103, 3, 1./3.));
399  thePartonInfo.push_back(new G4SPPartonInfo(3103, 1, 2./3.));
400  }
401  else if(theDefinition ==
402  G4ParticleTable::GetParticleTable()->FindParticle(-3224))// anti S*-
403  {
404  thePartonInfo.push_back(new G4SPPartonInfo(-1103, -3, 1./3.));
405  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -1, 2./3.));
406  }
407  else if(theDefinition ==
408  G4ParticleTable::GetParticleTable()->FindParticle(3324))// Xi*0
409  {
410  thePartonInfo.push_back(new G4SPPartonInfo(3203, 3, 1./3.));
411  thePartonInfo.push_back(new G4SPPartonInfo(3303, 2, 2./3.));
412  }
413  else if(theDefinition ==
414  G4ParticleTable::GetParticleTable()->FindParticle(-3324))// anti Xi*0
415  {
416  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -3, 1./3.));
417  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -2, 2./3.));
418  }
419  else if(theDefinition ==
420  G4ParticleTable::GetParticleTable()->FindParticle(3314))// Xi*-
421  {
422  thePartonInfo.push_back(new G4SPPartonInfo(3103, 3, 2./3.));
423  thePartonInfo.push_back(new G4SPPartonInfo(3303, 1, 1./3.));
424  }
425  else if(theDefinition ==
426  G4ParticleTable::GetParticleTable()->FindParticle(-3314))// anti Xi*-
427  {
428  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -3, 2./3.));
429  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -1, 1./3.));
430  }
431 }
432 
434 {
435  for(unsigned int i=0;i<thePartonInfo.size(); i++) delete thePartonInfo[i];
436 }
G4int MatchDiQuarkAndGetQuark(const G4SPBaryon &aBaryon, G4int &aDiQuark) const
Definition: G4SPBaryon.cc:71
void SampleQuarkAndDiquark(G4int &quark, G4int &diQuark) const
Definition: G4SPBaryon.cc:97
void FindDiquark(G4int quark, G4int &diQuark) const
Definition: G4SPBaryon.cc:124
G4double G4NeutronHPJENDLHEData::G4double result
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:87
G4int FindQuark(G4int diQuark) const
Definition: G4SPBaryon.cc:32
G4double GetProbability(G4int diQuark) const
Definition: G4SPBaryon.cc:55
G4SPBaryon(G4Proton *aProton)
Definition: G4SPBaryon.cc:154
G4double total(Particle const *const p1, Particle const *const p2)
static G4ParticleTable * GetParticleTable()
double G4double
Definition: G4Types.hh:76