#include <SimGeneral/HepPDTRecord/interface/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 (const std::string &name) | |
construct from particle name | |
PdtEntry (int pdgId) | |
construct from PDG id | |
PdtEntry () | |
default construct | |
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 14 of file PdtEntry.h.
PdtEntry::PdtEntry | ( | ) | [inline, explicit] |
PdtEntry::PdtEntry | ( | int | pdgId | ) | [inline, explicit] |
PdtEntry::PdtEntry | ( | const std::string & | name | ) | [inline, explicit] |
const HepPDT::ParticleData & PdtEntry::data | ( | void | ) | const |
particle data
Definition at line 25 of file PdtEntry.cc.
References data_, and Exception.
Referenced by converter::MassiveCandidateConverter::beginJob().
00025 { 00026 if( data_ == 0 ) 00027 throw cms::Exception( "ConfigError" ) 00028 << "PdtEntry::name was not set." 00029 << "please, call PdtEntry::setup( const edm::EventSetup & es )"; 00030 return * data_; 00031 }
const string & PdtEntry::name | ( | void | ) | const |
particle name
Definition at line 17 of file PdtEntry.cc.
References name_.
00017 { 00018 if ( name_.empty() ) 00019 throw cms::Exception( "ConfigError" ) 00020 << "PdtEntry::name was not set." 00021 << "please, call PdtEntry::setup( const edm::EventSetup & es )"; 00022 return name_; 00023 }
int PdtEntry::pdgId | ( | ) | const |
PDG id.
Definition at line 9 of file PdtEntry.cc.
References Exception, and pdgId_.
Referenced by converter::SuperClusterToCandidate::convert(), converter::StandAloneMuonTrackToCandidate::convert(), converter::TrackToCandidate::convert(), and GenParticleDecaySelector::produce().
00009 { 00010 if ( pdgId_ == 0 ) 00011 throw cms::Exception( "ConfigError" ) 00012 << "PdtEntry::pdgId was not set.\n" 00013 << "please, call PdtEntry::setup( const edm::EventSetup & es )"; 00014 return pdgId_; 00015 }
void PdtEntry::setup | ( | const edm::EventSetup & | es | ) |
fill data from Event Setup
Definition at line 33 of file PdtEntry.cc.
References data_, Exception, edm::EventSetup::getData(), name_, p, and pdgId_.
Referenced by converter::MassiveCandidateConverter::beginJob(), and GenParticleDecaySelector::beginJob().
00033 { 00034 ESHandle<HepPDT::ParticleDataTable> pdt; 00035 es.getData( pdt ); 00036 const HepPDT::ParticleData * p = 0; 00037 if ( pdgId_ == 0 ) { 00038 p = pdt->particle( name_ ); 00039 if ( p == 0 ) 00040 throw cms::Exception( "ConfigError" ) 00041 << "PDT has no entry for " << name_ << "." 00042 << "PdtEntry can't be set."; 00043 pdgId_ = p->pid(); 00044 } else { 00045 p = pdt->particle( pdgId_ ); 00046 if ( p == 0 ) 00047 throw cms::Exception( "ConfigError" ) 00048 << "PDT has no entry for " << pdgId_ << "." 00049 << "PdtEntry can't be set."; 00050 name_ = p->name(); 00051 } 00052 data_ = p; 00053 }
const HepPDT::ParticleData* PdtEntry::data_ [private] |
std::string PdtEntry::name_ [private] |
int PdtEntry::pdgId_ [private] |