| 1 | #ifndef MARS_MGeomPix
 | 
|---|
| 2 | #define MARS_MGeomPix
 | 
|---|
| 3 | 
 | 
|---|
| 4 | #ifndef MARS_MParContainer
 | 
|---|
| 5 | #include "MParContainer.h"
 | 
|---|
| 6 | #endif
 | 
|---|
| 7 | 
 | 
|---|
| 8 | class MGeomPix : public MParContainer
 | 
|---|
| 9 | { 
 | 
|---|
| 10 | private:
 | 
|---|
| 11 |     Float_t fX;  // [mm] the x coordinate
 | 
|---|
| 12 |     Float_t fY;  // [mm] the y coordinate
 | 
|---|
| 13 |     Float_t fR;  // [mm] the r coordinate
 | 
|---|
| 14 | 
 | 
|---|
| 15 |     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
 | 
|---|
| 18 | 
 | 
|---|
| 19 | public:
 | 
|---|
| 20 |     MGeomPix(Float_t x=0, Float_t y=0, Float_t r=0);
 | 
|---|
| 21 | 
 | 
|---|
| 22 |     void Print(Option_t *opt=NULL) const;
 | 
|---|
| 23 | 
 | 
|---|
| 24 |     void Set(Float_t x, Float_t y, Float_t r) { fX=x; fY=y; fR=r; }
 | 
|---|
| 25 | 
 | 
|---|
| 26 |     void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
 | 
|---|
| 27 |                       Short_t i3=-1, Short_t i4=-1, Short_t i5=-1);
 | 
|---|
| 28 | 
 | 
|---|
| 29 |     void SetX(Float_t x) { fX = x; }
 | 
|---|
| 30 |     void SetY(Float_t y) { fY = y; }
 | 
|---|
| 31 |     void SetR(Float_t r) { fR = r; }
 | 
|---|
| 32 | 
 | 
|---|
| 33 |     Float_t GetX() const  { return fX; }
 | 
|---|
| 34 |     Float_t GetY() const  { return fY; }
 | 
|---|
| 35 |     Float_t GetR() const  { return fR; }
 | 
|---|
| 36 | 
 | 
|---|
| 37 |     Float_t GetA() const  { return fR*fR*3; } // FIXME: Algorithm! A hexagonal shape is assumed!
 | 
|---|
| 38 | 
 | 
|---|
| 39 |     Byte_t  GetNumNeighbors() const { return fNumNeighbors; }
 | 
|---|
| 40 |     Short_t GetNeighbor(Byte_t i) const { return fNeighbors[i]; }
 | 
|---|
| 41 | 
 | 
|---|
| 42 |     ClassDef(MGeomPix, 1) // Geometry class describing the geometry of one pixel
 | 
|---|
| 43 | };
 | 
|---|
| 44 | 
 | 
|---|
| 45 | #endif
 | 
|---|
| 46 | 
 | 
|---|