CMS 3D CMS Logo

PdtEntry Class Reference

#include <SimGeneral/HepPDTRecord/interface/PdtEntry.h>

List of all members.

Public Member Functions

const HepPDT::ParticleDatadata () 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::ParticleDatadata_
 particle data
std::string name_
 particle name
int pdgId_
 PDG id.


Detailed Description

Definition at line 14 of file PdtEntry.h.


Constructor & Destructor Documentation

PdtEntry::PdtEntry (  )  [inline, explicit]

default construct

Definition at line 17 of file PdtEntry.h.

00017 : pdgId_( 0 ), data_( 0 ) { }

PdtEntry::PdtEntry ( int  pdgId  )  [inline, explicit]

construct from PDG id

Definition at line 19 of file PdtEntry.h.

00019 : pdgId_( pdgId ), data_( 0 ) { }

PdtEntry::PdtEntry ( const std::string &  name  )  [inline, explicit]

construct from particle name

Definition at line 21 of file PdtEntry.h.

00021 : pdgId_( 0 ), name_( name ), data_( 0 ) { }


Member Function Documentation

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 }


Member Data Documentation

const HepPDT::ParticleData* PdtEntry::data_ [private]

particle data

Definition at line 37 of file PdtEntry.h.

Referenced by data(), and setup().

std::string PdtEntry::name_ [private]

particle name

Definition at line 35 of file PdtEntry.h.

Referenced by name(), and setup().

int PdtEntry::pdgId_ [private]

PDG id.

Definition at line 33 of file PdtEntry.h.

Referenced by pdgId(), and setup().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:29 2009 for CMSSW by  doxygen 1.5.4