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

Last change on this file since 9588 was 9519, checked in by tbretz, 15 years ago
*** empty log message ***
File size: 1.7 KB
Line 
1#ifndef MARS_MGeomPix
2#define MARS_MGeomPix
3
4#ifndef MARS_MGeom
5#include "MGeom.h"
6#endif
7
8class MGeomPix : public MGeom
9{
10public:
11 static const Float_t gsTan60; // tan(60/kRad2Deg);
12 static const Float_t gsTan30; // tan(30/kRad2Deg);
13
14 static const Float_t gsCos60; // cos(60/kRad2Deg);
15 static const Float_t gsSin60; // sin(30/kRad2Deg);
16
17private:
18 Float_t fD; // [mm] the d coordinate of the pixel (dist between two parallel sides)
19
20 Double_t fCosPhi;
21 Double_t fSinPhi;
22
23 // Store fD*fCosPhi ???
24 // Store fD*fSinPhi ???
25 // Store array and check if initialized before needed?
26
27public:
28 MGeomPix(Float_t x=0, Float_t y=0, Float_t d=1, UInt_t s=0, UInt_t aidx=0);
29
30 void Copy(TObject &obj) const
31 {
32 MGeomPix &pix = (MGeomPix&)obj;
33
34 pix.fD = fD;
35
36 MGeom::Copy(obj);
37 TObject::Copy(obj);
38 }
39
40 void SetD(Float_t d=1) { fD=d; fA=d*d*gsSin60; }
41 void SetPhi(Double_t phi=0);
42
43 Float_t GetD() const { return fD; } // Distance between two parallel sides
44 Float_t GetL() const { return fD*gsTan30; } // Length of one of the parallel sides
45 Float_t GetT() const { return fD/gsTan60; } // Distance between two opposite edges (traverse)
46
47 Float_t GetDx() const { return fD; } // Distance of two rows in x-direction (without rotation)
48 Float_t GetDy() const { return fD*gsSin60; } // Distance of two rows in y-direction (without rotation)
49
50 Bool_t IsInside(Float_t px, Float_t py) const;
51 void PaintPrimitive(const TAttLine &line, const TAttFill &fill, Double_t scalexy=1, Double_t scaled=1) const;
52
53 void Print(Option_t *opt=NULL) const;
54
55 ClassDef(MGeomPix, 5) // Geometry class describing the geometry of one pixel
56};
57
58#endif
Note: See TracBrowser for help on using the repository browser.