![]() |
![]() |
#include <PhysicsTools/HepPDTESSource/interface/HepPDTESSource.h>
Public Types | |
typedef HepPDT::ParticleDataTable | PDT |
define the particle data table type | |
typedef std::auto_ptr< PDT > | ReturnType |
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 |
Implementation: <Notes on="" implementation>="">
Definition at line 32 of file HepPDTESSource.h.
typedef std::auto_ptr<PDT> HepPDTESSource::ReturnType |
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 | ( | ) |
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 }
edm::FileInPath HepPDTESSource::pdtFileName [private] |