GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EFC / dev > ggfc / rhel6-64


Interface   Data Structures   File List   Data Fields   Globals  

ATF_filter.h File Reference

Defines the interface to implement the Acd/Tkr Fast filter. More...


Defines

#define ATF_FILTER_PRINTF(_args)
 Debugging macro -- activated by defining ATF_TKRVETO_PRINT.

Functions

static __inline int ATF__filterSideMasksGet (int start, int length)
 Returns the list of ACD tiles associated with a side exiting track.
static __inline int ATF__filterTop (int tower, int start, int acd_top)
 Vetos an event based on whether the track, as determined by the layer bit masks, is associated with an ACD tile.
static __inline int ATF__filterSides (int tower, int tower_mask, int start, int length, int xm_candidates, int xm, int xp_candidates, int xp, int ym_candidates, int ym, int yp_candidates, int yp)
 Looks for a ACD coincidence with a side exiting track.


Detailed Description

Defines the interface to implement the Acd/Tkr Fast filter.

Author:
JJRussell - russell@slac.stanford.edu

    CVS $Id: ATF_filter.h,v 1.2 2005/11/22 02:32:07 russell Exp $

Function Documentation

static __inline int ATF__filterSideMasksGet ( int  start,
int  length 
) [static]

Returns the list of ACD tiles associated with a side exiting track.

Returns:
A bit mask representing the list of ACD tiles associated with a track of the specified length and starting point exiting the side of the specified tower.
Parameters:
start The starting layer of the track (0 is closest to the ACD top tiles).
length The length of the track, in layers
While the list of ACD tiles associated a track exiting the top of tower can be determined algorithmically, unfortunately this is not the case for a side exiting track. The only recourse is to build a lookup table.
However, building a straight lookup table based on the tower, the track's starting point and its length, would be prohibitively large, ensuring that it will never by cached. Therefore, a combination of a lookup table and algorithm is used to form the mask.
The association is only in the vertical direction for the lowest numbered corner tower. The routine assumes the caller will adjust the mask based on the tower number and orientation. This last clause is why this routine cannot produce the correct tower mask based solely on the tower number. The corner towers have two different masks, for the two faces that are exposed.

Referenced by ATF__filterSides().

static int ATF__filterSides ( int  tower,
int  tower_mask,
int  start,
int  length,
int  xm_candidates,
int  xm,
int  xp_candidates,
int  xp,
int  ym_candidates,
int  ym,
int  yp_candidates,
int  yp 
) [static]

Looks for a ACD coincidence with a side exiting track.

Parameters:
tower The tower to be examined.
tower_mask The towers to consider, expressed as a bit mask.
start The starting layer (0 is closest to the ACD top tiles)
length The length of the coincidence. This must be a minimum of 3 layers, in keeping with the 3-in-a-row philosophy.
xm_candidates The towers to consider along the XM face.
xm The struck ACD XM face tiles.
xp_candidates The towers to consider along the XP face.
xp The struck ACD XP face tiles.
ym_candidates The towers to consider along the YM face.
ym The struck ACD YM face tiles.
yp_candidates The towers to consider along the YP face
yp The struck ACD YP face tiles.
Return values:
== 0, if no coincidence
!= 0, if have a coincidence
This routine looks for a coincidence between a side exiting track and associated ACD tiles. Only the appropriate ACD plane is consulted. In particular, inner towers are not exposed, so no ACD tile can be in coincidence. Corner towers consult both 1 X and 1 Y plane, while 'middle' towers only consult the appropriate X or Y plane. At most 2 planes may be consulted for the corner towers.

References ATF__filterSideMasksGet().

Referenced by evaluateAtf().

static __inline int ATF__filterTop ( int  tower,
int  start,
int  acd_top 
) [static]

Vetos an event based on whether the track, as determined by the layer bit masks, is associated with an ACD tile.

Returns:
The subset of the bits in acd_top that are matched for this tower. If 0, none match.
Parameters:
tower The tower number being examined
start Starting layer of the track
acd_top Bit mask of which ACD tiles are hit in the top plane
The decision to keep or pitch the event is based on whether the X/Y layer OR trigger masks align with an appropriate ACD tile. The tracker layer masks have been examined, producing a candidate tower.
If the coincidence began in the top layer, the top plane of ACD tiles are examined for a coincidence. Since the resolution is crude, the coincidence can be any one of 4 tiles.
Warning:
The list of ACD tiles associated with a tower is determined by examining the diagram below.
  TOP COINCIDENCE PATTERN    Tower   ACD Tiles    Tower     ACD Tiles
  -----------------------    -----   ----------   -----   -----------
  ACD  20  21  22  23  24        0   0, 1, 5, 6       8   10,11,15,16
  twr    12  13  14  15          1   1, 2, 6, 7       9   11,12,16,17
  ACD  15  16  17  18  19        2   2, 3, 7, 8      10   12,13,17,18
  twr     8   9  10  11          3   3, 4, 8, 9      11   13,14,18,19
  ACD  10  11  12  13  14        4   5, 6,10,11      12   15,16,20,21
  twr     4  <5>  6   7      ->  5   6, 7,11,12 <-   13   16,17,21,22
  ACD  05  06  07  08  09        6   7, 8,12,13      14   17,18,22,23
  twr     0   1   2   3          7   8, 9,13,14      15   18,19,23,24
  ACD  00  01  02  03  04

For example, concentrate on twr 5 in the left most diagram. The shadowing ACD tiles are 6,7,11,12. Now locate tower 5 in the middle cluster of numbers and note that tower 5 is indeed associated with tiles 6,7,11,12
A little numerology shows that the proper bit mask is formed if one takes the following bit pattern
         6543210
   P = 0b1100011
  

and shifts it by P << (tower + (tower>>2)). Effectively the 'tower' term marches one along in the X dimension, and the 'tower>>2' term advances the Y dimension. One could have used a lookup table, but that is a memory reference which may or may not be cached. This calculation is a couple of simple register-to-register instructions.

References ATF_FILTER_PRINTF.

Referenced by evaluateAtf().


Generated on Wed Jan 16 13:34:52 2013 by  doxygen 1.5.8