StdObjStream syntax

D. Adams
27jan01 1130


StdObjStream is an implementation of ObjStream. Three types of syntax are recognized.

Comments

Blank lines or lines beginning with the pound sign are treated as commments and ignored. For example:
# This is comment 1.

# This is comment 3 (blank line above is comment 2).

Symbol definitions

Symbols are defined with the syntax "synname = value". The value is read in as a string and later intepreted as required by context. For example:
ptmin = 0.5
color = red

The name-value pirs are put into a symbol table and the symbol definitions are available later in the stream. They are not available in other streams.

There are some special symbols:

Objects

Objects are specified with the following syntax:
[ objname MyClass data1=1.23 data2=$color ]
where objname is a unique object name, MyClass is the object type (class) and any number of data attributes follow. The example shows how symbols may be used to assign data values by prepending a dollar sign.

The value type is discovered by parsing the value string. The type is required to match that expected by the object creator. There is no automatic conversion between types, e.g. 123 is an INTEGER and cannot be read as a DOUBLE.

Here are an examples of the syntax for each type:

Arrays of any of the above may be defined by listing any number of values with the following syntax:

Example

# Example OBS file.

# dla 27jan01

# Display debugging messages.
OBSDEBUG = true

# Protect this file from being reread.
OBSNAME = test_electron_stream

# Include the geometry (R1, R2, ...)
OBSINCLUDE = tracker_geometry.obs

# Define the error to assign to cluster positions.
DPHI = 0.00023

# Define clusters.
[ clu1 PhiCluster    r=$R1 phi=1.234  dphi=$DPHI ]
[ clu2 PhiCluster    r=$R2 phi=1.456  dphi=$DPHI ]
[ clu3 StereoCluster r=$R3 phiz=2.447 dphiz=$DPHI ]

# Define track.
[ test_track Track clusters=( *clu1 *clu2 *clu3 ) pfit=*0 ]

# Define electron.
[ test_electron Electron has_track=true energy=22.5 region="central"
                ptrack=@test_track ]


dladams@fnal.gov