hepmc

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/ @ 139  →  / @ 140
/branches/HEPMC_02_01_branch/src/Flow.cc
@@ -15,16 +15,22 @@
{}
 
Flow::Flow( const Flow& inflow ) :
m_particle_owner(inflow.m_particle_owner)
m_particle_owner(inflow.m_particle_owner),
m_icode(inflow.m_icode)
{
/// copies both the m_icode AND the m_particle_owner
*this = inflow;
}
 
Flow::~Flow() {
m_icode.clear();
}
 
void Flow::swap( Flow & other)
{
std::swap( m_particle_owner, other.m_particle_owner );
m_icode.swap( other.m_icode );
}
 
void Flow::print( std::ostream& ostr ) const {
ostr << "Flow(" << m_particle_owner << "): " << *this << std::endl;
}
/branches/HEPMC_02_01_branch/HepMC/Flow.h
@@ -75,6 +75,8 @@
/// copy
Flow( const Flow& );
virtual ~Flow();
/// swap
void swap( Flow & other);
/// make a copy
Flow& operator=( const Flow& );
/// equality
@@ -198,9 +200,9 @@
return !( *this == a );
}
inline Flow& Flow::operator=( const Flow& inflow ) {
// copies only the m_icode ... not the particle_owner
// this is intuitive behaviour so you can do
// oneparticle->flow() = otherparticle->flow()
/// copies only the m_icode ... not the particle_owner
/// this is intuitive behaviour so you can do
/// oneparticle->flow() = otherparticle->flow()
//
m_icode = inflow.m_icode;
return *this;
/branches/HEPMC_02_01_branch/HepMC/SimpleVector.icc
@@ -9,6 +9,7 @@
//////////////////////////////////////////////////////////////////////////
 
#include <cmath>
#include <algorithm> // for swap
 
namespace HepMC {
 
@@ -16,6 +17,13 @@
// FourVector inline methods
//////////////////////////////////////////////////////////////////////////
 
inline void FourVector::swap( FourVector & other ) {
std::swap( m_x, other.m_x );
std::swap( m_y, other.m_y );
std::swap( m_z, other.m_z );
std::swap( m_t, other.m_t );
}
 
inline FourVector & FourVector::operator=(const FourVector & v) {
m_x = v.x();
m_y = v.y();
@@ -83,6 +91,12 @@
// ThreeVector inline methods
//////////////////////////////////////////////////////////////////////////
 
inline void ThreeVector::swap( ThreeVector & other ) {
std::swap( m_x, other.m_x );
std::swap( m_y, other.m_y );
std::swap( m_z, other.m_z );
}
 
inline double ThreeVector::theta() const {
return m_x == 0.0 && m_y == 0.0 && m_z == 0.0 ? 0.0 : std::atan2(perp(),m_z);
}
/branches/HEPMC_02_01_branch/HepMC/SimpleVector.h
@@ -65,6 +65,8 @@
inline FourVector(const FourVector & v)
: m_x(v.x()), m_y(v.y()), m_z(v.z()), m_t(v.t()) {}
 
void swap( FourVector & other ); //!< swap
 
inline double px() const { return m_x; } //!< return px
inline double py() const { return m_y; } //!< return py
inline double pz() const { return m_z; } //!< return pz
@@ -149,6 +151,8 @@
inline ThreeVector(const ThreeVector & v)
: m_x(v.x()), m_y(v.y()), m_z(v.z()) {}
 
void swap( ThreeVector & other ); //!< swap
 
inline double x() const { return m_x; } //!< return x
inline double y() const { return m_y; } //!< return y
inline double z() const { return m_z; } //!< return z