gov.nist.microanalysis.NISTMonte
Class XRayEventListener

java.lang.Object
  extended by gov.nist.microanalysis.NISTMonte.XRayEventListener
All Implemented Interfaces:
XRaySource, java.awt.event.ActionListener, java.util.EventListener

public class XRayEventListener
extends java.lang.Object
implements java.awt.event.ActionListener, XRaySource

The XRayEventListener class serves to respond to events in the MonteCarloSS class by computing the generated and transmitted x-ray intensities. These numbers are then available for other classes to organize as the wish - ie in phi-rho-z or graphically or however. The XRayEventListener class serves as a optimization to eliminate the need for each class to recaculate the x-ray event properties. The class also simplifies accessing these properties.

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Constructor Summary
XRayEventListener(MonteCarloSS mcss, double[] detectorPosition)
          XRayEventListener - Creates a XRayEventListener to listen to events occuring on the specified MonteCarloSS instance.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          actionPerformed - Handles x-ray events by computing the amount of characteristic x-rays generated.
 void addActionListener(java.awt.event.ActionListener al)
          addActionListener - Objects that are interested in receiving notification whenever an x-ray event occurs should register an ActionListener using this method.
 CharacteristicXRayGeneration getCharacteristicXRayGeneration()
          getCharacteristicXRayGeneration - Returns the algorithm to use to compute the characteristic x-ray generation.
 double getEnergy(int n)
          getEnergy
 int getEventCount()
          getEventCount
 double getGenerated(XRayTransition xrt)
          getGenerated - Gets the generated intensity of x-rays for the specified transition.
 double getIntensity(int n)
          getIntensity
 MassAbsorptionCoefficient getMassAbsorptionCoefficient()
          getMassAbsorptionCoefficient - Returns the algorithm to use to compute the mass absorption coefficient.
 Material getMaterial()
          getMaterial - During an event fired by this class, this method will get the material in which this x-ray event occured.
 int getMaterialIndex()
          getMaterialIndex - During an event fired by this class, this method will get the index assigned to the Material in which this x-ray event occured.
 int getMaxTrajectories()
          Limits the number of trajectories that generate x-rays.
 double[] getPosition()
          getPosition - During an event fired by this class, the getPosition will return the location of the x-ray event.
 double[] getPosition(int n)
          getPosition - Returns the position from which the x-ray is emitted.
 AtomicShell[] getShells()
          getShells - Returns a list of the shells under consideration.
 double getStepLength()
           
 XRayTransition[] getTransitions()
          getTransitions - Returns a list of the transitions under consideration.
 double getTransmittedFraction(XRayTransition xrt)
          getTransmittedFraction - Returns the fraction of the generated x-rays that reach the detector.
 double getTransmittedIntensity(XRayTransition xrt)
          getTransmittedIntensity - Returns the intensity of the specified transition that is generated and reaches the detector.
 boolean inside(MonteCarloSS.Region region)
          inside - Did this event occur within the specified Region?
 boolean inside(MonteCarloSS.Shape shape)
          inside - Did this event occur within the volume defined by the specified Shape?
 void removeActionListener(java.awt.event.ActionListener al)
          removeActionListener - Removes an ActionListener that was previously registered with addActionListener.
 void setCharacteristicXRayGeneration(CharacteristicXRayGeneration gen)
          setCharacteristicXRayGeneration - Specify the algorithm to use to compute the characteristic x-ray generation.
 void setMassAbsorptionCoefficient(MassAbsorptionCoefficient mac)
          setMassAbsorptionCoefficient - Specify the algorithm to use to compute the mass absorption coefficient.
 void setMaxTrajectories(int maxTrajectories)
          Limits the number of trajectories that generate x-rays.
 void setTransitions(java.util.Collection col)
          setTransitions - Sets the list of XRayTransitions to consider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XRayEventListener

public XRayEventListener(MonteCarloSS mcss,
                         double[] detectorPosition)
                  throws EPQException
XRayEventListener - Creates a XRayEventListener to listen to events occuring on the specified MonteCarloSS instance.

Parameters:
mcss - MonteCarloSS
detectorPosition - The coordinate location of the detector
Throws:
EPQException
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed - Handles x-ray events by computing the amount of characteristic x-rays generated.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
ae - (non-Javadoc)
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

getPosition

public double[] getPosition()
getPosition - During an event fired by this class, the getPosition will return the location of the x-ray event.

Returns:
double[]

getMaterialIndex

public int getMaterialIndex()
getMaterialIndex - During an event fired by this class, this method will get the index assigned to the Material in which this x-ray event occured.

Returns:
int

getMaterial

public Material getMaterial()
getMaterial - During an event fired by this class, this method will get the material in which this x-ray event occured.

Returns:
Material

getGenerated

public double getGenerated(XRayTransition xrt)
getGenerated - Gets the generated intensity of x-rays for the specified transition.

Parameters:
xrt - XRayTransition
Returns:
double

getStepLength

public double getStepLength()

getTransmittedFraction

public double getTransmittedFraction(XRayTransition xrt)
getTransmittedFraction - Returns the fraction of the generated x-rays that reach the detector. This function is optimized for those transitions in default transitions list or selected via setTransitions

Parameters:
xrt - XRayTransition
Returns:
double

getTransmittedIntensity

public double getTransmittedIntensity(XRayTransition xrt)
                               throws EPQException
getTransmittedIntensity - Returns the intensity of the specified transition that is generated and reaches the detector.

Parameters:
xrt - XRayTransition
Returns:
double
Throws:
EPQException

getTransitions

public XRayTransition[] getTransitions()
getTransitions - Returns a list of the transitions under consideration.

Returns:
ArrayList

getShells

public AtomicShell[] getShells()
getShells - Returns a list of the shells under consideration.

Returns:
AtomicShell[]

setTransitions

public void setTransitions(java.util.Collection col)
setTransitions - Sets the list of XRayTransitions to consider. By default XRayTransitionAdapter considers those transitions returned by MonteCarloSS.getTransitionList(false)

Parameters:
col - Collection - A collection of XRayTransition objects

inside

public boolean inside(MonteCarloSS.Region region)
inside - Did this event occur within the specified Region?

Parameters:
region - Region
Returns:
boolean

inside

public boolean inside(MonteCarloSS.Shape shape)
inside - Did this event occur within the volume defined by the specified Shape?

Parameters:
shape - Shape
Returns:
boolean

addActionListener

public void addActionListener(java.awt.event.ActionListener al)
addActionListener - Objects that are interested in receiving notification whenever an x-ray event occurs should register an ActionListener using this method.

Parameters:
al - ActionListener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener al)
removeActionListener - Removes an ActionListener that was previously registered with addActionListener.

Parameters:
al - ActionListener

getEventCount

public int getEventCount()
getEventCount

Specified by:
getEventCount in interface XRaySource
Returns:
int

getEnergy

public double getEnergy(int n)
getEnergy

Specified by:
getEnergy in interface XRaySource
Parameters:
n - int
Returns:
double

getIntensity

public double getIntensity(int n)
getIntensity

Specified by:
getIntensity in interface XRaySource
Parameters:
n - int
Returns:
double

getPosition

public double[] getPosition(int n)
Description copied from interface: XRaySource
getPosition - Returns the position from which the x-ray is emitted.

Specified by:
getPosition in interface XRaySource

getMaxTrajectories

public int getMaxTrajectories()
Limits the number of trajectories that generate x-rays.

Returns:
Returns the maxTrajectories.

setMaxTrajectories

public void setMaxTrajectories(int maxTrajectories)
Limits the number of trajectories that generate x-rays.

Parameters:
maxTrajectories - The value to which to set maxTrajectories.

setCharacteristicXRayGeneration

public void setCharacteristicXRayGeneration(CharacteristicXRayGeneration gen)
setCharacteristicXRayGeneration - Specify the algorithm to use to compute the characteristic x-ray generation.

Parameters:
gen -

getCharacteristicXRayGeneration

public CharacteristicXRayGeneration getCharacteristicXRayGeneration()
getCharacteristicXRayGeneration - Returns the algorithm to use to compute the characteristic x-ray generation.

Returns:
CharacteristicXRayGeneration

setMassAbsorptionCoefficient

public void setMassAbsorptionCoefficient(MassAbsorptionCoefficient mac)
setMassAbsorptionCoefficient - Specify the algorithm to use to compute the mass absorption coefficient.

Parameters:
mac -

getMassAbsorptionCoefficient

public MassAbsorptionCoefficient getMassAbsorptionCoefficient()
getMassAbsorptionCoefficient - Returns the algorithm to use to compute the mass absorption coefficient.

Returns:
MassAbsorptionCoefficient