//
// $Id: WallInteraction.cc,v 1.11 2005/03/21 17:58:55 thea Exp $
//
#include "EsafRandom.hh"
#include "WallInteraction.hh"
#include "EEvent.hh"
ClassImp(WallInteraction)
//______________________________________________________________________________
WallInteraction::WallInteraction() {
//
// Constructor
//
fSpecRefl=Conf()->GetNum("WallInteraction.fSpecularReflectivity");
}
//______________________________________________________________________________
Photon *WallInteraction::Transport(Photon *p) const {
TRandom* rndm = EsafRandom::Get();
if(rndm->Rndm() > fSpecRefl) {
p=0;
return p;
}
// ortho is ortho normal to the cylinder in the impact point.
EVector ortho=p->pos;
ortho[Z]=0;
ortho=ortho.Unit();
p->dir -= ortho*2*p->dir.Dot(ortho);
return p;
}