GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> XFC / V0-2-0 > dmfc / mv2304
#include <XFC/MFC.h>
#include <XFC/MFC_cfg.h>
#include <XFC/MFC_status.h>
#include <MFC_def.h>
#include <MFC_resultDef.h>
#include <EFC/EDM.h>
#include <EFC/EFC_edsFw.h>
#include <EFC/EFC.h>
#include <EFC/ATF_shadowedTowers.h>
#include <EDS/EDS_fw.h>
#include <EDS/EBF_gem.h>
#include <EDS/EBF_gemLocate.h>
#include <EDS/EBF_dir.h>
#include <EDS/ECR_cal.h>
#include <EDS/EDR_cal.h>
#include <EDS/EDR_calUnpack.h>
#include <CDM/CDM_pubdefs.h>
#include <PBI/FFS.ih>
#include <stdlib.h>
#include <string.h>
Defines | |
#define | _code EDM_CODE |
#define | _info(...) |
#define | _debug(...) |
#define | _display_title_bar() |
#define | _display_layer_energy(_energy) |
#define | PAT(_c, _d, _e, _f,_8, _9, _a, _b,_4, _5, _6, _7,_0, _1, _2, _3) |
#define | ROW(_0c, _0d, _0e, _0f, _1c, _1d, _1e, _1f, _2c, _2d, _2e, _2f, _3c, _3d, _3e, _3f,_08, _09, _0a, _0b, _18, _19, _1a, _1b, _28, _29, _2a, _2b, _38, _39, _3a, _3b,_04, _05, _06, _07, _14, _15, _16, _17, _24, _25, _26, _27, _34, _35, _36, _37,_00, _01, _02, _03, _10, _11, _12, _13, _20, _21, _22, _23, _30, _31, _32, _33) |
#define | x 0 |
#define | a 1 |
#define | _ 0 |
Functions | |
static __inline int | isVetoed (unsigned int status, unsigned int vetoes) |
Checks whether any of the veto bits are up. | |
static __inline int | mfcFilter (MFC *mfc, unsigned int pktBytes, EBF_pkt *pkt, EBF_siv siv, EDS_fwIxb *ixb, unsigned int vetoes, MFC_result *result) |
Determines the fate of 1 event. | |
static int | compileCfgPrms (MfcCfgPrms *cfg, const MFC_DB_prms *prms) |
Compiles/commits the set of user defined parameters into the the configuration block. | |
int | MFC_sizeof (int cnt) |
Sizes the minimum ionizing particle filtering control structure. | |
int | MFC_cfgSizeof (void) |
Sizes the minimum filtering configuration as it is used in the actual filtering progam. | |
int | MFC_resultSizeof (const MFC *mfc) |
Returns the size, in bytes, of one result vector. | |
int | MFC_cfgCompile (MFC_cfg *cfg, const MFC_DB_prms *prms) |
Implements the transformation of the configuration parameters as specified by the user, cfg, into the internal form, ctlCfg. | |
MFC_cfg * | MFC_cfgSet (MFC *mfc, MFC_cfg *cfg) |
Makes the specified internal representation of the configuration parameters the current active one. | |
static int __inline | dir_check (int status, EBF_dir *dir, int dir_status) |
Check the directory status. | |
static __inline int | acd_check (const ATF_shadowedTowers *shadowed, unsigned int acd_x, unsigned int acd_y, unsigned int acd_z, unsigned int tkrTrg) |
Evaluates whether any tower with a track trigger is in coincidence with a shadowing ACD tile. | |
static __inline int | cal_check (const MfcCfgCal *cfg, const EDR_cal *cal, int status, int vetoes, MFC_result *result) |
Does the CAL based checking of the MIP filter. | |
static __inline int | tkr_check (const MfcCfgTkr *cfg, unsigned int tkrTrg) |
Does the TKR based checking of the MIP filter. | |
int | MFC_filter (MFC *mfc, unsigned int pktBytes, EBF_pkt *pkt, EBF_siv siv, EDS_fwIxb *ixb, unsigned int vetoes, MFC_result *result) |
Determines the fate of 1 event. | |
unsigned int | MFC_fwNeeds (void) |
Returns a bit mask of the EDS_fw needs. | |
unsigned int | MFC_fwObjects (void) |
Returns a bit mask of the EDS_fw objects used by the heavy ion filter. |
CVS $Id: MFC.c,v 1.3 2011/03/28 20:50:57 russell Exp $
#define PAT | ( | _c, | |||
_d, | |||||
_e, | |||||
_f, | |||||
_8, | |||||
_9, | |||||
_a, | |||||
_b, | |||||
_4, | |||||
_5, | |||||
_6, | |||||
_7, | |||||
_0, | |||||
_1, | |||||
_2, | |||||
_3 | ) |
Value:
(_f << 0xf) | (_e << 0xe) | (_d << 0xd) | (_c << 0xc) | \ (_b << 0xb) | (_a << 0xa) | (_9 << 0x9) | (_8 << 0x8) | \ (_7 << 0x7) | (_6 << 0x6) | (_5 << 0x5) | (_4 << 0x4) | \ (_3 << 0x3) | (_2 << 0x2) | (_1 << 0x1) | (_0 << 0x0)
#define ROW | ( | _0c, | |||
_0d, | |||||
_0e, | |||||
_0f, | |||||
_1c, | |||||
_1d, | |||||
_1e, | |||||
_1f, | |||||
_2c, | |||||
_2d, | |||||
_2e, | |||||
_2f, | |||||
_3c, | |||||
_3d, | |||||
_3e, | |||||
_3f, | |||||
_08, | |||||
_09, | |||||
_0a, | |||||
_0b, | |||||
_18, | |||||
_19, | |||||
_1a, | |||||
_1b, | |||||
_28, | |||||
_29, | |||||
_2a, | |||||
_2b, | |||||
_38, | |||||
_39, | |||||
_3a, | |||||
_3b, | |||||
_04, | |||||
_05, | |||||
_06, | |||||
_07, | |||||
_14, | |||||
_15, | |||||
_16, | |||||
_17, | |||||
_24, | |||||
_25, | |||||
_26, | |||||
_27, | |||||
_34, | |||||
_35, | |||||
_36, | |||||
_37, | |||||
_00, | |||||
_01, | |||||
_02, | |||||
_03, | |||||
_10, | |||||
_11, | |||||
_12, | |||||
_13, | |||||
_20, | |||||
_21, | |||||
_22, | |||||
_23, | |||||
_30, | |||||
_31, | |||||
_32, | |||||
_33 | ) |
Value:
\ PAT(_3c,_3d,_3e,_3f, _38,_39,_3a,_3b, _34,_35,_36,_37, _30,_31,_32,_33),\ PAT(_2c,_2d,_2e,_2f, _28,_29,_2a,_2b, _24,_25,_26,_27, _20,_21,_22,_23),\ PAT(_1c,_1d,_1e,_1f, _18,_19,_1a,_1b, _14,_15,_16,_17, _10,_11,_12,_13),\ PAT(_0c,_0d,_0e,_0f, _08,_09,_0a,_0b, _04,_05,_06,_07, _00,_01,_02,_03) \
int acd_check | ( | const ATF_shadowedTowers * | shadowed, | |
unsigned int | acd_x, | |||
unsigned int | acd_y, | |||
unsigned int | acd_z, | |||
unsigned int | tkrTrg | |||
) | [static] |
Evaluates whether any tower with a track trigger is in coincidence with a shadowing ACD tile.
shadowed | The structure defining which towers are shadowed by which ACD tiles. | |
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. | |
tkrTrg | Bit mask of towers with a 3-in-a-row. Unfortunately this is specified in little endian order. |
References MFC_STATUS_M_NO_ACD_TKR.
Referenced by mfcFilter().
static __inline int cal_check | ( | const MfcCfgCal * | cfg, | |
const EDR_cal * | cal, | |||
int | status, | |||
int | vetoes, | |||
MFC_result * | result | |||
) | [static] |
Does the CAL based checking of the MIP filter.
cfg | The MIP CAL configuration cuts | |
cal | The unpacked CAL data | |
status | The status of the MIP filter to this point | |
vetoes | The bit mask of active vetoes | |
result | The result vector to fill out |
References _MfcCfgCal::ehi, _MfcCfgCal::elo, ievt_store, isVetoed(), MFC_STATUS_M_LYR_COUNTS, MFC_STATUS_M_STAGE_XCAL, MFC_STATUS_M_VETOED, and _MFC_result::mlayers.
Referenced by mfcFilter().
static int compileCfgPrms | ( | MfcCfgPrms * | cfg, | |
const MFC_DB_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 _MfcCfgPrms::cal, _MfcCfgCal::ehi, _MfcCfgCal::elo, _MfcCfgCal::nlayers, _MfcCfgTkr::placeholder, and _MfcCfgPrms::tkr.
Referenced by MFC_cfgCompile().
static int __inline dir_check | ( | int | status, | |
EBF_dir * | dir, | |||
int | dir_status | |||
) | [static] |
Check the directory status.
status | The status | |
dir | The directory | |
dir_status | The directory status |
References MFC_STATUS_M_ERR_CTB, MFC_STATUS_M_ERR_DIR, and MFC_STATUS_M_VETOED.
Referenced by mfcFilter().
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 cal_check(), and mfcFilter().
int MFC_cfgCompile | ( | MFC_cfg * | cfg, | |
const MFC_DB_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 _MFC_cfg::prms.
Makes the specified internal representation of the configuration parameters the current active one.
mfc | The minimum ionizing particle filter control structure | |
cfg | The internal representation of the configuration constants |
References _MFC::cfg.
int MFC_cfgSizeof | ( | void | ) |
Sizes the minimum filtering configuration as it is used in the actual filtering progam.
ctlCfg = malloc (MFC_cfgSizeof ()); status = MFC_cfgCompile (cfg, usrPrms); MFC_cfgSet (mfc, cfg);
int MFC_filter | ( | MFC * | mfc, | |
unsigned int | pktBytes, | |||
EBF_pkt * | pkt, | |||
EBF_siv | siv, | |||
EDS_fwIxb * | ixb, | |||
unsigned int | vetoes, | |||
MFC_result * | result | |||
) |
Determines the fate of 1 event.
< | 0, rejected | |
==0,undecided | ||
> | 0, accepted |
mfc | The minimum ionizing particle 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 mfcFilter().
unsigned int MFC_fwNeeds | ( | void | ) |
Returns a bit mask of the EDS_fw needs.
Referenced by mfc_construct().
unsigned int MFC_fwObjects | ( | void | ) |
Returns a bit mask of the EDS_fw objects used by the heavy ion filter.
Referenced by mfc_construct().
int MFC_resultSizeof | ( | const MFC * | mfc | ) |
Returns the size, in bytes, of one result vector.
The | size, in bytes, of one result vector |
mfc | The configuration control structure |
int MFC_sizeof | ( | int | cnt | ) |
Sizes the minimum ionizing particle filtering control structure.
cnt | Number of configurations to accommodate |
static __inline int mfcFilter | ( | MFC * | mfc, | |
unsigned int | pktBytes, | |||
EBF_pkt * | pkt, | |||
EBF_siv | siv, | |||
EDS_fwIxb * | ixb, | |||
unsigned int | vetoes, | |||
MFC_result * | result | |||
) | [static] |
Determines the fate of 1 event.
mfc | The minimum ionizing particle 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 list of active vetoes | |
result | The filter result vector |
References acd_check(), _MFC_result::beg, _MfcCfgPrms::cal, _MFC_result::cal, cal_check(), _MFC::cfg, _MFC_result::dir, dir_check(), _MFC_result::evtNum, _MFC_result::gem, ievt_store, isVetoed(), MFC_STATUS_M_ERR_CAL, MFC_STATUS_M_GEM_CNO, MFC_STATUS_M_GEM_NOTKR, MFC_STATUS_M_MULTI_PKT, MFC_STATUS_M_STAGE_CAL, MFC_STATUS_M_STAGE_DIR, MFC_STATUS_M_STAGE_GEM, MFC_STATUS_M_VETOED, _MFC_cfg::prms, _MFC_result::status, _MfcCfgPrms::tkr, tkr_check(), tmr_store, and _MFC_result::xcal.
Referenced by MFC_filter().
static __inline int tkr_check | ( | const MfcCfgTkr * | cfg, | |
unsigned int | tkrTrg | |||
) | [static] |
Does the TKR based checking of the MIP filter.
cfg | The TKR configuration | |
tkrTrg | The 3-in-a-row GEM bit mask (lower 16 bits, LSB = Tower 0) |
References MFC_STATUS_M_NO_TKR_ADJ.
Referenced by mfcFilter().