CLHEP/HepPDT/ParticleDataTableT.hh

00001 // $Id: ParticleDataTableT.hh,v 1.4 2002/04/12 15:02:43 evc Exp $
00002 // ----------------------------------------------------------------------
00003 //
00004 // ParticleDataTableT.hh
00005 // Author: Lynn Garren, Walter Brown
00006 //
00007 // ----------------------------------------------------------------------
00008 #ifndef PARTICLEDATATABLET_HH
00009 #define PARTICLEDATATABLET_HH
00010 
00011 #include "CLHEP/config/CLHEP.h"
00012 #include "CLHEP/config/iostream.h"
00013 #include <map>
00014 
00015 #include "CLHEP/HepPDT/ParticleID.hh"
00016 #include "CLHEP/HepPDT/DecayDataT.hh"
00017 #include "CLHEP/HepPDT/DecayChannelT.hh"
00018 #include "CLHEP/HepPDT/ParticleDataT.hh"
00019 #include "CLHEP/HepPDT/Version.hh"
00020 
00021 namespace HepPDT {
00022   
00027 template< class Config >
00028 class ParticleDataTableT  {
00029   
00030 public:
00031   typedef typename Config::CPDlist                CPDlist;
00032   typedef typename Config::DDlist                 DDlist;
00033   typedef typename Config::DecayData              DecayData;
00034   typedef typename Config::ParticleData           ParticleData;
00035   typedef typename Config::ParticleDataTable      ParticleDataTable;
00036   typedef typename Config::CPDID                  CPDID;
00037   typedef typename Config::DDID                   DDID;
00038   typedef typename Config::CPD                    CPD;
00039 
00040   typedef  std::map<ParticleID,TempParticleData>  TempMap;
00041   typedef  std::map<ParticleID,ParticleData>      PDTMap;
00042 
00043   typedef typename  PDTMap::const_iterator  const_iterator;
00044 
00045   // ---  birth/death:
00046   //
00047   inline ParticleDataTableT( std::string name = " " );
00048   inline ~ParticleDataTableT();
00049 
00050   // ---  accessors:
00051   //
00052   int             size()  const { return itsMap.size(); }
00053   const_iterator  begin() const { return itsMap.begin(); }
00054   const_iterator  end()   const { return itsMap.end(); }
00055   std::string     tableName() const { return itsTableName; }
00056 
00057   inline ParticleData const * particle( ParticleID ) const;
00058   inline ParticleData       * particle( ParticleID );
00059 
00060   inline ParticleData       * operator [] ( ParticleID );
00061   inline ParticleData const * operator [] ( ParticleID ) const;
00062 
00063   void writeParticleData( std::ostream & outstr );
00064   
00065   void convertTemporaryMap( TempMap & tempPDT, std::ostream & err );
00066 
00067   DDID addDecayData( DecayData const & d );
00068 
00069 private:
00070   // --- local data:
00071   CPDlist     itsCPDlist;
00072   DDlist      itsDDlist;
00073   PDTMap      itsMap;
00074   std::string itsTableName;
00075 
00076   // ---  copying; forbidden:
00077   ParticleDataTableT( const ParticleDataTableT & orig );
00078   ParticleDataTableT& operator=( const ParticleDataTableT & );
00079   
00080   // --- add method is private
00081   void addParticle( ParticleData const & p );
00082   CPDID addParticleData( CPD const & cpd );
00083   typedef typename  PDTMap::iterator        iterator;
00084   //?iterator        begin()       { return itsMap.begin(); }
00085   //?iterator        end()       { return itsMap.end(); }
00086 
00087 };  // ParticleDataTableT
00088 
00089 // --- free functions
00090 //
00091 
00092 template< class Config >
00093 bool writePDGStream (std::ostream & os, const ParticleDataTableT<Config> & table);
00094 
00095 template< class Config >
00096 bool writePythiaStream (std::ostream & os, const ParticleDataTableT<Config> & table);
00097 
00098 template< class Config >
00099 bool writeHerwigStream (std::ostream & os, const ParticleDataTableT<Config> & table);
00100 
00101 template< class Config >
00102 bool writeIsajetStream (std::ostream & os, const ParticleDataTableT<Config> & table);
00103 
00104 template< class Config >
00105 bool writeQQStream (std::ostream & os, const ParticleDataTableT<Config> & table);
00106 
00107 template< class Config >
00108 bool writeEvtGenStream (std::ostream & os, const ParticleDataTableT<Config> & table);
00109 
00110 
00111 }       // HepPDT
00112 
00113 #include "CLHEP/HepPDT/ParticleDataTableT.icc"
00114 #include "CLHEP/HepPDT/convertTemporaryMap.icc"
00115 
00116 #endif // PARTICLEDATATABLET_HH

Class Library for High Energy Physics (version 1.8)