| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

HepMC::WeightContainer Class Reference

Basically just an interface to STL vector. More...

#include <WeightContainer.h>

List of all members.


Public Types

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 (unsigned int n=0, const double &value=0.)
 default constructor
 WeightContainer (const std::vector< double > &weights)
 construct from a vector of weights
 WeightContainer (const WeightContainer &in)
 copy
virtual ~WeightContainer ()
void swap (WeightContainer &other)
 swap
WeightContaineroperator= (const WeightContainer &)
 copy
WeightContaineroperator= (const std::vector< double > &in)
 copy
void print (std::ostream &ostr=std::cout) const
 print weights
int 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
double & operator[] (unsigned int n)
 access the weight container
const double & operator[] (unsigned int n) const
 access the weight container
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

Private Attributes

std::vector< double > m_weights

Detailed Description

Basically just an interface to STL vector.

Definition at line 24 of file WeightContainer.h.


Member Typedef Documentation

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

iterator for the weight container

Definition at line 71 of file WeightContainer.h.

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

const iterator for the weight container

Definition at line 73 of file WeightContainer.h.


Constructor & Destructor Documentation

HepMC::WeightContainer::WeightContainer ( unsigned int  n = 0,
const double &  value = 0. 
) [inline]

default constructor

Definition at line 91 of file WeightContainer.h.

00093         : m_weights(n,value)
00094     {}

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

construct from a vector of weights

Definition at line 96 of file WeightContainer.h.

00097         : m_weights(wgts)
00098     {}

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

copy

Definition at line 100 of file WeightContainer.h.

00101         : m_weights(in.m_weights)
00102     {}

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

Definition at line 104 of file WeightContainer.h.

00104 {}


Member Function Documentation

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

swap

Definition at line 106 of file WeightContainer.h.

00107     { m_weights.swap( other.m_weights ); }

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

copy

best practices implementation

Definition at line 110 of file WeightContainer.h.

00110                                   {
00112         WeightContainer tmp( in );
00113         swap( tmp );
00114         return *this;
00115     }

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

copy

best practices implementation

Definition at line 118 of file WeightContainer.h.

00118                                     {
00120         WeightContainer tmp( in );
00121         swap( tmp );
00122         return *this;
00123     }

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

print weights

Definition at line 125 of file WeightContainer.h.

00126     { 
00127         for ( const_iterator w = begin(); w != end(); ++w ) 
00128         { 
00129             ostr << *w << " ";
00130         }
00131         ostr << std::endl; 
00132     }

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

size of weight container

Definition at line 134 of file WeightContainer.h.

00134 { return m_weights.size(); }

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

return true if weight container is empty

Definition at line 136 of file WeightContainer.h.

00136 { return m_weights.empty(); }

void HepMC::WeightContainer::push_back ( const double &   )  [inline]

push onto weight container

Definition at line 138 of file WeightContainer.h.

00139     { m_weights.push_back(value); }

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

pop from weight container

Definition at line 141 of file WeightContainer.h.

00141 { m_weights.pop_back(); }

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

clear the weight container

Definition at line 143 of file WeightContainer.h.

00143 { m_weights.clear(); }

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

access the weight container

Definition at line 145 of file WeightContainer.h.

00146     { return m_weights[(int)n]; }

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

access the weight container

Definition at line 148 of file WeightContainer.h.

00149     { return m_weights[(int)n]; }

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

returns the first element

Definition at line 151 of file WeightContainer.h.

00151 { return m_weights.front(); }

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

returns the first element

Definition at line 153 of file WeightContainer.h.

00154     { return m_weights.front(); }

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

returns the last element

Definition at line 156 of file WeightContainer.h.

00156 { return m_weights.back(); }

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

returns the last element

Definition at line 158 of file WeightContainer.h.

00159     { return m_weights.back(); }

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

begining of the weight container

Definition at line 161 of file WeightContainer.h.

00162     { return m_weights.begin(); }

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

end of the weight container

Definition at line 164 of file WeightContainer.h.

00165     { return m_weights.end(); }

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

begining of the weight container

Definition at line 167 of file WeightContainer.h.

00168     { return m_weights.begin(); }

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

end of the weight container

Definition at line 170 of file WeightContainer.h.

00171     { return m_weights.end(); }


Member Data Documentation

std::vector<double> HepMC::WeightContainer::m_weights [private]

Definition at line 84 of file WeightContainer.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:56:45 2011 for HepMC by doxygen 1.4.7