Last change
on this file since 114 was
114,
checked in by moretto, 11 years ago
|
actual version of ESAF at CCin2p3
|
File size:
1.7 KB
|
Line | |
---|
1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // class JOpticalSystem |
---|
3 | // $Id: JOpticalSystem.cc 2836 2009-07-16 08:22:02Z biktem $ |
---|
4 | // |
---|
5 | #include <TTUBE.h> |
---|
6 | #include <TSPHE.h> |
---|
7 | #include <TNode.h> |
---|
8 | #include <TRotation.h> |
---|
9 | #include "JOpticalSystem.hh" |
---|
10 | #include "Config.hh" |
---|
11 | #include "EsafRandom.hh" |
---|
12 | #include "EEvent.hh" |
---|
13 | |
---|
14 | using namespace sou; |
---|
15 | |
---|
16 | ClassImp(JOpticalSystem) |
---|
17 | |
---|
18 | void read_para(void); |
---|
19 | int trace(double*, double*); |
---|
20 | |
---|
21 | JOpticalSystem::JOpticalSystem(): OpticalSystem() { |
---|
22 | fDZdown=20*mm; |
---|
23 | fDZup=900*mm; // FIXME |
---|
24 | fR=1250*mm; |
---|
25 | fPos=EVector(0,0,100*mm); |
---|
26 | read_para(); |
---|
27 | } |
---|
28 | |
---|
29 | Photon *JOpticalSystem::Transport(Photon *p) const { |
---|
30 | double ph_in[8]; |
---|
31 | double ph_out[8]; |
---|
32 | |
---|
33 | ph_in[0]=p->pos[X]/mm; |
---|
34 | ph_in[1]=p->pos[Y]/mm; |
---|
35 | ph_in[2]=p->pos[Z]/mm; |
---|
36 | |
---|
37 | ph_in[3]=p->dir[X]; |
---|
38 | ph_in[4]=p->dir[Y]; |
---|
39 | ph_in[5]=p->dir[Z]; |
---|
40 | |
---|
41 | ph_in[6]=p->wl/nm; |
---|
42 | ph_in[7]=p->time/ns; |
---|
43 | |
---|
44 | |
---|
45 | #ifdef DEBUG |
---|
46 | cout<<"JOpticalSystem"<<endl; |
---|
47 | cout<<"position = "<<p->pos<<endl; |
---|
48 | cout<<"direction = "<<p->dir<<endl; |
---|
49 | double theta=p->dir.Angle(EVector(0.,0.,1.)); |
---|
50 | cout<<"theta = "<<theta/deg<<endl; |
---|
51 | cout<<"wl = "<<p->wl/nm<<endl; |
---|
52 | cout<<"time = "<<p->time/ns<<endl; |
---|
53 | #endif /* DEBUG */ |
---|
54 | int flag=trace(ph_in, ph_out); |
---|
55 | #ifdef DEBUG |
---|
56 | cout << flag << endl; |
---|
57 | #endif /* DEBUG */ |
---|
58 | p->fate=flag; |
---|
59 | if(flag!=0) { |
---|
60 | return 0; |
---|
61 | } |
---|
62 | p->pos[X]=ph_out[0]*mm; |
---|
63 | p->pos[Y]=ph_out[1]*mm; |
---|
64 | p->pos[Z]=ph_out[2]*mm; |
---|
65 | |
---|
66 | p->dir[X]=ph_out[3]; |
---|
67 | p->dir[Y]=ph_out[4]; |
---|
68 | p->dir[Z]=ph_out[5]; |
---|
69 | |
---|
70 | p->wl = ph_out[6]*nm; |
---|
71 | p->time = ph_out[7]*ns; |
---|
72 | |
---|
73 | #ifdef DEBUG |
---|
74 | cout<<"new position = "<<p->pos<<endl; |
---|
75 | cout<<"new direction = "<<p->dir<<endl; |
---|
76 | #endif /* DEBUG */ |
---|
77 | return p; |
---|
78 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.