There is also another FEATURE of the TOPFND code. This one concerns the ZVertex reported by ELEVAL. Specifically, the code looks for a track for every ELES bank. If there is a track then it fills the Z0_ELE value for this track. If there is no track, then it is filled with 999.

Now, for ELES banks it loops over all vertices and picks the vertex (class 10 or better) which is closest to Z0_ELE. However, ELES banks without tracks (Photons, some plug electrons, and certainly Forward electrons) have Z0_ELE=999, so it picks the vertex with the LARGEST VALUE OF Z. This is clearly a stupid thing to do. I propose that we do something more civilized. For simplicity, let the electron have the same vertex as the ELES bank.

So...Change From: (ELEVAL.CDF)...

c Get the Z vertex used for this electron (Close Vertex with VClass>=10)

c ----------------------------------------------------------------------

ZDIFF = 999.

EZV_ELE(K) = 999.

DO I=1,NVERT

IF(KCLASS(I).GE.10) THEN

IF(ABS(ZVERT(I)-Z0_ELE(K)).LT.ZDIFF) THEN

EZV_ELE(K) = ZVERT(I)

ZDIFF = ABS(ZVERT(I)-Z0_ELE(K))

ENDIF

ENDIF

ENDDO

To:

c Get the Z vertex used for this electron (Close Vertex with VClass>=10)
c ----------------------------------------------------------------------
ZDIFF = 999.

EZV_ELE(K) = 999.

IF (Z0_ELE(K) .GT. 990) THEN

EZV_ELE(K) = RW(INDDAT+ZV_ELE) ! Zvertex for this cluster

ZDIFF = 999.

ELSE

DO I=1,NVERT

IF(KCLASS(I).GE.10) THEN

IF(ABS(ZVERT(I)-Z0_ELE(K)).LT.ZDIFF) THEN

EZV_ELE(K) = ZVERT(I)

ZDIFF = ABS(ZVERT(I)-Z0_ELE(K))

ENDIF

ENDIF

ENDDO

ENDIF

So, all that is really screwed up are the two values of EZV_ELE and ZDIFF. Only the value of EZV_ELE is in the standard Ntuple (EZV1). This problem shows up for example in the plug electron in the eegammagammamet event.

created by Marcus Hohlmann (hohlmann@uccdf.uchicago.edu) Jun 12, 1996