here is my example showing how to use this feature, I use
the example/validation here, as the purpose of onecube
is for testing debug info, the detector location are off
the mesh actually :)
in the first step, you run this in the validation folder:
../../src/bin/mmc -f cube.inp -s cube -n 1000000 -b 0 -D TP -d 1 -q 1
the -q 1 enables saving seeds for each detected photon
you will now see a cube.mch file in the folder.
You can rename it to a different file to avoid overwriting.
mv cube.mch cube_bk.mch
in the second step, you run
../../src/bin/mmc -f cube.inp -s cube -n 1000000 -b 0 -D TP -d 1 -E cube_bk.mch -O F -U 0 -P 1
this will load the recorded detected photons and "replay"
all of those captured by the 1st detector (-P 1) and output
the "raw" fluence (-O F) generated by these photons alone.
As you see, I disabled normalization (-U 0) because the
normalization will not be accurate in the replay mode.
The "-n 1000000" input are automatically ignored as the
photon number is determined by the .mch file in the
replay mode.
if you use "-O J", MMC will output the sensitivity map, i.e.
a "banana" pattern between the source and the selected
detector (-P 1). The output is in the cube.dat file.
../../src/bin/mmc -f cube.inp -s cube -n 1000000 -b 0 -D TP -d 1 -E cube_bk.mch -O J -P 1
You can replay photons from other detectors with more mmc calls
and create the full Jacobian. The "-O T" also produces
something similar to the Jacobian, but an approximated version
after the Taylor expansion.
Keep in mind that the Jacobian is defined on each node, and
is inclusive of the volumetric and time-gate effects (I am still
debating
about the time gate). This is different from the default
fluence/flux
output where these effects are "normalized" with "-U 1".
The only normalization in the -O J/T outputs is the number
of photons.
just as a sanity check, you can run
OMP_NUM_THREADS=1 ../../src/bin/mmc -f cube.inp -s cube -n 1000000 -b 0 -D TP -d 1 -q 1 -E cube_bk.mch
as the second step, this will dump a cube.mch that is
bit-to-bit identical to cube_bk.mch except the header.
as I said, this is an experimental feature, let me know if
you have any feedback.
Qianqian