Previous: Object Resources
Up: DSPACK - Advanced Features
Next: Introduction
Previous Page: Replacing resources
Next Page: Introduction

An Example

Following is a working example using some of the features described in this guide.

User's program patrec_ds is a track finding code. The space points have been stored in a DSPACK data file. The user wants to process a number of events by reading this file - the resulting tracks should be written into a new data file.

The program requires patrec.d Object Description File shown on page . The file is read-in once before the event loop starts. dsopen and dsread are used to set-up the input and output data file. fsmark tags all required objects for output.

Additional control parameters for patrec_ds are kept in $PATREC_HOME/.dspackrc file. patrec_ds may call XGKS to produce graphics (although it does not in this example) - therefore $PATREC_HOME/.dspackrc file is set to be also used by XGKS as it's Xdefaults file.

patrec_ds .dspackrc file

:
:                                Make sure that dseval doesn't waste time on this
:
dspack.eval.end         :
:
:                                Tell patrec that there it should not read data
:
dspack.patrec.setenv    : DSPACK_INPUT = NONE
:
:                     Make this file to be used instead of .Xdefaults by X tools
:
dspack.*.setenv         : XENVIRONMENT = .dspackrc
:
:                                Set DSPACK server environment for everybody
:
dspack.*.setenv         : DSPACK_FILES = /usr/spool/sockets/dspack
dspack.*.setenv         : DSPACK_SERVER = server-rz

: : Tell patrec to process one event only : dspack.patrec.setenv : EVENTS = 1 dspack.patrec.setenv : SKIP = 0 : : This is for XGKS - it will read this file because $XENVIRONMENT says so : Patrec tells XGKS to use name 'patrec' for X widgets. : patrec.geometry : 850x700+10+10 patrec.Background : DarkGreen

patrec_ds produces an object rtrack_vt2_t. In the example below the EXEC driver is programmed to call patrec_ds and rtrack_vt2_t is set to have appropriate class and type. point_vt2_t is an object needed by patrec_ds and kept in the input file. It's class is set so that dsinput is called when the request for point_vt2_t is made.

Therefore the event loop only needs to call dswrite - it will try to write rtrack_vt2_t - this will call patrec_ds which requires point_vt2_t - so dsinput is called. The event memory is cleared after each event with dsclear.

dseval is used for monitoring (and demonstration) purposes. patrec_ds calculates a first guess of the primary vertex position. This number with it's error is printed for each event. Additionally a new object v1 is defined here which is programmed to calculate the mean value and error of vertex position over the number of events. The TYPE of this object is set to 2, so that it is re-calculated every time it is accessed - the object is stored in section 2 - so that it survives between events. It is accessed exactly once per event - by dseval in the event loop. After the event loop it's TYPE is changed to 0 to enable us to use it without re-calculation (as you can see from the expression - each re-calculation changes the value of the object in this case).

It is assummed that the DSPACK server is already running.

Example of using EXEC class

#!/bin/csh
# 
#   ********************************************************************
#   *                                                                  *
#$$ *   patrec.sh  C shell script to run patrec                        *
#   *   This is a simple example of using DSPACK tools with            *
#   *   Object Oriented approach.                                      *
#   *   The event loop contains only DSWRITE and DSCLEAR,              *
#   *   PATREC as well as DSREAD are triggered by FILL messages        *
#   *   which are sent to objects.                                     *
#   *   All this is done using a single CLASS - EXEC                   *
#   *                                                                  *
#   *   Ryszard Zybert    Jun 17 20:26:46 1994                         *
#   ********************************************************************
#
# 
#   ********************************************************************
#   *                                                                  *
#$$ *   patrec.sh  Tools used:                                         *
#   *                                                                  *
#   *   dsdd - read object description files                           *
#   *   dsopen - open DSPACK data files (input and output)             *
#   *   dsread - read one record from input file                       *
#   *   dswrite - write one event to output file                       *
#   *   dseval - evaluate and return the value of a DSPACK object      *
#   *   fsmark - mark an object for output                             *
#   *   dsclear - clear event data (section 1 of DSPACK)               *
#   *   dsclose - close data file                                      *
#   *                                                                  *
#   *   patrec_ds is the tracking program:                             *
#   *             uses point_vt2_t                                     *
#   *             produces rtrack_vt2_t                                *
#   *                                                                  *
#   *   Both patrec_ds and dsread are called automatically their       *
#   *   objects are requested                                          *
#   *                                                                  *
#   ********************************************************************
# 
set nevnts = $1
set fname_in   = $2
set fname_out  = $3

