source: trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QPDGToG4Particle.cc @ 836

Last change on this file since 836 was 819, checked in by garnier, 16 years ago

import all except CVS

File size: 14.4 KB
Line 
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: G4QPDGToG4Particle.cc,v 1.5 2006/06/29 20:07:09 gunter Exp $
27// GEANT4 tag $Name:  $
28//
29// ---------------- G4QG4ToG4Particle singletone class ------------------
30//                 by Mikhail Kossov, December 2003.
31// PDGCode->G4Particle convertor of the CHIPS Simulation Branch in GEANT4
32// ----------------------------------------------------------------------
33// ****************************************************************************************
34// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
35// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
36// ****************************************************************************************
37
38//#define pdebug
39
40#include "G4QPDGToG4Particle.hh"
41
42G4QPDGToG4Particle::G4QPDGToG4Particle()
43{
44}
45
46G4QPDGToG4Particle::~G4QPDGToG4Particle() // The map is distructed only in the EndOfJob
47{
48}
49
50// Returns Pointer to the G4QPDGToG4Particle
51G4QPDGToG4Particle* G4QPDGToG4Particle::Get()
52//                  =========================
53{
54  static G4QPDGToG4Particle theMap;        // *** Static body of the G4QPDGToG4Particle ***
55  return &theMap;
56}
57
58G4ParticleDefinition* G4QPDGToG4Particle::GetParticleDefinition(G4int PDG)
59//                    ====================================================
60{
61  if(!PDG) return 0;
62  else if(PDG>0)     // Positive PDG Code
63                {
64    if(PDG<100)
65    {
66      if(PDG==22) return G4Gamma::Gamma();
67      else if(PDG>10 && PDG<17)
68      {
69        if(PDG<13)
70        {
71          if(PDG==11) return G4Electron::Electron();
72          else return G4NeutrinoE::NeutrinoE();
73        }
74        else
75                                                                {
76          if(PDG<15)
77          {
78            if(PDG==13) return G4MuonMinus::MuonMinus();
79            else return G4NeutrinoMu::NeutrinoMu();
80          }
81          else
82          {
83            if(PDG==15) return G4TauMinus::TauMinus();
84            else return G4NeutrinoTau::NeutrinoTau();
85          }
86        }
87      }
88      else return 0; // @@ Warning can be added
89    } // End of the Lepton definition
90    else if(PDG<1000)
91                                {
92      if(PDG<420)
93      {
94        if(PDG<320)
95        {
96          if(PDG==211) return G4PionPlus::PionPlus();
97          else if(PDG==111) return G4PionZero::PionZero();
98          else if(PDG==130) return G4KaonZeroLong::KaonZeroLong();
99          else if(PDG==221) return G4Eta::Eta();
100          else if(PDG==311) return G4KaonZero::KaonZero();
101          else return 0; // @@ Warning can be added
102        }
103        else
104        {
105          if(PDG==321) return G4KaonPlus::KaonPlus();
106          else if(PDG==331) return G4EtaPrime::EtaPrime();
107          else if(PDG==310) return G4KaonZeroShort::KaonZeroShort();
108          else if(PDG==411) return G4DMesonPlus::DMesonPlus();
109          else return 0; // @@ Warning can be added
110        }
111      }
112      else
113                                                {
114        if(PDG<500)
115        {
116          if(PDG==421) return G4DMesonZero::DMesonZero();
117          else if(PDG==431) return G4DsMesonPlus::DsMesonPlus();
118          else if(PDG==443) return G4JPsi::JPsi();
119          else return 0; // @@ Warning can be added
120        }
121        else
122        {
123          if(PDG==521) return G4BMesonPlus::BMesonPlus();
124          else if(PDG==511) return G4BMesonZero::BMesonZero();
125          else if(PDG==531) return G4BsMesonZero::BsMesonZero();
126          else return 0; // @@ Warning can be added
127        }
128      }
129    } // Emd of the Meson definition
130    else
131                                {
132      if(PDG<3333)
133      {
134        if(PDG<3211)
135        {
136          if(PDG<3111)
137          {
138            if(PDG==2112) return G4Neutron::Neutron();
139                                                      else if(PDG==2212) return G4Proton::Proton();
140            else return 0; // @@ Warning can be added
141          }
142          else
143          {
144            if(PDG==3112) return G4SigmaMinus::SigmaMinus();
145            else if(PDG==3122) return G4Lambda::Lambda();
146            else return 0; // @@ Warning can be added
147          }
148        }
149        else
150        {
151          if(PDG<3311)
152          {
153            if(PDG==3222) return G4SigmaPlus::SigmaPlus();
154            else if(PDG==3212) return G4SigmaZero::SigmaZero();
155            else return 0; // @@ Warning can be added
156          }
157          else
158          {
159            if(PDG==3312) return G4XiMinus::XiMinus();
160            else if(PDG==3322) return G4XiZero::XiZero();
161            else return 0; // @@ Warning can be added
162          }
163        }
164      }
165      else
166      {
167        if(PDG<4221)
168        {
169          if(PDG<4121)
170          {
171            if(PDG==3334) return G4OmegaMinus::OmegaMinus();
172            else if(PDG==4112) return G4SigmacZero::SigmacZero();
173            else return 0; // @@ Warning can be added
174          }
175          else
176          {
177            if(PDG==4122) return G4LambdacPlus::LambdacPlus();
178            else if(PDG==4212) return G4SigmacPlus::SigmacPlus();
179            else return 0; // @@ Warning can be added
180          }
181        }
182        else
183        {
184          if(PDG<4231)
185          {
186            if(PDG==4222) return G4SigmacPlusPlus::SigmacPlusPlus();
187            else if(PDG==4232) return G4XicPlus::XicPlus();
188            else return 0; // @@ Warning can be added
189          }
190          else
191          {
192            if(PDG==4132) return G4XicZero::XicZero();
193            else if(PDG==4332) return G4OmegacZero::OmegacZero();
194            else return 0; // @@ Warning can be added
195          }
196        }
197      }
198    } // End of Baryon definition
199  } 
200  else               // Negative PDG Code
201                {
202                  G4int aPDG=-PDG;
203#ifdef pdebug
204    G4cout<<"G4QPDGToG4Particle:Antiparticle PDG="<<PDG<<G4endl;
205#endif
206    if(aPDG<100)
207    {
208      if(aPDG>10 && aPDG<17)
209      {
210        if(aPDG<13)
211        {
212          if(aPDG==11) return G4Positron::Positron();
213          else return G4AntiNeutrinoE::AntiNeutrinoE();
214        }
215        else
216                                                                {
217          if(aPDG<15)
218          {
219            if(aPDG==13) return G4MuonPlus::MuonPlus();
220            else return G4AntiNeutrinoMu::AntiNeutrinoMu();
221          }
222          else
223          {
224            if(aPDG==15) return G4TauPlus::TauPlus();
225            else return G4AntiNeutrinoTau::AntiNeutrinoTau();
226          }
227        }
228      }
229      else return 0; // @@ Warning can be added
230    } // End of the Anti-Lepton definition
231    else if(aPDG<1000)
232                                {
233#ifdef pdebug
234      G4cout<<"G4QPDGToG4Particle:AntiMesons aPDG="<<aPDG<<G4endl;
235#endif
236      if(aPDG<420)
237      {
238#ifdef pdebug
239       G4cout<<"G4QPDGToG4Particle:AntiSU(3)Mesons aPDG="<<aPDG<<G4endl;
240#endif
241        if(aPDG<320)
242        {
243#ifdef pdebug
244          G4cout<<"G4QPDGToG4Particle:AntiPi&KMesons aPDG="<<aPDG<<G4endl;
245#endif
246          if(aPDG==211) return G4PionMinus::PionMinus();
247          else if(aPDG==311) return G4AntiKaonZero::AntiKaonZero();
248          else return 0; // @@ Warning can be added
249        }
250        else
251        {
252#ifdef pdebug
253          G4cout<<"G4QPDGToG4Particle:AntiK&DMesons aPDG="<<aPDG<<G4endl;
254#endif
255          if(aPDG==321) 
256          {
257#ifdef pdebug
258            G4cout<<"G4QPDGToG4Particle:KaonMinus aPDG="<<aPDG<<G4endl;
259#endif
260            return G4KaonMinus::KaonMinus();
261          }
262          else if(aPDG==411) return G4DMesonMinus::DMesonMinus();
263          else return 0; // @@ Warning can be added
264        }
265      }
266      else
267      {
268        if(aPDG<500)
269        {
270          if(aPDG==421) return G4AntiDMesonZero::AntiDMesonZero();
271          else if(aPDG==431) return G4DsMesonMinus::DsMesonMinus();
272          else return 0; // @@ Warning can be added
273        }
274        else
275        {
276          if(aPDG==521) return G4BMesonMinus::BMesonMinus();
277          else if(aPDG==511) return G4AntiBMesonZero::AntiBMesonZero();
278          else if(aPDG==531) return G4AntiBsMesonZero::AntiBsMesonZero();
279          else return 0; // @@ Warning can be added
280        }
281      }
282    } // Emd of the Anti-Meson definition
283    else
284                                {
285      if(aPDG<3333)
286      {
287        if(aPDG<3211)
288        {
289          if(aPDG<3111)
290          {
291            if(aPDG==2112) return G4AntiNeutron::AntiNeutron();
292                                                      else if(aPDG==2212) return G4AntiProton::AntiProton();
293            else return 0; // @@ Warning can be added
294          }
295          else
296          {
297            if(aPDG==3112) return G4AntiSigmaMinus::AntiSigmaMinus();
298            else if(aPDG==3122) return G4AntiLambda::AntiLambda();
299            else return 0; // @@ Warning can be added
300          }
301        }
302        else
303        {
304          if(aPDG<3311)
305          {
306            if(aPDG==3222) return G4AntiSigmaPlus::AntiSigmaPlus();
307            else if(aPDG==3212) return G4AntiSigmaZero::AntiSigmaZero();
308            else return 0; // @@ Warning can be added
309          }
310          else
311          {
312            if(aPDG==3312) return G4AntiXiMinus::AntiXiMinus();
313            else if(aPDG==3322) return G4AntiXiZero::AntiXiZero();
314            else return 0; // @@ Warning can be added
315          }
316        }
317      }
318      else
319      {
320        if(aPDG<4221)
321        {
322          if(aPDG<4121)
323          {
324            if(aPDG==3334) return G4AntiOmegaMinus::AntiOmegaMinus();
325            else if(aPDG==4112) return G4AntiSigmacZero::AntiSigmacZero();
326            else return 0; // @@ Warning can be added
327          }
328          else
329          {
330            if(aPDG==4122) return G4AntiLambdacPlus::AntiLambdacPlus();
331            else if(aPDG==4212) return G4AntiSigmacPlus::AntiSigmacPlus();
332            else return 0; // @@ Warning can be added
333          }
334        }
335        else
336        {
337          if(aPDG<4231)
338          {
339            if(aPDG==4222) return G4AntiSigmacPlusPlus::AntiSigmacPlusPlus();
340            else if(aPDG==4232) return G4AntiXicPlus::AntiXicPlus();
341            else return 0; // @@ Warning can be added
342          }
343          else
344          {
345            if(aPDG==4132) return G4AntiXicZero::AntiXicZero();
346            else if(aPDG==4332) return G4AntiOmegacZero::AntiOmegacZero();
347            else return 0; // @@ Warning can be added
348          }
349        }
350      }
351    } // End of Anti-Baryon definition
352  } // End of Anti-particle definition
353  return 0;
354}
355
356void G4QPDGToG4Particle::DefineAllParticles()
357// ==========================================
358{
359                //======== LEPTONS =========
360  G4Gamma::GammaDefinition();
361  G4MuonPlus::MuonPlusDefinition();
362  G4MuonMinus::MuonMinusDefinition();
363  G4TauMinus::TauMinusDefinition();
364  G4TauPlus::TauPlusDefinition();
365  G4Electron::ElectronDefinition();
366  G4Positron::PositronDefinition();
367  G4NeutrinoTau::NeutrinoTauDefinition();
368  G4AntiNeutrinoTau::AntiNeutrinoTauDefinition();
369  G4NeutrinoMu::NeutrinoMuDefinition();
370  G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
371  G4NeutrinoE::NeutrinoEDefinition();
372  G4AntiNeutrinoE::AntiNeutrinoEDefinition();
373  //================ MESONS ===================
374  G4PionPlus::PionPlusDefinition();
375  G4PionMinus::PionMinusDefinition();
376  G4PionZero::PionZeroDefinition();
377  G4Eta::EtaDefinition();
378  G4EtaPrime::EtaPrimeDefinition();
379  G4KaonPlus::KaonPlusDefinition();
380  G4KaonMinus::KaonMinusDefinition();
381  G4KaonZero::KaonZeroDefinition();
382  G4AntiKaonZero::AntiKaonZeroDefinition();
383  G4KaonZeroLong::KaonZeroLongDefinition();
384  G4KaonZeroShort::KaonZeroShortDefinition();
385  G4DMesonPlus::DMesonPlusDefinition();
386  G4DMesonMinus::DMesonMinusDefinition();
387  G4DMesonZero::DMesonZeroDefinition();
388  G4AntiDMesonZero::AntiDMesonZeroDefinition();
389  G4DsMesonPlus::DsMesonPlusDefinition();
390  G4DsMesonMinus::DsMesonMinusDefinition();
391  G4JPsi::JPsiDefinition();
392  G4BMesonPlus::BMesonPlusDefinition();
393  G4BMesonMinus::BMesonMinusDefinition();
394  G4BMesonZero::BMesonZeroDefinition();
395  G4AntiBMesonZero::AntiBMesonZeroDefinition();
396  G4BsMesonZero::BsMesonZeroDefinition();
397  G4AntiBsMesonZero::AntiBsMesonZeroDefinition();
398  // ========== BARYONS ==================
399  G4Proton::ProtonDefinition();
400  G4AntiProton::AntiProtonDefinition();
401  G4Neutron::NeutronDefinition();
402  G4AntiNeutron::AntiNeutronDefinition();
403  G4Lambda::LambdaDefinition();
404  G4SigmaPlus::SigmaPlusDefinition();
405  G4SigmaZero::SigmaZeroDefinition();
406  G4SigmaMinus::SigmaMinusDefinition();
407  G4XiMinus::XiMinusDefinition();
408  G4XiZero::XiZeroDefinition();
409  G4OmegaMinus::OmegaMinusDefinition();
410  G4AntiLambda::AntiLambdaDefinition();
411  G4AntiSigmaPlus::AntiSigmaPlusDefinition();
412  G4AntiSigmaZero::AntiSigmaZeroDefinition();
413  G4AntiSigmaMinus::AntiSigmaMinusDefinition();
414  G4AntiXiMinus::AntiXiMinusDefinition();
415  G4AntiXiZero::AntiXiZeroDefinition();
416  G4AntiOmegaMinus::AntiOmegaMinusDefinition();
417  G4LambdacPlus::LambdacPlusDefinition();
418  G4SigmacPlusPlus::SigmacPlusPlusDefinition();
419  G4SigmacPlus::SigmacPlusDefinition();
420  G4SigmacZero::SigmacZeroDefinition();
421  G4XicPlus::XicPlusDefinition();
422  G4XicZero::XicZeroDefinition();
423  G4OmegacZero::OmegacZeroDefinition();
424  G4AntiLambdacPlus::AntiLambdacPlusDefinition();
425  G4AntiSigmacPlusPlus::AntiSigmacPlusPlusDefinition();
426  G4AntiSigmacPlus::AntiSigmacPlusDefinition();
427  G4AntiSigmacZero::AntiSigmacZeroDefinition();
428  G4AntiXicPlus::AntiXicPlusDefinition();
429  G4AntiXicZero::AntiXicZeroDefinition();
430  G4AntiOmegacZero::AntiOmegacZeroDefinition();
431}
Note: See TracBrowser for help on using the repository browser.