GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > EFC / V4-2-2

Constituent: defc     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

TFC_prjFind.c File Reference

Finds projections in the TKR. More...

#include <stdlib.h>
#include "EDS/FFS.h"
#include "EDS/EDR_tkrUnpack.h"
#include "EDS/EDR_tkr.h"
#include "EDS/EBF_dir.h"
#include "EFC/EDM.h"
#include "EFC/TFC_prjFind.h"
#include "EFC/TFC_prjDef.h"
#include "TFC_tolerancesDef.h"
#include "TFC_geometryDef.h"
#include "PBS/TMR.h"

Include dependency graph for TFC_prjFind.c:


Data Structures

struct  _MatchVal_bf
 The return value of the various 'match' routines, expressed as bit fields. More...
union  _MatchVal
 Union of the bit field representation of the match routine's status word and a 32-bit signed integer. More...

Defines

#define REAL_TOLERANCES
#define ROUND
#define _PRINT_TITLE(_tower, _xy)
 Prints a header line if EDM is active and the print level is DEBUG or lower. otherwise is a NOP.
#define _PRINT_CHK(_lay, _top, _mid, _bot, _zex, _pred, _res, _tol)
 Prints the status of checking a middle point when finding a seed projection if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.
#define _PRINT_EXTI(_msk)
 Prints a line introducing the beginning of looking for additional layers to extend an existing projection, if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.
#define _PRINT_EXT(_lay, _top, _mid,_bot, _zex, _pred, _res, _tol)
 Prints the status of checking a point when extending a projection if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.
#define _PRINT_EXTX(_o, _lay, _a, _b, _t, _zex, _pred, _res, _tol)
 Prints the status of checking a point when extending a projection if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.
#define _PRINT_SKIP(_lay, _top, _mid,_zex, _pred, _dir)
 Prints the status of checking a point when extending a projection if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.
#define _PRINT_SPAN(_lay, _top, _mid,_pred, _dx, _maxStrip, _dir)
 Prints the status of checking a point when extending a projection to the next tower if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.
#define PRINT_EXTT(_twr, _xy, _dir)
#define _PRINT_TKRFIND_BEG(_towerId)
 Prints a header line. This is used when debugging these routines and is only defined if the symbol DEBUG is defined.
#define _PRINT_TKRFIND_END
#define EXTTWR_PRINT(_layer, _prediction, _offset, _topStrip, _dStrip)
#define x   -1
#define a   10
#define b   11
#define c   12
#define d   13
#define e   14
#define f   15
#define V(_t, _v)   ((_v != x) ? _v : _t)
#define M(_t)   ((_t != x) ? (1 << (31 - (_t))) : 0)
#define MAPXLO1(_20, _21, _22,_10, _11, _12,_00, _01, _02)
#define MAPYLO1(_20, _21, _22,_10, _11, _12,_00, _01, _02)
#define MAPXMID1(_20, _21, _22,_10, _11, _12,_00, _01, _02)
#define MAPYMID1(_20, _21, _22,_10, _11, _12,_00, _01, _02)
#define MAPXHI1(_20, _21, _22,_10, _11, _12,_00, _01, _02)
#define MAPYHI1(_20, _21, _22,_10, _11, _12,_00, _01, _02)
#define MAPSXLO(_020, _021, _022, _120, _121, _122, _220, _221, _222, _320, _321, _322,_010, _011, _012, _110, _111, _112, _210, _211, _212, _310, _311, _312,_000, _001, _002, _100, _101, _102, _200, _201, _202, _300, _301, _302)
#define MAPSXMID(_020, _021, _022, _120, _121, _122, _220, _221, _222, _320, _321, _322,_010, _011, _012, _110, _111, _112, _210, _211, _212, _310, _311, _312,_000, _001, _002, _100, _101, _102, _200, _201, _202, _300, _301, _302)
#define MAPSXHI(_020, _021, _022, _120, _121, _122, _220, _221, _222, _320, _321, _322,_010, _011, _012, _110, _111, _112, _210, _211, _212, _310, _311, _312,_000, _001, _002, _100, _101, _102, _200, _201, _202, _300, _301, _302)
#define MAPSYLO(_020, _021, _022, _120, _121, _122, _220, _221, _222, _320, _321, _322,_010, _011, _012, _110, _111, _112, _210, _211, _212, _310, _311, _312,_000, _001, _002, _100, _101, _102, _200, _201, _202, _300, _301, _302)
#define MAPSYMID(_020, _021, _022, _120, _121, _122, _220, _221, _222, _320, _321, _322,_010, _011, _012, _110, _111, _112, _210, _211, _212, _310, _311, _312,_000, _001, _002, _100, _101, _102, _200, _201, _202, _300, _301, _302)
#define MAPSYHI(_020, _021, _022, _120, _121, _122, _220, _221, _222, _320, _321, _322,_010, _011, _012, _110, _111, _112, _210, _211, _212, _310, _311, _312,_000, _001, _002, _100, _101, _102, _200, _201, _202, _300, _301, _302)
#define TOLERANCE   10
#define SWAP(_x, _y)   (_x ^= _y, _y ^= _x, _x ^= _y)
#define SEARCH_M_FOUND   0x80000000
#define SEARCH_M_ON   0x40000000
#define SEARCH_M_OFF_LO   0x20000000
#define SEARCH_M_OFF_HI   0x10000000
#define SEARCH_M_OFF   ( SEARCH_M_OFF_LO | SEARCH_M_OFF_HI )
#define AVAILABLE_M_IGNORE_OFF_TWR   (SEARCH_M_OFF >> 16)
#define AVAILABLE_M_OFF_TWR   (0x80000000 >> 2)
#define isSearchOffTwrOnGray(_s)   (_s & SEARCH_M_OFF_ON)
#define searchFoundHits(_s)   (_s < 0)
#define isSearchOnTwr(_s)   (_s & SEARCH_M_ON)
#define isSearchOffTwrLo(_s)   (_s & SEARCH_M_OFF_LO)
#define isSearchOffTwrHi(_s)   (_s & SEARCH_M_OFF_HI)
#define isSearchOffTwr(_s)   (_s & SEARCH_M_OFF)

