GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > XFC / V0-1-2

Constituent: ddfc     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

DFC.c File Reference

Diagnostic Filter Code. More...

#include "EFC/EDM.h"
#include "EFC/EFC_edsFw.h"
#include "EFC/EFC.h"
#include "EDS/FFS.h"
#include "XFC/DFC.h"
#include "XFC/DFC_cfg.h"
#include "XFC/DFC_status.h"
#include "DFC_def.h"
#include "DFC_resultDef.h"
#include "EDS/EDS_fw.h"
#include "EDS/EBF_gem.h"
#include "EDS/EBF_gemLocate.h"
#include "CDM/CDM_pubdefs.h"
#include <stdlib.h>
#include <string.h>

Include dependency graph for DFC.c:


Defines

#define _code   EDM_CODE
#define _info()
#define _debug()

Functions

static __inline int isVetoed (unsigned int status, unsigned int vetoes)
 Checks whether any of the veto bits are up.
static __inline int dfcFilter (DFC *dfc, unsigned int pktBytes, EBF_pkt *pkt, EBF_siv siv, EDS_fwIxb *ixb, unsigned int vetoes, DFC_result *result)
 Determines the fate of 1 event.
static int compileCfgPrms (DfcCfgPrms *cfg, const DFC_DB_prms *prms)
 Compiles/commits the set of user defined parameters into the the configuration block.
int DFC_sizeof (int cnt)
 Sizes the minimum ionizing particle filtering control structure.
int DFC_cfgSizeof (void)
 Sizes the minimum filtering configuration as it is used in the actual filtering progam.
int DFC_resultSizeof (const DFC *dfc)
 Returns the size, in bytes, of one result vector.
int DFC_cfgCompile (DFC_cfg *cfg, const DFC_DB_prms *prms)
 Implements the transformation of the configuration parameters as specified by the user, cfg, into the internal form, ctlCfg.
DFC_cfgDFC_cfgSet (DFC *dfc, DFC_cfg *cfg)
 Makes the specified internal representation of the configuration parameters the current active one.
int DFC_filter (DFC *dfc, unsigned int pktBytes, EBF_pkt *pkt, EBF_siv siv, EDS_fwIxb *ixb, unsigned int vetoes, DFC_result *result)
 Determines the fate of 1 event.
unsigned int DFC_fwNeeds (void)
 Returns a bit mask of the EDS_fw needs.
unsigned int DFC_fwObjects (void)
 Returns a bit mask of the EDS_fw objects used by the heavy ion filter.

Detailed Description

Diagnostic Filter Code.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: DFC.c,v 1.2 2006/06/14 22:04:16 russell Exp $

Function Documentation

static int compileCfgPrms DfcCfgPrms cfg,
const DFC_DB_prms *  prms
[static]
 

Compiles/commits the set of user defined parameters into the the configuration block.

Returns:
0 is success, -1 if failure
Parameters:
cfg The destination parameter configuration block
prms The set of user configuration parameters

int DFC_cfgCompile DFC_cfg cfg,
const DFC_DB_prms *  prms
 

Implements the transformation of the configuration parameters as specified by the user, cfg, into the internal form, ctlCfg.

Return values:
0 Successful
-1 Unrecognized or non-backwardly compatiable user configuration version number.
Parameters:
cfg Filled in with the internal form of the configuration parameters
prms The user form of the configuration parameters

const DFC_cfg * DFC_cfgSet DFC dfc,
DFC_cfg cfg
 

Makes the specified internal representation of the configuration parameters the current active one.

Returns:
Pointer to the current control configuration parameters
Parameters:
dfc The minimum ionizing particle filter control structure
cfg The internal representation of the configuration constants

int DFC_cfgSizeof void   ) 
 

Sizes the minimum filtering configuration as it is used in the actual filtering progam.

