ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SPBaryon.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4SPBaryon.cc
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 
55 
57 {
58  G4double sum = 0;
59  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
60  iter i;
61  for (i = thePartonInfo.begin(); i!=thePartonInfo.end(); i++)
62  {
63  if (std::abs((*i)->GetDiQuark()) == std::abs(diQuark))
64  {
65  sum += (*i)->GetProbability();
66  }
67  }
68  return sum;
69 }
70 
71 
73 MatchDiQuarkAndGetQuark(const G4SPBaryon & aBaryon, G4int & aDiQuark) const
74 {
75  G4int result=0;
76  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
77  iter i;
78  G4double running = 0;
79  G4double total = 0;
80  for (i = thePartonInfo.begin(); i!=thePartonInfo.end(); i++)
81  {
82  total += aBaryon.GetProbability((*i)->GetDiQuark());
83  }
84  G4double random = G4UniformRand();
85  for(i = thePartonInfo.begin(); i!=thePartonInfo.end(); i++)
86  {
87  running += aBaryon.GetProbability((*i)->GetDiQuark());
88  if (random<running/total)
89  {
90  result = (*i)->GetQuark(); // (diquark annihilated)
91  aDiQuark = (*i)->GetDiQuark();
92  break;
93  }
94  }
95  return result;
96 }
97 
98 
99 void G4SPBaryon::
100 SampleQuarkAndDiquark(G4int & quark, G4int & diQuark) const
101 {
102  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
103 
104  G4double random = G4UniformRand();
105  G4double sum = 0;
106  iter i;
107 
108  for (i=thePartonInfo.begin() ; i!=thePartonInfo.end(); i++)
109  {
110  sum += (*i)->GetProbability();
111  if (sum > random)
112  {
113  if (theDefinition->GetPDGEncoding() < 0)
114  {
115  quark = (*i)->GetDiQuark();
116  diQuark = (*i)->GetQuark();
117  }
118  else
119  {
120  quark = (*i)->GetQuark();
121  diQuark = (*i)->GetDiQuark();
122  }
123  break;
124  }
125  }
126 }
127 
128 
129 void G4SPBaryon::
130 FindDiquark(G4int quark, G4int & diQuark) const
131 {
132  typedef std::vector<G4SPPartonInfo *>::const_iterator iter;
133  G4double sum = 0;
134  iter i;
135  for (i=thePartonInfo.begin() ; i!=thePartonInfo.end(); i++)
136  {
137  if (std::abs((*i)->GetQuark()) == std::abs(quark))
138  {
139  sum += (*i)->GetProbability();
140  }
141  }
142  G4double random = G4UniformRand();
143  G4double running = 0;
144  for (i=thePartonInfo.begin() ; i!=thePartonInfo.end(); i++) {
145  if (std::abs((*i)->GetQuark()) == std::abs(quark))
146  {
147  running += (*i)->GetProbability();
148  if (running/sum >= random)
149  {
150  diQuark = (*i)->GetDiQuark();
151  break;
152  }
153  }
154  }
155 }
156 
157 
160 {
161  theDefinition = aProton;
162  thePartonInfo.push_back(new G4SPPartonInfo(2203, 1, 1./3./2.)); // uu_1, d
163  thePartonInfo.push_back(new G4SPPartonInfo(2103, 2, 1./6.*2.)); // ud_1, u
164  thePartonInfo.push_back(new G4SPPartonInfo(2101, 2, 1./2.)); // ud_0, u
165 }
166 
167 
169 G4SPBaryon(G4AntiProton * aAntiProton)
170 {
171  theDefinition = aAntiProton;
172  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -1, 1./3.));
173  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -2, 1./6.));
174  thePartonInfo.push_back(new G4SPPartonInfo(-2101, -2, 1./2.));
175 }
176 
177 
180 {
181  theDefinition = aNeutron;
182  thePartonInfo.push_back(new G4SPPartonInfo(2103, 1, 1./6.*2.)); // ud_1, d
183  thePartonInfo.push_back(new G4SPPartonInfo(2101, 1, 1./2. )); // ud_0, d
184  thePartonInfo.push_back(new G4SPPartonInfo(1103, 2, 1./3./2 )); // dd_1, u
185 }
186 
187 
189 G4SPBaryon(G4AntiNeutron * aAntiNeutron)
190 {
191  theDefinition = aAntiNeutron;
192  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -1, 1./6.));
193  thePartonInfo.push_back(new G4SPPartonInfo(-2101, -1, 1./2.));
194  thePartonInfo.push_back(new G4SPPartonInfo(-1103, -2, 1./3.));
195 }
196 
197 
200 {
201  theDefinition = aLambda;
202  thePartonInfo.push_back(new G4SPPartonInfo(2103, 3, 1./3.)); // ud_1, s
203  thePartonInfo.push_back(new G4SPPartonInfo(3203, 1, 1./4.)); // su_1, d
204  thePartonInfo.push_back(new G4SPPartonInfo(3201, 1, 1./12.)); // su_0, d
205  thePartonInfo.push_back(new G4SPPartonInfo(3103, 2, 1./4.)); // sd_1, u
206  thePartonInfo.push_back(new G4SPPartonInfo(3101, 2, 1./12.)); // sd_0, u
207 }
208 
209 
211 G4SPBaryon(G4AntiLambda * aAntiLambda)
212 {
213  theDefinition = aAntiLambda;
214  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -3, 1./3.));
215  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -1, 1./4.));
216  thePartonInfo.push_back(new G4SPPartonInfo(-3201, -1, 1./12.));
217  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -2, 1./4.));
218  thePartonInfo.push_back(new G4SPPartonInfo(-3101, -2, 1./12.));
219 }
220 
221 
223 G4SPBaryon(G4SigmaPlus * aSigmaPlus)
224 {
225  theDefinition = aSigmaPlus;
226  thePartonInfo.push_back(new G4SPPartonInfo(2203, 3, 1./3.));
227  thePartonInfo.push_back(new G4SPPartonInfo(3203, 2, 1./6.));
228  thePartonInfo.push_back(new G4SPPartonInfo(3201, 2, 1./2.));
229 }
230 
231 
233 G4SPBaryon(G4AntiSigmaPlus * aAntiSigmaPlus)
234 {
235  theDefinition = aAntiSigmaPlus;
236  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -3, 1./3.));
237  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -2, 1./6.));
238  thePartonInfo.push_back(new G4SPPartonInfo(-3201, -2, 1./2.));
239 }
240 
241 
243 G4SPBaryon(G4SigmaZero * aSigmaZero)
244 {
245  theDefinition = aSigmaZero;
246  thePartonInfo.push_back(new G4SPPartonInfo(2103, 3, 1./3.));
247  thePartonInfo.push_back(new G4SPPartonInfo(3203, 1, 1./12.));
248  thePartonInfo.push_back(new G4SPPartonInfo(3201, 1, 1./4.));
249  thePartonInfo.push_back(new G4SPPartonInfo(3103, 2, 1./12.));
250  thePartonInfo.push_back(new G4SPPartonInfo(3101, 2, 1./4.));
251 }
252 
253 
255 G4SPBaryon(G4AntiSigmaZero * aAntiSigmaZero)
256 {
257  theDefinition = aAntiSigmaZero;
258  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -3, 1./3.));
259  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -1, 1./12.));
260  thePartonInfo.push_back(new G4SPPartonInfo(-3201, -1, 1./4.));
261  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -2, 1./12.));
262  thePartonInfo.push_back(new G4SPPartonInfo(-3101, -2, 1./4.));
263 }
264 
265 
267 G4SPBaryon(G4SigmaMinus * aSigmaMinus)
268 {
269  theDefinition = aSigmaMinus;
270  thePartonInfo.push_back(new G4SPPartonInfo(1103, 3, 1./3.));
271  thePartonInfo.push_back(new G4SPPartonInfo(3103, 1, 1./6.));
272  thePartonInfo.push_back(new G4SPPartonInfo(3101, 1, 1./2.));
273 }
274 
275 
277 G4SPBaryon(G4AntiSigmaMinus * aAntiSigmaMinus)
278 {
279  theDefinition = aAntiSigmaMinus;
280  thePartonInfo.push_back(new G4SPPartonInfo(-1103, -3, 1./3.));
281  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -1, 1./6.));
282  thePartonInfo.push_back(new G4SPPartonInfo(-3101, -1, 1./2.));
283 }
284 
285 
288 {
289  theDefinition = aXiMinus;
290  thePartonInfo.push_back(new G4SPPartonInfo(3103, 3, 1./6.));
291  thePartonInfo.push_back(new G4SPPartonInfo(3101, 3, 1./2.));
292  thePartonInfo.push_back(new G4SPPartonInfo(3303, 1, 1./3.));
293 }
294 
295 
297 G4SPBaryon(G4AntiXiMinus * aAntiXiMinus)
298 {
299  theDefinition = aAntiXiMinus;
300  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -3, 1./6.));
301  thePartonInfo.push_back(new G4SPPartonInfo(-3101, -3, 1./2.));
302  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -1, 1./3.));
303 }
304 
305 
308 {
309  theDefinition = aXiZero;
310  thePartonInfo.push_back(new G4SPPartonInfo(3203, 3, 1./6.));
311  thePartonInfo.push_back(new G4SPPartonInfo(3201, 3, 1./2.));
312  thePartonInfo.push_back(new G4SPPartonInfo(3303, 2, 1./3.));
313 }
314 
315 
317 G4SPBaryon(G4AntiXiZero * aAntiXiZero)
318 {
319  theDefinition = aAntiXiZero;
320  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -3, 1./6.));
321  thePartonInfo.push_back(new G4SPPartonInfo(-3201, -3, 1./2.));
322  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -2, 1./3.));
323 }
324 
325 
327 G4SPBaryon(G4OmegaMinus * anOmegaMinus)
328 {
329  theDefinition = anOmegaMinus;
330  thePartonInfo.push_back(new G4SPPartonInfo(3303, 3, 1.));
331 }
332 
333 
335 G4SPBaryon(G4AntiOmegaMinus * anAntiOmegaMinus)
336 {
337  theDefinition = anAntiOmegaMinus;
338  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -3, 1.));
339 }
340 
341 
342 // non static particles
345 {
346  theDefinition = aDefinition;
347  if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(2224))// D++
348  {
349  thePartonInfo.push_back(new G4SPPartonInfo(2203, 2, 1.));
350  }
351  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-2224))// anti D++
352  {
353  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -2, 1.));
354  }
355  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(2214))// D+
356  {
357  thePartonInfo.push_back(new G4SPPartonInfo(2203, 1, 1./3.));
358  thePartonInfo.push_back(new G4SPPartonInfo(2103, 2, 2./3.));
359  }
360  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-2214))// anti D+
361  {
362  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -1, 1./3.));
363  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -2, 2./3.));
364  }
365  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(2114))// D0
366  {
367  thePartonInfo.push_back(new G4SPPartonInfo(2103, 1, 2./3.));
368  thePartonInfo.push_back(new G4SPPartonInfo(1103, 2, 1./3.));
369  }
370  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-2114))// anti D0
371  {
372  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -1, 2./3.));
373  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -2, 1./3.));
374  }
375  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(1114))// D-
376  {
377  thePartonInfo.push_back(new G4SPPartonInfo(1103, 1, 1.));
378  }
379  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-1114))// anti D-
380  {
381  thePartonInfo.push_back(new G4SPPartonInfo(-1103, -1, 1.));
382  }
383  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(3224))// S*+
384  {
385  thePartonInfo.push_back(new G4SPPartonInfo(2203, 3, 1./3.));
386  thePartonInfo.push_back(new G4SPPartonInfo(3203, 2, 2./3.));
387  }
388  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-3224))// anti S*+
389  {
390  thePartonInfo.push_back(new G4SPPartonInfo(-2203, -3, 1./3.));
391  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -2, 2./3.));
392  }
393  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(3214))// S*0
394  {
395  thePartonInfo.push_back(new G4SPPartonInfo(2103, 3, 1./3.));
396  thePartonInfo.push_back(new G4SPPartonInfo(3203, 1, 1./3.));
397  thePartonInfo.push_back(new G4SPPartonInfo(3103, 2, 1./3.));
398  }
399  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-3214))// anti S*0
400  {
401  thePartonInfo.push_back(new G4SPPartonInfo(-2103, -3, 1./3.));
402  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -1, 1./3.));
403  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -2, 1./3.));
404  }
405  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(3114))// S*-
406  {
407  thePartonInfo.push_back(new G4SPPartonInfo(1103, 3, 1./3.));
408  thePartonInfo.push_back(new G4SPPartonInfo(3103, 1, 2./3.));
409  }
410  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-3224))// anti S*-
411  {
412  thePartonInfo.push_back(new G4SPPartonInfo(-1103, -3, 1./3.));
413  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -1, 2./3.));
414  } else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(3324))// Xi*0
415  {
416  thePartonInfo.push_back(new G4SPPartonInfo(3203, 3, 1./3.));
417  thePartonInfo.push_back(new G4SPPartonInfo(3303, 2, 2./3.));
418  } else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-3324))// anti Xi*0
419  {
420  thePartonInfo.push_back(new G4SPPartonInfo(-3203, -3, 1./3.));
421  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -2, 2./3.));
422  }
423  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(3314))// Xi*-
424  {
425  thePartonInfo.push_back(new G4SPPartonInfo(3103, 3, 2./3.));
426  thePartonInfo.push_back(new G4SPPartonInfo(3303, 1, 1./3.));
427  }
428  else if (theDefinition == G4ParticleTable::GetParticleTable()->FindParticle(-3314))// anti Xi*-
429  {
430  thePartonInfo.push_back(new G4SPPartonInfo(-3103, -3, 2./3.));
431  thePartonInfo.push_back(new G4SPPartonInfo(-3303, -1, 1./3.));
432  }
433 }
434 
435 
437 {
438  for (unsigned int i=0;i<thePartonInfo.size(); i++) delete thePartonInfo[i];
439 }