Ignore:
Timestamp:
01/14/09 12:31:37 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgeom
Files:
4 edited

Legend:

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

    r8921 r9219  
    517517    // search for the neighbor in the given direction
    518518    //
    519     int i;
    520     for (i=0; i<pix.GetNumNeighbors(); i++)
     519    for (int i=0; i<pix.GetNumNeighbors(); i++)
    521520        if (GetDirection(idx, pix.GetNeighbor(i))==dir)
    522521            return pix.GetNeighbor(i);
  • trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.h

    r9148 r9219  
    1 #ifndef MARS_MGeomCamDwqarf
     1#ifndef MARS_MGeomCamDwarf
    22#define MARS_MGeomCamDwarf
    33
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.cc

    r8923 r9219  
    5555
    5656#include <TMath.h>
     57#include <TVector2.h>
    5758
    5859#include "MLog.h"
     
    7778    Set(x, y, r, s, a);
    7879    SetNeighbors();
     80}
     81
     82// --------------------------------------------------------------------------
     83//
     84// Return position as TVector2(fX, fY)
     85//
     86TVector2 MGeomPix::GetP() const
     87{
     88    return TVector2(fX, fY);
    7989}
    8090
     
    186196    // more, rotated with respect to that one by +- 60 degrees.
    187197    //
    188     if (TMath::Abs(dx)*2>fD)
     198    if (TMath::Abs(dx)>fD/2)
    189199        return kFALSE;
    190200
     
    194204    const static Double_t sin60 = TMath::Sin(60/kRad2Deg);
    195205
    196     const Double_t dx2 = dx*cos60 + dy*sin60;
    197     if  (TMath::Abs(dx2)*2>fD)
     206    const Double_t dxc = dx*cos60;
     207    const Double_t dys = dy*sin60;
     208
     209    if  (TMath::Abs(dxc + dys)>fD/2)
    198210        return kFALSE;
    199211
    200     const Double_t dx3 = dx*cos60 - dy*sin60;
    201     if (TMath::Abs(dx3)*2>fD)
     212    if (TMath::Abs(dxc - dys)>fD/2)
    202213        return kFALSE;
    203214
     
    218229    const Double_t y2 = pix.GetY();
    219230
    220     if (x1>=x2 && y1>y2) return kRightTop;
    221     if (x1>=x2 && y1<y2) return kRightBottom;
    222     if (x1<=x2 && y1>y2) return kLeftTop;
    223     if (x1<=x2 && y1<y2) return kLeftBottom;
    224     if (x1>x2)           return kRight;
    225     if (x1<x2)           return kLeft;
     231    if (x1<=x2 && y1<y2) return kRightTop;
     232    if (x1<=x2 && y1>y2) return kRightBottom;
     233    if (x1>=x2 && y1<y2) return kLeftTop;
     234    if (x1>=x2 && y1>y2) return kLeftBottom;
     235    if (x1<x2)           return kRight;
     236    if (x1>x2)           return kLeft;
     237
     238    cout << -1 << endl;
    226239
    227240    return -1;
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.h

    r8923 r9219  
    77
    88class MGeomCam;
     9class TVector2;
    910
    1011class MGeomPix : public MParContainer
     
    7778    UInt_t  GetSector() const { return fSector; }
    7879
     80    TVector2 GetP() const;
     81
    7982    Float_t GetDist() const;
    8083    Float_t GetDist(const MGeomPix &pix) const;
Note: See TracChangeset for help on using the changeset viewer.