HepPDT Reference Documentation

HepPDT

DefTable.cc

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------
00002 //
00003 // DefTable.cc
00004 // Author: Lynn Garren
00005 //
00006 // ----------------------------------------------------------------------
00007 
00008 #include <iostream>
00009 
00010 #include "HepPDT/defs.h"
00011 #include "HepPDT/DefTable.hh"
00012 
00013 namespace HepPDT {
00014 
00015 DefTable::DefTable( )
00016 { ; }
00017 
00018 double DefTable::definition( std::string const & def )
00019 {
00020     TempDefMap::iterator it = tempDefines.find( def );
00021     if( it != tempDefines.end() ) {
00022         return it->second;
00023     } else {
00024         // can neither build nor return a proper TempParticleData
00025         std::cout << "HepPDT::DefTable.definition: There is no entry for " 
00026                        << def << std::endl;
00027         return 0.0;
00028     }
00029 }
00030 
00031 bool DefTable::hasDefinition( std::string const & def ) const
00032 {
00033     TempDefMap::const_iterator it = tempDefines.find( def );
00034     if( it != tempDefines.end() ) {
00035         return true;
00036     } else {
00037         return false;
00038     }
00039 }
00040 
00041 void DefTable::writeDefinitions(  ) const
00042 {
00043   const_iterator  endit = end();
00044   const_iterator cit;
00045   for( cit=begin(); cit != endit; ++cit ) {
00046     std::cout << "Definition: " << cit->first << " = " << cit->second << std::endl;
00047   }
00048 }
00049 
00050 }  // namespace HepPDT

Generated on Fri Dec 4 14:05:23 2009 for HepPDT by  doxygen 1.4.7