StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Friends | List of all members
HepMC::WeightContainer Class Reference

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

#include <WeightContainer.h>

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
 
void swap (WeightContainer &other)
 swap
 
WeightContaineroperator= (const WeightContainer &)
 copy assignment More...
 
WeightContaineroperator= (const std::vector< double > &in)
 alternate assignment using a vector of doubles More...
 
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 Function Documentation

WeightContainer & HepMC::WeightContainer::operator= ( const WeightContainer in)
inline

copy assignment

best practices implementation

Definition at line 154 of file WeightContainer.h.

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.


The documentation for this class was generated from the following files: