![]() |
HepMC Reference DocumentationHepMC |
#include <ParticleDataTable.h>
Public Types | |
typedef std::map< int, HepMC::ParticleData * >::iterator | iterator |
iterator for ParticleData map | |
typedef std::map< int, HepMC::ParticleData * >::const_iterator | const_iterator |
const iterator for ParticleData map | |
Public Member Functions | |
ParticleDataTable (std::string description=std::string()) | |
constructor with optional description | |
ParticleDataTable (const char description) | |
constructor with description | |
ParticleDataTable (const ParticleDataTable &) | |
copy constructor | |
virtual | ~ParticleDataTable () |
Shallow: does not delete ParticleData entries. | |
ParticleDataTable & | operator= (const ParticleDataTable &) |
shallow: does not copy the entries, only makes new pointers | |
void | make_antiparticles_from_particles () |
make corresponding anti-particles for all particles in table | |
int | merge_table (const ParticleDataTable &) |
merge two tables | |
void | print (std::ostream &ostr=std::cout) const |
write the table to ostr | |
void | delete_all () |
delete all ParticleData instances in this table | |
void | clear () |
clears table without deleting | |
ParticleData * | operator[] (int id) const |
return pointer to requested ParticleData | |
ParticleData * | find (int id) const |
return pointer to requested ParticleData | |
int | size () const |
size of table | |
bool | empty () const |
true if the table is empty | |
bool | insert (ParticleData *) |
true if successful | |
bool | erase (ParticleData *) |
removes from table - does not delete | |
bool | erase (int id) |
removes from table - does not delete | |
iterator | begin () |
begin iteration | |
iterator | end () |
end iteration | |
const_iterator | begin () const |
begin const iteration | |
const_iterator | end () const |
end const iteration | |
std::string | description () const |
table description | |
void | set_description (std::string) |
set table description | |
void | set_description (const char) |
set table description |
Example container for ParticleData instances. Basically just an interface to STL map.
Definition at line 35 of file ParticleDataTable.h.
typedef std::map<int,HepMC::ParticleData*>::const_iterator HepMC::ParticleDataTable::const_iterator |
typedef std::map<int,HepMC::ParticleData*>::iterator HepMC::ParticleDataTable::iterator |
HepMC::ParticleDataTable::ParticleDataTable | ( | std::string | description = std::string() |
) | [inline] |
HepMC::ParticleDataTable::ParticleDataTable | ( | const char | description | ) | [inline] |
HepMC::ParticleDataTable::ParticleDataTable | ( | const ParticleDataTable & | ) | [inline] |
HepMC::ParticleDataTable::~ParticleDataTable | ( | ) | [inline, virtual] |
ParticleDataTable::const_iterator HepMC::ParticleDataTable::begin | ( | ) | const [inline] |
ParticleDataTable::iterator HepMC::ParticleDataTable::begin | ( | ) | [inline] |
begin iteration
Definition at line 214 of file ParticleDataTable.h.
Referenced by make_antiparticles_from_particles(), and merge_table().
void HepMC::ParticleDataTable::clear | ( | ) | [inline] |
clears table without deleting
Definition at line 249 of file ParticleDataTable.h.
Referenced by delete_all().
void HepMC::ParticleDataTable::delete_all | ( | ) | [inline] |
delete all ParticleData instances in this table
deletes all ParticleData instances in this table
Definition at line 242 of file ParticleDataTable.h.
References clear().
Referenced by main().
std::string HepMC::ParticleDataTable::description | ( | ) | const [inline] |
bool HepMC::ParticleDataTable::empty | ( | ) | const [inline] |
ParticleDataTable::const_iterator HepMC::ParticleDataTable::end | ( | ) | const [inline] |
ParticleDataTable::iterator HepMC::ParticleDataTable::end | ( | ) | [inline] |
end iteration
Definition at line 218 of file ParticleDataTable.h.
Referenced by make_antiparticles_from_particles(), and merge_table().
bool HepMC::ParticleDataTable::erase | ( | int | id | ) | [inline] |
removes from table - does not delete
removes from table does not delete returns True is an entry pdata existed in the table and was erased
Definition at line 208 of file ParticleDataTable.h.
bool HepMC::ParticleDataTable::erase | ( | ParticleData * | ) | [inline] |
removes from table - does not delete
removes from table does not delete returns True is an entry pdata existed in the table and was erased
Definition at line 201 of file ParticleDataTable.h.
References HepMC::ParticleData::pdg_id().
Referenced by HepMC::IO_PDG_ParticleDataTable::add_quarks_to_table().
ParticleData * HepMC::ParticleDataTable::find | ( | int | id | ) | const [inline] |
return pointer to requested ParticleData
finds a ParticleData pointer corresponding to id IF it exists in the table. If not returns NULL
Definition at line 173 of file ParticleDataTable.h.
Referenced by HepMC::IO_PDG_ParticleDataTable::add_quarks_to_table(), operator[](), and HepMC::IO_PDG_ParticleDataTable::read_entry().
bool HepMC::ParticleDataTable::insert | ( | ParticleData * | ) | [inline] |
true if successful
inserts pdata in the table IFF pdata's id has not already been used. It does NOT replace entries with the same id. True if successful. If you wish to overwrite another entry, first use erase()
Definition at line 193 of file ParticleDataTable.h.
References HepMC::ParticleData::pdg_id().
Referenced by HepMC::IO_PDG_ParticleDataTable::add_quarks_to_table(), main(), make_antiparticles_from_particles(), merge_table(), HepMC::IO_PDG_ParticleDataTable::read_entry(), and HepMC::IO_GenEvent::read_particle_data().
void HepMC::ParticleDataTable::make_antiparticles_from_particles | ( | ) | [inline] |
make corresponding anti-particles for all particles in table
make corresponding anti-particles for all particles in table
Definition at line 136 of file ParticleDataTable.h.
References begin(), end(), insert(), merge_table(), and p.
int HepMC::ParticleDataTable::merge_table | ( | const ParticleDataTable & | ) | [inline] |
merge two tables
merges pdt into this table each entry from pdt is inserted only if this table does not already have an entry matching the ParticleData's id returns the number of new entries inserted into this table.
Definition at line 251 of file ParticleDataTable.h.
References begin(), end(), insert(), and p.
Referenced by make_antiparticles_from_particles().
ParticleDataTable & HepMC::ParticleDataTable::operator= | ( | const ParticleDataTable & | ) | [inline] |
shallow: does not copy the entries, only makes new pointers
Definition at line 128 of file ParticleDataTable.h.
References m_data_table, and m_description.
ParticleData * HepMC::ParticleDataTable::operator[] | ( | int | id | ) | const [inline] |
return pointer to requested ParticleData
Definition at line 181 of file ParticleDataTable.h.
References find().
void HepMC::ParticleDataTable::print | ( | std::ostream & | ostr = std::cout |
) | const [inline] |
write the table to ostr
prints a summary of all particle Data currently in memory
Definition at line 153 of file ParticleDataTable.h.
References size().
Referenced by main().
void HepMC::ParticleDataTable::set_description | ( | const | char | ) | [inline] |
void HepMC::ParticleDataTable::set_description | ( | std::string | ) | [inline] |
set table description
Definition at line 234 of file ParticleDataTable.h.
Referenced by HepMC::IO_PDG_ParticleDataTable::fill_particle_data_table().
int HepMC::ParticleDataTable::size | ( | ) | const [inline] |