The apply command applies a gate to one or more
spectra or, if given the -list
option lists spectra
and the gates applied to them.
Application of a gate requires at least two command parameters. The first is the name of a gate. The remaining parametrs are the names of spectra to which that gate will be applied. Once a gate has been applied to a spectrum it can only be incremented for events that satisfy the gate.
The -list
option can accept an optional pattern
parameter. The pattern parameter accepts glob wild card characters.
If not provided, * is used.
-list
Instead of applying a gate to one or more spectra, the presence of this option lists the spectra and the gates applied to them.
A successful apply command
only produces meaningful output if the -list
option
is used. In that case, the output is a
list with a two element sublist for each defined spectrum that
matches the pattern parameter (recall that if no pattern is provided,
the patternd defaults to * which matches
everything).
The first element of that list is the name of the spectrum. The second
element of the list is a four element list containing in order:
The name of the applied gate, the gate id, the gate type code and
the gate definition string. The contents of the gate definition
string vary depending on the gate type.
The example above applies the gate named neutrons to the single spectrum named pid
Applies the gate named alpha to four spectra named: energy1, energy2, energy3 andenergy4.
Results in a list with a two element sublist for each defined spectrum. The first element of that list is the name of the spectrum. The second element of the list is a four element list containing in order: The name of the applied gate, the gate id, the gate type code and the gate definition string. The contents of the gate definition string vary depending on the gate type.
Suppose the neutrons and alphas gates are both slices. The output might look something like:
{pid {neutrons 0 s {time {1700.00 1800.00}}}} {energy1 {alphas 1 s {pid {1200.00 1350.00}}}} {energy2 {alphas 1 s {pid {1200.00 1350.00}}}} {energy3 {alphas 1 s {pid {1200.00 1350.00}}}} {energy4 {alphas 1 s {pid {1200.00 1350.00}}}}
Note that all spectra have an applied gate. The gate may, however be a T gate, which is always satisfied. For example:
For the spectra and application of the previous example, this will return: