nscl_logo_small.gif (2463 bytes)

gate command

HH00706_.jpg (6530 bytes)

Syntax

gate name type { description }
gate -list [-byid] [pattern]
gate -delete [-id] gate1 [gate2 ...]

Synopsis

The gate command allows you to create, list or delete gates in the SpecTcl gate dictionary.

Detailed Description

Using the gate command you can:

If the first command parameter is not either the -list or -delete switch then a new gate is created.   Otherwise the action is as indicated by the switch.

Gates are conditions which can be applied to a set of spectra to control when that spectrum is incremented.  See Also:

Top

gate name type { description }

Creates a new gate named name.  The type parameter describes the type of gate which can be created.  There are essentially two types of gates in SpecTcl: primitive or compound.  Primitive gates are those which are created directly from a set of points "drawn" on a spectrum.   Compound gates are gates which depend on other gates, either primitive or other compound gates.   If the named gate already exists, this command replaces the existing gate.  Note that if the gate is applied (directly or indirectly) to a spectrum, the change to the gate results in a change to the conditions for incrementing that spectrum.

The gate types supported by SpecTcl and the type character which should be entered are shown in the table below:

Gate Type type string Primitive? Meaning
And * No All dependent gates must be true to make this gate true.
Band b Yes An open set of points drawn on a 2-d spectrum, defining a single valued poly-line.  Points below the poly-line (exclusive) are accepted by this gate.
Contour c Yes Closed polygon of points drawn on a 2-d spectrum.  The polygon can be quite complex and the lines may cross arbitrarily many time.  The 'odd-crossing' rule is used to determine the interior of the shape.  Points in the shape interior are accepted by this gate.
Band pair contour c2band Yes (sort of) A contour formed by joining the endpoints of two bands defined on the same set of parameters.  This joining is done statically.  Therefore, while the gate is formed of two other gates (bands),  it becomes a primitive contour in behavior.
False F Yes Gate which is never made.  Can be used to disable spectra.
GammaBand gb Yes An open set of points forming a polyline on a spectrum. Applied as a fold to a 1-d gamma spectrum, for all pairs of parameters below the polyline, increments for all parameters in the spectrum which are not in the pair. Applied as an ordinary gate to any spectrum via apply the gate is true whenever any pair of parameters in the gate is under the band.

Applied to a 2-d spectrum as a fold, for all pairs of parameters, (p1, p2), below the polyline, increments for all pairs of parameters, (x, y) in the spectrum such that (p1, p2) and (x, y) have no intersection. As a gate to any spectrum via the apply command, the gate is true whenever any pair of parameters that make up the gate lie under the band.

GammaContour gc Yes Closed polygon of points drawn on a 2-d spectrum. The lines may cross abitrarily many times, and the 'odd-crossing' rule is used to determine the interior of the shape. Applied to a 1-d spectrum, for all pairs of parameters in the interior of the polygon, increments for all parameters in the spectrum which are not in the pair.

This gate has identical meaning to the gamma band but parameter pairs must lie within the contour (according to the odd crossing rule) to make the gate true.

GammaSlice gs Yes A lower and upper limit set on a spectrum.. Applied as a fold to a 1-d spectrum, for all parameters within the bounds of the upper and lower limits, increments for all other parameters in the spectrum.

Applied as a gate to any spectrum, via apply, is true whenever any parameter in the gate definition is in the slice.

Applied as a fold to a 2-d spectrum, for all parameters within the bounds of the upper and lower limits, increments for all pairs of parameters in the spectrum such that neither parameter in the pair is in the slice.

Applied as a gate via apply is true whenever any parameter in the gate is inside the slice.

Not - No Gate value is the complement of the value of the dependent gate.
Or + No Gate is true if any of the constituent gates is true.
Slice s Yes A lower and upper limit set on a single parameter (1-d spectrum).  True if the point is in the interval [low,high).
True T Yes Gate which is always made.
Mask Equal em Yes Gate returns true whenever the parameter is equal to a user defined bit pattern.
Mask And am Yes Gate returns true whenever the parameter value bitwise anded with the user defined bit pattern is equal to the user defined bit pattern.
Not Mask Equal nm Yes Gate returns true whenever the parameter value bitwise anded with the bitwise not of the user defined bit pattern equals the bitwise not of the user defined bit pattern.

