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

Last change on this file since 2282 was 2236, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.3 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 fD; // [mm] the d 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
27 UInt_t fSector; // Number of sector the pixels corresponds to
28
29public:
30 MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0, UInt_t s=0);
31
32 void Print(Option_t *opt=NULL) const;
33
34 void Set(Float_t x, Float_t y, Float_t d, UInt_t s=0) { fX=x; fY=y; fD=d; fSector=s; }
35
36 void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
37 Short_t i3=-1, Short_t i4=-1, Short_t i5=-1);
38
39 void CheckOuterRing(const MGeomCam &cam);
40 /*
41 void SetX(Float_t x) { fX = x; }
42 void SetY(Float_t y) { fY = y; }
43 void SetD(Float_t d) { fD = d; }
44 void SetSector(UInt_t s) { fSector = s; }
45 */
46
47 Float_t GetX() const { return fX; }
48 Float_t GetY() const { return fY; }
49 Float_t GetD() const { return fD; }
50 UInt_t GetSector() const { return fSector; }
51
52 Float_t GetA() const;
53
54 Byte_t GetNumNeighbors() const { return fNumNeighbors; }
55 Short_t GetNeighbor(Byte_t i) const { return fNeighbors[i]; }
56
57 Bool_t IsInOutermostRing() const { return TestBit(kIsInOutermostRing); }
58 Bool_t IsInOuterRing() const { return TestBit(kIsInOuterRing); }
59
60 /*
61 //
62 // These function are for future usage. They are not virtual in
63 // root by now.
64 //
65 void SetBit(UInt_t f, Bool_t set) { set ? TObject::SetBit(f) : TObject::ResetBit(f); }
66 void SetBit(UInt_t f) { TObject::SetBit(f & kUserBits); }
67 void ResetBit(UInt_t f) { TObject::ResetBit(f & kUserBits); }
68 void InvertBit(UInt_t f) { TObject InvertBit(f & kUserBits); }
69 */
70
71 ClassDef(MGeomPix, 1) // Geometry class describing the geometry of one pixel
72};
73
74#endif
75
Note: See TracBrowser for help on using the repository browser.