Back to index

C4Momentum.C

 
//----------------------------------------------------------------------------- 
//  $Header: /tmp_mnt/asis/offline/ceres/cool/project/RCS/C4Momentum.C,v 2.1 1996/10/04 08:43:38 voigt Exp $ 
// 
//  COOL Program Library   
//  Copyright (C) CERES collaboration, 1996 
// 
//  Definitions for class C4Momentum. 
// 
//----------------------------------------------------------------------------- 
#include "C4Momentum.h"  
 
C4Momentum::C4Momentum() { E = 0; } 
 
C4Momentum::C4Momentum(C3Momentum newP) : C3Momentum(newP) 
{ 
   E = abs(newP); 
} 
 
C4Momentum::C4Momentum(const C4Momentum& newQ) 
{ 
   C3Momentum::operator =(newQ); 
   E = newQ.E; 
} 
 
C4Momentum::C4Momentum(double newMass, C3Momentum newP) : C3Momentum(newP) 
{ 
   setM(newMass); 
} 
       
C4Momentum::~C4Momentum() { } 
 
ostream & operator << (ostream & s, const C4Momentum & q) 
{ 
  return s << "(" << q.getE() << "; " << q.getX() << ", " << q.getY() << ", " << q.getZ() << ")"; 
} 
 
C4Momentum& C4Momentum::operator = (const C4Momentum& a) 
{ 
   C3Momentum::operator =(a); 
   E = a.E; 
   return *this; 
} 

Back to index