// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // $Id: G4QPDGToG4Particle.cc,v 1.1 2009/11/17 10:36:55 mkossov Exp $ // GEANT4 tag $Name: hadr-chips-V09-03-08 $ // // ---------------- G4QG4ToG4Particle singletone class ------------------ // by Mikhail Kossov, December 2003. // PDGCode->G4Particle convertor of the CHIPS Simulation Branch in GEANT4 // ---------------------------------------------------------------------- // **************************************************************************************** // ********** This CLASS is temporary moved from the photolepton_hadron directory ********* // ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ****** // **************************************************************************************** // Short description: This is a helper class, which converts the PDG-defined // G4QHadrons of the CHIPS model to the G4 particles, defined by the singetones. // ----------------------------------------------------------------------------- //#define pdebug #include "G4QPDGToG4Particle.hh" G4QPDGToG4Particle::G4QPDGToG4Particle() { } G4QPDGToG4Particle::~G4QPDGToG4Particle() // The map is distructed only in the EndOfJob { } // Returns Pointer to the G4QPDGToG4Particle G4QPDGToG4Particle* G4QPDGToG4Particle::Get() // ========================= { static G4QPDGToG4Particle theMap; // *** Static body of the G4QPDGToG4Particle *** return &theMap; } G4ParticleDefinition* G4QPDGToG4Particle::GetParticleDefinition(G4int PDG) // ==================================================== { if(!PDG) return 0; else if(PDG>0) // Positive PDG Code { if(PDG<100) { if(PDG==22) return G4Gamma::Gamma(); else if(PDG>10 && PDG<17) { if(PDG<13) { if(PDG==11) return G4Electron::Electron(); else return G4NeutrinoE::NeutrinoE(); } else { if(PDG<15) { if(PDG==13) return G4MuonMinus::MuonMinus(); else return G4NeutrinoMu::NeutrinoMu(); } else { if(PDG==15) return G4TauMinus::TauMinus(); else return G4NeutrinoTau::NeutrinoTau(); } } } else return 0; // @@ Warning can be added } // End of the Lepton definition else if(PDG<1000) { if(PDG<420) { if(PDG<320) { if(PDG==211) return G4PionPlus::PionPlus(); else if(PDG==111) return G4PionZero::PionZero(); else if(PDG==130) return G4KaonZeroLong::KaonZeroLong(); else if(PDG==221) return G4Eta::Eta(); else if(PDG==311) return G4KaonZero::KaonZero(); else return 0; // @@ Warning can be added } else { if(PDG==321) return G4KaonPlus::KaonPlus(); else if(PDG==331) return G4EtaPrime::EtaPrime(); else if(PDG==310) return G4KaonZeroShort::KaonZeroShort(); else if(PDG==411) return G4DMesonPlus::DMesonPlus(); else return 0; // @@ Warning can be added } } else { if(PDG<500) { if(PDG==421) return G4DMesonZero::DMesonZero(); else if(PDG==431) return G4DsMesonPlus::DsMesonPlus(); else if(PDG==443) return G4JPsi::JPsi(); else return 0; // @@ Warning can be added } else { if(PDG==521) return G4BMesonPlus::BMesonPlus(); else if(PDG==511) return G4BMesonZero::BMesonZero(); else if(PDG==531) return G4BsMesonZero::BsMesonZero(); else return 0; // @@ Warning can be added } } } // Emd of the Meson definition else { if(PDG<3333) { if(PDG<3211) { if(PDG<3111) { if(PDG==2112) return G4Neutron::Neutron(); else if(PDG==2212) return G4Proton::Proton(); else return 0; // @@ Warning can be added } else { if(PDG==3112) return G4SigmaMinus::SigmaMinus(); else if(PDG==3122) return G4Lambda::Lambda(); else return 0; // @@ Warning can be added } } else { if(PDG<3311) { if(PDG==3222) return G4SigmaPlus::SigmaPlus(); else if(PDG==3212) return G4SigmaZero::SigmaZero(); else return 0; // @@ Warning can be added } else { if(PDG==3312) return G4XiMinus::XiMinus(); else if(PDG==3322) return G4XiZero::XiZero(); else return 0; // @@ Warning can be added } } } else { if(PDG<4221) { if(PDG<4121) { if(PDG==3334) return G4OmegaMinus::OmegaMinus(); else if(PDG==4112) return G4SigmacZero::SigmacZero(); else return 0; // @@ Warning can be added } else { if(PDG==4122) return G4LambdacPlus::LambdacPlus(); else if(PDG==4212) return G4SigmacPlus::SigmacPlus(); else return 0; // @@ Warning can be added } } else { if(PDG<4231) { if(PDG==4222) return G4SigmacPlusPlus::SigmacPlusPlus(); else if(PDG==4232) return G4XicPlus::XicPlus(); else return 0; // @@ Warning can be added } else { if(PDG==4132) return G4XicZero::XicZero(); else if(PDG==4332) return G4OmegacZero::OmegacZero(); else return 0; // @@ Warning can be added } } } } // End of Baryon definition } else // Negative PDG Code { G4int aPDG=-PDG; #ifdef pdebug G4cout<<"G4QPDGToG4Particle:Antiparticle PDG="<10 && aPDG<17) { if(aPDG<13) { if(aPDG==11) return G4Positron::Positron(); else return G4AntiNeutrinoE::AntiNeutrinoE(); } else { if(aPDG<15) { if(aPDG==13) return G4MuonPlus::MuonPlus(); else return G4AntiNeutrinoMu::AntiNeutrinoMu(); } else { if(aPDG==15) return G4TauPlus::TauPlus(); else return G4AntiNeutrinoTau::AntiNeutrinoTau(); } } } else return 0; // @@ Warning can be added } // End of the Anti-Lepton definition else if(aPDG<1000) { #ifdef pdebug G4cout<<"G4QPDGToG4Particle:AntiMesons aPDG="<