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

Last change on this file since 9370 was 9369, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 1.4 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
20public:
21 MGeomPix(Float_t x=0, Float_t y=0, Float_t d=1, UInt_t s=0, UInt_t aidx=0);
22
23 void Copy(TObject &obj) const
24 {
25 MGeomPix &pix = (MGeomPix&)obj;
26
27 pix.fD = fD;
28
29 MGeom::Copy(obj);
30 TObject::Copy(obj);
31 }
32
33 void SetD(Float_t d=1) { fD=d; fA=d*d*gsTan60/2; }
34
35 Float_t GetD() const { return fD; } // Distance between two parallel sides
36 Float_t GetL() const { return fD*gsTan30; } // Length of one of the parallel sides
37 Float_t GetT() const { return fD/gsTan60; } // Distance between two opposite edges (traverse)
38
39 Bool_t IsInside(Float_t px, Float_t py) const;
40 Float_t DistanceToPrimitive(Float_t px, Float_t py) const;
41 void PaintPrimitive(const TAttLine &line, const TAttFill &fill, Double_t scalexy=1, Double_t scaled=1) const;
42
43 void Print(Option_t *opt=NULL) const;
44
45 ClassDef(MGeomPix, 5) // Geometry class describing the geometry of one pixel
46};
47
48#endif
Note: See TracBrowser for help on using the repository browser.