# # Read object definition file and PATREC parameters # dsdd $PATREC_HOME/par/patrec.d

# # Open data file and read the parameter block # dsopen $fname_in dsread

# # Define more objects and classes # dsdd <<.end

INIT .exec(1) methods(1).command = dsread >/dev/null methods(1).messages = FILL END INIT

INIT .exec(2) methods(1).command = $PATREC_HOME/bin/patrec_ds >/dev/null methods(1).messages = FILL END INIT

DEFINE tracks I 1 number_of_tracks n END DEFINE

CALC tracks.n = NENT(rtrack_vt2_t)

RECLASS rtrack_vt2_t -CLASS exec -TYPE 2 RECLASS point_vt2_t -CLASS exec -TYPE 1

# # Define extra calculator stuff to get mean vertex position # Note - -TYPE 2 for calculator objects means they are recalculated # every time they are accessed.... careful!! #

DEFINE v1 S 2 .REAL4 sum .REAL4 ss .INT4 n .REAL4 z .REAL4 dz END DEFINE

CALC v1.sum = v1.sum + pr_v1_guess.z CALC v1.ss = v1.ss + pr_v1_guess.dz^2 CALC v1.n = v1.n + 1 CALC v1.z = v1.sum/v1.n CALC v1.dz = SQRT(v1.ss)/v1.n

RECLASS v1 -CLASS calc -TYPE 2

INIT v1 sum = 0.0 ss = 0.0 n = 0 END INIT

.end

# # Open output file # dsopen $fname_out -o

# # Mark objects for output # fsmark rtrack_vt2_t fsmark event_mc_t fsmark vertex_mc_t fsmark track_mc_t fsmark ref_vt2_mc_t fsmark event_t fsmark point_vt2_t fsmark vt2_t

setenv DSPACKRC $PATREC_HOME/.dspackrc setenv DSPACK_MODE 1

# # Loop over events # # dseval calls don't take part in the processing - they are here # simply to echo values of some objects for monitoring # It should not be over-done - it keeps server busy. # However - evaluating v1.z is important - otherwise the sums whould # not be calculated. # echo "Starting event loop"

set n = 0 while ( $n < $nevnts ) dsclear dswrite >/dev/null @ n++

echo "Event" `dseval 'event_t.n_event'`": " `dseval 'tracks.n'` "tracks, " \(\backslash\) "Vertex: " `dseval 'pr_v1_guess.z'`" +/-"\(\backslash\) `dseval 'pr_v1_guess.dz'`", mean: "\(\backslash\) `dseval 'v1.z'` end

# # Close data files # dsclose dsclose -o

# # Have a look at mean vertex - make sure it does not recalculate!! # Setting -TYPE 0 for v1 stops it from responding to REFILL message. # dsdd <<.end RECLASS v1 -CLASS calc -TYPE 0 .end

echo "Mean vertex over "`dseval 'v1.n'`" events: "\(\backslash\) `dseval 'v1.z'`" +/- "`dseval 'v1.dz'`

Here is an example interactive session using the shell script above:

Interactive session with DSPACK tools

np_rhi/data/tmp>{\bf dsserver&}
[1] 964
np_rhi/data/tmp>{\bf patrec.sh 10 e50t50.ds p_e10t50.ds}
                                                         {\bf (dsdd starts)}
*****************************************************
*   This is $HOME/.dspackrc file                    *
*****************************************************
DSPACK 1.128, 22 Jun 1994
######################### patrec parameter file ######################
                                                          (long listing removed)
######################### end of patrec parameter file ###############

