Ignore:
Timestamp:
10/13/07 19:56:29 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.cc

    r8399 r8756  
    473473    GetNeighbors(arr, pix, r);
    474474}
     475
     476// --------------------------------------------------------------------------
     477//
     478// Return direction of p2 w.r.t. p1. For more details
     479// see MGeomPix::GetDirection
     480//
     481Int_t MGeomCam::GetDirection(UInt_t p1, UInt_t p2) const
     482{
     483    if (p1>fNumPixels || p2>fNumPixels)
     484        return -1;
     485
     486    return operator[](p1).GetDirection(operator[](p2));
     487}
     488
     489// --------------------------------------------------------------------------
     490//
     491// Get index of neighbor of pixel idx in direction dir, if existing.
     492//
     493Int_t MGeomCam::GetNeighbor(UInt_t idx, Int_t dir) const
     494{
     495    if (idx>fNumPixels)
     496        return -1;
     497
     498    const MGeomPix &pix=operator[](idx);
     499
     500    //
     501    // search for the neighbor in the given direction
     502    //
     503    int i;
     504    for (i=0; i<pix.GetNumNeighbors(); i++)
     505        if (GetDirection(idx, pix.GetNeighbor(i))==dir)
     506            return pix.GetNeighbor(i);
     507
     508    return -1;
     509}
Note: See TracChangeset for help on using the changeset viewer.