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

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

File size: 14.7 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.1 2009/11/17 10:36:55 mkossov Exp $
27// GEANT4 tag $Name: hadr-chips-V09-03-08 $
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// Short description: This is a helper class, which converts the PDG-defined
38// G4QHadrons of the CHIPS model to the G4 particles, defined by the singetones.
39// -----------------------------------------------------------------------------
40
41
42//#define pdebug
43
44#include "G4QPDGToG4Particle.hh"
45
46G4QPDGToG4Particle::G4QPDGToG4Particle()
47{
48}
49
50G4QPDGToG4Particle::~G4QPDGToG4Particle() // The map is distructed only in the EndOfJob
51{
52}
53
54// Returns Pointer to the G4QPDGToG4Particle
55G4QPDGToG4Particle* G4QPDGToG4Particle::Get()
56//                  =========================
57{
58  static G4QPDGToG4Particle theMap;        // *** Static body of the G4QPDGToG4Particle ***
59  return &theMap;
60}
61
62G4ParticleDefinition* G4QPDGToG4Particle::GetParticleDefinition(G4int PDG)
63//                    ====================================================
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();
229            else return G4AntiNeutrinoTau::AntiNeutrinoTau();
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
360void G4QPDGToG4Particle::DefineAllParticles()
361// ==========================================
362{
363  //======== LEPTONS =========
364  G4Gamma::GammaDefinition();
365  G4MuonPlus::MuonPlusDefinition();
366  G4MuonMinus::MuonMinusDefinition();
367  G4TauMinus::TauMinusDefinition();
368  G4TauPlus::TauPlusDefinition();
369  G4Electron::ElectronDefinition();
370  G4Positron::PositronDefinition();
371  G4NeutrinoTau::NeutrinoTauDefinition();
372  G4AntiNeutrinoTau::AntiNeutrinoTauDefinition();
373  G4NeutrinoMu::NeutrinoMuDefinition();
374  G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
375  G4NeutrinoE::NeutrinoEDefinition();
376  G4AntiNeutrinoE::AntiNeutrinoEDefinition();
377  //================ MESONS ===================
378  G4PionPlus::PionPlusDefinition();
379  G4PionMinus::PionMinusDefinition();
380  G4PionZero::PionZeroDefinition();
381  G4Eta::EtaDefinition();
382  G4EtaPrime::EtaPrimeDefinition();
383  G4KaonPlus::KaonPlusDefinition();
384  G4KaonMinus::KaonMinusDefinition();
385  G4KaonZero::KaonZeroDefinition();
386  G4AntiKaonZero::AntiKaonZeroDefinition();
387  G4KaonZeroLong::KaonZeroLongDefinition();
388  G4KaonZeroShort::KaonZeroShortDefinition();
389  G4DMesonPlus::DMesonPlusDefinition();
390  G4DMesonMinus::DMesonMinusDefinition();
391  G4DMesonZero::DMesonZeroDefinition();
392  G4AntiDMesonZero::AntiDMesonZeroDefinition();
393  G4DsMesonPlus::DsMesonPlusDefinition();
394  G4DsMesonMinus::DsMesonMinusDefinition();
395  G4JPsi::JPsiDefinition();
396  G4BMesonPlus::BMesonPlusDefinition();
397  G4BMesonMinus::BMesonMinusDefinition();
398  G4BMesonZero::BMesonZeroDefinition();
399  G4AntiBMesonZero::AntiBMesonZeroDefinition();
400  G4BsMesonZero::BsMesonZeroDefinition();
401  G4AntiBsMesonZero::AntiBsMesonZeroDefinition();
402  // ========== BARYONS ==================
403  G4Proton::ProtonDefinition();
404  G4AntiProton::AntiProtonDefinition();
405  G4Neutron::NeutronDefinition();
406  G4AntiNeutron::AntiNeutronDefinition();
407  G4Lambda::LambdaDefinition();
408  G4SigmaPlus::SigmaPlusDefinition();
409  G4SigmaZero::SigmaZeroDefinition();
410  G4SigmaMinus::SigmaMinusDefinition();
411  G4XiMinus::XiMinusDefinition();
412  G4XiZero::XiZeroDefinition();
413  G4OmegaMinus::OmegaMinusDefinition();
414  G4AntiLambda::AntiLambdaDefinition();
415  G4AntiSigmaPlus::AntiSigmaPlusDefinition();
416  G4AntiSigmaZero::AntiSigmaZeroDefinition();
417  G4AntiSigmaMinus::AntiSigmaMinusDefinition();
418  G4AntiXiMinus::AntiXiMinusDefinition();
419  G4AntiXiZero::AntiXiZeroDefinition();
420  G4AntiOmegaMinus::AntiOmegaMinusDefinition();
421  G4LambdacPlus::LambdacPlusDefinition();
422  G4SigmacPlusPlus::SigmacPlusPlusDefinition();
423  G4SigmacPlus::SigmacPlusDefinition();
424  G4SigmacZero::SigmacZeroDefinition();
425  G4XicPlus::XicPlusDefinition();
426  G4XicZero::XicZeroDefinition();
427  G4OmegacZero::OmegacZeroDefinition();
428  G4AntiLambdacPlus::AntiLambdacPlusDefinition();
429  G4AntiSigmacPlusPlus::AntiSigmacPlusPlusDefinition();
430  G4AntiSigmacPlus::AntiSigmacPlusDefinition();
431  G4AntiSigmacZero::AntiSigmacZeroDefinition();
432  G4AntiXicPlus::AntiXicPlusDefinition();
433  G4AntiXicZero::AntiXicZeroDefinition();
434  G4AntiOmegacZero::AntiOmegacZeroDefinition();
435}
Note: See TracBrowser for help on using the repository browser.