Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4QPDGToG4Particle.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 // $Id$
27 //
28 // ---------------- G4QG4ToG4Particle singletone class ------------------
29 // by Mikhail Kossov, December 2003.
30 // PDGCode->G4Particle convertor of the CHIPS Simulation Branch in GEANT4
31 // ----------------------------------------------------------------------
32 // ****************************************************************************************
33 // ********** This CLASS is temporary moved from the photolepton_hadron directory *********
34 // ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
35 // ****************************************************************************************
36 // Short description: This is a helper class, which converts the PDG-defined
37 // G4QHadrons of the CHIPS model to the G4 particles, defined by the singetones.
38 // -----------------------------------------------------------------------------
39 
40 
41 //#define pdebug
42 
43 #include "G4QPDGToG4Particle.hh"
44 #include "G4HadronicDeprecate.hh"
45 
46 
48 {
49  G4HadronicDeprecate("G4QPDGToG4Particle");
50 }
51 
52 G4QPDGToG4Particle::~G4QPDGToG4Particle() // The map is distructed only in the EndOfJob
53 {
54 }
55 
56 // Returns Pointer to the G4QPDGToG4Particle
58 {
59  static G4QPDGToG4Particle theMap; // *** Static body of the G4QPDGToG4Particle ***
60  return &theMap;
61 }
62 
64 {
65  if(!PDG) return 0;
66  else if(PDG>0) // Positive PDG Code
67  {
68  if(PDG<100)
69  {
70  if(PDG==22) return G4Gamma::Gamma();
71  else if(PDG>10 && PDG<17)
72  {
73  if(PDG<13)
74  {
75  if(PDG==11) return G4Electron::Electron();
76  else return G4NeutrinoE::NeutrinoE();
77  }
78  else
79  {
80  if(PDG<15)
81  {
82  if(PDG==13) return G4MuonMinus::MuonMinus();
83  else return G4NeutrinoMu::NeutrinoMu();
84  }
85  else
86  {
87  if(PDG==15) return G4TauMinus::TauMinus();
88  else return G4NeutrinoTau::NeutrinoTau();
89  }
90  }
91  }
92  else return 0; // @@ Warning can be added
93  } // End of the Lepton definition
94  else if(PDG<1000)
95  {
96  if(PDG<420)
97  {
98  if(PDG<320)
99  {
100  if(PDG==211) return G4PionPlus::PionPlus();
101  else if(PDG==111) return G4PionZero::PionZero();
102  else if(PDG==130) return G4KaonZeroLong::KaonZeroLong();
103  else if(PDG==221) return G4Eta::Eta();
104  else if(PDG==311) return G4KaonZero::KaonZero();
105  else return 0; // @@ Warning can be added
106  }
107  else
108  {
109  if(PDG==321) return G4KaonPlus::KaonPlus();
110  else if(PDG==331) return G4EtaPrime::EtaPrime();
111  else if(PDG==310) return G4KaonZeroShort::KaonZeroShort();
112  else if(PDG==411) return G4DMesonPlus::DMesonPlus();
113  else return 0; // @@ Warning can be added
114  }
115  }
116  else
117  {
118  if(PDG<500)
119  {
120  if(PDG==421) return G4DMesonZero::DMesonZero();
121  else if(PDG==431) return G4DsMesonPlus::DsMesonPlus();
122  else if(PDG==443) return G4JPsi::JPsi();
123  else return 0; // @@ Warning can be added
124  }
125  else
126  {
127  if(PDG==521) return G4BMesonPlus::BMesonPlus();
128  else if(PDG==511) return G4BMesonZero::BMesonZero();
129  else if(PDG==531) return G4BsMesonZero::BsMesonZero();
130  else return 0; // @@ Warning can be added
131  }
132  }
133  } // Emd of the Meson definition
134  else
135  {
136  if(PDG<3333)
137  {
138  if(PDG<3211)
139  {
140  if(PDG<3111)
141  {
142  if(PDG==2112) return G4Neutron::Neutron();
143  else if(PDG==2212) return G4Proton::Proton();
144  else return 0; // @@ Warning can be added
145  }
146  else
147  {
148  if(PDG==3112) return G4SigmaMinus::SigmaMinus();
149  else if(PDG==3122) return G4Lambda::Lambda();
150  else return 0; // @@ Warning can be added
151  }
152  }
153  else
154  {
155  if(PDG<3311)
156  {
157  if(PDG==3222) return G4SigmaPlus::SigmaPlus();
158  else if(PDG==3212) return G4SigmaZero::SigmaZero();
159  else return 0; // @@ Warning can be added
160  }
161  else
162  {
163  if(PDG==3312) return G4XiMinus::XiMinus();
164  else if(PDG==3322) return G4XiZero::XiZero();
165  else return 0; // @@ Warning can be added
166  }
167  }
168  }
169  else
170  {
171  if(PDG<4221)
172  {
173  if(PDG<4121)
174  {
175  if(PDG==3334) return G4OmegaMinus::OmegaMinus();
176  else if(PDG==4112) return G4SigmacZero::SigmacZero();
177  else return 0; // @@ Warning can be added
178  }
179  else
180  {
181  if(PDG==4122) return G4LambdacPlus::LambdacPlus();
182  else if(PDG==4212) return G4SigmacPlus::SigmacPlus();
183  else return 0; // @@ Warning can be added
184  }
185  }
186  else
187  {
188  if(PDG<4231)
189  {
190  if(PDG==4222) return G4SigmacPlusPlus::SigmacPlusPlus();
191  else if(PDG==4232) return G4XicPlus::XicPlus();
192  else return 0; // @@ Warning can be added
193  }
194  else
195  {
196  if(PDG==4132) return G4XicZero::XicZero();
197  else if(PDG==4332) return G4OmegacZero::OmegacZero();
198  else return 0; // @@ Warning can be added
199  }
200  }
201  }
202  } // End of Baryon definition
203  }
204  else // Negative PDG Code
205  {
206  G4int aPDG=-PDG;
207 #ifdef pdebug
208  G4cout<<"G4QPDGToG4Particle:Antiparticle PDG="<<PDG<<G4endl;
209 #endif
210  if(aPDG<100)
211  {
212  if(aPDG>10 && aPDG<17)
213  {
214  if(aPDG<13)
215  {
216  if(aPDG==11) return G4Positron::Positron();
217  else return G4AntiNeutrinoE::AntiNeutrinoE();
218  }
219  else
220  {
221  if(aPDG<15)
222  {
223  if(aPDG==13) return G4MuonPlus::MuonPlus();
224  else return G4AntiNeutrinoMu::AntiNeutrinoMu();
225  }
226  else
227  {
228  if(aPDG==15) return G4TauPlus::TauPlus();
230  }
231  }
232  }
233  else return 0; // @@ Warning can be added
234  } // End of the Anti-Lepton definition
235  else if(aPDG<1000)
236  {
237 #ifdef pdebug
238  G4cout<<"G4QPDGToG4Particle:AntiMesons aPDG="<<aPDG<<G4endl;
239 #endif
240  if(aPDG<420)
241  {
242 #ifdef pdebug
243  G4cout<<"G4QPDGToG4Particle:AntiSU(3)Mesons aPDG="<<aPDG<<G4endl;
244 #endif
245  if(aPDG<320)
246  {
247 #ifdef pdebug
248  G4cout<<"G4QPDGToG4Particle:AntiPi&KMesons aPDG="<<aPDG<<G4endl;
249 #endif
250  if(aPDG==211) return G4PionMinus::PionMinus();
251  else if(aPDG==311) return G4AntiKaonZero::AntiKaonZero();
252  else return 0; // @@ Warning can be added
253  }
254  else
255  {
256 #ifdef pdebug
257  G4cout<<"G4QPDGToG4Particle:AntiK&DMesons aPDG="<<aPDG<<G4endl;
258 #endif
259  if(aPDG==321)
260  {
261 #ifdef pdebug
262  G4cout<<"G4QPDGToG4Particle:KaonMinus aPDG="<<aPDG<<G4endl;
263 #endif
264  return G4KaonMinus::KaonMinus();
265  }
266  else if(aPDG==411) return G4DMesonMinus::DMesonMinus();
267  else return 0; // @@ Warning can be added
268  }
269  }
270  else
271  {
272  if(aPDG<500)
273  {
274  if(aPDG==421) return G4AntiDMesonZero::AntiDMesonZero();
275  else if(aPDG==431) return G4DsMesonMinus::DsMesonMinus();
276  else return 0; // @@ Warning can be added
277  }
278  else
279  {
280  if(aPDG==521) return G4BMesonMinus::BMesonMinus();
281  else if(aPDG==511) return G4AntiBMesonZero::AntiBMesonZero();
282  else if(aPDG==531) return G4AntiBsMesonZero::AntiBsMesonZero();
283  else return 0; // @@ Warning can be added
284  }
285  }
286  } // Emd of the Anti-Meson definition
287  else
288  {
289  if(aPDG<3333)
290  {
291  if(aPDG<3211)
292  {
293  if(aPDG<3111)
294  {
295  if(aPDG==2112) return G4AntiNeutron::AntiNeutron();
296  else if(aPDG==2212) return G4AntiProton::AntiProton();
297  else return 0; // @@ Warning can be added
298  }
299  else
300  {
301  if(aPDG==3112) return G4AntiSigmaMinus::AntiSigmaMinus();
302  else if(aPDG==3122) return G4AntiLambda::AntiLambda();
303  else return 0; // @@ Warning can be added
304  }
305  }
306  else
307  {
308  if(aPDG<3311)
309  {
310  if(aPDG==3222) return G4AntiSigmaPlus::AntiSigmaPlus();
311  else if(aPDG==3212) return G4AntiSigmaZero::AntiSigmaZero();
312  else return 0; // @@ Warning can be added
313  }
314  else
315  {
316  if(aPDG==3312) return G4AntiXiMinus::AntiXiMinus();
317  else if(aPDG==3322) return G4AntiXiZero::AntiXiZero();
318  else return 0; // @@ Warning can be added
319  }
320  }
321  }
322  else
323  {
324  if(aPDG<4221)
325  {
326  if(aPDG<4121)
327  {
328  if(aPDG==3334) return G4AntiOmegaMinus::AntiOmegaMinus();
329  else if(aPDG==4112) return G4AntiSigmacZero::AntiSigmacZero();
330  else return 0; // @@ Warning can be added
331  }
332  else
333  {
334  if(aPDG==4122) return G4AntiLambdacPlus::AntiLambdacPlus();
335  else if(aPDG==4212) return G4AntiSigmacPlus::AntiSigmacPlus();
336  else return 0; // @@ Warning can be added
337  }
338  }
339  else
340  {
341  if(aPDG<4231)
342  {
343  if(aPDG==4222) return G4AntiSigmacPlusPlus::AntiSigmacPlusPlus();
344  else if(aPDG==4232) return G4AntiXicPlus::AntiXicPlus();
345  else return 0; // @@ Warning can be added
346  }
347  else
348  {
349  if(aPDG==4132) return G4AntiXicZero::AntiXicZero();
350  else if(aPDG==4332) return G4AntiOmegacZero::AntiOmegacZero();
351  else return 0; // @@ Warning can be added
352  }
353  }
354  }
355  } // End of Anti-Baryon definition
356  } // End of Anti-particle definition
357  return 0;
358 }
359 
361 {
362  //=---------= LEPTONS =---------------=
376  //=--------------= MESONS =---------------=
401  // =---------= BARYONS =-----------=
434 }