Next: About this document ...
C
C TPT - main track finding
C
C DESCRIPTION:
C Sets up corespondence between the hit id and the entry in the tphit
C table( tpt_hit_pnt), then sets up a look up tables so that hits for
C a given row & sector could be found( tpt_row_sect_pnt). Next track
C segments are found(tpt_form_segments)and extended(tpt_extend_segments)
C Final step consists of an attempt to merge reconstructed pieces of
C tracks.
C
C INPUT ARGUMENTS:
C tpar_h - header for the tptpar (tracking parameters) table
C tpar - tracking parameters table
C pad_pl_h - header for the pad_plane (pad_plane geometry) table
C pad_pl - pad_plane geometry table
C hit_h - header for the tphit (tpc hits) table
C hit - rows of the tphit table
C
C OUTPUT ARGUMENTS:
C track_h - header for the tptrack (reconstructed tracks) table
C track - rows of the tptrack table
C
C<---------------------------------------------------------------------
INTEGER FUNCTION TPT(tpar_h,tpar,pad_pl_h,pad_pl,
> hit_h,hit,track_h, track)
C
C Modified: 13-NOV-1997 by R.Bossingham
C Eliminate unused variable.
C
IMPLICIT NONE
#include "tpt.inc"
#include "tpt_pointers.inc"
#include "tpt_mxdim.inc"
#include "tpt_mxhit.inc"
C______________________________________________________________________
C Local variables
RECORD /track_pointers/ trk(mxtrack)
C
INTEGER loc_hit(tpt_mxhit)
C loc_hit - pointers to the tphit table sorted acc
C to row/sec field
INTEGER tpstart(mxrow,mxsector),tpcount(mxrow,mxsector)
C tpstart -pointer to the first hit in the row/sector
C tpcount -# of hits in a given row/sector
INTEGER tls_Index_Sort_i
C sort hits in the TPC table according to row/sec field
INTEGER tpt_row_sect_pnt
INTEGER tpt_form_segments
INTEGER tpt_extend_segments
INTEGER tpt_merge_segments
INTEGER iret !scratch integer
INTEGER i,ipass
INTEGER next_hit(tpt_mxhit),slice_loc(mxsector,mxrow,mxslic)
INTEGER slice_pnt(2,mxsector*mxrow*mxslic),last_track
REAL time_now,time_all
COMMON /CPUTIM/ time_all
REAL time_sort,time_seguv,time_seg,time_ext,time_merge
real xglobal(3), xlocal(3)
integer tgc_global_to_local,isect
C______________________________________________________________________
C initialize timing counters
time_sort = 0
time_seguv = 0
time_seg = 0
time_ext = 0
time_merge = 0
ipass=1
if(tpar(ipass).debug(1).eq.1) then
write(6,*) 'starting in the main tracking subroutine ...'
endif
C set return value to normal success
tpt = STAFCV_OK
C set counter for number of rows of good data to 0
track_h.nok = 0
C preset all the hit(i).track to 0
do i=1,hit_h.nok
hit(i).track=0
end do
if(hit_h.nok.eq.0) go to 888
c
c make sure that there is enough space in local arrays
c if not, truncate number of hits to track...
if(hit_h.nok.gt.tpt_mxhit) then
write(6,*) ' tpt local araays not big enough',hit_h.nok,tpt_mxhit
hit_h.nok=tpt_mxhit
endif
C Sort the TPC hits according to row/sector field
call timed(time_now)
time_all = time_all + time_now
do i=1,hit_h.nok
xglobal(1)=hit(i).x
xglobal(2)=hit(i).y
xglobal(3)=10.0
iret=tgc_global_to_local(isect,xglobal,xlocal)
if(isect.gt.12) isect=24-isect
if(isect.eq.0) isect=12
hit(i).row=isect*100+mod(hit(i).row,100)
end do
c
*************************************** and so on .......
Lanny Ray
2/20/1998