Back to index

CSidcHit.C

 
//----------------------------------------------------------------------------- 
//  $Header: CSidcHit.C,v 3.1 97/04/22 11:09:35 messer Exp $ 
// 
//  COOL Program Library   
//  Copyright (C) CERES collaboration, 1996 
// 
//  Implementation of CSidcHit class. 
// 
//----------------------------------------------------------------------------- 
#include <iostream.h> 
#include "CSidcHit.h"  
 
CSidcHit::CSidcHit(const CLabCylinderCoord newCenter, const double newAmp) 
{ 
   center  = newCenter; 
   amp     = newAmp; 
   sumAmp  = 0; 
   cluster = 0; 
   ::transform(centerInXYZ, center);     // ensure coordinate consistency 
} 
 
CSidcHit::CSidcHit(const CLabXYZCoord newXY, const double newAmp) 
{ 
   centerInXYZ = newXY; 
   amp         = newAmp; 
   sumAmp  = 0; 
   cluster     = 0; 
   ::transform(center, centerInXYZ);		       // ensure coordinate consitency 
} 
 
CSidcHit & CSidcHit::operator = (const CSidcHit &)  
{ 
   return *this; 
} 
 
CBoolean CSidcHit::operator== (const CSidcHit& otherHit) const 
{ 
   return (center == otherHit.center && amp == otherHit.amp); 
} 
 
CBoolean CSidcHit::operator< (const CSidcHit& otherHit) const 
{ 
   return (center.getPhi() < otherHit.center.getPhi());     // for more efficient use, sort increasing. 
} 
 
double CSidcHit::operator- (const CSidcHit& otherHit) const 
{ 
   return (center.getPhi() - otherHit.center.getPhi());     // according to the < operator defined above 
} 
 
void CSidcHit::setCenter(const CLabCylinderCoord& newCenter) 
{ 
   center = newCenter; 
   ::transform(centerInXYZ, center);     // ensure coordinate consitency 
} 
 
void CSidcHit::setCenterInXYZ(const CLabXYZCoord& newXY) 
{ 
   centerInXYZ = newXY; 
   ::transform(center, centerInXYZ);     // ensure coordinate consitency 
}    

Back to index