{\bf (dsopen starts)} ***************************************************** * This is $HOME/.dspackrc file * ***************************************************** DSPACK 1.128, 22 Jun 1994 Read definitions /* * DSPACK c header file generated from a data file * * DSPACK file created on 29 May 1994 at 19:46 * By DSPACK 1.077, 25 May 1994 * Following objects found on input 1 * .api_def .event_mc_t event_mc_t .vertex_mc_t * vertex_mc_t .track_mc_t track_mc_t .ref_vt2_mc_t * ref_vt2_mc_t .event_t event_t .vt2_t * point_vt2_t .point_vt2_t rtrack_vt2_t .rtrack_vt2_t * vt2_t * * Following definitions may be used as a header * to define all necessary structures */ typedef struct api_def \{ char api_def_pack[52] \}; typedef struct event_mc_t \{ char packed[1172] \}; typedef struct vertex_mc_t \{ struct vertex_sim_mc_t *vertex_sim_p; struct vertex_mc_t *next_vertex_p; struct track_mc_t *tdaughter_p; struct track_mc_t *tparent_p; int n_daughter; int l_vertex; float z; float y; float x; \}; typedef struct ref_vt2_mc_t \{ float pz; float py; float px; float z; float y; float x; int n_row; int n_sec; \}; typedef struct track_mc_t \{ struct track_mc_t *next_track_p; struct track_sim_mc_t *track_sim_p; struct track_mc_t *next_vtrack_p; struct track_mc_t *next_daughter_p; struct track_mc_t *tdaughter_p; struct track_mc_t *tur_p; struct track_mc_t *tparent_p; struct vertex_mc_t *vstop_p; struct vertex_mc_t *vstart_p; struct ref_mtr_mc_t *ref_mtr_p; struct ref_mtl_mc_t *ref_mtl_p; struct ref_vt2_mc_t *ref_vt2_p; struct ref_vt1_mc_t *ref_vt1_p; int l_track; float charge; int id; float ptot; float pt; float y; float pz; float py; float px; \}; typedef struct event_mc_t \{ struct event_sim_mc_t *event_sim_p; struct track_mc_t *track_p; struct vertex_mc_t *vertex_p; int n_track_prim; int n_vertex; int l_vertex; float eg_version; int time; int date; int n_targ_spec_prot; int n_targ_spec_neut; int n_proj_spec_prot; int n_proj_spec_neut; float b; int m_trig; float e_lab; float target_z; float target_a; float proj_z; float proj_a; int n_event; int n_run; char eg_name[32] \}; typedef struct vertex_mc_t \{ char packed[500] \}; typedef struct track_mc_t \{ char packed[1304] \}; typedef struct ref_vt2_mc_t \{ char packed[352] \}; typedef struct event_t \{ char packed[1076] \}; typedef struct point_vt2_t \{ struct point_vt2_t *next_trkpoint_p; struct point_vt2_t *next_point_p; struct track_mc_t *track_mc_p; int iflag; int max_adc; float charge; float var_y; float var_x; float covar[6]; float z; float y; float x; int n_row; int n_sec; \}; typedef struct rtrack_vt2_t \{ struct rtrack_vt2_t *next_segment_p; struct rtrack_vt2_t *next_rtrack_p; struct track_vt2_t *track_p; struct point_vt2_t *point_p; struct track_mc_t *track_mc_p; int iflag; float var_tmean; float tmean_charge; float pchi2; int n_point; float z_last; float y_last; float x_last; float z_first; float y_first; float x_first; float covar[15]; float phi; float tanl; float qpxz; float z; float y; float x; \}; typedef struct vt2_t \{ struct svertex_vt2_t *svertex_p; struct mvertex_vt2_t *mvertex_p; struct rtrack_vt2_t *rtrack_p; struct point_vt2_t *point_p; struct slow_vt2_t *slowcontrol_p; float clock_to_trigger; float tslice; float delay; \}; typedef struct event_t \{ struct event_mc_t *event_mc_p; struct dss_t *dss_p; struct beam_t *beam_p; struct ring_t *ring_p; struct veto_t *veto_p; struct tofr_t *tofr_p; struct tofl_t *tofl_p; struct mtr_t *mtr_p; struct mtl_t *mtl_p; struct vt2_t *vt2_p; struct vt1_t *vt1_p; struct bos_t *bos_p; struct rundb_t *rundb_p; int time; int date; int mc_flag; int mask_trig; float target_mass; float proj_mass; float momentum; int n_event; int n_run; \}; typedef struct vt2_t \{ char packed[500] \}; typedef struct point_vt2_t \{ char packed[640] \}; typedef struct rtrack_vt2_t \{ char packed[1012] \};

{\bf (dsread starts)} ***************************************************** * This is $HOME/.dspackrc file * ***************************************************** DSPACK 1.128, 22 Jun 1994 Read record type: 2

{\bf (dsdd starts)} ***************************************************** * This is $HOME/.dspackrc file * ***************************************************** DSPACK 1.128, 22 Jun 1994

INIT .exec(1) methods(1).command = dsread >/dev/null methods(1).messages = FILL END INIT

INIT .exec(2) methods(1).command = /data/tmp/patrec/bin/patrec_ds >/dev/null methods(1).messages = FILL END INIT

DEFINE tracks I 1 number_of_tracks n END DEFINE

CALC tracks.n = NENT(rtrack_vt2_t)

RECLASS rtrack_vt2_t -CLASS exec -TYPE 2 RECLASS point_vt2_t -CLASS exec -TYPE 1

# # Define extra calculator stuff to get mean vertex position # Note - -TYPE 2 for calculator objects means they are recalculated # every time they are accessed.... careful!! #

DEFINE v1 S 2 .REAL4 sum .REAL4 ss .INT4 n .REAL4 z .REAL4 dz END DEFINE

CALC v1.sum = v1.sum + pr_v1_guess.z CALC v1.ss = v1.ss + pr_v1_guess.dz^2 CALC v1.n = v1.n + 1 CALC v1.z = v1.sum/v1.n CALC v1.dz = SQRT(v1.ss)/v1.n

RECLASS v1 -CLASS calc -TYPE 2

INIT v1 sum = 0.0 ss = 0.0 n = 0 END INIT

{\bf (dsopen -o starts)} ***************************************************** * This is $HOME/.dspackrc file * ***************************************************** DSPACK 1.128, 22 Jun 1994

{\bf (fsmark)} rtrack_vt2_t marked for output 1 event_mc_t marked for output 1 vertex_mc_t marked for output 1 track_mc_t marked for output 1 ref_vt2_mc_t marked for output 1 event_t marked for output 1 point_vt2_t marked for output 1 vt2_t marked for output 1

Starting event loop Event 1: 52 tracks, Vertex: -542.457 +/- 9.76601, mean: -542.457 Event 2: 54 tracks, Vertex: -539.575 +/- 11.1741, mean: -541.016 Event 3: 54 tracks, Vertex: -542.869 +/- 11.7035, mean: -541.633 Event 4: 52 tracks, Vertex: -542.335 +/- 11.6563, mean: -541.809 Event 5: 51 tracks, Vertex: -531.569 +/- 14.2423, mean: -539.761 Event 6: 51 tracks, Vertex: -540.852 +/- 8.69483, mean: -539.943 Event 7: 53 tracks, Vertex: -539.459 +/- 13.6912, mean: -539.874 Event 8: 54 tracks, Vertex: -535.783 +/- 14.0949, mean: -539.362 Event 9: 50 tracks, Vertex: -539.109 +/- 13.6300, mean: -539.334 Event 10: 53 tracks, Vertex: -543.064 +/- 14.7827, mean: -539.707

DSPACK 1.128, 22 Jun 1994 (dsclose) DSPACK 1.128, 22 Jun 1994 (dsclose -o) DSPACK 1.128, 22 Jun 1994 (dsdd) RECLASS v1 -CLASS calc -TYPE 0 Mean vertex over 10 events: -539.707 +/- 3.95214

