CLHEP/HepPDT/QQDecayTable.hh

00001 // $Id: QQDecayTable.hh,v 1.3 2002/04/12 15:02:43 evc Exp $
00002 // ----------------------------------------------------------------------
00003 //
00004 // QQDecayTable.hh
00005 // Author: Lynn Garren
00006 //
00007 // This class holds all the information in the QQ decay.dec table
00008 // 
00009 // ----------------------------------------------------------------------
00010 #ifndef QQDECAYTABLE_HH
00011 #define QQDECAYTABLE_HH
00012 
00013 #include "CLHEP/config/CLHEP.h"
00014 #include <string>
00015 #include <map>
00016 
00017 #include "CLHEP/config/sstream.h"
00018 #include "CLHEP/HepPDT/QQStructs.hh"
00019 #include "CLHEP/HepPDT/QQDecay.hh"
00020 #include "CLHEP/HepPDT/Version.hh"
00021 
00022 namespace HepPDT {
00023 
00028 class QQDecayTable  {
00029 
00030 public:
00031 
00032   typedef std::map<std::string,PARTICLE> ParticleMap;
00033   typedef std::map<std::string,QQBAR> QuarkMap;
00034   typedef std::map<std::string,QQDecay> DecayMap;
00035 
00036   // -- constructors
00037   QQDecayTable();
00038   QQDecayTable( std::istream & pdfile );
00039   ~QQDecayTable();
00040 
00041   // ---  copying:
00042   //
00043   void  swap ( QQDecayTable & rhs );
00044   QQDecayTable( const QQDecayTable & orig );
00045   QQDecayTable & operator = ( const QQDecayTable & rhs );
00046 
00047   // --- mutators
00048   //
00049   void addParticle ( std::string & nm, PARTICLE p ) { itsParticleMap[nm] = p; }
00050   void addQQbar    ( std::string & nm, QQBAR q )    { itsQuarkMap[nm] = q; }
00051   void addDecay    ( std::string & nm, QQDecay d )  { itsDecayMap[nm] = d; }
00052   void readQQstream( std::istream & pdfile );
00053 
00054   // --- accessors
00055   //
00056   PARTICLE particle( const std::string & name );
00057   QQBAR    qqbar( const std::string & name );
00058   QQDecay  decay( const std::string & name );
00059   const ParticleMap particleMap( ) const { return itsParticleMap; }
00060   const QuarkMap    quarkMap( )    const { return itsQuarkMap; }
00061   const DecayMap    decayMap( )    const { return itsDecayMap; }
00062   void writeTable( std::ostream & os ) const;   // intended for diagnostic use
00063 
00064 private:
00065 
00066   int         itsVersion;               // decay.dec version
00067   ParticleMap itsParticleMap;
00068   QuarkMap    itsQuarkMap;
00069   DecayMap    itsDecayMap;
00070 
00071   // helper methods
00072   bool getQQLineType( std::string & ltype, std::string & name, const std::string & pdline );
00073   int  getQQversion( const std::string & pdline );
00074   int  getQQbar( const std::string & pdline );
00075   void addPDG( const std::string & pdline );
00076   void addParity( const std::string & pdline );
00077   void addCParity( const std::string & pdline );
00078   void addMixing( const std::string & pdline );
00079   bool parseQQDecayLine( QQDecay & dcy, QQChannel & ch, const std::string & pdline );
00080   PARTICLE parseParticle( const std::string & pdline );
00081 
00082 };  // QQDecayTable
00083 
00084 inline void swap( QQDecayTable & first, QQDecayTable & second ) {
00085   first.swap( second );
00086 }
00087 
00088 }  // namespace HepPDT
00089 
00090 #endif // QQDECAYTABLE_HH

Class Library for High Energy Physics (version 1.8)