HepMC Reference Documentation

HepMC

HepMC::WeightContainer Class Reference

Container for the Weights associated with an event or vertex. More...

#include <WeightContainer.h>

List of all members.

Public Types

typedef std::size_t size_type
 defining the size type used by vector and map
typedef std::vector< double
>::iterator 
iterator
 iterator for the weight container
typedef std::vector< double
>::const_iterator 
const_iterator
 const iterator for the weight container

Public Member Functions

 WeightContainer (size_type n=0, double value=0.)
 default constructor
 WeightContainer (const std::vector< double > &weights)
 construct from a vector of weights
 WeightContainer (const WeightContainer &in)
 copy
 ~WeightContainer ()
void swap (WeightContainer &other)
 swap
WeightContaineroperator= (const WeightContainer &)
 copy assignment
WeightContaineroperator= (const std::vector< double > &in)
 alternate assignment using a vector of doubles
void print (std::ostream &ostr=std::cout) const
 print weights
void write (std::ostream &ostr=std::cout) const
 write weights in a readable table
size_type size () const
 size of weight container
bool empty () const
 return true if weight container is empty
void push_back (const double &)
 push onto weight container
void pop_back ()
 pop from weight container
void clear ()
 clear the weight container
bool has_key (const std::string &s) const
 check to see if a name exists in the map
double & operator[] (size_type n)
 access the weight container
const double & operator[] (size_type n) const
 access the weight container
double & operator[] (const std::string &s)
 access the weight container
const double & operator[] (const std::string &s) const
 access the weight container
bool operator== (const WeightContainer &) const
 equality
bool operator!= (const WeightContainer &) const
 inequality
double & front ()
 returns the first element
const double & front () const
 returns the first element
double & back ()
 returns the last element
const double & back () const
 returns the last element
iterator begin ()
 begining of the weight container
iterator end ()
 end of the weight container
const_iterator begin () const
 begining of the weight container
const_iterator end () const
 end of the weight container

Friends

class GenEvent


Detailed Description

Container for the Weights associated with an event or vertex.

This class has both map-like and vector-like functionality. Named weights are now supported.

Definition at line 29 of file WeightContainer.h.


Member Typedef Documentation

typedef std::vector<double>::const_iterator HepMC::WeightContainer::const_iterator

const iterator for the weight container

Definition at line 38 of file WeightContainer.h.

typedef std::vector<double>::iterator HepMC::WeightContainer::iterator

iterator for the weight container

Definition at line 36 of file WeightContainer.h.

typedef std::size_t HepMC::WeightContainer::size_type

defining the size type used by vector and map

Definition at line 34 of file WeightContainer.h.


Constructor & Destructor Documentation

HepMC::WeightContainer::WeightContainer ( size_type  n = 0,
double  value = 0. 
) [explicit]

default constructor

Definition at line 22 of file WeightContainer.cc.

HepMC::WeightContainer::WeightContainer ( const std::vector< double > &  weights  ) 

construct from a vector of weights

Definition at line 26 of file WeightContainer.cc.

References size().

HepMC::WeightContainer::WeightContainer ( const WeightContainer in  )  [inline]

copy

Definition at line 141 of file WeightContainer.h.

HepMC::WeightContainer::~WeightContainer (  )  [inline]

Definition at line 145 of file WeightContainer.h.


Member Function Documentation

const double & HepMC::WeightContainer::back (  )  const [inline]

returns the last element

Definition at line 192 of file WeightContainer.h.

double & HepMC::WeightContainer::back (  )  [inline]

returns the last element

Definition at line 190 of file WeightContainer.h.

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

begining of the weight container

Definition at line 201 of file WeightContainer.h.

WeightContainer::iterator HepMC::WeightContainer::begin (  )  [inline]

begining of the weight container

Definition at line 195 of file WeightContainer.h.

Referenced by write(), and HepMC::IO_AsciiParticles::write_event().

