| 1 |
+++ |
| 2 |
title = "Monte-Carlo" |
| 3 |
weight = 10 |
| 4 |
+++ |
| 5 |
|
| 6 |
## Option: Monte-Carlo integration |
| 7 |
|
| 8 |
If for some reason the midpoint of a detector pixel is not representative |
| 9 |
for the average scattering intensity of the entire pixel it is possible |
| 10 |
to resort to Monte-Carlo integration. |
| 11 |
|
| 12 |
To request Monte-Carlo integration over detector pixels, use |
| 13 |
```python |
| 14 |
simulation.options().setMonteCarloIntegration(True, n) |
| 15 |
``` |
| 16 |
where `n` is the number of scattering intensity evaluations per pixel. |
| 17 |
|
| 18 |
Example: [Monte-Carlo](/ref/sim/class/scattering/ex/mc). |