From: Art Olin <olin@triumf.ca>
Date: Thu, 8 Jul 1999 11:50:17 -0700 (PDT)
To: e614 software list <E614Software@relay.phys.ualberta.ca>
Subject: Data structures

Here are the data structures that I have come up with after extensive
consultation. The arrangement is slightly different than the f77 version, but 
it envisions that the data will be processed through the pattern recognition
and tracking routines into different sublists that will be defined by
index arrays. After investigating the alternatives I've concluded that
dynamic linked lists were clearly too inefficient, while static linked
lists add no advantages but considerable complexity. 

From a particular tdc value, links within the structure
give access to all the wire geometry information information,  calculated
hit positions and multiplicities. The same information can be accessed
through wire and plane numbers. Notice that the wire and plane numbers
are not explicitly in the data structure as I believe they are redundant
information. However, if necessary they can be added back.

The basic data types are dc_tdc_type, dc_wires_type (in Maher's posting).
and dc_hits_type. The dc_pt_type will be refined in working through the
tracking code. Other structures are sketched to show how they might
be linked to these structures.

The tdc data will be stored in the dc_tdc and dc_hits arrays using
the tdcunp routines. The dc_wire data is filled by dc_setup. We still
have to work out how the pc information is to be integrated into this
scheme.

==============================================================================

!Data structures for tdc information and related wire and hit point parameters
  TYPE dc_tdc_type   !contains tdc information for all hit wires
     REAL(R4)::time,width     !TDC information
     TYPE(dc_wires_type),POINTER::wire  !link  to associated wire,plane information
                                  !Equivalent to wire, plane numbers
     TYPE(dc_hit_type),POINTER::hit   !link to wire hit counts
     TYPE(dc_pt_type),POINTER::pt      !link to hit position, angle, STR values
  END TYPE dc_tdc_type

  !This structure is to be used for the storage of information calculated
  !during the tracking phase and will be defined by people writing this code.
  !It is included here so that the pointer linking this information to the
  !hit can be defined.
  TYPE dc_pt_type     !Contains information for calculation of hit position
     REAL(R4)::strUV,  & !distance from wire for track normal to plane  &
        strZ,      & !distance from wire for track parallel to plane 
        angle,uv,z
  END TYPE dc_pt_type

! This structure is needed to define an array of pointers to the tdc info.
  TYPE dc_ptdc_type
     TYPE(dc_tdc_type),POINTER::tdc
  END TYPE dc_ptdc_type

  !Indexed structure for wire information
  !This structure is needed to define links from wire/plane to hits on that 
  !wire/plane
  !The ability to access the hits through the wire and plane number is
  !included because it is possible to do so in the existing code. 
  TYPE dc_hit_type
     INTEGER(I4)::ithits     !  Number of hits on this wire
     TYPE(dc_ptdc_type)::P(dc_mhits) !Link to the tdc tdc values 
     !This is included so dc_wires(wire,plane)%P%tdc(tdc)%time  equivalent
     ! to dc_ttdc(wire,plane,tdc)
   END TYPE dc_hit_type

  !Instantiate tdc arrays 
  TYPE(dc_tdc_type),TARGET,DIMENSION(dc_mngw)::dc_tdc   !tdc hits array
  TYPE (dc_hit_type),TARGET,DIMENSION(max_wires_d,max_planes_d)::dc_hit
  INTEGER(I4)::dc_ihits     !Total # of tdcs

  ! These suggested structures could be used in the tracking. They need to
  !be defined as this part of the code is written. 
  TYPE helix_par_type
     REAL(R4)::x0,y0 ,phi0  ! position and phase at z=0 
     REAL(R4)::radius,dip     ! helix radius and dip angle
  END TYPE helix_par_type
  !Data structure for track information
  ! Array of pointers to the hit point information
  TYPE dc_ptr_type
     TYPE(dc_pt_type),POINTER::hit
  END TYPE dc_ptr_type
  TYPE track_type
     INTEGER(I4)::nhit
     TYPE(dc_PTR_type)::P(4*MAX_PLANES_D)
     LOGICAL ::LR
     TYPE(helix_par_type)::helix
  END TYPE track_type




Data structures / Art Olin

Created for the The Center for Subatomic Research E614 Project Projects Page.
Created by The CoCoBoard.