|
HepMC Reference DocumentationHepMC |
#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 | |
| ~WeightContainer () | |
| void | swap (WeightContainer &other) |
| swap | |
| WeightContainer & | operator= (const WeightContainer &) |
| copy assignment | |
| WeightContainer & | operator= (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 |
This class has both map-like and vector-like functionality. Named weights are now supported.
Definition at line 29 of file WeightContainer.h.
| typedef std::vector<double>::const_iterator HepMC::WeightContainer::const_iterator |
| typedef std::vector<double>::iterator HepMC::WeightContainer::iterator |
| typedef std::size_t HepMC::WeightContainer::size_type |
| HepMC::WeightContainer::WeightContainer | ( | size_type | n = 0, |
|
| double | value = 0. | |||
| ) | [explicit] |
| 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] |
| HepMC::WeightContainer::~WeightContainer | ( | ) | [inline] |
Definition at line 145 of file WeightContainer.h.
| const double & HepMC::WeightContainer::back | ( | ) | const [inline] |
| double & HepMC::WeightContainer::back | ( | ) | [inline] |
| WeightContainer::const_iterator HepMC::WeightContainer::begin | ( | ) | const [inline] |
| 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] |
| 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] |
| 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] |
| double & HepMC::WeightContainer::front | ( | ) | [inline] |
| 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 |
| 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] |
| bool HepMC::WeightContainer::operator== | ( | const WeightContainer & | ) | const |
| const double & HepMC::WeightContainer::operator[] | ( | const std::string & | s | ) | const |
| double & HepMC::WeightContainer::operator[] | ( | const std::string & | s | ) |
| const double & HepMC::WeightContainer::operator[] | ( | size_type | n | ) | const [inline] |
| double & HepMC::WeightContainer::operator[] | ( | size_type | n | ) | [inline] |
| 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 & | ) |
| 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().
friend class GenEvent [friend] |
Definition at line 30 of file WeightContainer.h.
1.4.7