Gate Descriptions

The contents of the gate description depend on the gate type.  In general,  gate descriptions are formatted as a Tcl list.  In some cases, elements of the list may themselves be sublists.  For primitive gates, in general, the description will contain one or a pair of parameters on which the gate was drawn, and a list of points.  The points are in parameter coordinates, not the coordinates of some spectrum of the parameter(s).  For compound gates the description will contain a list of the dependent gates.  Examples are given below:

gate And      * {Gate2 Gate3 Gate4}     
gate ABand  b { XParameter YParameter { {10 10} {150 150} {1072 15} }}
gate ACont  c { XParameter YParameter { {10 10 } {200 10} {200 200} {10 200}}}
gate AB2C c2band { Band1 Band2 }
gate FALSE F
gate GammaBand     gb { { {200 200} {300 400}} gamma1 gamma2 gamma3}
gate GammaContour gc { { {200 300} {200 400} {400 400} {400 300}} {gamma1 gamma2 gamma3}}
gate GammaSlice      gs { {400 600} gamma1 gamma2 gamma 3}
gate NotAband - {ABand}                                  ;# Can be only one gate.
gate ABorAC  + {ABand AContour}                   ;# Can be any number of gates.
gate Slice         s {Parameter {100 157}}
gate TRUE      T
gate EqualMask em {Parameter 0x00}
gate AndMask am {Parameter 0x00}
gate NotMask nm {Parameter 0x00000000}

Xamine and Primitive Gates

The Slice, Band, and Contour gates correspond exactly to the Cut, Band and Contour gates which can be accepted through Xamine.  SpecTcl establishes a handler for these gates so that Xamine can be used to enter them.  The components of the gate are taken as follows:

The Xamine contour acceptance dialog box below clarifies this:

Top

gate -list [-byid]

Produces a list of the gates sorted either by name or gate id.  The gate id is a number assigned to the gate by SpecTcl which has essentially no meaning from SpecTcl's point of view.  The gate -list command produces a Tcl list.  Each element of the list is a gate description sub-list.  Gate description sub-lists contain (in order):

The gate description depends on the type of gate:

Gate Type Description
And List of gates and-ed together to create this gate.
band, contour, contour from 2bands List containing:
  • List of parameters involved in the gate.
  • List of point coordinates making up the band.
False, True Empty list
gammaband, gammacontour List containing:
  • List of point coordinates making up the band.
  • List of parameters to check on the gate.
gammaslice List containing:
  • List of lower and upper limits of the gate.
  • List of parameters to check the gate on.
Not Name of the gate which is complemented.
Or List of gates which are or-ed together to create this gate.
Slice List containing the name of the parameter on which the gate is created and a list containing the lower and upper limits of the gate.
Mask Equal First element of the list is the parameter name and the second element is the mask bit pattern
Mask And First element of the list is the parameter name and the second element is the mask bit pattern
Mask Not First element of the list is the parameter name and the second element is a 32 bit mask pattern

Top

gate -delete [-id] Gate1 [Gate2 ...]

Deletes the gates listed in the tail of the command.  If the -id switch is supplied, then the gates must be specified by id number.   Otherwise, gate names should be specified. 

If a spectrum has this gate applied, the spectrum will not be incremented until it is either ungated or until a new apply is made for an existing gate.  You can thing of the gate -delete command as effectively replacing the gate with a FALSE with the same name.

Examples:

gate Slice         s {Parameter {100 157}} ;# Adds a cut gate.
gate -list                                                   ;# Lists the set of gates defined.
gate -delete Slice   &nbs

gate command

HH00706_.jpg (6530 bytes)

Syntax

gate name type { description }
gate -list [-byid] [pattern]
gate -delete [-id] gate1 [gate2 ...]


Last Modified: May 27, 2005 by: fox@nscl.msu.edu
Copyright NSCL 2005, All rights reserved