CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PdtEntry Class Reference

#include <PdtEntry.h>

Public Member Functions

const HepPDT::ParticleDatadata () const
 particle data More...
 
const std::string & name () const
 particle name More...
 
int pdgId () const
 PDG id. More...
 
 PdtEntry ()
 default construct More...
 
 PdtEntry (int pdgId)
 construct from PDG id More...
 
 PdtEntry (const std::string &name)
 construct from particle name More...
 
void setup (const edm::EventSetup &)
 fill data from Event Setup More...
 

Private Attributes

const HepPDT::ParticleDatadata_
 particle data More...
 
std::string name_
 particle name More...
 
int pdgId_
 PDG id. More...
 

Detailed Description

Definition at line 15 of file PdtEntry.h.

Constructor & Destructor Documentation

PdtEntry::PdtEntry ( )
inlineexplicit

default construct

Definition at line 18 of file PdtEntry.h.

Referenced by edm::pdtentry::getPdtEntry().

18 : pdgId_( 0 ), data_( nullptr ) { }
int pdgId_
PDG id.
Definition: PdtEntry.h:34
const HepPDT::ParticleData * data_
particle data
Definition: PdtEntry.h:38
PdtEntry::PdtEntry ( int  pdgId)
inlineexplicit

construct from PDG id

Definition at line 20 of file PdtEntry.h.

20 : pdgId_( pdgId ), data_( nullptr ) { }
int pdgId_
PDG id.
Definition: PdtEntry.h:34
const HepPDT::ParticleData * data_
particle data
Definition: PdtEntry.h:38
int pdgId() const
PDG id.
Definition: PdtEntry.cc:7
PdtEntry::PdtEntry ( const std::string &  name)
inlineexplicit

construct from particle name

Definition at line 22 of file PdtEntry.h.

References data, dataset::name, common_cff::pdgId, GeneralSetup::setup(), and AlCaHLTBitMon_QueryRunRegistry::string.

22 : pdgId_( 0 ), name_( name ), data_( nullptr ) { }
int pdgId_
PDG id.
Definition: PdtEntry.h:34
std::string name_
particle name
Definition: PdtEntry.h:36
const HepPDT::ParticleData * data_
particle data
Definition: PdtEntry.h:38
const std::string & name() const
particle name
Definition: PdtEntry.cc:15

Member Function Documentation

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().

23  {
24  if(data_ == nullptr)
25  throw cms::Exception("ConfigError")
26  << "PdtEntry::name was not set."
27  << "please, call PdtEntry::setup(const EventSetup & es)";
28  return * data_;
29 }
const HepPDT::ParticleData * data_
particle data
Definition: PdtEntry.h:38
std::string const & PdtEntry::name ( void  ) const

particle name

Definition at line 15 of file PdtEntry.cc.

References name_.

Referenced by config.CFG::__str__(), and validation.Sample::digest().

15  {
16  if (name_.empty())
17  throw cms::Exception("ConfigError")
18  << "PdtEntry::name was not set."
19  << "please, call PdtEntry::setup(const EventSetup & es)";
20  return name_;
21 }
std::string name_
particle name
Definition: PdtEntry.h:36
int PdtEntry::pdgId ( ) const

PDG id.

Definition at line 7 of file PdtEntry.cc.

References Exception, and pdgId_.

Referenced by Particle.Particle::__str__(), converter::SuperClusterToCandidate::convert(), converter::StandAloneMuonTrackToCandidate::convert(), converter::TrackToCandidate::convert(), GenParticleDecaySelector::produce(), and PdgEntryReplacer::replace().

7  {
8  if (pdgId_ == 0)
9  throw cms::Exception("ConfigError")
10  << "PdtEntry::pdgId was not set.\n"
11  << "please, call PdtEntry::setup(const EventSetup & es)";
12  return pdgId_;
13 }
int pdgId_
PDG id.
Definition: PdtEntry.h:34
void PdtEntry::setup ( const edm::EventSetup )

fill data from Event Setup

Definition at line 31 of file PdtEntry.cc.

References data_, Exception, edm::EventSetup::getData(), name_, AlCaHLTBitMon_ParallelJobs::p, and pdgId_.

Referenced by converter::MassiveCandidateConverter::beginFirstRun(), GenParticleDecaySelector::produce(), and PdgEntryReplacer::replace().

31  {
33  es.getData(pdt);
34  HepPDT::ParticleData const* p = nullptr;
35  if (pdgId_ == 0) {
36  p = pdt->particle(name_);
37  if (p == nullptr)
38  throw cms::Exception("ConfigError")
39  << "PDT has no entry for " << name_ << "."
40  << "PdtEntry can't be set.";
41  pdgId_ = p->pid();
42  } else {
43  p = pdt->particle(pdgId_);
44  if (p == nullptr)
45  throw cms::Exception("ConfigError")
46  << "PDT has no entry for " << pdgId_ << "."
47  << "PdtEntry can't be set.";
48  name_ = p->name();
49  }
50  data_ = p;
51 }
int pdgId_
PDG id.
Definition: PdtEntry.h:34
std::string name_
particle name
Definition: PdtEntry.h:36
HepPDT::ParticleData ParticleData
const HepPDT::ParticleData * data_
particle data
Definition: PdtEntry.h:38

Member Data Documentation

const HepPDT::ParticleData* PdtEntry::data_
private

particle data

Definition at line 38 of file PdtEntry.h.

Referenced by data(), and setup().

std::string PdtEntry::name_
private

particle name

Definition at line 36 of file PdtEntry.h.

Referenced by name(), and setup().

int PdtEntry::pdgId_
private

PDG id.

Definition at line 34 of file PdtEntry.h.

Referenced by pdgId(), and setup().