G4UnboundPN.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 // ------------------------------------------------------------
00029 //      Bertini Cascade unboundPN class implementation file
00030 //
00031 //      History: first implementation, inspired by G4Proton
00032 //      17 Nov 2009:  Michael Kelsey
00033 //      06 Apr 2010:  Do G4Ions initialization in ctor.
00034 //      13 Apr 2010:  Per Kurashige, inherit from G4VShortLivedParticle.
00035 //      06 May 2010:  Remove created particle from master table.
00036 //      25 May 2012:  Add flags to suppress particle-table error message.
00037 // ----------------------------------------------------------------
00038 
00039 #include "G4UnboundPN.hh"
00040 
00041 #include "globals.hh"
00042 #include "G4ios.hh"
00043 #include "G4PhysicalConstants.hh"
00044 #include "G4SystemOfUnits.hh"
00045 #include "G4ParticleTable.hh"
00046 
00047 // ######################################################################
00048 // ###                          UNBOUNDPN                             ###
00049 // ######################################################################
00050 G4UnboundPN* G4UnboundPN::theInstance = 0;
00051 
00052 //    Arguments for constructor are as follows
00053 //               name             mass          width         charge
00054 //             2*spin           parity  C-conjugation
00055 //          2*Isospin       2*Isospin3       G-parity
00056 //               type    lepton number  baryon number   PDG encoding
00057 //             stable         lifetime    decay table
00058 G4UnboundPN::G4UnboundPN()
00059   : G4VShortLivedParticle("unboundPN",
00060                           (proton_mass_c2+neutron_mass_c2), 0.0*MeV, +1.*eplus, 
00061                           2,       +1,       0,          
00062                           2,        0,       0,             
00063                           "nucleus",        0,      +2, 0, /* ? 100010020 */
00064                           true,       0.,    NULL) {}
00065 
00066 G4UnboundPN* G4UnboundPN::Definition() {
00067   if (0 == theInstance) {
00068     theInstance = new G4UnboundPN;      // There can be only one
00069 
00070     G4ParticleTable* pTable = G4ParticleTable::GetParticleTable();
00071     pTable->SetReadiness(false);        // Suppress error message
00072     pTable->Remove(theInstance);        // Make invisible to GEANT4
00073     pTable->SetReadiness(true);         // Set back 'ready to use' flag
00074   }
00075 
00076   return theInstance;
00077 }
00078 
00079 // Simple call-throughs
00080 G4UnboundPN* G4UnboundPN::UnboundPNDefinition() { return Definition(); }
00081 G4UnboundPN* G4UnboundPN::UnboundPN()           { return Definition(); }

Generated on Mon May 27 17:50:07 2013 for Geant4 by  doxygen 1.4.7