source: trunk/MagicSoft/Mars/mgeom/MGeomPix.h@ 1824

Last change on this file since 1824 was 1459, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.0 KB
Line 
1#ifndef MARS_MGeomPix
2#define MARS_MGeomPix
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8class MGeomCam;
9
10class MGeomPix : public MParContainer
11{
12private:
13 enum {
14 kIsInOutermostRing = BIT(22),
15 kIsInOuterRing = BIT(23),
16 kUserBits = 0x1fc000 // 14-21 are allowed
17
18 };
19
20 Float_t fX; // [mm] the x coordinate of the center
21 Float_t fY; // [mm] the y coordinate of the center
22 Float_t fR; // [mm] the r coordinate of the pixel (dist between two parallel sides)
23
24 Byte_t fNumNeighbors; // number of valid neighbors
25 Short_t fNeighbors[6]; // the IDs of the pixel next to it (we are assuming an hexagonal geometry)
26
27public:
28 MGeomPix(Float_t x=0, Float_t y=0, Float_t r=0);
29
30 void Print(Option_t *opt=NULL) const;
31
32 void Set(Float_t x, Float_t y, Float_t r) { fX=x; fY=y; fR=r; }
33
34 void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
35 Short_t i3=-1, Short_t i4=-1, Short_t i5=-1);
36
37 void CheckOuterRing(const MGeomCam &cam);
38
39 void SetX(Float_t x) { fX = x; }
40 void SetY(Float_t y) { fY = y; }
41 void SetR(Float_t r) { fR = r; }
42
43 Float_t GetX() const { return fX; }
44 Float_t GetY() const { return fY; }
45 Float_t GetR() const { return fR; }
46
47 Float_t GetA() const;
48
49 Byte_t GetNumNeighbors() const { return fNumNeighbors; }
50 Short_t GetNeighbor(Byte_t i) const { return fNeighbors[i]; }
51
52 Bool_t IsInOutermostRing() const { return TestBit(kIsInOutermostRing); }
53 Bool_t IsInOuterRing() const { return TestBit(kIsInOuterRing); }
54
55 /*
56 //
57 // These function are for future usage. They are not virtual in
58 // root by now.
59 //
60 void SetBit(UInt_t f, Bool_t set) { set ? TObject::SetBit(f) : TObject::ResetBit(f); }
61 void SetBit(UInt_t f) { TObject::SetBit(f & kUserBits); }
62 void ResetBit(UInt_t f) { TObject::ResetBit(f & kUserBits); }
63 void InvertBit(UInt_t f) { TObject InvertBit(f & kUserBits); }
64 */
65
66 ClassDef(MGeomPix, 1) // Geometry class describing the geometry of one pixel
67};
68
69#endif
70
Note: See TracBrowser for help on using the repository browser.