G4QPDGToG4Particle.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00028 // ---------------- G4QG4ToG4Particle singletone class ------------------
00029 //                 by Mikhail Kossov, December 2003.
00030 // PDGCode->G4Particle convertor of the CHIPS Simulation Branch in GEANT4
00031 // ----------------------------------------------------------------------
00032 // ****************************************************************************************
00033 // ********** This CLASS is temporary moved from the photolepton_hadron directory *********
00034 // ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
00035 // ****************************************************************************************
00036 // Short description: This is a helper class, which converts the PDG-defined
00037 // G4QHadrons of the CHIPS model to the G4 particles, defined by the singetones.
00038 // -----------------------------------------------------------------------------
00039 
00040 
00041 //#define pdebug
00042 
00043 #include "G4QPDGToG4Particle.hh"
00044 #include "G4HadronicDeprecate.hh"
00045 
00046 
00047 G4QPDGToG4Particle::G4QPDGToG4Particle()
00048 {
00049   G4HadronicDeprecate("G4QPDGToG4Particle");
00050 }
00051 
00052 G4QPDGToG4Particle::~G4QPDGToG4Particle() // The map is distructed only in the EndOfJob
00053 {
00054 }
00055 
00056 // Returns Pointer to the G4QPDGToG4Particle
00057 G4QPDGToG4Particle* G4QPDGToG4Particle::Get()
00058 {
00059   static G4QPDGToG4Particle theMap;        // *** Static body of the G4QPDGToG4Particle ***
00060   return &theMap;
00061 }
00062 
00063 G4ParticleDefinition* G4QPDGToG4Particle::GetParticleDefinition(G4int PDG)
00064 {
00065   if(!PDG) return 0;
00066   else if(PDG>0)     // Positive PDG Code
00067   {
00068     if(PDG<100)
00069     {
00070       if(PDG==22) return G4Gamma::Gamma();
00071       else if(PDG>10 && PDG<17)
00072       {
00073         if(PDG<13)
00074         {
00075           if(PDG==11) return G4Electron::Electron();
00076           else return G4NeutrinoE::NeutrinoE();
00077         }
00078         else
00079         {
00080           if(PDG<15)
00081           {
00082             if(PDG==13) return G4MuonMinus::MuonMinus();
00083             else return G4NeutrinoMu::NeutrinoMu();
00084           }
00085           else
00086           {
00087             if(PDG==15) return G4TauMinus::TauMinus();
00088             else return G4NeutrinoTau::NeutrinoTau();
00089           }
00090         }
00091       }
00092       else return 0; // @@ Warning can be added
00093     } // End of the Lepton definition
00094     else if(PDG<1000)
00095     {
00096       if(PDG<420)
00097       {
00098         if(PDG<320)
00099         {
00100           if(PDG==211) return G4PionPlus::PionPlus();
00101           else if(PDG==111) return G4PionZero::PionZero();
00102           else if(PDG==130) return G4KaonZeroLong::KaonZeroLong();
00103           else if(PDG==221) return G4Eta::Eta();
00104           else if(PDG==311) return G4KaonZero::KaonZero();
00105           else return 0; // @@ Warning can be added
00106         }
00107         else
00108         {
00109           if(PDG==321) return G4KaonPlus::KaonPlus();
00110           else if(PDG==331) return G4EtaPrime::EtaPrime();
00111           else if(PDG==310) return G4KaonZeroShort::KaonZeroShort();
00112           else if(PDG==411) return G4DMesonPlus::DMesonPlus();
00113           else return 0; // @@ Warning can be added
00114         }
00115       }
00116       else
00117       {
00118         if(PDG<500)
00119         {
00120           if(PDG==421) return G4DMesonZero::DMesonZero();
00121           else if(PDG==431) return G4DsMesonPlus::DsMesonPlus();
00122           else if(PDG==443) return G4JPsi::JPsi();
00123           else return 0; // @@ Warning can be added
00124         }
00125         else
00126         {
00127           if(PDG==521) return G4BMesonPlus::BMesonPlus();
00128           else if(PDG==511) return G4BMesonZero::BMesonZero();
00129           else if(PDG==531) return G4BsMesonZero::BsMesonZero();
00130           else return 0; // @@ Warning can be added
00131         }
00132       }
00133     } // Emd of the Meson definition
00134     else
00135     {
00136       if(PDG<3333)
00137       {
00138         if(PDG<3211)
00139         {
00140           if(PDG<3111)
00141           {
00142             if(PDG==2112) return G4Neutron::Neutron();
00143             else if(PDG==2212) return G4Proton::Proton();
00144             else return 0; // @@ Warning can be added
00145           }
00146           else
00147           {
00148             if(PDG==3112) return G4SigmaMinus::SigmaMinus();
00149             else if(PDG==3122) return G4Lambda::Lambda();
00150             else return 0; // @@ Warning can be added
00151           }
00152         }
00153         else
00154         {
00155           if(PDG<3311)
00156           {
00157             if(PDG==3222) return G4SigmaPlus::SigmaPlus();
00158             else if(PDG==3212) return G4SigmaZero::SigmaZero();
00159             else return 0; // @@ Warning can be added
00160           }
00161           else
00162           {
00163             if(PDG==3312) return G4XiMinus::XiMinus();
00164             else if(PDG==3322) return G4XiZero::XiZero();
00165             else return 0; // @@ Warning can be added
00166           }
00167         }
00168       }
00169       else
00170       {
00171         if(PDG<4221)
00172         {
00173           if(PDG<4121)
00174           {
00175             if(PDG==3334) return G4OmegaMinus::OmegaMinus();
00176             else if(PDG==4112) return G4SigmacZero::SigmacZero();
00177             else return 0; // @@ Warning can be added
00178           }
00179           else
00180           {
00181             if(PDG==4122) return G4LambdacPlus::LambdacPlus();
00182             else if(PDG==4212) return G4SigmacPlus::SigmacPlus();
00183             else return 0; // @@ Warning can be added
00184           }
00185         }
00186         else
00187         {
00188           if(PDG<4231)
00189           {
00190             if(PDG==4222) return G4SigmacPlusPlus::SigmacPlusPlus();
00191             else if(PDG==4232) return G4XicPlus::XicPlus();
00192             else return 0; // @@ Warning can be added
00193           }
00194           else
00195           {
00196             if(PDG==4132) return G4XicZero::XicZero();
00197             else if(PDG==4332) return G4OmegacZero::OmegacZero();
00198             else return 0; // @@ Warning can be added
00199           }
00200         }
00201       }
00202     } // End of Baryon definition
00203   } 
00204   else               // Negative PDG Code
00205   {
00206     G4int aPDG=-PDG;
00207 #ifdef pdebug
00208     G4cout<<"G4QPDGToG4Particle:Antiparticle PDG="<<PDG<<G4endl;
00209 #endif
00210     if(aPDG<100)
00211     {
00212       if(aPDG>10 && aPDG<17)
00213       {
00214         if(aPDG<13)
00215         {
00216           if(aPDG==11) return G4Positron::Positron();
00217           else return G4AntiNeutrinoE::AntiNeutrinoE();
00218         }
00219         else
00220         {
00221           if(aPDG<15)
00222           {
00223             if(aPDG==13) return G4MuonPlus::MuonPlus();
00224             else return G4AntiNeutrinoMu::AntiNeutrinoMu();
00225           }
00226           else
00227           {
00228             if(aPDG==15) return G4TauPlus::TauPlus();
00229             else return G4AntiNeutrinoTau::AntiNeutrinoTau();
00230           }
00231         }
00232       }
00233       else return 0; // @@ Warning can be added
00234     } // End of the Anti-Lepton definition
00235     else if(aPDG<1000)
00236     {
00237 #ifdef pdebug
00238       G4cout<<"G4QPDGToG4Particle:AntiMesons aPDG="<<aPDG<<G4endl;
00239 #endif
00240       if(aPDG<420)
00241       {
00242 #ifdef pdebug
00243        G4cout<<"G4QPDGToG4Particle:AntiSU(3)Mesons aPDG="<<aPDG<<G4endl;
00244 #endif
00245         if(aPDG<320)
00246         {
00247 #ifdef pdebug
00248           G4cout<<"G4QPDGToG4Particle:AntiPi&KMesons aPDG="<<aPDG<<G4endl;
00249 #endif
00250           if(aPDG==211) return G4PionMinus::PionMinus();
00251           else if(aPDG==311) return G4AntiKaonZero::AntiKaonZero();
00252           else return 0; // @@ Warning can be added
00253         }
00254         else
00255         {
00256 #ifdef pdebug
00257           G4cout<<"G4QPDGToG4Particle:AntiK&DMesons aPDG="<<aPDG<<G4endl;
00258 #endif
00259           if(aPDG==321) 
00260           {
00261 #ifdef pdebug
00262             G4cout<<"G4QPDGToG4Particle:KaonMinus aPDG="<<aPDG<<G4endl;
00263 #endif
00264             return G4KaonMinus::KaonMinus();
00265           }
00266           else if(aPDG==411) return G4DMesonMinus::DMesonMinus();
00267           else return 0; // @@ Warning can be added
00268         }
00269       }
00270       else
00271       {
00272         if(aPDG<500)
00273         {
00274           if(aPDG==421) return G4AntiDMesonZero::AntiDMesonZero();
00275           else if(aPDG==431) return G4DsMesonMinus::DsMesonMinus();
00276           else return 0; // @@ Warning can be added
00277         }
00278         else
00279         {
00280           if(aPDG==521) return G4BMesonMinus::BMesonMinus();
00281           else if(aPDG==511) return G4AntiBMesonZero::AntiBMesonZero();
00282           else if(aPDG==531) return G4AntiBsMesonZero::AntiBsMesonZero();
00283           else return 0; // @@ Warning can be added
00284         }
00285       }
00286     } // Emd of the Anti-Meson definition
00287     else
00288     {
00289       if(aPDG<3333)
00290       {
00291         if(aPDG<3211)
00292         {
00293           if(aPDG<3111)
00294           {
00295             if(aPDG==2112) return G4AntiNeutron::AntiNeutron();
00296             else if(aPDG==2212) return G4AntiProton::AntiProton();
00297             else return 0; // @@ Warning can be added
00298           }
00299           else
00300           {
00301             if(aPDG==3112) return G4AntiSigmaMinus::AntiSigmaMinus();
00302             else if(aPDG==3122) return G4AntiLambda::AntiLambda();
00303             else return 0; // @@ Warning can be added
00304           }
00305         }
00306         else
00307         {
00308           if(aPDG<3311)
00309           {
00310             if(aPDG==3222) return G4AntiSigmaPlus::AntiSigmaPlus();
00311             else if(aPDG==3212) return G4AntiSigmaZero::AntiSigmaZero();
00312             else return 0; // @@ Warning can be added
00313           }
00314           else
00315           {
00316             if(aPDG==3312) return G4AntiXiMinus::AntiXiMinus();
00317             else if(aPDG==3322) return G4AntiXiZero::AntiXiZero();
00318             else return 0; // @@ Warning can be added
00319           }
00320         }
00321       }
00322       else
00323       {
00324         if(aPDG<4221)
00325         {
00326           if(aPDG<4121)
00327           {
00328             if(aPDG==3334) return G4AntiOmegaMinus::AntiOmegaMinus();
00329             else if(aPDG==4112) return G4AntiSigmacZero::AntiSigmacZero();
00330             else return 0; // @@ Warning can be added
00331           }
00332           else
00333           {
00334             if(aPDG==4122) return G4AntiLambdacPlus::AntiLambdacPlus();
00335             else if(aPDG==4212) return G4AntiSigmacPlus::AntiSigmacPlus();
00336             else return 0; // @@ Warning can be added
00337           }
00338         }
00339         else
00340         {
00341           if(aPDG<4231)
00342           {
00343             if(aPDG==4222) return G4AntiSigmacPlusPlus::AntiSigmacPlusPlus();
00344             else if(aPDG==4232) return G4AntiXicPlus::AntiXicPlus();
00345             else return 0; // @@ Warning can be added
00346           }
00347           else
00348           {
00349             if(aPDG==4132) return G4AntiXicZero::AntiXicZero();
00350             else if(aPDG==4332) return G4AntiOmegacZero::AntiOmegacZero();
00351             else return 0; // @@ Warning can be added
00352           }
00353         }
00354       }
00355     } // End of Anti-Baryon definition
00356   } // End of Anti-particle definition
00357   return 0;
00358 }
00359 
00360 void G4QPDGToG4Particle::DefineAllParticles()
00361 {
00362   //=---------= LEPTONS =---------------=
00363   G4Gamma::GammaDefinition();
00364   G4MuonPlus::MuonPlusDefinition();
00365   G4MuonMinus::MuonMinusDefinition();
00366   G4TauMinus::TauMinusDefinition();
00367   G4TauPlus::TauPlusDefinition();
00368   G4Electron::ElectronDefinition();
00369   G4Positron::PositronDefinition();
00370   G4NeutrinoTau::NeutrinoTauDefinition();
00371   G4AntiNeutrinoTau::AntiNeutrinoTauDefinition();
00372   G4NeutrinoMu::NeutrinoMuDefinition();
00373   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
00374   G4NeutrinoE::NeutrinoEDefinition();
00375   G4AntiNeutrinoE::AntiNeutrinoEDefinition();
00376   //=--------------= MESONS =---------------=
00377   G4PionPlus::PionPlusDefinition();
00378   G4PionMinus::PionMinusDefinition();
00379   G4PionZero::PionZeroDefinition();
00380   G4Eta::EtaDefinition();
00381   G4EtaPrime::EtaPrimeDefinition();
00382   G4KaonPlus::KaonPlusDefinition();
00383   G4KaonMinus::KaonMinusDefinition();
00384   G4KaonZero::KaonZeroDefinition();
00385   G4AntiKaonZero::AntiKaonZeroDefinition();
00386   G4KaonZeroLong::KaonZeroLongDefinition();
00387   G4KaonZeroShort::KaonZeroShortDefinition();
00388   G4DMesonPlus::DMesonPlusDefinition();
00389   G4DMesonMinus::DMesonMinusDefinition();
00390   G4DMesonZero::DMesonZeroDefinition();
00391   G4AntiDMesonZero::AntiDMesonZeroDefinition();
00392   G4DsMesonPlus::DsMesonPlusDefinition();
00393   G4DsMesonMinus::DsMesonMinusDefinition();
00394   G4JPsi::JPsiDefinition();
00395   G4BMesonPlus::BMesonPlusDefinition();
00396   G4BMesonMinus::BMesonMinusDefinition();
00397   G4BMesonZero::BMesonZeroDefinition();
00398   G4AntiBMesonZero::AntiBMesonZeroDefinition();
00399   G4BsMesonZero::BsMesonZeroDefinition();
00400   G4AntiBsMesonZero::AntiBsMesonZeroDefinition();
00401   // =---------= BARYONS =-----------=
00402   G4Proton::ProtonDefinition();
00403   G4AntiProton::AntiProtonDefinition();
00404   G4Neutron::NeutronDefinition();
00405   G4AntiNeutron::AntiNeutronDefinition();
00406   G4Lambda::LambdaDefinition();
00407   G4SigmaPlus::SigmaPlusDefinition();
00408   G4SigmaZero::SigmaZeroDefinition();
00409   G4SigmaMinus::SigmaMinusDefinition();
00410   G4XiMinus::XiMinusDefinition();
00411   G4XiZero::XiZeroDefinition();
00412   G4OmegaMinus::OmegaMinusDefinition();
00413   G4AntiLambda::AntiLambdaDefinition();
00414   G4AntiSigmaPlus::AntiSigmaPlusDefinition();
00415   G4AntiSigmaZero::AntiSigmaZeroDefinition();
00416   G4AntiSigmaMinus::AntiSigmaMinusDefinition();
00417   G4AntiXiMinus::AntiXiMinusDefinition();
00418   G4AntiXiZero::AntiXiZeroDefinition();
00419   G4AntiOmegaMinus::AntiOmegaMinusDefinition();
00420   G4LambdacPlus::LambdacPlusDefinition();
00421   G4SigmacPlusPlus::SigmacPlusPlusDefinition();
00422   G4SigmacPlus::SigmacPlusDefinition();
00423   G4SigmacZero::SigmacZeroDefinition();
00424   G4XicPlus::XicPlusDefinition();
00425   G4XicZero::XicZeroDefinition();
00426   G4OmegacZero::OmegacZeroDefinition();
00427   G4AntiLambdacPlus::AntiLambdacPlusDefinition();
00428   G4AntiSigmacPlusPlus::AntiSigmacPlusPlusDefinition();
00429   G4AntiSigmacPlus::AntiSigmacPlusDefinition();
00430   G4AntiSigmacZero::AntiSigmacZeroDefinition();
00431   G4AntiXicPlus::AntiXicPlusDefinition();
00432   G4AntiXicZero::AntiXicZeroDefinition();
00433   G4AntiOmegacZero::AntiOmegacZeroDefinition();
00434 }

Generated on Mon May 27 17:49:39 2013 for Geant4 by  doxygen 1.4.7