/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SimGeneral/HepPDTESSource/src/HepPDTESSource.cc
29 строк
1 KB
Christopher Jones
Move to EventSetupRecordInfiniteIntervalFinder
16 июн 2026, 21:21
16 июн 2026, 21:21
419a1ec
Код
Авторство
О чём код?
#include "HepPDT/HeavyIonUnknownID.hh" #include "SimGeneral/HepPDTESSource/interface/HepPDTESSource.h" HepPDTESSource::HepPDTESSource(const edm::ParameterSet &cfg) : pdtFileName(cfg.getParameter<edm::FileInPath>("pdtFileName")) { setWhatProduced(this); findingRecord<PDTRecord>(); } HepPDTESSource::~HepPDTESSource() {} HepPDTESSource::ReturnType HepPDTESSource::produce(const PDTRecord &iRecord) { using namespace edm::es; auto pdt = std::make_unique<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; } // define this as a plug-in // DEFINE_FWK_EVENTSETUP_SOURCE( HepPDTESSource );