void HepMC::WeightContainer::clear (  )  [inline]

clear the weight container

Definition at line 173 of file WeightContainer.h.

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

return true if weight container is empty

Definition at line 171 of file WeightContainer.h.

Referenced by main().

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

end of the weight container

Definition at line 204 of file WeightContainer.h.

WeightContainer::iterator HepMC::WeightContainer::end (  )  [inline]

end of the weight container

Definition at line 198 of file WeightContainer.h.

Referenced by HepMC::GenVertex::print(), write(), and HepMC::IO_AsciiParticles::write_event().

const double & HepMC::WeightContainer::front (  )  const [inline]

returns the first element

Definition at line 187 of file WeightContainer.h.

double & HepMC::WeightContainer::front (  )  [inline]

returns the first element

Definition at line 185 of file WeightContainer.h.

bool HepMC::WeightContainer::has_key ( const std::string &  s  )  const

check to see if a name exists in the map

Definition at line 105 of file WeightContainer.cc.

Referenced by main().

bool HepMC::WeightContainer::operator!= ( const WeightContainer  )  const

inequality

Definition at line 100 of file WeightContainer.cc.

WeightContainer & HepMC::WeightContainer::operator= ( const std::vector< double > &  in  )  [inline]

alternate assignment using a vector of doubles

best practices implementation

Definition at line 162 of file WeightContainer.h.

WeightContainer & HepMC::WeightContainer::operator= ( const WeightContainer  )  [inline]

copy assignment

best practices implementation

Definition at line 154 of file WeightContainer.h.

bool HepMC::WeightContainer::operator== ( const WeightContainer  )  const

equality

Definition at line 92 of file WeightContainer.cc.

References m_names, m_weights, and size().

const double & HepMC::WeightContainer::operator[] ( const std::string &  s  )  const

access the weight container

Definition at line 80 of file WeightContainer.cc.

double & HepMC::WeightContainer::operator[] ( const std::string &  s  ) 

access the weight container

Definition at line 66 of file WeightContainer.cc.

const double & HepMC::WeightContainer::operator[] ( size_type  n  )  const [inline]

access the weight container

Definition at line 182 of file WeightContainer.h.

double & HepMC::WeightContainer::operator[] ( size_type  n  )  [inline]

access the weight container

Definition at line 179 of file WeightContainer.h.

void HepMC::WeightContainer::pop_back (  ) 

pop from weight container

Definition at line 51 of file WeightContainer.cc.

References size().

Referenced by main().

void HepMC::WeightContainer::print ( std::ostream &  ostr = std::cout  )  const

print weights

Definition at line 111 of file WeightContainer.cc.

Referenced by HepMC::GenEvent::print().

void HepMC::WeightContainer::push_back ( const double &   ) 

push onto weight container

Definition at line 42 of file WeightContainer.cc.

Referenced by main().

WeightContainer::size_type HepMC::WeightContainer::size (  )  const [inline]

size of weight container

Definition at line 169 of file WeightContainer.h.

Referenced by main(), operator==(), pop_back(), HepMC::GenVertex::print(), HepMC::GenEvent::print(), WeightContainer(), HepMC::GenEvent::write(), and HepMC::IO_AsciiParticles::write_event().

void HepMC::WeightContainer::swap ( WeightContainer other  )  [inline]

swap

Definition at line 147 of file WeightContainer.h.

References m_names, and m_weights.

Referenced by HepMC::GenVertex::swap(), and HepMC::GenEvent::swap().

void HepMC::WeightContainer::write ( std::ostream &  ostr = std::cout  )  const

write weights in a readable table

Definition at line 121 of file WeightContainer.cc.

References begin(), and end().

Referenced by main().


Friends And Related Function Documentation

friend class GenEvent [friend]

Definition at line 30 of file WeightContainer.h.


The documentation for this class was generated from the following files:
Generated on Fri Feb 17 00:31:28 2012 for HepMC by  doxygen 1.4.7