Message: Re: Optical Photons Spectrum Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Optical Photons Spectrum 

Forum: Processes Involving Optical Photons
Re: Question Optical Photons Spectrum (Dragos Constantin)
Re: Feedback Re: Optical Photons Spectrum (Gumplinger Peter)
Re: More Re: Optical Photons Spectrum (Gumplinger Peter)
Date: 21 Jan, 2011
From: Gumplinger Peter <Gumplinger Peter>

I'll try to explain the photon energy sampling with words although a simple graph would explain it much better and easier.

If you have a spectrum that is defined at discrete locations and you want to sample from this spectrum, you have the two simplest choices:

(1) You can either brute force sample with the rejection method - slow - or (2) you can resort to the faster integral method. The integral method was chosen.

This means that you need to first integrate the spectrum and make a new vector which is monotonically increasing and holds the integral of the spectrum to the left of the bin in question. The (linear) integral of a spectral bin F(x) is the width of the bin times the average y=f(x) at the bin's edges.

During simulation a flat random number is taken from zero to the integral vector's largest entry: Y_max=F(x_max). For this number (Y) we now find the corresponding integral vector's left bin, x_i, then sample x above the bin's lower limit, x_i, by linearly interpolating the integral vector's entries at the bin edges, F(x_i) and F(x_i+1).

If you think about it, what that produces is a flat spectrum in x (the photon energy) within the bin because the line connecting the bin's edges Y_i=F(x_i) and Y_i+1=F(x_i+1) is a straight line.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: Optical Photons Spectrum   (Benton Pahlka - 21 Jan, 2011)
1 Feedback: Re: Optical Photons Spectrum   (Dragos Constantin - 26 Jan, 2011)
2 Feedback: Re: Optical Photons Spectrum   (Dragos Constantin - 26 Jan, 2011)
 Add Message Add Message
to: "Re: Optical Photons Spectrum"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews