#include <PdtEntry.h>
Public Member Functions | |
const HepPDT::ParticleData & | data () const |
particle data | |
const std::string & | name () const |
particle name | |
int | pdgId () const |
PDG id. | |
PdtEntry () | |
default construct | |
PdtEntry (int pdgId) | |
construct from PDG id | |
PdtEntry (const std::string &name) | |
construct from particle name | |
void | setup (const edm::EventSetup &) |
fill data from Event Setup | |
Private Attributes | |
const HepPDT::ParticleData * | data_ |
particle data | |
std::string | name_ |
particle name | |
int | pdgId_ |
PDG id. |
Definition at line 15 of file PdtEntry.h.
PdtEntry::PdtEntry | ( | ) | [inline, explicit] |
PdtEntry::PdtEntry | ( | int | pdgId | ) | [inline, explicit] |
PdtEntry::PdtEntry | ( | const std::string & | name | ) | [inline, explicit] |
HepPDT::ParticleData const & PdtEntry::data | ( | ) | const |
particle data
Definition at line 23 of file PdtEntry.cc.
References data_, and Exception.
Referenced by converter::MassiveCandidateConverter::beginFirstRun().
{ if(data_ == 0) throw cms::Exception("ConfigError") << "PdtEntry::name was not set." << "please, call PdtEntry::setup(const EventSetup & es)"; return * data_; }
std::string const & PdtEntry::name | ( | void | ) | const |
particle name
Definition at line 15 of file PdtEntry.cc.
References name_.
{ if (name_.empty()) throw cms::Exception("ConfigError") << "PdtEntry::name was not set." << "please, call PdtEntry::setup(const EventSetup & es)"; return name_; }
int PdtEntry::pdgId | ( | ) | const |
PDG id.
Definition at line 7 of file PdtEntry.cc.
References Exception, and pdgId_.
Referenced by converter::SuperClusterToCandidate::convert(), converter::StandAloneMuonTrackToCandidate::convert(), converter::TrackToCandidate::convert(), and GenParticleDecaySelector::produce().
{ if (pdgId_ == 0) throw cms::Exception("ConfigError") << "PdtEntry::pdgId was not set.\n" << "please, call PdtEntry::setup(const EventSetup & es)"; return pdgId_; }
void PdtEntry::setup | ( | const edm::EventSetup & | es | ) |
fill data from Event Setup
Definition at line 31 of file PdtEntry.cc.
References data_, Exception, edm::EventSetup::getData(), name_, L1TEmulatorMonitor_cff::p, and pdgId_.
Referenced by converter::MassiveCandidateConverter::beginFirstRun(), and GenParticleDecaySelector::produce().
{ edm::ESHandle<HepPDT::ParticleDataTable> pdt; es.getData(pdt); HepPDT::ParticleData const* p = 0; if (pdgId_ == 0) { p = pdt->particle(name_); if (p == 0) throw cms::Exception("ConfigError") << "PDT has no entry for " << name_ << "." << "PdtEntry can't be set."; pdgId_ = p->pid(); } else { p = pdt->particle(pdgId_); if (p == 0) throw cms::Exception("ConfigError") << "PDT has no entry for " << pdgId_ << "." << "PdtEntry can't be set."; name_ = p->name(); } data_ = p; }
const HepPDT::ParticleData* PdtEntry::data_ [private] |
std::string PdtEntry::name_ [private] |
int PdtEntry::pdgId_ [private] |