hepmc
Subversion Repositories:
| /branches/HEPMC_02_07_proposal/src/WeightContainer.cc |
|---|
| @@ -16,6 +16,7 @@ |
| #include <stdexcept> |
| #include "HepMC/WeightContainer.h" |
| #include "HepMC/StreamHelpers.h" |
| namespace HepMC { |
| @@ -135,5 +136,30 @@ |
| } |
| } |
| std::ostream& WeightContainer::write_io( std::ostream& ostr ) |
| { |
| ostr << ' ' << (int)size() ; |
| for ( const_map_iterator w = map_begin(); |
| w != map_end(); ++w ) { |
| detail::output( ostr, m_weights[w->second] ); |
| } |
| detail::output( ostr,'\n'); |
| // now add names for weights |
| // note that this prints a new line if and only if the weight container |
| // is not empty |
| if ( ! empty() ) { |
| ostr << "N " << (int)size() << " " ; |
| for ( const_map_iterator w = map_begin(); |
| w != map_end(); ++w ) { |
| detail::output( ostr,'"'); |
| ostr << w->first; |
| detail::output( ostr,'"'); |
| detail::output( ostr,' '); |
| } |
| detail::output( ostr,'\n'); |
| } |
| return ostr; |
| } |
| } // HepMC |
