HepMC Reference Documentation

HepMC

HepMC::ParticleDataTable Class Reference

an example ParticleDataTable class More...

#include <ParticleDataTable.h>

List of all members.

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.
ParticleDataTableoperator= (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
ParticleDataoperator[] (int id) const
 return pointer to requested ParticleData
ParticleDatafind (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


Detailed Description

an example ParticleDataTable class

Example container for ParticleData instances. Basically just an interface to STL map.

Examples:

example_BuildEventFromScratch.cc.

Definition at line 35 of file ParticleDataTable.h.


Member Typedef Documentation

typedef std::map<int,HepMC::ParticleData*>::const_iterator HepMC::ParticleDataTable::const_iterator

const iterator for ParticleData map

Definition at line 77 of file ParticleDataTable.h.

typedef std::map<int,HepMC::ParticleData*>::iterator HepMC::ParticleDataTable::iterator

iterator for ParticleData map

Definition at line 75 of file ParticleDataTable.h.


Constructor & Destructor Documentation

HepMC::ParticleDataTable::ParticleDataTable ( std::string  description = std::string()  )  [inline]

constructor with optional description

Definition at line 107 of file ParticleDataTable.h.

HepMC::ParticleDataTable::ParticleDataTable ( const char  description  )  [inline]

constructor with description

Definition at line 114 of file ParticleDataTable.h.

HepMC::ParticleDataTable::ParticleDataTable ( const ParticleDataTable  )  [inline]

copy constructor

Definition at line 122 of file ParticleDataTable.h.

HepMC::ParticleDataTable::~ParticleDataTable (  )  [inline, virtual]

Shallow: does not delete ParticleData entries.

Definition at line 126 of file ParticleDataTable.h.


Member Function Documentation

ParticleDataTable::const_iterator HepMC::ParticleDataTable::begin (  )  const [inline]

begin const iteration

Definition at line 222 of file ParticleDataTable.h.

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

Examples:
example_BuildEventFromScratch.cc.

Definition at line 242 of file ParticleDataTable.h.

References clear().

Referenced by main().

std::string HepMC::ParticleDataTable::description (  )  const [inline]

table description

Definition at line 230 of file ParticleDataTable.h.

bool HepMC::ParticleDataTable::empty (  )  const [inline]

true if the table is empty

Definition at line 189 of file ParticleDataTable.h.

ParticleDataTable::const_iterator HepMC::ParticleDataTable::end (  )  const [inline]

end const iteration

Definition at line 226 of file ParticleDataTable.h.

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

Examples:
example_BuildEventFromScratch.cc.

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

Examples:
example_BuildEventFromScratch.cc.

Definition at line 153 of file ParticleDataTable.h.

References size().

Referenced by main().

void HepMC::ParticleDataTable::set_description ( const   char  )  [inline]

set table description

Definition at line 238 of file ParticleDataTable.h.

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]

size of table

Definition at line 185 of file ParticleDataTable.h.

Referenced by print().


The documentation for this class was generated from the following file:
Generated on Thu Jan 7 13:10:21 2010 for HepMC by  doxygen 1.4.7