CMS 3D CMS Logo

HepPDTESSource Class Reference

Description: HepPDT particle data table ESSource. More...

#include <PhysicsTools/HepPDTESSource/interface/HepPDTESSource.h>

Inheritance diagram for HepPDTESSource:

edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef HepPDT::ParticleDataTable PDT
 define the particle data table type
typedef std::auto_ptr< PDTReturnType
 define the return type

Public Member Functions

 HepPDTESSource (const edm::ParameterSet &)
 constructor from parameter set
ReturnType produce (const PDTRecord &)
 return the particle table
void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
 set validity interval
 ~HepPDTESSource ()
 destructor

Private Attributes

edm::FileInPath pdtFileName


Detailed Description

Description: HepPDT particle data table ESSource.

Implementation: <Notes on="" implementation>="">

Definition at line 32 of file HepPDTESSource.h.


Member Typedef Documentation

typedef HepPDT::ParticleDataTable HepPDTESSource::PDT

define the particle data table type

Definition at line 39 of file HepPDTESSource.h.

typedef std::auto_ptr<PDT> HepPDTESSource::ReturnType

define the return type

Definition at line 41 of file HepPDTESSource.h.


Constructor & Destructor Documentation

HepPDTESSource::HepPDTESSource ( const edm::ParameterSet cfg  ) 

constructor from parameter set

Definition at line 3 of file HepPDTESSource.cc.

References edm::ESProducer::setWhatProduced().

00003                                                            :
00004   pdtFileName( cfg.getParameter<edm::FileInPath>( "pdtFileName" ) ) {
00005   setWhatProduced( this );
00006   findingRecord<PDTRecord>();
00007 }

HepPDTESSource::~HepPDTESSource (  ) 

destructor

Definition at line 9 of file HepPDTESSource.cc.

00009                                 {
00010 }


Member Function Documentation

HepPDTESSource::ReturnType HepPDTESSource::produce ( const PDTRecord iRecord  ) 

return the particle table

Definition at line 13 of file HepPDTESSource.cc.

References Exception, edm::FileInPath::fullPath(), and pdtFileName.

00013                                                    {
00014   using namespace edm::es;
00015   std::auto_ptr<PDT> pdt( new PDT( "PDG table" ) ); 
00016   std::ifstream pdtFile( pdtFileName.fullPath().c_str() );
00017   if( ! pdtFile ) 
00018     throw cms::Exception( "FileNotFound", "can't open pdt file" )
00019       << "cannot open " << pdtFileName.fullPath();
00020   { // notice: the builder has to be destroyed 
00021     // in order to fill the table!
00022     HepPDT::TableBuilder builder( * pdt );
00023     if( ! addParticleTable( pdtFile, builder ) ) { 
00024       throw cms::Exception( "ConfigError", "can't read pdt file" )
00025         << "wrong format of " << pdtFileName.fullPath();
00026     }
00027   }  
00028   return pdt;
00029 }

void HepPDTESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oInterval 
) [virtual]

set validity interval

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 31 of file HepPDTESSource.cc.

References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().

00033                                                                       {
00034   // the same PDT is valid for any time
00035   oInterval = edm::ValidityInterval( edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime() );
00036 }


Member Data Documentation

edm::FileInPath HepPDTESSource::pdtFileName [private]

Definition at line 50 of file HepPDTESSource.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:10 2009 for CMSSW by  doxygen 1.5.4