# A very simple script for a simple bulk material
import gov.nist.microanalysis.EPQLibrary as epq
import gov.nist.microanalysis.NISTMonte as nm
import java.io as jio
# create an instance of the model
print "Start...";
monte=nm.MonteCarloSS()
for alg in [epq.CzyzewskiMottScatteringAngle,
epq.NISTMottScatteringAngle,
epq.ScreenedRutherfordScatteringAngle]:
print "Starting "+alg.getName()
monte.setScatteringAlgorithm(alg)
monte.setBeamEnergy(epq.ToSI.keV(25.0))
# create the material, shape and region
mat=epq.MaterialFactory.createPureElement(epq.Element.Al)
mat.setDensity(epq.ToSI.gPerCC(1.0))
# create a solid of Al
plane = nm.MultiPlaneShape.createSubstrate([0.0, 0.0, -1.0],[0.0, 0.0, 0.0])
r1=nm.MonteCarloSS.Region(monte, monte.getChamber(), mat, plane)
# add event listeners
xrel=nm.XRayEventListener(monte,monte.computeDetectorPosition(40*(3.1415926/180),0.0))
monte.addActionListener(xrel)
przs=nm.PhiRhoStats.watchDefaultTransitions(xrel,0.0e-6,20.0e-6)
# add a trajectory image
img=nm.TrajectoryImage(2048,2048,20.0e-6)
monte.addActionListener(img)
# add generation images
imgs=nm.EmissionImage.watchDefaultTransitions(xrel,512,20.0e-6)
# run the simulation
monte.runMultipleTrajectories(10000)
# determine where to save the results
dest=DefaultOutput+PathSep+monte.getScatteringAlgorithm().getName()+PathSep
# output the phi-rho-z stats
nm.PhiRhoStats.dumpToFiles(przs,dest)
# output the trajectory image
img.dumpToFile(dest)
# output the transition image
nm.EmissionImage.dumpToFiles(imgs,dest)
print "Done!"
# NWMR 16-Mar-2006
Example 1: This script sets up a pure Al sample of density 1.0 g/cc (since
φ(ρz) curves are usually normalized to 1 g/cc). The detectors are
configured to accumulate a φ(ρz) curve and an emission image for the
default Al transitions (K-family). The script runs 10000 trajectories and saves
the results. This process is iterated over three different algorithms for the
elastic scattering cross-section.
|