np_rhi/data/tmp>{\bf dsdb} *** dsdb - DSPACK interactive debugger *** DSPACK 1.128, 22 Jun 1994 dsdb> ls -l Name Type Id Sect Size Items Nent Bytes POINT R 18 0 3 3 0 0 vt2_hit S 19 1 6 4 2902 69648 vt2_hitp I 20 1 1 1 2902 11608 VTP2_SECTORS S 21 2 11 11 1 44 VTP2_DIMS S 22 2 5 5 1 20 VTP2_L3_PAR R 23 2 2 2 1 8 VTP2_L4_PAR R 24 2 2 2 1 8 VTP2_L5_PAR R 25 2 2 2 1 8 VTP2_PR_PAR M 26 2 4 4 1 16 VTP2_EX_PAR M 27 2 4 4 1 16 VTP2_H_CUT R 28 2 2 2 1 8 VTP2_YBIN I 29 2 1 1 1 4 VTP2_V1_PAR M 30 2 4 4 1 16 pr_v1_guess M 31 1 3 3 1 12 event_mc_t S 45 1 30 23 1 120 vertex_mc_t S 47 1 9 9 1 36 track_mc_t S 49 1 22 22 50 4400 ref_vt2_mc_t S 51 1 8 8 50 1600 event_t S 53 1 22 22 1 88 point_vt2_t S 55 1 19 14 2902 220552 rtrack_vt2_t S 57 1 37 23 53 7844 vt2_t S 59 1 8 8 1 32 tracks I 60 1 1 1 1 4 v1 S 61 2 5 5 1 20 helix M 72 0 9 9 0 0 pr_track S 73 1 12 4 53 2544 pr_hits S 74 1 72 1 53 15264 pr_time R 75 1 1 1 1 4 pr_res S 76 1 144 2 53 30528

dsdb> {\bf rtrack_vt2_t} Definition of data set: rtrack_vt2_t (rtra) ID: 57 Type: Structure Section: 1 Machine words: 37 Items: 23 1 *next_segment_p rtrack_vt2_t 2 *next_rtrack_p rtrack_vt2_t 3 *track_p track_vt2_t 4 *point_p point_vt2_t 5 *track_mc_p track_mc_t 6 iflag .INT4 7 var_tmean .REAL4 8 tmean_charge .REAL4 9 pchi2 .REAL4 10 n_point .INT4 11 z_last .REAL4 12 y_last .REAL4 13 x_last .REAL4 14 z_first .REAL4 15 y_first .REAL4 16 x_first .REAL4 17 covar(15) .REAL4 18 phi .REAL4 19 tanl .REAL4 20 qpxz .REAL4 21 z .REAL4 22 y .REAL4 23 x .REAL4

