Ignore:
Timestamp:
07/31/02 11:10:37 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgeom
Files:
7 edited

Legend:

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

    r1438 r1458  
    7878// --------------------------------------------------------------------------
    7979//
     80//  Set the kIsOuterRing flag for all pixels which have a outermost pixel
     81//  as Next Neighbor and don't have the kIsOutermostRing flag itself.
     82//
     83void MGeomCam::InitOuterRing()
     84{
     85    for (UInt_t i=0; i<fNumPixels; i++)
     86        (*this)[i].CheckOuterRing(*this);
     87}
     88
     89// --------------------------------------------------------------------------
     90//
    8091// Calculate the maximum radius of the camera. This is ment for GUI layout.
    8192//
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.h

    r1436 r1458  
    2424protected:
    2525    void CalcMaxRadius();
     26    void InitOuterRing();
    2627
    2728public:
    28 
    2929    MGeomCam(UInt_t npix, Float_t dist, const char *name=NULL, const char *title=NULL);
    3030
  • trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc

    r1436 r1458  
    200200      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    201201                              nn[i][3], nn[i][4], nn[i][5]);
     202
     203  InitOuterRing();
    202204}
    203205
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc

    r1436 r1458  
    896896      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    897897                              nn[i][3], nn[i][4], nn[i][5]);
     898
     899  InitOuterRing();
    898900}
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.h

    r1436 r1458  
    1313
    1414public:
    15 
    1615    MGeomCamMagic(const char *name=NULL);
    1716
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.cc

    r1436 r1458  
    3939#include "MLog.h"
    4040#include "MLogManip.h"
     41
     42#include "MGeomCam.h"
    4143
    4244ClassImp(MGeomPix);
     
    8385
    8486    fNumNeighbors = i;
     87
     88    if (fNumNeighbors<5)
     89        SetBit(kIsInOutermostRing);
     90}
     91
     92// --------------------------------------------------------------------------
     93//
     94//  Set the kIsOuterRing flag if this pixel has a outermost pixel
     95//  as Next Neighbor and don't have the kIsOutermostRing flag itself.
     96//
     97void MGeomPix::CheckOuterRing(const MGeomCam &cam)
     98{
     99    if (IsInOutermostRing())
     100        return;
     101
     102    for (int i=0; i<fNumNeighbors; i++)
     103        if (cam[fNeighbors[i]].IsInOutermostRing())
     104        {
     105            SetBit(kIsInOuterRing);
     106            return;
     107        }
    85108}
    86109
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.h

    r1436 r1458  
    66#endif
    77
     8class MGeomCam;
     9
    810class MGeomPix : public MParContainer
    911{
    1012private:
     13    enum {
     14        kIsInOutermostRing = BIT(14),
     15        kIsInOuterRing     = BIT(15)
     16    };
     17
    1118    Float_t fX;  // [mm] the x coordinate of the center
    1219    Float_t fY;  // [mm] the y coordinate of the center
     
    1421
    1522    Byte_t  fNumNeighbors; // number of valid neighbors
    16     Short_t fNeighbors[6]; // the IDs of the pixel next to it
    17                            // we are assuming an hexagonal geometry
     23    Short_t fNeighbors[6]; // the IDs of the pixel next to it (we are assuming an hexagonal geometry)
    1824
    1925public:
     
    2632    void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
    2733                      Short_t i3=-1, Short_t i4=-1, Short_t i5=-1);
     34
     35    void CheckOuterRing(const MGeomCam &cam);
    2836
    2937    void SetX(Float_t x) { fX = x; }
     
    4048    Short_t GetNeighbor(Byte_t i) const { return fNeighbors[i]; }
    4149
     50    Bool_t IsInOutermostRing() const { return TestBit(kIsInOutermostRing); }
     51    Bool_t IsInOuterRing() const     { return TestBit(kIsInOuterRing); }
     52
    4253    ClassDef(MGeomPix, 1) // Geometry class describing the geometry of one pixel
    4354};
Note: See TracChangeset for help on using the changeset viewer.