//====================================================================== // File and Version Information: // $Id:$ // // Class PndEmcTwoCoordIndex // // 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 "PndEmcTwoCoordIndex.h" #include "PndEmcNeighbourStore.h" #include #include "math.h" using namespace std; //---------------- // Constructors -- //---------------- PndEmcTwoCoordIndex::PndEmcTwoCoordIndex() { itsCoords[0]=-1; itsCoords[1]=-1; index=-1; } PndEmcTwoCoordIndex::PndEmcTwoCoordIndex( long x, long y, long ind ) { itsCoords[0]=x; itsCoords[1]=y; index=ind; } //-------------- // Destructor -- //-------------- PndEmcTwoCoordIndex::~PndEmcTwoCoordIndex() { } //------------- // Methods -- //------------- const PndEmcNeighbourStore PndEmcTwoCoordIndex::itsNeighbours() const { return theNeighbours; } void PndEmcTwoCoordIndex::addToNeighbourList( PndEmcTwoCoordIndex *addition ) { theNeighbours.insert( addition ); } bool PndEmcTwoCoordIndex::isNeighbour( PndEmcTwoCoordIndex* _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(PndEmcTwoCoordIndex)