GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EFC / dev > gfc / rhel6-64
#include <EFC/EDM.h>
#include <EFC/EFC_edsFw.h>
#include <EFC/EFC.h>
#include <EFC/GFC.h>
#include <EFC/GFC_cfg.h>
#include <EFC/GFC_V3_status.h>
#include <EFC/AFC_splashMap.h>
#include <EFC/ATF_shadowedTowers.h>
#include <EFC/TFC_prjFind.h>
#include <EFC/TFC_prjDef.h>
#include <EFC/TFC_tolerances.h>
#include <EFC/TFC_geometry.h>
#include <EFC/TFC_geometryDef.h>
#include <EFC/GFC_def.h>
#include <GFC_resultDef.h>
#include <ATF_filter.h>
#include <ATF_shadowedTowers.ih>
#include <AFC_splash.h>
#include <CFC_ratio.h>
#include <TFC_tolerancesDef.h>
#include <TFC_triggerFill.h>
#include <TFC_triggerForm.h>
#include <TFC_triggerSortedForm.h>
#include <TFC_acd.h>
#include <TFC_skirt.h>
#include <EDS/EDS_fw.h>
#include <EDS/EBF_cid.h>
#include <EDS/EBF_acd.h>
#include <EDS/EBF_gem.h>
#include <EDS/EBF_tkr.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_err.h>
#include <EDS/EBF_calEnergy.h>
#include <EDS/EBF_gemLocate.h>
#include <EDS/ECR_cal.h>
#include <EDS/EDR_cal.h>
#include <EDS/EDR_tkr.h>
#include <EDS/EDR_calUnpack.h>
#include <EDS/EDR_tkrUnpack.h>
#include <GEO_DB/GEO_DB_schema.h>
#include <GFC_DB/GFC_DB_V3_schema.h>
#include <CDM/CDM_pubdefs.h>
#include <PBI/FFS.ih>
#include <string.h>
Classes | |
struct | _TkrMap |
Structure to store the augment X and Y tracker layer maps. More... | |
Defines | |
#define | _MOVE_BIT(_w, _from, _to) (((_w >> _from) & 1) << _to) |
Moves a bit from one location to another. | |
#define | MASK0_4_OF_6 |
A bit mask to be ordered with the dynamic 4/6 coincidence mask. Only patterns with 4/6 layers set are selected by this mask. This is the first of 2 32-bit words, representing patterns 0-0x1f. | |
#define | MASK1_4_OF_6 |
A bit mask to be ordered with the dynamic 4/6 coincidence mask. Only patterns with 4/6 layers set are selected by this mask. This is the second of 2 32-bit words, representing patterns 0x20-0x3f. | |
#define | PRJ_CNT (sizeof (((TFC_prjs *)(4))->prjs) / sizeof (TFC_prj)) |
#define | LIMIT_PRJ_CNT(_cnt) ((_cnt < PRJ_CNT) ? _cnt : PRJ_CNT) |
Typedefs | |
typedef enum _ACD_SIDE_TILES_M | ACD_SIDE_TILES_M |
Typedef for enum _ACD_SIDE_TILES_M. | |
typedef struct _TkrMap | TkrMap |
Typedef for struct _TkrMap. | |
Enumerations | |
enum | _ACD_SIDE_TILES_M { ACD_SIDE_TILES_M_ROW = (0x1f << 16) | (0x1f), ACD_SIDE_TILES_M_ROW0 = ACD_SIDE_TILES_M_ROW<<(0*5), ACD_SIDE_TILES_M_ROW1 = ACD_SIDE_TILES_M_ROW<<(1*5), ACD_SIDE_TILES_M_ROW2 = ACD_SIDE_TILES_M_ROW<<(2*5), ACD_SIDE_TILES_M_ROW01 = ACD_SIDE_TILES_M_ROW0 | ACD_SIDE_TILES_M_ROW1, ACD_SIDE_TILES_M_ROW3 = 0x80008000 } |
Enumerates the bit masks used to extract the struck tiles in various rows for both the + and - ACD side tile planes. More... | |
Functions | |
static __inline int | isVetoed (unsigned int status, unsigned int vetoes) |
Checks whether any of the veto bits are up. | |
static __inline unsigned int | cntBits (unsigned int word) |
Counts the bits in the specified word. | |
static __inline int | evaluateAcd (const GammaCfgAcd *cfg, int status, unsigned int vetoes, int energy, unsigned int acd_x, unsigned int acd_y, unsigned int acd_z, unsigned int acd_cnt) |
Rejects events based on CAL energy and ACD info. | |
static __inline int | evaluateZbottom (const GammaCfgZbottom *cfg, int energy, TkrMap *tkrMap, const EBF_dir *dir) |
Makes a quick test to see if there is energy in the CAL without the possibility of a track pointing into it. | |
static __inline int | evaluateAtf (const GammaCfgAtf *cfg, int status, unsigned int vetoes, int energy, unsigned int acd_x, unsigned int acd_y, unsigned int acd_z, unsigned int tmsk, unsigned int omsk, TkrMap *tkr_map, const EBF_dirCtbDsc *contributor) |
Evaluates whether any tower with a track trigger is in coincidence with a shadowing ACD tile. | |
static __inline int | classifyAcd (unsigned int acd_x, unsigned int acd_y, unsigned int acd_z) |
Sets status bits indicating which part of the ACD has hits. return A status mask indicating those parts of the ACD which have hits. | |
static __inline unsigned int(* | form_map (TkrMap *tkr_map, int tid, const EBF_tkr *tkr, const EBF_err *err))[2] |
Computes or returns the augmented x and y tracker layer maps for the specified tower. | |
static __inline int | nominateTowers (const EBF_dir *dir) |
Creates a list of towers with the potential for finding tracks in. | |
static __inline int | constrainEnergy (int energy) |
Limits the absolute value of the energy to be < 23 bits. | |
static __inline void | tkrComplete (EBF_dir *dir, int pktBytes, EBF_pkt *pkt, EBF_siv siv, GFC_result *result, int status, int energy, EDS_fwIxb *ixb, const GammaCfgTkr *cfg, unsigned int ctids) |
Kludge version to do the tracking for the events that pass the energy condition. | |
static unsigned int | tkrFilter (const GammaCfgTkr *cfg, int status, unsigned int vetoes, int energy, unsigned int acd_x, unsigned int acd_y, unsigned int acd_z, EDR_tkr *tlr, TFC_prjs *prjs) |
Performs the most computationally intensive portions of the filtering. This involves TKR pattern recognition and matching to the ACD, skirt region and CAL. | |
static __inline unsigned int | tkrSetPrjCount (const GammaCfgTkr *cfg, int energy, int prjCnt) |
Completes tracker status, by evaluating the projection count. | |
static __inline int | evaluateTkr (const GammaCfgTkr *cfg, int status, unsigned int vetoes, int energy, unsigned int acd_x, unsigned int acd_y, unsigned int acd_z, EBF_dir *dir, EDR_tkr *tkr, TFC_prjs *prjs) |
Does the projection finding and evaluates all the cuts based on the found projections. | |
static __inline int | gammaFilter (GFC *gfc, unsigned int pktBytes, EBF_pkt *pkt, EBF_siv siv, EDS_fwIxb *ixb, unsigned int vetoes, GFC_result *result) |
Determines the fate of 1 event. | |
static __inline unsigned int | not_only_tkr_fifo_overflow (EBF_dir *dir) |
Checks if there any error contributions that are not due to TKR FIFO overflows. | |
static int | compileCfgPrms (GammaCfgPrms *cfg, const GFC_DB_V3_prms *prms) |
Compiles/commits the set of user defined parameters into the the configuration block. | |
int | GFC_sizeof (int cnt) |
Sizes the gamma filtering control structure. | |
int | GFC_cfgSizeof (void) |
Sizes the gamma filtering configuration as it is used in the actual filtering progam. | |
int | GFC_resultSizeof (const GFC *gfc) |
Returns the size, in bytes, of one result vector. | |
int | GFC_cfgCompile (GFC_cfg *cfg, const GFC_DB_V3_prms *prms) |
Implements the transformation of the configuration parameters as specified by the user, cfg, into the internal form, ctlCfg. | |
int | GFC_cfgSchemaCompile (GFC_cfg *cfg, const GFC_DB_V3_schema *schema) |
Implements the transformation of the configuration parameters as specified by the user, cfg, into the internal form, ctlCfg. | |
GFC_cfg * | GFC_cfgSet (GFC *gfc, GFC_cfg *cfg) |
Makes the specified internal representation of the configuration parameters the current active one. | |
int | GFC_filter (GFC *gfc, unsigned int pktBytes, EBF_pkt *pkt, EBF_siv siv, EDS_fwIxb *ixb, unsigned int vetoes, GFC_result *result) |
Determines the fate of 1 event. | |
unsigned int | GFC_fwNeeds (void) |
Returns a bit mask of the EDS_fw needs. | |
unsigned int | GFC_fwObjects (void) |
Returns a bit mask of the EDS_fw objects used by the gamma filter. |
CVS $Id: GFC.c,v 1.20 2012/12/20 21:37:52 russell Exp $
#define _MOVE_BIT | ( | _w, | |||
_from, | |||||
_to | ) | (((_w >> _from) & 1) << _to) |
Moves a bit from one location to another.
_w | The word to move the bit from | |
_from | The bit position (LSB = 0) to extract the bit from | |
_to | The bit position (LSB = 0) to move the bit to |
Referenced by evaluateZbottom().
#define MASK0_4_OF_6 |
Value:
((0 << 0x00) | (0 << 0x01) | (0 << 0x02) | (0 << 0x03) | \ (0 << 0x04) | (0 << 0x05) | (0 << 0x06) | (0 << 0x07) | \ (0 << 0x08) | (0 << 0x09) | (0 << 0x0a) | (0 << 0x0b) | \ (0 << 0x0c) | (0 << 0x0d) | (0 << 0x0e) | (1 << 0x0f) | \ (0 << 0x10) | (0 << 0x11) | (0 << 0x12) | (0 << 0x13) | \ (0 << 0x14) | (0 << 0x15) | (0 << 0x16) | (1 << 0x17) | \ (0 << 0x18) | (0 << 0x19) | (0 << 0x1a) | (1 << 0x1b) | \ (0 << 0x1c) | (1 << 0x1d) | (1 << 0x1e) | (1 << 0x1f))
Referenced by evaluateZbottom().
#define MASK1_4_OF_6 |
Value:
((0 << 0x00) | (0 << 0x01) | (0 << 0x02) | (0 << 0x03) | \ (0 << 0x04) | (0 << 0x05) | (0 << 0x06) | (1 << 0x07) | \ (0 << 0x08) | (0 << 0x09) | (0 << 0x0a) | (1 << 0x0b) | \ (0 << 0x0c) | (1 << 0x0d) | (1 << 0x0e) | (1 << 0x0f) | \ (0 << 0x10) | (0 << 0x11) | (0 << 0x12) | (1 << 0x13) | \ (0 << 0x14) | (1 << 0x15) | (1 << 0x16) | (1 << 0x17) | \ (0 << 0x18) | (1 << 0x19) | (1 << 0x1a) | (1 << 0x1b) | \ (1 << 0x1c) | (1 << 0x1d) | (1 << 0x1e) | (1 << 0x1f))
The bits representing the last 6 layers are extracted from the X/Y layer hit masks and placed in the low 6 bits or a new word. This word can take on the values 0x00 to 0x3f (0-63).
If the value of this word is less than 32, then MASK0_4_OF_6 is used. That is, of the low 5 bits, 4 must be set.
If the value of this word is greater than or equal to 32, then MASK1_4_OF_6 is used. That is, of the remaining low 5 bits, 3 must be set.
Referenced by evaluateZbottom().
Typedef for struct _TkrMap.
With the hardware configured to allow the GTCC FIFOs to overflow the map of struck X and Y layers taken from the tracker data accept list are no longer complete. These maps must be augmented with the GTRCs that have overflowed.
This structure keeps track of
enum _ACD_SIDE_TILES_M |
Enumerates the bit masks used to extract the struck tiles in various rows for both the + and - ACD side tile planes.
static __inline int classifyAcd | ( | unsigned int | acd_x, | |
unsigned int | acd_y, | |||
unsigned int | acd_z | |||
) | [static] |
Sets status bits indicating which part of the ACD has hits. return A status mask indicating those parts of the ACD which have hits.
acd_x | The struck tiles in the ACD X face. | |
acd_y | The struck tiles in the ACD Y face. | |
acd_z | The struck tiles in the ACD Z (top) face. |
References ACD_SIDE_TILES_M_ROW01, GFC_V3_STATUS_M_ACD_SIDE, GFC_V3_STATUS_M_ACD_SIDE_FILTER, and GFC_V3_STATUS_M_ACD_TOP.
Referenced by gammaFilter().
static __inline unsigned int cntBits | ( | unsigned int | word | ) | [static] |
Counts the bits in the specified word.
word | The word to count the bits in |
Referenced by gammaFilter().
static int compileCfgPrms | ( | GammaCfgPrms * | cfg, | |
const GFC_DB_V3_prms * | prms | |||
) | [static] |
Compiles/commits the set of user defined parameters into the the configuration block.
cfg | The destination parameter configuration block | |
prms | The set of user configuration parameters |
References _GammaCfgPrms::acd, AFC_SplashMap1x1, _GammaCfgPrms::atf, _GammaCfgPrms::cal, _GammaCfgCal::emax, _GammaCfgAtf::emax, _GammaCfgCal::emin, _GammaCfgZbottom::emin, _GammaCfgCal::epass, _GammaCfgCal::eveto, _GammaCfgTkr::geometry, _GammaCfgTkr::grbPrjMax, _TFC_tolerancesAll::is_valid, _GammaCfgCal::layer0RatioHi, _GammaCfgCal::layer0RatioLo, _GammaCfgTkr::prjMax, _GammaCfgTkr::row01Emax, _GammaCfgTkr::row2Emax, _GammaCfgAtf::shadowed, _GammaCfgTkr::skirtEmax, _GammaCfgAcd::splashCount, _GammaCfgAcd::splashEmax, _GammaCfgAcd::splashMap, _GammaCfgPrms::tkr, _GammaCfgTkr::tolerancesAll, _GammaCfgTkr::topEmax, _GammaCfgAcd::topSideEmax, _GammaCfgAcd::topSideFilterEmax, _GammaCfgTkr::twoTkrEmax, _GammaCfgPrms::zbottom, and _GammaCfgTkr::zeroTkrEmin.
Referenced by GFC_cfgCompile().
static __inline int constrainEnergy | ( | int | energy | ) | [static] |
Limits the absolute value of the energy to be < 23 bits.
energy | The energy to constrain |
References GFC_V3_STAGE_M_ENERGY.
Referenced by gammaFilter().
static __inline int evaluateAcd | ( | const GammaCfgAcd * | cfg, | |
int | status, | |||
unsigned int | vetoes, | |||
int | energy, | |||
unsigned int | acd_x, | |||
unsigned int | acd_y, | |||
unsigned int | acd_z, | |||
unsigned int | acd_cnt | |||
) | [static] |
Rejects events based on CAL energy and ACD info.
cfg | The configuration constants for this routine | |
status | The current status of this event. | |
vetoes | the list of enabled vetoes | |
energy | The total energy deposited in the CAL. | |
acd_x | The ACD X side face tiles that are struck. | |
acd_y | The ACD Y side face tiles that are struck. | |
acd_z | The ACD Z TOP face tiles that are struck. | |
acd_cnt | The count of struck ACD tiles. |
References AFC_splash(), EDM_INFOPRINTF, GFC_V3_STATUS_M_ACD_SIDE, GFC_V3_STATUS_M_ACD_SIDE_FILTER, GFC_V3_STATUS_M_ACD_TOP, GFC_V3_STATUS_M_E0_TILE, GFC_V3_STATUS_M_E350_FILTER_TILE, GFC_V3_STATUS_M_SPLASH_1, GFC_V3_STATUS_M_VETOED, GFC_V3_STATUS_V_SPLASH_1, isVetoed(), _GammaCfgAcd::splashCount, and _GammaCfgAcd::splashMap.
Referenced by gammaFilter().
static __inline int evaluateAtf | ( | const GammaCfgAtf * | cfg, | |
int | status, | |||
unsigned int | vetoes, | |||
int | energy, | |||
unsigned int | acd_x, | |||
unsigned int | acd_y, | |||
unsigned int | acd_z, | |||
unsigned int | tmsk, | |||
unsigned int | omsk, | |||
TkrMap * | tkr_map, | |||
const EBF_dirCtbDsc * | contributor | |||
) | [static] |
Evaluates whether any tower with a track trigger is in coincidence with a shadowing ACD tile.
cfg | The configuration parameters for this routine | |
status | The current status of this event. | |
vetoes | the list of enabled vetoes | |
energy | The energy, in LEUs, of the event.. | |
acd_x | The bit mask of struck tiles in the X+/X- side face. | |
acd_y | The bit mask of struck tiles in the Y+/Y- side face. | |
acd_z | The bit mask of struck tiles in the Z top face. | |
tmsk | Bit mask giving the towers with TKR hits (TWR 0 = MSB) | |
omsk | Bit mask giving the towers with only tracker overflows | |
tkr_map | The map of struck X and Y tracker layers. This structure will be used if the X and Y tracker layer map for a TEM is already filled in, otherwise it will be computed and committed to this structure. | |
contributor | The array of tower contributors. |
References ACD_SIDE_TILES_M_ROW01, ATF__filterSides(), ATF__filterTop(), ATF__shadowedTowersByTop(), ATF__shadowedTowersByXM(), ATF__shadowedTowersByXP(), ATF__shadowedTowersByYM(), ATF__shadowedTowersByYP(), _TFC_trigger::bf, _GammaCfgAtf::emax, form_map(), GFC_V3_STATUS_M_SIDE, GFC_V3_STATUS_M_TOP, GFC_V3_STATUS_M_VETOED, isVetoed(), _TFC_trigger_bf::length, _GammaCfgAtf::shadowed, _TFC_trigger::si, _TFC_trigger_bf::start, TFC__triggerForm(), TFC_K_TRIGGER_TYPE_4_OF_4, and _TFC_trigger_bf::type.
Referenced by gammaFilter().
static __inline int evaluateTkr | ( | const GammaCfgTkr * | cfg, | |
int | status, | |||
unsigned int | vetoes, | |||
int | energy, | |||
unsigned int | acd_x, | |||
unsigned int | acd_y, | |||
unsigned int | acd_z, | |||
EBF_dir * | dir, | |||
EDR_tkr * | tkr, | |||
TFC_prjs * | prjs | |||
) | [static] |
Does the projection finding and evaluates all the cuts based on the found projections.
cfg | The tracker cut criteria | |
status | The current status | |
vetoes | A bit mask of the active veto conditions | |
energy | The energy of the event | |
acd_x | The struck tiles in the planes normal to the X axis | |
acd_y | The struck tiles in the planes normal to the Y axis | |
acd_z | The struck tiles in the planes normal to the Z axis better known as the top plane | |
dir | The event directory | |
tkr | The structure to hold the unpacked TKR data | |
prjs | The structure to hold the found projections |
References EDM_DEBUGPRINTF, GFC_V3_STATUS_M_TKR_EQ_0, GFC_V3_STATUS_M_VETOED, isVetoed(), nominateTowers(), and tkrFilter().
Referenced by gammaFilter().
static __inline int evaluateZbottom | ( | const GammaCfgZbottom * | cfg, | |
int | energy, | |||
TkrMap * | tkr_map, | |||
const EBF_dir * | dir | |||
) | [static] |
Makes a quick test to see if there is energy in the CAL without the possibility of a track pointing into it.
0 | If there is no energy in the calorimeter or there is a possibility of a track pointing at the energy | |
GFC_V3_STATUS_M_ZBOTTOM | If there is energy in the calorimeter and there is no possibility of a track pointing at it. |
cfg | The configuration constants for this routine | |
energy | The energy in the calorimeter | |
tkr_map | The tracker x and y layer maps | |
dir | The directory of event contributors |
References _MOVE_BIT, EDM_DEBUGPRINTF, form_map(), GFC_V3_STATUS_M_ZBOTTOM, MASK0_4_OF_6, and MASK1_4_OF_6.
Referenced by gammaFilter().
static __inline unsigned int(* form_map | ( | TkrMap * | tkr_map, | |
int | tid, | |||
const EBF_tkr * | tkr, | |||
const EBF_err * | err | |||
) | )[2] [static] |
Computes or returns the augmented x and y tracker layer maps for the specified tower.
tkr_map | The existing cache of tracker x and y layer maps | |
tid | The target TEM | |
tkr | The tracker data | |
err | The error block, may be NULL |
Referenced by evaluateAtf(), and evaluateZbottom().
static __inline int gammaFilter | ( | GFC * | gfc, | |
unsigned int | pktBytes, | |||
EBF_pkt * | pkt, | |||
EBF_siv | siv, | |||
EDS_fwIxb * | ixb, | |||
unsigned int | enabled, | |||
GFC_result * | result | |||
) | [static] |
Determines the fate of 1 event.
gfc | The gamma filter control structure | |
pktBytes | The number of bytes in pkt, includes the packet header | |
pkt | The event data packet | |
siv | The packet's state information vector | |
ixb | The information exchange block | |
enabled | The list of enabled vetoes and passes | |
result | The filter result vector |
References _GFC_result::acd, _GammaCfgPrms::acd, _GammaCtxRestart::acd_cnt, _GammaCtxRestart::acd_x, _GammaCtxRestart::acd_y, _GammaCtxRestart::acd_z, AFC_splash(), _GammaCfgPrms::atf, _GFC_result::atf, _GFC_result::beg, _GFC_result::cal, _GammaCfgPrms::cal, CFC__ratioLayerCheck(), _GFC::cfg, classifyAcd(), cntBits(), constrainEnergy(), _GFC_result::dir, EFC_EDS_FW_OBJ_K_TFC_PRJS, EFC_FATE_K_UNDECIDED, _GammaCfgCal::emin, _GammaCfgCal::epass, evaluateAcd(), evaluateAtf(), evaluateTkr(), evaluateZbottom(), _GFC_result::evtNum, _GFC_result::gem, GFC_V3_STAGE_M_ACD, GFC_V3_STAGE_M_ATF, GFC_V3_STAGE_M_CAL, GFC_V3_STAGE_M_DIR, GFC_V3_STAGE_M_MPKT, GFC_V3_STAGE_M_TKR, GFC_V3_STATUS_M_ACD_SIDE_FILTER, GFC_V3_STATUS_M_ACD_TOP, GFC_V3_STATUS_M_EL0_ETOT_HI, GFC_V3_STATUS_M_EL0_ETOT_LO, GFC_V3_STATUS_M_ERR_CTB, GFC_V3_STATUS_M_GEM_CALHI, GFC_V3_STATUS_M_GEM_CALLO, GFC_V3_STATUS_M_HI_ENERGY, GFC_V3_STATUS_M_LO_ENERGY, GFC_V3_STATUS_M_NOCALLO_FILTER_TILE, GFC_V3_STATUS_M_NON_PHYSICS, GFC_V3_STATUS_M_PASSES, GFC_V3_STATUS_M_SPLASH_0, GFC_V3_STATUS_M_VETOED, GFC_V3_STATUS_M_VETOES, GFC_V3_STATUS_V_SPLASH_0, ievt_store, isVetoed(), _GammaCfgCal::layer0RatioHi, _GammaCfgCal::layer0RatioLo, not_only_tkr_fifo_overflow(), _GFC_cfg::prms, _GFC::restart, _GammaCfgAcd::splashCount, _GammaCfgAcd::splashMap, _GFC_result::stageEnergy, _GFC_result::status, _GFC_result::tkr, _GammaCfgPrms::tkr, tkrComplete(), tmr_store, _TkrMap::valid, and _GammaCfgPrms::zbottom.
Referenced by GFC_filter().
int GFC_cfgCompile | ( | GFC_cfg * | cfg, | |
const GFC_DB_V3_prms * | prms | |||
) |
Implements the transformation of the configuration parameters as specified by the user, cfg, into the internal form, ctlCfg.
0 | Successful | |
-1 | Unrecognized or non-backwardly compatiable user configuration version number. |
cfg | Filled in with the internal form of the configuration parameters | |
prms | The user form of the configuration parameters |
References compileCfgPrms(), and _GFC_cfg::prms.
Referenced by GFC_cfgSchemaCompile().
int GFC_cfgSchemaCompile | ( | GFC_cfg * | cfg, | |
const GFC_DB_V3_schema * | schema | |||
) |
Implements the transformation of the configuration parameters as specified by the user, cfg, into the internal form, ctlCfg.
0 | Successful | |
-1 | Unrecognized or non-backwardly compatiable user configuration version number. |
cfg | Filled in with the internal form of the configuration parameters | |
schema | The user form of the configuration schema |
References GFC_cfgCompile(), and _GFC_cfg::prms.
Makes the specified internal representation of the configuration parameters the current active one.
gfc | The gamma filter control structure | |
cfg | The internal representation of the configuration constants |
References _GFC::cfg.
int GFC_cfgSizeof | ( | void | ) |
Sizes the gamma filtering configuration as it is used in the actual filtering progam.
ctlCfg = malloc (GFC_cfgSizeof ()); status = GFC_cfgCompile (cfg, usrPrms); GFC_cfgSet (gfc, cfg);
int GFC_filter | ( | GFC * | gfc, | |
unsigned int | pktBytes, | |||
EBF_pkt * | pkt, | |||
EBF_siv | siv, | |||
EDS_fwIxb * | ixb, | |||
unsigned int | vetoes, | |||
GFC_result * | result | |||
) |
Determines the fate of 1 event.
< | 0, rejected | |
==0,undecided | ||
> | 0, accepted |
gfc | The gamma filter control structure | |
pktBytes | The number of bytes in pkt, includes the packet header | |
pkt | The event data packet | |
siv | The packet's state information vector | |
ixb | The information exchange block | |
vetoes | The active vetoes | |
result | The filter result vector |
References gammaFilter().
unsigned int GFC_fwNeeds | ( | void | ) |
Returns a bit mask of the EDS_fw needs.
Referenced by gfc_construct().
unsigned int GFC_fwObjects | ( | void | ) |
Returns a bit mask of the EDS_fw objects used by the gamma filter.
References EFC_EDS_FW_OBJ_M_TFC_PRJS.
Referenced by gfc_construct().
int GFC_resultSizeof | ( | const GFC * | gfc | ) |
Returns the size, in bytes, of one result vector.
The | size, in bytes, of one result vector |
gfc | The configuration control structure |
int GFC_sizeof | ( | int | cnt | ) |
Sizes the gamma filtering control structure.
cnt | Number of configurations to accommodate |
static __inline int isVetoed | ( | unsigned int | status, | |
unsigned int | vetoes | |||
) | [static] |
Checks whether any of the veto bits are up.
status | The current set of status bits | |
vetoes | The set of veto bits |
Referenced by evaluateAcd(), evaluateAtf(), evaluateTkr(), gammaFilter(), and tkrFilter().
static __inline int nominateTowers | ( | const EBF_dir * | dir | ) | [static] |
Creates a list of towers with the potential for finding tracks in.
dir | The event directory |
References EDM_DEBUGPRINTF.
Referenced by evaluateTkr().
static __inline unsigned int not_only_tkr_fifo_overflow | ( | EBF_dir * | dir | ) | [static] |
Checks if there any error contributions that are not due to TKR FIFO overflows.
[in,out] | dir | The event directory. |
Referenced by gammaFilter().
static __inline void tkrComplete | ( | EBF_dir * | dir, | |
int | pktBytes, | |||
EBF_pkt * | pkt, | |||
EBF_siv | siv, | |||
GFC_result * | result, | |||
int | status, | |||
int | energy, | |||
EDS_fwIxb * | ixb, | |||
const GammaCfgTkr * | cfg, | |||
unsigned int | ctids | |||
) | [static] |
Kludge version to do the tracking for the events that pass the energy condition.
dir | The event directory | |
pktBytes | The size, in bytes of the current event packet | |
pkt | The event packet | |
siv | The event state information vector | |
result | The gamma filter result structure. The time of directory completion and tracker completion are stored in this structure + the setting of the corresponding completion stage bits. | |
status | The current set of status bits | |
energy | The energy of the event in LEUs | |
ixb | The information exchange block | |
cfg | The track configuration block | |
ctids | The ids of the TEMs to do tracking on |
References EDM_INFOPRINTF, EFC_EDS_FW_OBJ_K_TFC_PRJS, _GammaCfgTkr::geometry, GFC_V3_STAGE_M_TKR, _GammaCfgTkr::grbPrjMax, _GFC_result::stageEnergy, _GFC_result::tkr, _TFC_geometry::tkr, tmr_store, and _GammaCfgTkr::tolerancesAll.
Referenced by gammaFilter().
static unsigned int tkrFilter | ( | const GammaCfgTkr * | cfg, | |
int | status, | |||
unsigned int | vetoes, | |||
int | energy, | |||
unsigned int | acd_x, | |||
unsigned int | acd_y, | |||
unsigned int | acd_z, | |||
EDR_tkr * | tlr, | |||
TFC_prjs * | prjs | |||
) | [static] |
Performs the most computationally intensive portions of the filtering. This involves TKR pattern recognition and matching to the ACD, skirt region and CAL.
cfg | The tracker configuration and cut criteria | |
status | The current status word. | |
vetoes | The bit mask of vetoes. If, at any time in this routine a veto bit is added that matches in this word, the routine is aborted. | |
energy | The total energy in the CAL | |
acd_x | The bit pattern of struck tiles in the side X+/X- planes | |
acd_y | The bit pattern of struck tiles in the side Y+/Y- planes | |
acd_z | The bit pattern of struck tiles in the top Z plane | |
tlr | The unpacked tracker data for the entire LAT | |
prjs | Filled in with the projections for this event |
References ACD_SIDE_TILES_M_ROW01, ACD_SIDE_TILES_M_ROW2, _TFC_prjFindStatus::bf, _TFC_prjs::curCnt, _TFC_prjs::dir, EDM_INFOPRINTF, _GammaCfgTkr::geometry, GFC_V3_STATUS_M_TKR_ROW01, GFC_V3_STATUS_M_TKR_ROW2, GFC_V3_STATUS_M_TKR_SKIRT, GFC_V3_STATUS_M_TKR_TOP, GFC_V3_STATUS_M_VETOED, _TFC_prjDir::idx, isVetoed(), _GammaCfgTkr::prjMax, _TFC_prjs::prjs, _GammaCfgTkr::row01Emax, _GammaCfgTkr::row2Emax, _TFC_prjFindStatus::si, _GammaCfgTkr::skirtEmax, TFC_acdProject(), TFC_acdProjectTemplate(), TFC_skirtProject(), _TFC_geometry::tkr, tkrSetPrjCount(), _GammaCfgTkr::tolerancesAll, _GammaCfgTkr::topEmax, _TFC_prjs::twrMsk, _TFC_prjDir::xCnt, and _TFC_prjDir::yCnt.
Referenced by evaluateTkr().
static __inline unsigned int tkrSetPrjCount | ( | const GammaCfgTkr * | cfg, | |
int | energy, | |||
int | prjCnt | |||
) | [static] |
Completes tracker status, by evaluating the projection count.
cfg | The tracker configuration and cut criteria | |
energy | The total energy in the CAL | |
prjCnt | The count of projections |
References GFC_V3_STATUS_M_TKR_EQ_0, GFC_V3_STATUS_M_TKR_EQ_1, GFC_V3_STATUS_M_TKR_GE_2, GFC_V3_STATUS_M_TKR_LT_2_ELO, and _GammaCfgTkr::zeroTkrEmin.
Referenced by tkrFilter().