typedef struct vertex_mc_t \{ struct vertex_sim_mc_t *vertex_sim_p; struct vertex_mc_t *next_vertex_p; struct track_mc_t *tdaughter_p; struct track_mc_t *tparent_p; int n_daughter; int l_vertex; float z; float y; float x; \}; typedef struct ref_vt2_mc_t \{ float pz; float py; float px; float z; float y; float x; int n_row; int n_sec; \}; typedef struct track_mc_t \{ struct track_mc_t *next_track_p; struct track_sim_mc_t *track_sim_p; struct track_mc_t *next_vtrack_p; struct track_mc_t *next_daughter_p; struct track_mc_t *tdaughter_p; struct track_mc_t *tur_p; struct track_mc_t *tparent_p; struct vertex_mc_t *vstop_p; struct vertex_mc_t *vstart_p; struct ref_mtr_mc_t *ref_mtr_p; struct ref_mtl_mc_t *ref_mtl_p; struct ref_vt2_mc_t *ref_vt2_p; struct ref_vt1_mc_t *ref_vt1_p; int l_track; float charge; int id; float ptot; float pt; float y; float pz; float py; float px; \}; typedef struct point_vt2_t \{ struct point_vt2_t *next_trkpoint_p; struct point_vt2_t *next_point_p; struct track_mc_t *track_mc_p; int iflag; int max_adc; float charge; float var_y; float var_x; float covar[6]; float z; float y; float x; int n_row; int n_sec; \}; typedef struct rtrack_vt2_t \{ struct rtrack_vt2_t *next_segment_p; struct rtrack_vt2_t *next_rtrack_p; struct track_vt2_t *track_p; struct point_vt2_t *point_p; struct track_mc_t *track_mc_p; int iflag; float var_tmean; float tmean_charge; float pchi2; int n_point; float z_last; float y_last; float x_last; float z_first; float y_first; float x_first; float covar[15]; float phi; float tanl; float qpxz; float z; float y; float x; \}; dsdb> {\bf *rtrack_vt2_t(10:11)} Data set: rtrack_vt2_t(10:11) Entry: 10 Type: Structure (at: -287403752) 1 *next_segment_p Pointer : 0 2 *next_rtrack_p Pointer : -287403604 3 *track_p Pointer : 0 4 *point_p Pointer : -287653192 5 *track_mc_p Pointer : 0 6 iflag Integer : 0 7 var_tmean Real : 0. 8 tmean_charge Real : 0. 9 pchi2 Real : 0. 10 n_point Integer : 46 11 z_last Real : 111.000 12 y_last Real : -6.42164 13 x_last Real : 70.4347 14 z_first Real : -28.0000 15 y_first Real : -5.00439 16 x_first Real : 13.2499 17 covar(1) Real : 0. 17 covar(2) Real : 0. 17 covar(3) Real : 0. 17 covar(4) Real : 0. 17 covar(5) Real : 0. 17 covar(6) Real : 0. 17 covar(7) Real : 0. 17 covar(8) Real : 0. 17 covar(9) Real : 0. 17 covar(10) Real : 0. 17 covar(11) Real : 0. 17 covar(12) Real : 0. 17 covar(13) Real : 0. 17 covar(14) Real : 0. 17 covar(15) Real : 0. 18 phi Real : 0. 19 tanl Real : 0. 20 qpxz Real : 0. 21 z Real : 0. 22 y Real : 0. 23 x Real : 0. Entry: 11 Type: Structure (at: -287403604) 1 *next_segment_p Pointer : 0 2 *next_rtrack_p Pointer : -287403456 3 *track_p Pointer : 0 4 *point_p Pointer : -287595584 5 *track_mc_p Pointer : 0 6 iflag Integer : 0 7 var_tmean Real : 0. 8 tmean_charge Real : 0. 9 pchi2 Real : 0. 10 n_point Integer : 24 11 z_last Real : 111.000 12 y_last Real : -2.66645 13 x_last Real : 31.4202 14 z_first Real : -111.000 15 y_first Real : -1.78658 16 x_first Real : 16.8726 17 covar(1) Real : 0. 17 covar(2) Real : 0. 17 covar(3) Real : 0. 17 covar(4) Real : 0. 17 covar(5) Real : 0. 17 covar(6) Real : 0. 17 covar(7) Real : 0. 17 covar(8) Real : 0. 17 covar(9) Real : 0. 17 covar(10) Real : 0. 17 covar(11) Real : 0. 17 covar(12) Real : 0. 17 covar(13) Real : 0. 17 covar(14) Real : 0. 17 covar(15) Real : 0. 18 phi Real : 0. 19 tanl Real : 0. 20 qpxz Real : 0. 21 z Real : 0. 22 y Real : 0. 23 x Real : 0. dsdb> {\bf *rtrack_vt2_t.y_first} 1 rtrack_vt2_t.y_first = -27.60115 2 rtrack_vt2_t.y_first = -14.75850 3 rtrack_vt2_t.y_first = -11.03135 4 rtrack_vt2_t.y_first = -9.14805 5 rtrack_vt2_t.y_first = -8.13782 6 rtrack_vt2_t.y_first = -7.49848 7 rtrack_vt2_t.y_first = -7.28085 8 rtrack_vt2_t.y_first = -6.28944 9 rtrack_vt2_t.y_first = -4.25609 10 rtrack_vt2_t.y_first = -5.00439 11 rtrack_vt2_t.y_first = -1.78658 ... (long listing removed) 52 rtrack_vt2_t.y_first = -1.54501 53 rtrack_vt2_t.y_first = -12.39243 dsdb> {\bf indexes} Showing indexes dsdb> {\bf *rtrack_vt2_t(11)} Data set: rtrack_vt2_t(11) Entry: 11 Type: Structure (at: -287403604) 1 *next_segment_p Index : 0 2 *next_rtrack_p Index : 12 3 *track_p Index : 0 4 *point_p Index : 2209 5 *track_mc_p Index : 0 6 iflag Integer : 0 7 var_tmean Real : 0. 8 tmean_charge Real : 0. 9 pchi2 Real : 0. 10 n_point Integer : 24 11 z_last Real : 111.000 12 y_last Real : -2.66645 13 x_last Real : 31.4202 14 z_first Real : -111.000 15 y_first Real : -1.78658 16 x_first Real : 16.8726 17 covar(1) Real : 0. 17 covar(2) Real : 0. 17 covar(3) Real : 0. 17 covar(4) Real : 0. 17 covar(5) Real : 0. 17 covar(6) Real : 0. 17 covar(7) Real : 0. 17 covar(8) Real : 0. 17 covar(9) Real : 0. 17 covar(10) Real : 0. 17 covar(11) Real : 0. 17 covar(12) Real : 0. 17 covar(13) Real : 0. 17 covar(14) Real : 0. 17 covar(15) Real : 0. 18 phi Real : 0. 19 tanl Real : 0. 20 qpxz Real : 0. 21 z Real : 0. 22 y Real : 0. 23 x Real : 0. dsdb> {\bf *point_vt2_t(2209)} Data set: point_vt2_t(2209) Entry: 2209 Type: Structure (at: -287595584) 1 *next_trkpoint_p Index : 2258 2 *next_point_p Index : 2210 3 *track_mc_p Index : 39 4 iflag Integer : 0 5 max_adc Integer : 0 6 charge Real : 0. 7 var_y Real : 0. 8 var_x Real : 0. 9 covar(1) Real : 5.58987E-04 9 covar(2) Real : 0. 9 covar(3) Real : 6.25000E-04 9 covar(4) Real : 0. 9 covar(5) Real : 0. 9 covar(6) Real : 0. 10 z Real : -111.000 11 y Real : -1.78658 12 x Real : 16.8726 13 n_row Integer : 1 14 n_sec Integer : 4 dsdb> pointers Showing pointers dsdb> *point_vt2_t(2209) Data set: point_vt2_t(2209) Entry: 2209 Type: Structure (at: -287595584) 1 *next_trkpoint_p Pointer : -287591860 2 *next_point_p Pointer : -287595508 3 *track_mc_p Pointer : -287766292 4 iflag Integer : 0 5 max_adc Integer : 0 6 charge Real : 0. 7 var_y Real : 0. 8 var_x Real : 0. 9 covar(1) Real : 5.58987E-04 9 covar(2) Real : 0. 9 covar(3) Real : 6.25000E-04 9 covar(4) Real : 0. 9 covar(5) Real : 0. 9 covar(6) Real : 0. 10 z Real : -111.000 11 y Real : -1.78658 12 x Real : 16.8726 13 n_row Integer : 1 14 n_sec Integer : 4 dsdb> {\bf v1} v1.sum = v1.sum + pr_v1_guess.z v1.ss = v1.ss + pr_v1_guess.dz^2 v1.n = v1.n + 1 v1.z = v1.sum/v1.n v1.dz = SQRT(v1.ss)/v1.n Definition of data set: v1 (v1 ) ID: 61 Type: Structure Section: 2 Machine words: 5 Items: 5 1 sum .REAL4 2 ss .REAL4 3 n .INT4 4 z .REAL4 5 dz .REAL4

typedef struct v1 \{ float sum; float ss; int n; float z; float dz; \}; dsdb> {\bf *v1} Data set: v1 Entry: 1 Type: Structure (at: -279883728) 1 sum Real : -5397.07 2 ss Real : 1561.94 3 n Integer : 10 4 z Real : -539.707 5 dz Real : 3.95214 dsdb> {\bf quit}



Previous: Object Resources
Up: DSPACK - Advanced Features
Next: Introduction
Previous Page: Replacing resources
Next Page: Introduction

wwwd@na49
Fri Nov 4 23:36:02 MET 1994