G4QCHIPSWorld.hh

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 //
00027 // $Id$
00028 //
00029 //      ---------------- G4QCHIPSWorld ----------------
00030 //             by Mikhail Kossov, Sept 1999.
00031 //  class header for CHIPS World of particles in CHIPS Model
00032 // ------------------------------------------------------------
00033 // Short description: The CHIPS World is a world of elementary particles
00034 // and nuclear fragments. This class is a singletone, but without fixed
00035 // limits. E.g. the nuclear fragments as possible G4Candidates can be
00036 // initialized in the CHIPS World only up to Be8 od C12 or other bigger
00037 // nuclear fragment. If one need the heavy fragment production then the
00038 // the CHIPS World must be initialized up to these fragments (see the
00039 // CHIPS Manual), but the price in performans will be big, because in
00040 // each act of the fragmentation competition these numerous candidates
00041 // take place in the competition and the hadronization probability is
00042 // calculated each time for each of them, so the Be8 limit (Be8->alpha+
00043 // alpha decays very fast and contribute to the alpha-spectrum) is the
00044 // most optimal.
00045 // -------------------------------------------------------------------
00046 
00047 #ifndef G4QCHIPSWorld_h
00048 #define G4QCHIPSWorld_h 1
00049 
00050 #include <iostream>
00051 #include "globals.hh"
00052 #include "G4QParticleVector.hh"
00053 
00054 class G4QCHIPSWorld
00055 {
00056   // Constructor/Destructor
00057 protected:
00058   G4QCHIPSWorld();             // the Default Construction is protected - Singelton
00059 public:
00060   ~G4QCHIPSWorld();            // Destructor is public because of Windows compilation error
00061 
00062   // Member Functions
00063 private:
00064   G4QCHIPSWorld(const G4QCHIPSWorld& right);       // copy QCHIPSWorld by value
00065   G4QCHIPSWorld(G4QCHIPSWorld* right);             // copy QCHIPSWorld by pointer
00066   const G4QCHIPSWorld& operator=(const G4QCHIPSWorld& right);//copy QCHIPSWorld by Operator
00067   G4bool operator==(const G4QCHIPSWorld &right) const;
00068   G4bool operator!=(const G4QCHIPSWorld &right) const;
00069 
00070 public:
00071   // Pointers to Particles of the Singeltone of the CHIPS World
00072   static G4QCHIPSWorld* Get();
00073   G4QParticleVector* GetParticles(G4int nOfParts=0);
00074   // Selectors
00075   G4QParticle* GetQParticle(G4int PDG)       const;// Get pointer to particle in CHIPSWorld
00076   G4QParticle* GetQParticle(G4QPDGCode QPDG) const;// Get pointer to particle in CHIPSWorld
00077   G4QParticle* GetQParticle(G4QPDGCode* pQP) const;// Get pointer to particle in CHIPSWorld
00078   G4int        GetQPEntries()                const;// Get a#of particles in CHIPS World
00079 
00080 // Body
00081 private:
00082   //static G4QCHIPSWorld* aWorld;             // Pointer to the CHIPS World
00083   static G4QParticleVector& GetQWorld();
00084 };
00085 
00086  
00087 inline G4QParticle* G4QCHIPSWorld::GetQParticle(G4int       PDG) const
00088 {
00089   G4int qCode=G4QPDGCode(PDG).GetQCode();
00090   //G4cout<<"G4QCHIPSWorld::GetQPart:Q="<<qCode<<",Max="<<qWorld.size()<<G4endl;
00091   return GetQWorld()[qCode];
00092 }
00093 
00094 inline G4QParticle* G4QCHIPSWorld::GetQParticle(G4QPDGCode QPDG) const
00095 {
00096   return GetQWorld()[QPDG.GetQCode()];
00097 }
00098 
00099 inline G4QParticle* G4QCHIPSWorld::GetQParticle(G4QPDGCode* pQP) const
00100 {
00101   return GetQWorld()[pQP->GetQCode()];
00102 }
00103 
00104 inline G4int        G4QCHIPSWorld::GetQPEntries() const {return GetQWorld().size();}
00105 
00106 #endif
00107 
00108 
00109 

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