#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 |
Description: HepPDT particle data table ESSource
Implementation: <Notes on="" implementation>="">
Definition at line 32 of file HepPDTESSource.h.
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.
HepPDTESSource::HepPDTESSource | ( | const edm::ParameterSet & | cfg | ) |
constructor from parameter set
Definition at line 4 of file HepPDTESSource.cc.
References edm::ESProducer::setWhatProduced().
: pdtFileName( cfg.getParameter<edm::FileInPath>( "pdtFileName" ) ) { setWhatProduced( this ); findingRecord<PDTRecord>(); }
HepPDTESSource::~HepPDTESSource | ( | ) |
HepPDTESSource::ReturnType HepPDTESSource::produce | ( | const PDTRecord & | iRecord | ) |
return the particle table
Definition at line 14 of file HepPDTESSource.cc.
References Exception, edm::FileInPath::fullPath(), and pdtFileName.
{ using namespace edm::es; std::auto_ptr<PDT> pdt( new PDT( "PDG table" , new HepPDT::HeavyIonUnknownID) ); std::ifstream pdtFile( pdtFileName.fullPath().c_str() ); if( ! pdtFile ) throw cms::Exception( "FileNotFound", "can't open pdt file" ) << "cannot open " << pdtFileName.fullPath(); { // notice: the builder has to be destroyed // in order to fill the table! HepPDT::TableBuilder builder( * pdt ); if( ! addParticleTable( pdtFile, builder ) ) { throw cms::Exception( "ConfigError", "can't read pdt file" ) << "wrong format of " << pdtFileName.fullPath(); } } return pdt; }
void HepPDTESSource::setIntervalFor | ( | const edm::eventsetup::EventSetupRecordKey & | , |
const edm::IOVSyncValue & | , | ||
edm::ValidityInterval & | oInterval | ||
) | [virtual] |
set validity interval
Implements edm::EventSetupRecordIntervalFinder.
Definition at line 32 of file HepPDTESSource.cc.
References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().
{ // the same PDT is valid for any time oInterval = edm::ValidityInterval( edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime() ); }
edm::FileInPath HepPDTESSource::pdtFileName [private] |
Definition at line 50 of file HepPDTESSource.h.
Referenced by produce().