Last change
on this file since 114 was
114,
checked in by moretto, 11 years ago
|
actual version of ESAF at CCin2p3
|
File size:
841 bytes
|
Line | |
---|
1 | // |
---|
2 | // $Id: WallInteraction.cc 1611 2005-03-21 17:58:55Z thea $ |
---|
3 | // |
---|
4 | #include "EsafRandom.hh" |
---|
5 | #include "WallInteraction.hh" |
---|
6 | #include "EEvent.hh" |
---|
7 | |
---|
8 | ClassImp(WallInteraction) |
---|
9 | |
---|
10 | //______________________________________________________________________________ |
---|
11 | WallInteraction::WallInteraction() { |
---|
12 | // |
---|
13 | // Constructor |
---|
14 | // |
---|
15 | |
---|
16 | fSpecRefl=Conf()->GetNum("WallInteraction.fSpecularReflectivity"); |
---|
17 | } |
---|
18 | |
---|
19 | //______________________________________________________________________________ |
---|
20 | Photon *WallInteraction::Transport(Photon *p) const { |
---|
21 | |
---|
22 | TRandom* rndm = EsafRandom::Get(); |
---|
23 | if(rndm->Rndm() > fSpecRefl) { |
---|
24 | p=0; |
---|
25 | return p; |
---|
26 | } |
---|
27 | |
---|
28 | // ortho is ortho normal to the cylinder in the impact point. |
---|
29 | EVector ortho=p->pos; |
---|
30 | ortho[Z]=0; |
---|
31 | ortho=ortho.Unit(); |
---|
32 | |
---|
33 | p->dir -= ortho*2*p->dir.Dot(ortho); |
---|
34 | |
---|
35 | return p; |
---|
36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.