Returns:
Returns the size of the heavy ion filtering configuration control structure
There are two different breeds of the filtering configuration structure. There are two reasons for this. The more familar is the configuration structure that the user fills in. This structure is meant to be convenient for the user, but not for the program. Some of the information in the user structure is transformed into data that the program will find more accessible.
The second reason is that by having a user configuration and an internal configuration, the two can evolve separately. If more parameters are added to the filter, they will find a home in the internal structure. At some time they may be exposed to the user. The correct course of action is to define a new version of the user configuration block. Since the version number is carried along with the configuration constants, the routine transforming the user configuration to its internal representation can evolve and can be made to handle older versions of the user configuration parameters with some degree of grace, at least giving some hope to backward compatibility.
The correct usage model is
       ctlCfg = malloc (DFC_cfgSizeof ());
       status = DFC_cfgCompile (cfg, usrPrms);
       DFC_cfgSet (dfc, cfg);
Note:
Because the 'set routine just seeds a pointer to the user configuration, in the control structure. the user is free to swap it out with any other pre-prepared configuration.

int DFC_filter DFC dfc,
unsigned int  pktBytes,
EBF_pkt *  pkt,
EBF_siv  siv,
EDS_fwIxb *  ixb,
unsigned int  vetoes,
DFC_result result
 

Determines the fate of 1 event.

Return values:
< 0, rejected
==0,undecided 
> 0, accepted
Parameters:
dfc 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
Overview
This acts as a wrapper of the actual filter. This is were the sampling logic is implemented by the use prescalers. A prescaler is defined by a pair of integers; one giving the current countdown value and the other giving the refresh value. When the countdown value reaches 0, the prescaler is said to expire.
Types of prescaling
There are two kinds of samplings allow.
  1. Pass-thru sampling
  2. Individual veto sampling

Pass-Thru Sampling
Conceptually this is the easiest to understand. When the pass-thru prescaler expires, instead of using the normal veto mask, a 0 is used, effectively causing the filter to evaluate all its cuts but not allowing an cut to veto the event. While easy to understand, the event sample leaked through by this technique will be dominated by events that would normally have been rejected by the very early cuts.
Individual Veto Sampling
This prescaler type allows to ignore the reject decision of each veto bit. While a bit harder to understand than the Pass-Thru Sampling, this technique allows one to tap a predetermined percentage of events failing at each cut. The hope is that one will be a statisitically meaningful sample of events that would have normally failed some of the later cuts in the filter.

unsigned int DFC_fwNeeds void   ) 
 

Returns a bit mask of the EDS_fw needs.

Returns:
A bit mask of the EDS_fw needs
Use
This value should be passed to EDS_fwRegister when registering the filter.

unsigned int DFC_fwObjects void   ) 
 

Returns a bit mask of the EDS_fw objects used by the heavy ion filter.

Returns:
A bit mask of the EDS_fw needs
Use
This value should be passed to EDS_fwRegister when registering the filter.

int DFC_resultSizeof const DFC dfc  ) 
 

Returns the size, in bytes, of one result vector.

Return values:
The size, in bytes, of one result vector
Parameters:
dfc The configuration control structure

int DFC_sizeof int  cnt  ) 
 

Sizes the minimum ionizing particle filtering control structure.

Returns:
Returns the size of the heavy ion filtering control structure
Parameters:
cnt Number of configurations to accommodate

static __inline int dfcFilter DFC dfc,
unsigned int  pktBytes,
EBF_pkt *  pkt,
EBF_siv  siv,
EDS_fwIxb *  ixb,
unsigned int  vetoes,
DFC_result result
[static]
 

Determines the fate of 1 event.

Returns:
Status mask, if the
  • < 0, reject
  • = 0, no decision
  • > 0, accept
Parameters:
dfc 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

static __inline int isVetoed unsigned int  status,
unsigned int  vetoes
[static]
 

Checks whether any of the veto bits are up.

Returns:
Non-zero if the status bits contain any of the veto bits.
Parameters:
status The current set of status bits
vetoes The set of veto bits


Generated on Thu Jun 19 01:21:56 2008 by  doxygen 1.4.4