1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // class MacroCellGeometry |
---|
3 | // $Id: MacroCellGeometry.hh 1793 2005-04-28 23:15:13Z thea $ |
---|
4 | // M. Pallavicini - created 10-10-03 |
---|
5 | // |
---|
6 | |
---|
7 | #ifndef _MACROCELLGEOMETRY__H |
---|
8 | #define _MACROCELLGEOMETRY__H |
---|
9 | |
---|
10 | #include "EVector.hh" |
---|
11 | #include "Photon.hh" |
---|
12 | #include "Photomultiplier.hh" |
---|
13 | #include "EsafMsgSource.hh" |
---|
14 | |
---|
15 | class MacroCell; |
---|
16 | |
---|
17 | class MacroCellGeometry : public EsafMsgSource { |
---|
18 | public: |
---|
19 | // ctor |
---|
20 | MacroCellGeometry( MacroCell* ); |
---|
21 | |
---|
22 | // dtor |
---|
23 | virtual ~MacroCellGeometry(); |
---|
24 | |
---|
25 | // get normal |
---|
26 | inline const EVector& GetNormal() const { return fNormal;} |
---|
27 | |
---|
28 | // get center |
---|
29 | inline const EVector& GetCenter() const { return fCenter;} |
---|
30 | |
---|
31 | // get xaxis |
---|
32 | inline const EVector& GetXAxis() const { return fXAxis;} |
---|
33 | |
---|
34 | // get yaxis |
---|
35 | inline const EVector& GetYAxis() const { return fYAxis;} |
---|
36 | |
---|
37 | // get up-left corner |
---|
38 | inline EVector GetUpLeft() const { return fCenter+fXMin*fXAxis+fYMax*fYAxis;} |
---|
39 | |
---|
40 | // get up-right corner |
---|
41 | inline EVector GetUpRight() const { return fCenter+fXMax*fXAxis+fYMax*fYAxis;} |
---|
42 | |
---|
43 | // get down-left corner |
---|
44 | inline EVector GetDownLeft() const { return fCenter+fXMin*fXAxis+fYMin*fYAxis;} |
---|
45 | |
---|
46 | // get down-right corner |
---|
47 | inline EVector GetDownRight() const { return fCenter+fXMax*fXAxis+fYMin*fYAxis;} |
---|
48 | |
---|
49 | // checks if p hits the MC. In that case returns the distance |
---|
50 | Double_t IsHit(const Photon &p ) const; |
---|
51 | |
---|
52 | // finds which pmt has been hit, if exists |
---|
53 | Photomultiplier* FindHitPmt(const Photon &p) const; |
---|
54 | |
---|
55 | // draw the macrocell |
---|
56 | virtual void Draw() const; |
---|
57 | |
---|
58 | private: |
---|
59 | // MacroCell |
---|
60 | MacroCell *pCell; |
---|
61 | inline MacroCell* Cell() { return pCell;} |
---|
62 | |
---|
63 | // compute internal infos |
---|
64 | virtual void Compute(); |
---|
65 | |
---|
66 | // compute (roughly) the area covered by this macrocell |
---|
67 | // it is used in Optics module to search for hit pmt |
---|
68 | // the area is a circle centered in the macrocell centroid |
---|
69 | EVector fNormal; |
---|
70 | EVector fCenter; |
---|
71 | EVector fXAxis; |
---|
72 | EVector fYAxis; |
---|
73 | Double_t fXMin; |
---|
74 | Double_t fXMax; |
---|
75 | Double_t fYMin; |
---|
76 | Double_t fYMax; |
---|
77 | |
---|
78 | |
---|
79 | friend class MacroCell; |
---|
80 | ClassDef(MacroCellGeometry,0) |
---|
81 | }; |
---|
82 | |
---|
83 | #endif |
---|