1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: LightPipe.hh 2136 2005-10-02 14:18:08Z thea $ |
---|
3 | // A.Thea created Oct, 26 2002 |
---|
4 | |
---|
5 | #ifndef __LIGHTPIPE_HH_ |
---|
6 | #define __LIGHTPIPE_HH_ |
---|
7 | |
---|
8 | #include "euso.hh" |
---|
9 | #include "DetectorPhotonTransporter.hh" |
---|
10 | #include "PmtGeometry.hh" |
---|
11 | #include "EVector.hh" |
---|
12 | #include "TRotation.h" |
---|
13 | |
---|
14 | enum PVertex {TOPLEFTBACK=0, TOPRIGHTBACK, TOPRIGHTFRONT, |
---|
15 | TOPLEFTFRONT, BOTTOMLEFTBACK, BOTTOMRIGHTBACK, |
---|
16 | BOTTOMRIGHTFRONT, BOTTOMLEFTFRONT}; |
---|
17 | |
---|
18 | class LightPipe : public DetectorPhotonTransporter { |
---|
19 | protected: |
---|
20 | const PmtGeometry *pmt; |
---|
21 | EVector pos, par_X, par_Y, par_Z; |
---|
22 | vector <EVector> corner; |
---|
23 | vector <EVector> normal; |
---|
24 | vector <EVector> edge; |
---|
25 | |
---|
26 | TRotation rot, inv_rot; |
---|
27 | public: |
---|
28 | LightPipe(const EVector c1, const EVector c2, double t_x, |
---|
29 | double t_y, double b_x, double b_y, |
---|
30 | const PmtGeometry *p); |
---|
31 | virtual ~LightPipe(); |
---|
32 | virtual Photon *Transport(Photon *) const; |
---|
33 | vector<EVector> intPoints(Photon *p) const; |
---|
34 | int whichFace(Photon *p) const; |
---|
35 | EVector goLocal(const EVector &v) const; |
---|
36 | EVector goGlobal(const EVector &v) const; |
---|
37 | |
---|
38 | ClassDef(LightPipe,0) |
---|
39 | }; |
---|
40 | |
---|
41 | inline EVector LightPipe::goLocal(const EVector &v) const { |
---|
42 | EVector nv=v; |
---|
43 | nv.Transform(inv_rot); |
---|
44 | return nv; |
---|
45 | } |
---|
46 | |
---|
47 | inline EVector LightPipe::goGlobal(const EVector &v) const { |
---|
48 | EVector nv=v; |
---|
49 | nv.Transform(rot); |
---|
50 | return nv; |
---|
51 | } |
---|
52 | #endif /* __LIGHTPIPE_HH_ */ |
---|
53 | |
---|