//====================================================================== // File and Version Information: // $Id:$ // // Class TwoCoordIndex // // Software developed for the BaBar Detector at the SLAC B-Factory. // Adapted for the PANDA experiment at GSI // // Class to hold coordinate and index information // for system in which two co-ordinates specifies a channel uniquely. // (Based on class from BABAR framework) // // Author List: // // Phil Strother Imperial College // Stephen J. Gowdy University of Edinburgh // Dima Melnichuk - adaption for PANDA // //====================================================================== #include "TwoCoordIndex.h" #include "NeighbourStore.h" #include #include "math.h" using namespace std; //---------------- // Constructors -- //---------------- TwoCoordIndex::TwoCoordIndex() { itsCoords[0]=-1; itsCoords[1]=-1; index=-1; } TwoCoordIndex::TwoCoordIndex( long x, long y, long ind ) { itsCoords[0]=x; itsCoords[1]=y; index=ind; } //-------------- // Destructor -- //-------------- TwoCoordIndex::~TwoCoordIndex() { } //------------- // Methods -- //------------- const NeighbourStore TwoCoordIndex::itsNeighbours() const { return theNeighbours; } void TwoCoordIndex::addToNeighbourList( TwoCoordIndex *addition ) { theNeighbours.insert( addition ); } bool TwoCoordIndex::isNeighbour( TwoCoordIndex* _tci ) { if( abs(itsCoords[0] - _tci->itsXCoord()) > 1 ) return false; if((itsCoords[1]<200) &&(abs(itsCoords[1] - _tci->itsYCoord()) > 1)&&(abs(itsCoords[1] - _tci->itsYCoord()) !=159 )) return false; return true; } ClassImp(TwoCoordIndex)