Message: Re: Optical boundary process and absorption at boundary Not Logged In (login)

## Re: Optical boundary process and absorption at boundary

Forum: Processes Involving Optical Photons
Re: Re: Optical boundary process and absorption at boundary (Gumplinger Peter)
Date: 15 Aug, 2008
From: Kay Ulbrich <Kay Ulbrich>

 Hello Peter, thank you very much for another detailed answer. Actually, I went into the stepping and decided to use a somewhat different approach not involving killing the track, but counting the number of reflections (so one can use the same simulated data for different assumptions about the absorption probability). But the important point of course is the criteria when to increase the number of reflections (or alternatively kill the track based on a certain absorption probability). I describe, what I have done in the following and it would be nice to get a feedback. The geometry is such, that every photon passing the boundary of the volume is lost. So the only processes, which leave them in the volume are ```* TotalInternalReflection * FresnelReflection ``` In G4UserSteppingAction::UserSteppingAction(const G4Step* Step) I do (excerpts, *fTheTrack is the actual track): ```------------------------------------------------------------------------------------------------------------------------ fEndPoint = Step->GetPostStepPoint(); fEndVol = fEndPoint->GetPhysicalVolume(); if(!fEndVol) return;``` ``` fStartPoint = Step->GetPreStepPoint(); fStartVol = fStartPoint->GetPhysicalVolume();``` ```if(fEndPoint->GetStepStatus() == fGeomBoundary) { fBoundaryProc = dynamic_cast(ExistsProcess("OpBoundary", fTheTrack)); if(fBoundaryProc) { fBoundaryStatus = fBoundaryProc->GetStatus(); if(fBoundaryStatus == TotalInternalReflection || fBoundaryStatus == FresnelReflection) IncNofReflections(); else if(fBoundaryStatus == FresnelRefraction) fTheTrack->SetTrackStatus(fStopButAlive); } } ------------------------------------------------------------------------------------------------------------------------``` The function ExistsProcess(...) loops over the track's process vector and looks, whether the named process is in it. IncNofReflections() does, what it sounds like. The if-clause "else if(fBoundaryStatus == FresnelRefraction)" serves to abandon tracks having left the volume of interest, which may speed up the program a little and makes the picture in visual mode less crowded. Would I have to add a check for fTheTrack->GetStepLength()>kCarTolerance/2 here, too? Thanks a lot for advice! Kay

 Inline Depth: Outline Depth: Add message:

1 Re: Optical boundary process and absorption at boundary   (Kay Ulbrich - 15 Aug, 2008)
2 Re: Optical boundary process and absorption at boundary   (Gumplinger Peter - 15 Aug, 2008)
 to: "Re: Optical boundary process and absorption at boundary"
This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews