/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Types | Public Member Functions | Private Attributes
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::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

Container for the Weights associated with an event or vertex.

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.

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.

        : m_weights(n,value)
    {}
HepMC::WeightContainer::WeightContainer ( const std::vector< double > &  weights) [inline]

construct from a vector of weights

Definition at line 96 of file WeightContainer.h.

        : m_weights(wgts)
    {}
HepMC::WeightContainer::WeightContainer ( const WeightContainer in) [inline]

copy

Definition at line 100 of file WeightContainer.h.

        : m_weights(in.m_weights)
    {}
HepMC::WeightContainer::~WeightContainer ( ) [inline, virtual]

Definition at line 104 of file WeightContainer.h.

{}

Member Function Documentation

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

swap

Definition at line 106 of file WeightContainer.h.

    { m_weights.swap( other.m_weights ); }
WeightContainer & HepMC::WeightContainer::operator= ( const WeightContainer in) [inline]

copy

best practices implementation

Definition at line 110 of file WeightContainer.h.

                                  {
        WeightContainer tmp( in );
        swap( tmp );
        return *this;
    }
WeightContainer & HepMC::WeightContainer::operator= ( const std::vector< double > &  in) [inline]

copy

best practices implementation

Definition at line 118 of file WeightContainer.h.

                                    {
        WeightContainer tmp( in );
        swap( tmp );
        return *this;
    }
void HepMC::WeightContainer::print ( std::ostream &  ostr = std::cout) const [inline]

print weights

Definition at line 125 of file WeightContainer.h.

    { 
        for ( const_iterator w = begin(); w != end(); ++w ) 
        { 
            ostr << *w << " ";
        }
        ostr << std::endl; 
    }
int HepMC::WeightContainer::size ( ) const [inline]

size of weight container

Definition at line 134 of file WeightContainer.h.

{ 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.

{ return m_weights.empty(); }
void HepMC::WeightContainer::push_back ( const double &  value) [inline]

push onto weight container

Definition at line 138 of file WeightContainer.h.

    { m_weights.push_back(value); }
void HepMC::WeightContainer::pop_back ( ) [inline]

pop from weight container

Definition at line 141 of file WeightContainer.h.

{ m_weights.pop_back(); }
void HepMC::WeightContainer::clear ( ) [inline]

clear the weight container

Definition at line 143 of file WeightContainer.h.

{ m_weights.clear(); }
double & HepMC::WeightContainer::operator[] ( unsigned int  n) [inline]

access the weight container

Definition at line 145 of file WeightContainer.h.

    { 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.

    { return m_weights[(int)n]; }
double & HepMC::WeightContainer::front ( ) [inline]

returns the first element

Definition at line 151 of file WeightContainer.h.

{ return m_weights.front(); }
const double & HepMC::WeightContainer::front ( ) const [inline]

returns the first element

Definition at line 153 of file WeightContainer.h.

    { return m_weights.front(); }
double & HepMC::WeightContainer::back ( ) [inline]

returns the last element

Definition at line 156 of file WeightContainer.h.

{ return m_weights.back(); }
const double & HepMC::WeightContainer::back ( ) const [inline]

returns the last element

Definition at line 158 of file WeightContainer.h.

    { return m_weights.back(); }
WeightContainer::iterator HepMC::WeightContainer::begin ( ) [inline]

begining of the weight container

Definition at line 161 of file WeightContainer.h.

    { return m_weights.begin(); }
WeightContainer::iterator HepMC::WeightContainer::end ( ) [inline]

end of the weight container

Definition at line 164 of file WeightContainer.h.

    { 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.

    { 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.

    { 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 Fri May 16 2014 09:49:37 for HepMC by doxygen 1.7.4