Professional Documents
Culture Documents
02/08/07
MC Simulation and Integration are mathematically the same thing, but get approached with slightly different biases.
02/08/07
When is an MC Used?
MC Integration
Used when the function is complicated
There isn't a closed form for most integrals Non-MC numeric techniques depend on the function being smooth MC integration always works, but takes a lot of CPU time to get an accurate answer
But, CPU is CHEAP
MC Simulation
Before an experiment you should understand the expected distributions. It's hard to combine probability distributions MC's provide a simple way to predict the outcome of an experiment
Tells you what the null hypothesis will look like Let's you verify that the experiment is sensitive enough to make the observation
02/08/07
f dV
= fV
02/08/07
The mean of a function (e.g. the Expectation Value, E[f(x)], when x follows a uniform p.d.f) is estimated by the sample mean (also called the average)
1 f = f x i N i =1
N
]
N 2 j =1
f x j
The estimate the function mean, we generate a large sample of random values, xi, and use them to calculate the sample mean for the function.
f f f = E [ f x ] f N1
02/08/07 PHY310: Statistical Data Analysis
The uncertainty may not be Gaussian, so the it'sonly a rough estimate of the probable error.
If the function isn't smooth (and it never is) then the uncertainty tends to be underestimated
02/08/07
MC Integration Example
0.6670 0.0019
1 2 x dx =
1
1
2 3
x x x dx 2 x 2 N 1
2 2
2 2
2 2
Notice the missing { and } at the start and end of the file. They are not needed with a named macro.
8
1) Pick a volume, W, that encloses the integration volume, V. 1) e.g. 1 < x < 4, -3 < y < 4, and -1 < z < 1 2) The actual volume isn't very important, as long as it is larger than the integration region. 2) Redefine the integration function to include limits and integrate over W
z x y 3 1, x 1 and y 3
2 2 2 2
if z x y 3 1, x 1 and y 3 f x , y , z = e 0, otherwise
1 x y z 2 2 2
f dV = f 1 dW
02/08/07 PHY310: Statistical Data Analysis 10
Change the loop in integrate.C to have three variables, and cover the entire volume.
// The integration loop in integrate.C becomes... double xmin=0; double xmax =4; double ymin=-4; double ymax=4; double zmin=-1; double zmax=1; for (int i=0; i<100000; ++i) { double x = gRandom->Uniform(0,4); double y = gRandom->Uniform(-4,4); double z = gRandom->Uniform(-1,1); double f = func(x,y,z); sum += f; sum2 += f*f; weight += 1; } double value = (xmax-xmin)*(ymax-ymin)*(zmax-zmin)*sum/weight; 02/08/07 PHY310: Statistical Data Analysis 11
Even if you understand the individual processes, it can be very difficult to fold them together and predict the observed distribution. Monte Carlo simulation provides a way to combine the processes and predict the final measured distribution Big advantages
You know exactly how the final distribution was simulated You can vary physical constants and see the effect You can inject hypothesized processes and see how they effect the data
This is vital when you are looking for things that have never been seen Proton Decay, Super Symmetry, Higgs Particles, Quark-Gluon Plasma
02/08/07
12
Vo = 0V (Ground) Dynode voltages set at Vo < V1 < V2 < V3 < V4 < V5 < V6 < Vhv 1) A photon strikes the photocathode and may/may-not generate a photo-electron 2) The photoelectron accelerates to the first dynode and generates dynode electrons a) The number of liberated electrons depends on metal (assume lib = E) 3) Electrons from the first dynode accelerate and strike the second dynode. Etc. 4) Final electrons are collected by the anode.
One photon can create one photoelectron. The photoelectron starts at rest.
// Simulate the number of photoelectrons created // by a single photon. double photoElectrons(int photons) { // Assume wave length is 400 nm and QE is 23% double pe = 0; for (int i=0; i<photons; ++i) { if (gRandom->Uniform()<0.23) pe = pe + 1; } return pe; } 02/08/07 PHY310: Statistical Data Analysis 14
Dynode electrons
1)When an electron with energy, E, strikes a dynode it liberates more electrons. a) Mean liberated electrons depends on metal (assume lib = E) b) Liberated electrons start at rest 2) Electrons get energy from the electric field.
02/08/07
15
Dynode electrons
// Simulate the dynodes generated at a single dynode by // a number of incoming electrons with an energy of E. double dynodeElectrons(double incoming, double E) { double mean = incoming*meanDynodeElectrons(E); // This is counting so use Poisson. Use PoissonD since // the number of electrons can be HUGE. return gRandom->PoissonD(mean); }
02/08/07
16
Dynode voltages set at Vo < V1 < V2 < V3 < V4 < V5 < V6 < Vhv
// Simulate a sequence of dynodes. The dynode voltages are // given in V[] double photonToElectrons(int photons, double V[], int dynodes) { double electrons = photoElectrons(photons); double lastVoltage = 0.0; for (int dynode = 0; dynode<dynodes; ++dynode) { double voltDrop = V[dynode] - lastVoltage; electrons += dynodeElectrons(electrons,voltDrop); lastVoltage = V[dynode]; } return electrons; } 02/08/07 PHY310: Statistical Data Analysis 17
Use the PMT simulation to learn about what PMT signals look like in a real experiment.
02/08/07 PHY310: Statistical Data Analysis 18
02/08/07
19
Signal vs Photons
02/08/07
20
The End
02/08/07 PHY310: Statistical Data Analysis 21