Typedefs

typedef _MatchVal_bf MatchVal_bf
 Typedef for struct _MatchVal_bf.
typedef _MatchVal MatchVal
 Typedef for union _MatchVal.

Functions

static __inline unsigned int getToleranceFind (const unsigned char *tolerances, int layerNum)
static __inline unsigned int getToleranceExtend1 (const unsigned char *tolerances, int layerNum)
static __inline unsigned int getToleranceExtend2 (const unsigned char *tolerances, int layerNum)
static __inline int _abs (int x)
 Returns the absolute value of the signed integer x.
static __inline int project (int top, int bot, int dz)
 Predicts the middle strip address between the top and bot strip addresses.
static __inline int projectDx (int x0, int dx, int dz)
 A strict linear projection from the point p0 using a slope of dx / dz. (Note that dz is really 1/dz, thus avoiding a cycle soaking divide.).
static __inline int projectDxm (int x0, int dx, int dz)
 A strict linear projection from the point p0 using a slope of dx / dz. (Note that dz is really 1/dz, thus avoiding a cycle soaking divide.).
static __inline int projectDxp (int x0, int dx, int dz)
 A strict linear projection from the point p0 using a slope of dx / dz. (Note that dz is really 1/dz, thus avoiding a cycle soaking divide.).
static __inline int projectMid (int top, int bot, int dz)
 Another projection function, used to predict a point in a skipped layer.
static MatchVal findMatch (unsigned int tolerance, int prediction, int tgtMsk, const EDR_tkrCluster *tgtClusters, int tgtLayerNum, int aStrip, int bStrip, int dz, int order)
 Finds the best match when extending a projection down.
static __inline MatchVal findMatchTop (unsigned int tolerance, int prediction, int topMsk, const EDR_tkrCluster *topClusters, int topLayerNum, int midStrip, int botStrip, int dz)
 Finds the best match when extending a projection up.
static __inline MatchVal findMatchMid (unsigned int tolerance, int prediction, int midMsk, const EDR_tkrCluster *midClusters, int topLayerNum, int topStrip, int botStrip, int dz)
 Finds the best match when projecting to a middle layer.
static __inline MatchVal findMatchBot (unsigned int tolerance, int prediction, int midMsk, const EDR_tkrCluster *midClusters, int botLayerNum, int topStrip, int botStrip, int dz)
 Finds the best match when extending a projection down.
static __inline void storePrj (TFC_prj *prj, int twr, int topLayerNum, int offset, int topStrip, int topIdx, int midStrip, int midIdx, int botStrip, int botIdx)
 Simple routine to store the initial parameters describing a projection.
static __inline void storePrms (TFC_prj *prj, const TFC_geometryTkrZ *geoz, const TFC_geometryTkrOffset_t *offsets)
 Fills in the parameters describing the projection.
static int findPrj (TFC_prj *prj, const TFC_prj *prjmax, int towerId, int xy, int layers, int elayers, int topLayerNum, EDR_tkrLayer *top, const TFC_geometryTkrXY *geoxy, const TFC_tolerances_xy *tolerances, EDR_tkr *tkr, EDR_tkrTower *twr)
 Looks for projections in the specified tower starting at topLayerNum.
static unsigned int extendTower (TFC_prj *prjs, EDR_tkr *tkr, int tower, int xy, const TFC_geometryTkrXY *geoxy, const TFC_tolerances_xy *tolerances)
static unsigned int extendTowerDir (TFC_prj *prj, EDR_tkr *tkr, int dir, int tower, int xy, int allowed, const unsigned short int *zextends, const unsigned short int *zmids, const TFC_geometryTkrXY *geoxy, const TFC_tolerances_xy *tolerances, const unsigned int neighbor_maps[3][16])
static __inline int searchLayers (TFC_prj *prj, int dir, int tower, int layerMap, EDR_tkrLayer *bot, int botLayer, int layerCnt, int skipLimit, const unsigned short int *zextends, const unsigned short int *zmids, int topStrip, int midStrip, int maxStrip, const TFC_tolerances_xy *tolerances)
int TFC_prjsSizeof (void)
 Returns the size of a projections results record.
unsigned int TFC_prjsConstruct (TFC_prjs *projections)
 The TFC_prjs constructor.
unsigned int TFC_prjsDestruct (TFC_prjs *projections)
 The TFC_prjs destructor.
void TFC_prjsReset (TFC_prjs *projections)
 Resets the prjs structure, effectively cleaning it out for the next event.
unsigned int TFC_prjFind (TFC_prjs *projections, const TFC_geometryTkr *geo, const TFC_tolerances *tolerances, EDR_tkr *tkr, unsigned int tmsk)
int TFC_prjTowerFind (TFC_prj *prjs, const TFC_prj *prjmax, const TFC_geometryTkr *geo, const TFC_tolerances *tolerances, EDR_tkr *tkr, int towerId)
 Driver routine which looks for X and Y projections in the specified tower.
static __inline int span_cnt (int midLayer, int dir)

Variables

static const unsigned int NeighborMaps_XY [2][3][16]

Detailed Description

Finds projections in the TKR.

Author:
JJRussell - russell@slac.stanford.edu
    CVS $Id

Define Documentation

#define _PRINT_CHK _lay,
_top,
_mid,
_bot,
_zex,
_pred,
_res,
_tol   ) 
 

Value:

EDM_DEBUGPRINTF ((                                                      \
           TFC_PrjTowerFind_edm,                                          \
           " Seed %3d %4d %4d %4d %7d %4d %6d %4d %s\n",                  \
            _lay, _top, _mid, _bot, _zex, _pred, _res, _tol,              \
            _abs(_res) <= _tol ? "found" : ""))
Prints the status of checking a middle point when finding a seed projection if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.

Parameters:
_lay The layer number of the top layer being used.
_top The strip number in the top layer.
_mid The strip number in the middle layer.
_bot The strip number in the bottom layer.
_zex The zextension factor being used to predict the middle strip address.
_pred The predicted middle layer strip number.
_res The residual (actual - predicted).
_tol The tolerance used to declare a match between the actual and predicted hit number.
This macro prints a status line for every triple of strip addresses being examined as a possible seed projection.

#define _PRINT_EXT _lay,
_top,
_mid,
_bot,
_zex,
_pred,
_res,
_tol   ) 
 

Value:

EDM_DEBUGPRINTF ((TFC_PrjTowerFind_edm,                                 \
                   " Ext  %3d %4d %4d %4d %7d %4d %6d %4d %s\n",          \
                     _lay, _top, _mid, _bot, _zex, _pred, _res, _tol,     \
                     _abs(_res) <= _tol ? "extended" : ""))
Prints the status of checking a point when extending a projection if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.

Parameters:
_lay The layer number of the top layer being used.
_top The strip number in the top layer.
_mid The strip number in the middle layer.
_bot The strip number in the bottom layer.
_zex The zextension factor being used to predict the strip address in the extension layer
_pred The predicted extension layer strip number.
_res The residual (actual - predicted).
_tol The tolerance used to declare a match between the actual and predicted hit number.

#define _PRINT_EXTI _msk   ) 
 

Value:

;                                                \
  EDM_DEBUGPRINTF ((TFC_PrjTowerFind_edm,                                 \
                   " Ext %*c %8.8x\n", 43, ' ',  _msk))
Prints a line introducing the beginning of looking for additional layers to extend an existing projection, if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.

Parameters:
_msk A bit mask of the layers which have hits in them and, thus, are possible candidate extension layers.

#define _PRINT_EXTX _o,
_lay,
_a,
_b,
_t,
_zex,
_pred,
_res,
_tol   ) 
 

Value:

EDM_DEBUGPRINTF ((TFC_PrjTowerFind_edm,                                 \
                   " Ext%c %3d %4d %4d %4d %7d %4d %6d %4d %s\n",         \
                     _o==-1 ? '-' : (_o==0 ? ' ' : '+'),                  \
                     _lay,                                                \
                    (_o==-1 ? _a : _t),                                   \
                    (_o== 0 ? _t : _b),                                   \
                    (_o==-1 ? _t : (_o==0 ? _b : _a)),                    \
                    _zex, _pred, _res, _tol,                              \
                     _abs(_res) <= _tol ? "extended" : ""))
Prints the status of checking a point when extending a projection if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.

Parameters:
_o Determines the order
                        _o  =      -1         0           1
                  topStrip     aStrip    aStrip    tgtStrip\n
                  midStrip     bStrip  tgtStrip      bStrip\n
                  botStrip   tgtStrip    bStrip      aStrip\n
  
_lay The layer number of the top layer being used.
_a One of the strips in the non-search layers, see _o for the interpretation
_b One of the strips in the non-search layers, see _o for the interpretation
_t The target strip
_zex The zextension factor being used to predict the strip address in the extension layer
_pred The predicted extension layer strip number.
_res The residual (actual - predicted).
_tol The tolerance used to declare a match between the actual and predicted hit number.

#define _PRINT_SKIP _lay,
_top,
_mid,
_zex,
_pred,
_dir   ) 
 

Value:

EDM_DEBUGPRINTF ((TFC_PrjTowerFind_edm,                                 \
                   " Skip%c%3d %4d %4d      %7d %4d\n",                   \
                     _dir < 0 ? '-' : '+', _lay, _top, _mid, _zex, _pred))\
Prints the status of checking a point when extending a projection if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.

Parameters:
_lay The layer number of the top layer being used.
_top The strip number in the top layer.
_mid The strip number in the middle layer.
_zex The zextension factor being used to predict the strip address in the extension layer
_pred The predicted extension layer strip number.
_dir The direction (-1 down, +1 up)

#define _PRINT_SPAN _lay,
_top,
_mid,
_pred,
_dx,
_maxStrip,
_dir   ) 
 

Value:

EDM_DEBUGPRINTF ((TFC_PrjTowerFind_edm,                                 \
                   " Span%c%3d %4d %4d %4d   %5d %4d\n",                  \
                   _dir,_lay-1, _top, _mid, _pred, _dx, _pred+_maxStrip)) \
Prints the status of checking a point when extending a projection to the next tower if EDM is active and the print level is DEBUG or lower; otherwise is a NOP.

Parameters:
_lay The layer number of the top layer being used.
_top The strip number in the top layer.
_mid The strip number in the middle layer.
_pred The predicted extension layer strip number.
_dx The residual
_maxStrip The maximum strip number
_dir A character giving the direction of the scan, usually '-' or '+'

#define _PRINT_TITLE _tower,
_xy   ) 
 

Value:

EDM_DEBUGPRINTF ((                                                     \
       TFC_PrjTowerFind_edm,                                              \
      "\n"                                                                \
      "%1.1X%c OP Lyr  Top  Mid  Bot Zfactor Pred   Diff  Tol Status\n"   \
           " ---- --- ---- ---- ---- ------- ---- ------ ---- ------\n",  \
           _tower&0xf, xy ? 'y' : 'x'))
Prints a header line if EDM is active and the print level is DEBUG or lower. otherwise is a NOP.

Parameters:
_tower The tower number being used to find the projections
_xy 0 if X projection, 1 if Y projection

#define _PRINT_TKRFIND_BEG _towerId   ) 
 

Prints a header line. This is used when debugging these routines and is only defined if the symbol DEBUG is defined.

Parameters:
_towerId The tower number being used search for tracks.

#define _PRINT_TKRFIND_END
 

Prints a footer line. This is used when debugging these routines and is only defined if the symbol DEBUG is defined.

#define EXTTWR_PRINT _layer,
_prediction,
_offset,
_topStrip,
_dStrip   ) 
 

Value:

EDM_INFOPRINTF (                                                   \
                  (TFC_PrjTowerFind_edm,                                \
                   "Prediction Layer %2u %5d(%4d) <- %4u %5d\n",        \
                   _layer,                                              \
                   _prediction, _prediction - _offset,                  \
                   _topStrip,                                           \
                   _dStrip))

#define MAPSXHI _020,
_021,
_022,
_120,
_121,
_122,
_220,
_221,
_222,
_320,
_321,
_322,
_010,
_011,
_012,
_110,
_111,
_112,
_210,
_211,
_212,
_310,
_311,
_312,
_000,
_001,
_002,
_100,
_101,
_102,
_200,
_201,
_202,
_300,
_301,
_302   ) 
 

Value:

MAPXHI1(_020, _021, _022, _010, _011, _012, _000, _001, _002),            \
    MAPXHI1(_120, _121, _122, _110, _111, _112, _100, _101, _102),            \
    MAPXHI1(_220, _221, _222, _210, _211, _212, _200, _201, _202),            \
    MAPXHI1(_320, _321, _322, _310, _311, _312, _300, _301, _302)

#define MAPSXLO _020,
_021,
_022,
_120,
_121,
_122,
_220,
_221,
_222,
_320,
_321,
_322,
_010,
_011,
_012,
_110,
_111,
_112,
_210,
_211,
_212,
_310,
_311,
_312,
_000,
_001,
_002,
_100,
_101,
_102,
_200,
_201,
_202,
_300,
_301,
_302   ) 
 

Value:

MAPXLO1(_020, _021, _022, _010, _011, _012, _000, _001, _002),            \
    MAPXLO1(_120, _121, _122, _110, _111, _112, _100, _101, _102),            \
    MAPXLO1(_220, _221, _222, _210, _211, _212, _200, _201, _202),            \
    MAPXLO1(_320, _321, _322, _310, _311, _312, _300, _301, _302)

#define MAPSXMID _020,
_021,
_022,
_120,
_121,
_122,
_220,
_221,
_222,
_320,
_321,
_322,
_010,
_011,
_012,
_110,
_111,
_112,
_210,
_211,
_212,
_310,
_311,
_312,
_000,
_001,
_002,
_100,
_101,
_102,
_200,
_201,
_202,
_300,
_301,
_302   ) 
 

Value:

MAPXMID1(_020, _021, _022, _010, _011, _012, _000, _001, _002),            \
   MAPXMID1(_120, _121, _122, _110, _111, _112, _100, _101, _102),            \
   MAPXMID1(_220, _221, _222, _210, _211, _212, _200, _201, _202),            \
   MAPXMID1(_320, _321, _322, _310, _311, _312, _300, _301, _302)

#define MAPSYHI _020,
_021,
_022,
_120,
_121,
_122,
_220,
_221,
_222,
_320,
_321,
_322,
_010,
_011,
_012,
_110,
_111,
_112,
_210,
_211,
_212,
_310,
_311,
_312,
_000,
_001,
_002,
_100,
_101,
_102,
_200,
_201,
_202,
_300,
_301,
_302   ) 
 

Value:

MAPYHI1(_020, _021, _022, _010, _011, _012, _000, _001, _002),           \
     MAPYHI1(_120, _121, _122, _110, _111, _112, _100, _101, _102),           \
     MAPYHI1(_220, _221, _222, _210, _211, _212, _200, _201, _202),           \
     MAPYHI1(_320, _321, _322, _310, _311, _312, _300, _301, _302)

#define MAPSYLO _020,
_021,
_022,
_120,
_121,
_122,
_220,
_221,
_222,
_320,
_321,
_322,
_010,
_011,
_012,
_110,
_111,
_112,
_210,
_211,
_212,
_310,
_311,
_312,
_000,
_001,
_002,
_100,
_101,
_102,
_200,
_201,
_202,
_300,
_301,
_302   ) 
 

Value:

MAPYLO1(_020, _021, _022, _010, _011, _012, _000, _001, _002),           \
     MAPYLO1(_120, _121, _122, _110, _111, _112, _100, _101, _102),           \
     MAPYLO1(_220, _221, _222, _210, _211, _212, _200, _201, _202),           \
     MAPYLO1(_320, _321, _322, _310, _311, _312, _300, _301, _302)

#define MAPSYMID _020,
_021,
_022,
_120,
_121,
_122,
_220,
_221,
_222,
_320,
_321,
_322,
_010,
_011,
_012,
_110,
_111,
_112,
_210,
_211,
_212,
_310,
_311,
_312,
_000,
_001,
_002,
_100,
_101,
_102,
_200,
_201,
_202,
_300,
_301,
_302   ) 
 

Value:

MAPYMID1(_020, _021, _022, _010, _011, _012, _000, _001, _002),           \
    MAPYMID1(_120, _121, _122, _110, _111, _112, _100, _101, _102),           \
    MAPYMID1(_220, _221, _222, _210, _211, _212, _200, _201, _202),           \
    MAPYMID1(_320, _321, _322, _310, _311, _312, _300, _301, _302)

#define MAPXHI1 _20,
_21,
_22,
_10,
_11,
_12,
_00,
_01,
_02   ) 
 

Value:

((M(_22) | M(_12) | M(_02))                      |                         \
   ((V(_11, _12) << (2*4)) | (V(_11, _22) << (1*4)) | (V(_11, _02) << (0*4))))

#define MAPXLO1 _20,
_21,
_22,
_10,
_11,
_12,
_00,
_01,
_02   ) 
 

Value:

((M(_20) | M(_10) | M(_00))                     |                          \
   ((V(_11, _10) << (2*4)) | (V(_11, _20) << (1*4)) | (V(_11, _00) << (0*4))))

#define MAPXMID1 _20,
_21,
_22,
_10,
_11,
_12,
_00,
_01,
_02   ) 
 

Value:

((M(_21) | M(_01))                       |                                 \
   ((_11 << (2*4)) | (V(_11, _21) << (1*4)) | (V(_11, _01) << (0*4))))

#define MAPYHI1 _20,
_21,
_22,
_10,
_11,
_12,
_00,
_01,
_02   ) 
 

Value:

((M(_22) | M(_21) | M(_20))                      |                         \
   ((V(_11, _21) << (2*4)) | (V(_11, _22) << (1*4)) | (V(_11, _20) << (0*4))))

#define MAPYLO1 _20,
_21,
_22,
_10,
_11,
_12,
_00,
_01,
_02   ) 
 

Value:

((M(_02) | M(_01) | M(_00))                      |                         \
   ((V(_11, _01) << (2*4)) | (V(_11, _02) << (1*4)) | (V(_11, _00) << (0*4))))

#define MAPYMID1 _20,
_21,
_22,
_10,
_11,
_12,
_00,
_01,
_02   ) 
 

Value:

((M(_12) | M(_10))                       |                                 \
   ((_11 << (2*4)) | (V(_11, _12) << (1*4)) | (V(_11, _10) << (0*4))))

#define PRINT_EXTT _twr,
_xy,
_dir   ) 
 

Value:

EDM_DEBUGPRINTF ((TFC_PrjTowerFind_edm,                                 \
                   "%1X%c%c\n", _twr, _xy ? 'y' : 'x', _dir < 0 ? '-' : '+'))


Function Documentation

int _abs int  x  )  [static]
 

Returns the absolute value of the signed integer x.

Returns:
The absolute value of the signed integer x
This function at one time was an intrinsic function of the GNU-C compiler. For some reason (at least I think it did), it disappeared and was replaced was with a call. I do not want that, so this function places the absolute value function as an inline.

The algorithm is simple and uses no if's

     X               2 = 0x00000002    -2 = 0xfffffffe
     Y = X >> 31         0x00000000         0xffffffff
     Z = X ^ Y           0x00000002         0x00000001
     ABS(X) = Z - Y      0x00000002         0x00000002

static MatchVal findMatch unsigned int  tolerance,
int  prediction,
int  tgtMsk,
const EDR_tkrCluster *  tgtClusters,
int  tgtLayerNum,
int  aStrip,
int  bStrip,
int  dz,
int  order
[static]
 

Finds the best match when extending a projection down.

Returns:
A packed status word summarizing the best match.
Parameters:
tolerance The tolerance used to accept a match
prediction The predicted strip number
tgtMsk The mask of available hits in the target layer
tgtClusters The array of clusters in the target layer
tgtLayerNum The target layer number, used only for debugging
aStrip One of the 'other' layer strip numbers. The interpretation is determined by order. If
  • Order = -1, then this is the top layer
  • Order = 0, then this is the top layer
  • Order = 1, then this is the mid layer
bStrip One of the 'other' layer strip numbers. The interpretation is determined by order. If
  • Order = -1, then this is the mid layer
  • Order = 0, then this is the bot layer
  • Order = 1, then this is the bot layer
dz A geometrical factor used when extending the projection.
order The ordering of the hits. See aStrip and bStrip for how this parameter affects their interpretation. This is for debugging only

static MatchVal findMatchBot unsigned int  tolerance,
int  prediction,
int  botMsk,
const EDR_tkrCluster *  botClusters,
int  botLayerNum,
int  topStrip,
int  midStrip,
int  dz
[static]
 

Finds the best match when extending a projection down.

Parameters:
tolerance The tolerance used to accept a match
prediction The predicted strip number
botMsk The mask of available hits in the bottom layer
botClusters The array of clusters in the bottom layer
botLayerNum The bottom layer number
topStrip The top strip number
midStrip The middle strip number
dz A geometrical factor used when extending the projection.
Returns:
A packed status word, summarizing the best match.

static MatchVal findMatchMid unsigned int  tolerance,
int  prediction,
int  midMsk,
const EDR_tkrCluster *  midClusters,
int  topLayerNum,
int  topStrip,
int  botStrip,
int  dz
[static]
 

Finds the best match when projecting to a middle layer.

Returns:
A packed status word, summarizing the best match.
Parameters:
tolerance The tolerance used to accept a match
prediction The predicted strip number
midMsk The mask of available hits in the middle layer
midClusters The array of clusters in the middle layer
topLayerNum The top layer number
topStrip The top strip number
botStrip The bottom strip number
dz A geometrical factor used when extending the projection to the middle layer.

static MatchVal findMatchTop unsigned int  tolerance,
int  prediction,
int  topMsk,
const EDR_tkrCluster *  topClusters,
int  topLayerNum,
int  midStrip,
int  botStrip,
int  dz
[static]
 

Finds the best match when extending a projection up.

Parameters:
tolerance The tolerance used to accept a match. If this value is negative, then one must beat this value
prediction The predicted strip number
topMsk The mask of available hits in the top layer
topClusters The array of clusters in the top layer
topLayerNum The top layer number
midStrip The middle strip number
botStrip The bottom strip number
dz A geometrical factor used when extending the projection.
Returns:
A packed status word, summarizing the best match.

static int findPrj TFC_prj prj,
const TFC_prj prjmax,
int  towerId,
int  xy,
int  layers,
int  elayers,
int  topLayerNum,
EDR_tkrLayer *  top,
const TFC_geometryTkrXY geoxy,
const TFC_tolerances_xy tolerances,
EDR_tkr *  tkr,
EDR_tkrTower *  twr
[static]
 

Looks for projections in the specified tower starting at topLayerNum.

Returns:
A bit mask representing the layers with available hits.
Parameters:
prj A structure to store the found projections
prjmax The address (actually 1 past it) of the maximum projection that can be filled in.
towerId The id of the tower being searched.
xy An index indicating a X (=0) or a Y (=1) search
layers A bit mask of the layers with available hits to do the seed 3-in-a-row matching
elayers A bit mask of the layers with available hits to do the extension
topLayerNum The number of the top layer to begin the seach.
top Pointer to the first (top) of the layers to be examined for a projection, ie where the search begins.
geoxy The X or Y geometry to use. The argument xy indicates which (X or Y) it is.
tolerances The hit matching tolerances to use
tkr The tracker event data
twr The tracker event data for the specified tower.
This is your basic follow-your-nose permutation driven method of finding tracks. Three layers with candidate hits are examined. An attempt is made to find 3 hits which for a straight line simply by looping over all the hits in each layer. Each combination is tried with the 'best' projections being selected. If a projection is found, an attempt is made to extend the projection both upwards and downwards. The downwards direction is will be more successful. Since the seed projections are found by starting at the top (nearest the ACD) the hits in the layers above will most likely have already been assigned to tracks. Only if there is an inefficiency, will the extension upwards be successful.

static int project int  top,
int  bot,
int  dz
[static]
 

Predicts the middle strip address between the top and bot strip addresses.

Parameters:
top The address of the top strip.
bot The address of the bottom strip.
dz The fractional Z distance of the middle layer between the top and bottom layers and the halfway point in units of pf TFC_Z_FIND_SCALE_FACTOR. If the middle layer were exactly halfway, dz would be TFC_Z_FIND_SCALE_FACTOR.
Returns:
The predicted address of the middle strip.

static int projectDx int  p0,
int  dx,
int  dz
[static]
 

A strict linear projection from the point p0 using a slope of dx / dz. (Note that dz is really 1/dz, thus avoiding a cycle soaking divide.).

Parameters:
p0 The initial point
dx The change is x
dz The inverse of the change in z, ie the slope is dx * dz.
Returns:
The predict point.

static int projectDxm int  p0,
int  dx,
int  dz
[static]
 

A strict linear projection from the point p0 using a slope of dx / dz. (Note that dz is really 1/dz, thus avoiding a cycle soaking divide.).

Parameters:
p0 The initial point
dx The change is x, it must be negative to get the rounding correct
dz The inverse of the change in z, ie the slope is dx * dz.
Returns:
The predict point.

static int projectDxp int  p0,
int  dx,
int  dz
[static]
 

A strict linear projection from the point p0 using a slope of dx / dz. (Note that dz is really 1/dz, thus avoiding a cycle soaking divide.).

Parameters:
p0 The initial point
dx The change is x, it must be positive to get the rounding correct
dz The inverse of the change in z, ie the slope is dx * dz.
Returns:
The predict point.

static int projectMid int  top,
int  bot,
int  dz
[static]
 

Another projection function, used to predict a point in a skipped layer.

Returns:
The predicted strip number in the missing layer.
Parameters:
top The top strip address
bot The bottom strip address
dz The scaled distance from the top strip to the missing strip

static __inline void storePrj TFC_prj prj,
int  twr,
int  topLayerNum,
int  offset,
int  topStrip,
int  topIdx,
int  midStrip,
int  midIdx,
int  botStrip,
int  botIdx
[static]
 

Simple routine to store the initial parameters describing a projection.

Parameters:
prj The projection
topLayerNum The number of the upper most layer
twr The tower number of the upper most layer
offset The absolute coordinate offset
topStrip Strip number of top layer of the projection
topIdx Strip index of top layer of the projection
midStrip Strip number of middle layer of the projection
midIdx Strip index of middle layer of the projection
botStrip Strip number of bottom layer of the projection
botIdx Strip index of bottom layer of the projection

static __inline void storePrms TFC_prj prj,
const TFC_geometryTkrZ *  geoz,
const TFC_geometryTkrOffset_t offsets
[static]
 

Fills in the parameters describing the projection.

Parameters:
prj The target projection
geoz The Z geometry, this gives the Z positions of the layers
offsets The array of offsets by tower

unsigned int TFC_prjsConstruct TFC_prjs projections  ) 
 

The TFC_prjs constructor.

Returns:
0, always. This just satisties the EDS_fw object constructor protocol.
Parameters:
projections The TFC_prjs structure to construct.

unsigned int TFC_prjsDestruct TFC_prjs projections  ) 
 

The TFC_prjs destructor.

Returns:
0, always. This just satisties the EDS_fw object destructor protocol.
Parameters:
projections The TFC_prjs structure to destruct.

void TFC_prjsReset TFC_prjs projections  ) 
 

Resets the prjs structure, effectively cleaning it out for the next event.

Parameters:
projections The TFC_prjs structure to reset

int TFC_prjsSizeof void   ) 
 

Returns the size of a projections results record.

Returns:
The size, in bytes, of a projections results record
This routine is provided to hide the implemenation of a TFC_projections record allowing a caller to determine the size so it can be allocated.

int TFC_prjTowerFind TFC_prj prjs,
const TFC_prj prjmax,
const TFC_geometryTkr geo,
const TFC_tolerances tolerances,
EDR_tkr *  tkr,
int  towerId
 

Driver routine which looks for X and Y projections in the specified tower.

Returns:
A packed number with the upper 16 bits representing the count of Y projections found and the lower 16 bits representing the count of X projections found.
Parameters:
prjs Structure to store any found projections
prjmax Pointer to the maximum projection structure (actually, in true C fashion, one after it) that can be filled in)
geo The geometry to be used when finding projections
tolerances The strip matching tolerances to use
tkr The unpacked tracker data for this event
towerId The tower number to start the search in


Generated on Fri Sep 5 01:46:41 2008 by  doxygen 1.4.4