GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FES / V6-5-0 > fes_ux / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

fesDataFmt.h File Reference

Definitions for FES data formatting. More...

#include <fesDevice.h>

Classes

struct  fesRecHead_u_t
 FES data record header, universal version. More...
struct  fesFileHead_u_t
 FES file header, universal version. More...
struct  fesTranRec_u_t
 FES transition record, universal version. More...
struct  fesRecHead_t
 FES data record header. More...
struct  fesFileHead_t
 FES file header. More...
struct  fesTranRec_t
 FES transition record. More...
struct  fesCalRawPedData_s
 Calorimeter raw pedestal data block. More...
struct  fesCalPedesData_s
 Calorimeter pedestal data block. More...
struct  fesAcdPedesData_s
 ACD pedestal data block. More...
union  fesPedesData_u
 Combined pedestal data block. More...
struct  fesCalHits_t
 Calorimeter single-range hits data. More...
struct  fesCalHits4_t
 Calorimeter four-range hits data. More...

Typedefs

typedef struct fesCalRawPedData_s fesCalRawPedData_t
 Calorimeter raw pedestal data block.
typedef struct fesCalPedesData_s fesCalPedesData_t
 Calorimeter pedestal data block.
typedef struct fesAcdPedesData_s fesAcdPedesData_t
 ACD pedestal data block.
typedef union fesPedesData_u fesPedesData_t
 Combined pedestal data block.

Enumerations

enum  {
  RTYP_HEADER = 0,
  RTYP_TKR_TRAN = 1,
  RTYP_CAL_TRAN = 2,
  RTYP_ACD_TRAN = 3,
  RTYP_CAL_PED = 4,
  RTYP_ACD_PED = 5,
  RVER_CABLE = 0,
  RVER_DETC = 1,
  RVER_CBL_TIME = 2,
  RVER_DET_TIME = 3,
  RVER_NULL = 4,
  RVER_MAX = 4,
  DETC_TKR = 0x00,
  DETC_CAL = 0x10,
  DETC_ACD = 0x20,
  DETC_GAMMA = 0x80,
  DTYP_TEST = 0,
  DTYP_SIMUL = 1,
  DTYP_LAT = 2
}
 General file definitions. More...
enum  {
  MAX_TIMER = 0x3fff,
  TIMER_M = MAX_TIMER,
  PAUSE_M = 0x8000,
  NEGTIME_M = 0x2000,
  EVENT_M = 0x80000000,
  PAUSEL_M = 0x40000000,
  INTVL_M = 0x3fffffff
}
 Time field definitions. More...
enum  {
  TKR_NLAYER = 9,
  TKR_NSIDE = 4,
  TKR_NCABLE = 2 * TKR_NSIDE,
  TKR_NFE = 24,
  TKR_NSTRIP = 64,
  TKR_DAV = 0x10,
  TKR_LWORD = 11,
  TKR_LWORD_FILE = 12,
  TKR_LTVEC = TKR_NSIDE * DEV_TMEM_WD_SIZE_TKR,
  TKR_MRLENG = 14400,
  TKR_MHWORD = 1200,
  TKR_MAX_HITS = 128,
  TKR_MAX_DWORDS = 1000,
  TKR_MAX_DBYTES = 2 * TKR_MAX_DWORDS,
  TKR_TMEM_WD_SIZE = DEV_TMEM_WD_SIZE_TKR,
  TKR_TMEM_QUANTUM = DEV_MEM_QUANTUM * DEV_TMEM_WD_SIZE_TKR,
  TKR_DMEM_WD_SIZE = DEV_DMEM_WD_SIZE_TKR,
  TKR_DMEM_QUANTUM = DEV_MEM_QUANTUM * DEV_DMEM_WD_SIZE_TKR,
  TKR_DMEM_SIZE = DEV_MEM_SIZE - 0x004000
}
 Tracker definitions. More...
enum  {
  CAL_NCABLE = 4,
  CAL_NLAYER = 4,
  CAL_NLOG = 12,
  CAL_NFE = CAL_NLOG,
  CAL_NRANGE = 4,
  CAL_NSLICE = 4,
  CAL_NBIT_ADC = 12,
  CAL_MAX_ADC = (1 << CAL_NBIT_ADC) - 1,
  CAL_LTVEC = CAL_NCABLE * DEV_TMEM_WD_SIZE_CAL,
  CAL_MRLENG = 1940,
  CAL_MAX_DWORDS = 56,
  CAL_MAX_DBYTES = 6 * CAL_MAX_DWORDS,
  CAL_NCOL = CAL_NLAYER * 2,
  CAL_NROW = CAL_NLOG / 2,
  CAL_NBIT_DAT = CAL_NBIT_ADC / 2,
  CAL_MASK_DAT = (1 << CAL_NBIT_DAT) - 1,
  CAL_TMEM_WD_SIZE = DEV_TMEM_WD_SIZE_CAL,
  CAL_TMEM_QUANTUM = DEV_MEM_QUANTUM * DEV_TMEM_WD_SIZE_CAL,
  CAL_DMEM_WD_SIZE = DEV_DMEM_WD_SIZE_CAL,
  CAL_DMEM_QUANTUM = DEV_MEM_QUANTUM * DEV_DMEM_WD_SIZE_CAL,
  CAL_DMEM_SIZE = DEV_MEM_SIZE - 0x000200
}
 Calorimeter definitions. More...
enum  {
  ACD_NFREE = 12,
  ACD_NCABLE = 4,
  ACD_NCHAN = 18,
  ACD_NFE = ACD_NCHAN,
  ACD_NRANGE = 2,
  ACD_NBIT_ADC = 12,
  ACD_MAX_ADC = (1 << ACD_NBIT_ADC) - 1,
  ACD_LTVEC = ACD_NCABLE * DEV_TMEM_WD_SIZE_ACD,
  ACD_MRLENG = 300,
  ACD_MAX_DWORDS = 16,
  ACD_MAX_DBYTES = 4 * ACD_MAX_DWORDS,
  ACD_TMEM_WD_SIZE = DEV_TMEM_WD_SIZE_ACD,
  ACD_TMEM_QUANTUM = DEV_MEM_QUANTUM * DEV_TMEM_WD_SIZE_ACD,
  ACD_DMEM_WD_SIZE = DEV_DMEM_WD_SIZE_ACD,
  ACD_DMEM_QUANTUM = DEV_MEM_QUANTUM * DEV_DMEM_WD_SIZE_ACD
}
 ACD definitions. More...
enum  {
  ACD_M_RANGE = 0x1000,
  ACD_M_HIT_MAP = 0x2000,
  ACD_M_USE_PED = 0x4000
}
 Special bit values in the hit data. More...
enum  {
  CAL_M_USE_PED = 0x80,
  CAL_M_FOUR_RANGE = 0x40,
  CAL_M_ACCEPT = 0x20,
  CAL_M_AUTO_RANGE = 0x10,
  CAL_M_RANGE = 0x03
}
 Calorimeter hit data flag byte values. More...

Functions

int fesDataFmtAcdNrec (int id, const int *cables, int intvl, int pause, char *buff, int lBuff, int *nData)
 Format a complete null ACD transition record.
int fesDataFmtAcdPrec (int id, const int *cables, const fesAcdPedesData_t *peds, char *buff, int lBuff, int *nData)
 Format a complete ACD pedestal record.
int fesDataFmtAcdTrec (int versn, int id, const int *cables, const int *veto, int intvl, int pause, const int *nhit, const int *const *hits, char *buff, int lBuff, int *nData)
 Format a complete ACD transition record.
int fesDataFmtCalNrec (int id, int intvl, int pause, char *buff, int lBuff, int *nData)
 Format a complete null calorimeter transition record.
int fesDataFmtCalPrec (int id, const fesCalPedesData_t *peds, char *buff, int lBuff, int *nData)
 Format a complete calorimeter pedestal record.
int fesDataFmtCalTrec (int versn, int id, const int *treq, int intvl, int pause, const int *nhit, const fesCalHits_t *const *hits, char *buff, int lBuff, int *nData)
 Format a complete calorimeter transition record.
int fesDataFmtCalTrec4 (int versn, int id, const int *treq, int intvl, int pause, const int *nhit, const fesCalHits4_t *const *hits, char *buff, int lBuff, int *nData)
 Format a complete calorimeter transition record (four-range).
int fesDataFmtHrec (int dType, long long dMask, int nTran, int nEvent, const char *desc, fesFileHead_u_t *hRec)
 Format header record.
int fesDataFmtTkrNrec (int id, int intvl, int pause, char *buff, int lBuff, int *nData)
 Format a complete null tracker transition record.
int fesDataFmtTkrTrec (int versn, int id, const int *treq, int intvl, int pause, const int *nhit, const short *const *hits, char *buff, int lBuff, int *nData)
 Format a complete tracker transition record.
int fesDataFmtTrecTime (int intvl, int pause, char *recd)
 Format transition record time.


Detailed Description

Definitions for FES data formatting.

Author:
Owen H Saxton
$Id: fesDataFmt.h,v 1.8 2011/03/29 23:05:11 saxton Exp $

Enumeration Type Documentation

anonymous enum

General file definitions.

Enumerator:
RTYP_HEADER  Header record type.
RTYP_TKR_TRAN  Tracker transition record type.
RTYP_CAL_TRAN  Calorimeter transition record type.
RTYP_ACD_TRAN  ACD transition record type.
RTYP_CAL_PED  Calorimeter pedestal record type.
RTYP_ACD_PED  ACD pedestal record type.
RVER_CABLE  Cable-ready data version.
RVER_DETC  Detector-oriented data version.
RVER_CBL_TIME  Cable-ready with event time data version.
RVER_DET_TIME  Detector-oriented with time data version.
RVER_NULL  Null (event time only) data version.
RVER_MAX  Maximum allowed data version.
DETC_TKR  Tracker detector element.
DETC_CAL  Calorimeter detector element.
DETC_ACD  ACD detector element.
DETC_GAMMA  Gamma event flag.
DTYP_TEST  Test pattern data type.
DTYP_SIMUL  Simulation data type.
DTYP_LAT  LAT data type.

anonymous enum

Time field definitions.

Enumerator:
MAX_TIMER  Maximum event timer value.
TIMER_M  Event timer bits mask.
PAUSE_M  Run pause bit.
NEGTIME_M  Negative time indicator bit.
EVENT_M  Event bit in long time field.
PAUSEL_M  Run pause bit in long time field.
INTVL_M  Event interval mask in long time.

anonymous enum

Tracker definitions.

Enumerator:
TKR_NLAYER  Number of tracker layers per side.
TKR_NSIDE  Number of tracker sides.
TKR_NCABLE  Number of tracker cables.
TKR_NFE  Number of tracker front-ends per layer.
TKR_NSTRIP  Number of tracker strips per front-end.
TKR_DAV  Tracker data available bit in layer hdr.
TKR_LWORD  Bit length of each tracker data word.
TKR_LWORD_FILE  Bit length of tracker data word in file.
TKR_LTVEC  Length of tracker TVEC data.
TKR_MRLENG  Maxm length of a tracker transition recd.
TKR_MHWORD  Maxm number of trkr hit words per cable.
TKR_MAX_HITS  Maxm number of tracker hits per GTRC.
TKR_MAX_DWORDS  Maxm number of trkr data words per cable.
TKR_MAX_DBYTES  Maxm number of trkr data bytes per cable.
TKR_TMEM_WD_SIZE  Tracker TMEM word size.
TKR_TMEM_QUANTUM  Quantum of tracker transition vectors.
TKR_DMEM_WD_SIZE  Tracker data memory word size.
TKR_DMEM_QUANTUM  Quantum of tracker data.
TKR_DMEM_SIZE  Effective size of tracker data memory.

anonymous enum

Calorimeter definitions.

Enumerator:
CAL_NCABLE  Number of calorimeter cables.
CAL_NLAYER  Number of calorimeter layers per cable.
CAL_NLOG  Number of calorimeter logs per layer.
CAL_NFE  Number of calorimeter front-ends per layer.
CAL_NRANGE  Number of calorimeter readout ranges.
CAL_NSLICE  Number of slices in cal pedestal data.
CAL_NBIT_ADC  Number of bits in calorimeter ADC value.
CAL_MAX_ADC  Maximum calorimeter ADC value.
CAL_LTVEC  Length of calorimeter TVEC data.
CAL_MRLENG  Maximum length of a cal transition recd.
CAL_MAX_DWORDS  Maxm number of cal data words per cable.
CAL_MAX_DBYTES  Maxm number of cal data bytes per cable.
CAL_NCOL  Number of calorimeter columns.
CAL_NROW  Number of calorimeter rows.
CAL_NBIT_DAT  Number of calorimeter data bits.
CAL_MASK_DAT  Mask for calorimeter data.
CAL_TMEM_WD_SIZE  Calorimeter TMEM word size.
CAL_TMEM_QUANTUM  Quantum of calorimeter transition vectors.
CAL_DMEM_WD_SIZE  Calorimeter DMEM word size.
CAL_DMEM_QUANTUM  Quantum of calorimeter data.
CAL_DMEM_SIZE  Effective size of calorimeter data memory.

anonymous enum

ACD definitions.

Enumerator:
ACD_NFREE  Number of ACD FREE boards.
ACD_NCABLE  Number of ACD cables per sim card.
ACD_NCHAN  Number of ACD channels per cable.
ACD_NFE  Number of ACD front-ends per cable.
ACD_NRANGE  Number of ACD readout ranges.
ACD_NBIT_ADC  Number of bits in ACD ADC value.
ACD_MAX_ADC  Maximum ACD ADC value.
ACD_LTVEC  Length of ACD TVEC data.
ACD_MRLENG  Maximum length of an ACD transition recd.
ACD_MAX_DWORDS  Maxm number of ACD data words per cable.
ACD_MAX_DBYTES  Maxm number of ACD data bytes per cable.
ACD_TMEM_WD_SIZE  ACD TMEM word size.
ACD_TMEM_QUANTUM  Quantum of ACD transition vectors.
ACD_DMEM_WD_SIZE  ACD DMEM word size.
ACD_DMEM_QUANTUM  Quantum of ACD data.

anonymous enum

Special bit values in the hit data.

Enumerator:
ACD_M_RANGE  High range.
ACD_M_HIT_MAP  Data is in hit map.
ACD_M_USE_PED  Use pedestal data.

anonymous enum

Calorimeter hit data flag byte values.

Enumerator:
CAL_M_USE_PED  Use pedestal values.
CAL_M_FOUR_RANGE  Four-range data.
CAL_M_ACCEPT  Set log accept bit.
CAL_M_AUTO_RANGE  Output "best" range first.
CAL_M_RANGE  First (if not auto-range) or only range.


Function Documentation

int fesDataFmtAcdNrec ( int  id,
const int *  cables,
int  intvl,
int  pause,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete null ACD transition record.

This routine formats the supplied data into a complete null transition record for one ACD board.

Parameters:
id The ID of the ACD board.
cables The array of up to four ACD cable numbers connected to the board. If there are fewer than four cables, the array is padded out with the value -1.
intvl The interval for this transition, in 50 nsec clock ticks. If non-negative, the transition is the main one of an event, and the interval is from this transition to the main one of the following event. If negative, the transition is subsidiary to the preceding main one, and is the negative of the interval from the main transition to this one.
pause If non-zero, the pause bit is set in the transition vector, causing a pause after the transition.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed

References ACD_NCABLE, RTYP_ACD_TRAN, and RVER_NULL.

int fesDataFmtAcdPrec ( int  id,
const int *  cables,
const fesAcdPedesData_t peds,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete ACD pedestal record.

This routine formats the supplied data into a complete transition record for one ACD board.

Parameters:
id The ID of the ACD board.
cables The array of up to four ACD cable numbers connected to the board. If there are fewer than four cables, the array is padded out with the value -1.
peds The address of the array of ACD pedestal data.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed

References ACD_NCABLE, ACD_NCHAN, ACD_NRANGE, fesTranRec_u_t::data, and RTYP_ACD_PED.

Referenced by fesDataGenPedes().

int fesDataFmtAcdTrec ( int  versn,
int  id,
const int *  cables,
const int *  veto,
int  intvl,
int  pause,
const int *  nhit,
const int *const *  hits,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete ACD transition record.

This routine formats the supplied data into a complete transition record for one ACD board.

Parameters:
versn The format version of the generated data. The value RVER_NULL may be used to generate a record containing no veto or hits data.
id The ID of the ACD board.
cables The array of up to four ACD cable numbers connected to the board. If there are fewer than four cables, the array is padded out with the value -1.
veto The address of the array of veto masks, one per cable present. If NULL, the masks are generated from the hit data. Ignored if versn is RVER_NULL.
intvl The interval for this transition, in 50 nsec clock ticks. If non-negative, the transition is the main one of an event, and the interval is from this transition to the main one of the following event. If negative, the transition is subsidiary to the preceding main one, and is the negative of the interval from the main transition to this one.
pause If non-zero, the pause bit is set in the transition vector, causing a pause after the transition.
nhit The address of the array of the number of hits on each cable present. Ignored if versn is RVER_NULL.
hits The address of the array of pointers to the arrays cantaining the hit data. There is one such array per cable present. Each data word contains the channel number (0 - 17) in the high order byte, and the hit value in the low order two bytes. The latter consists of the ADC value in bits 0 - 11, the range in bit 12, the hit map in bit 13, and the pedestal flag in bit 14. Ignored if versn is RVER_NULL.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed

References ACD_DMEM_QUANTUM, ACD_LTVEC, ACD_NCABLE, RTYP_ACD_TRAN, RVER_CABLE, RVER_CBL_TIME, RVER_DET_TIME, and RVER_DETC.

int fesDataFmtCalNrec ( int  id,
int  intvl,
int  pause,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete null calorimeter transition record.

This routine formats the supplied data into a complete null transition record for one calorimeter board.

Parameters:
id The ID of the calorimeter board.
intvl The interval for this transition, in 50 nsec clock ticks. If non-negative, the transition is the main one of an event, and the interval is from this transition to the main one of the following event. If negative, the transition is subsidiary to the preceding main one, and is the negative of the interval from the main transition to this one.
pause If non-zero, the pause bit is set in the transition vector, causing a pause after the transition.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed

References RTYP_CAL_TRAN, and RVER_NULL.

int fesDataFmtCalPrec ( int  id,
const fesCalPedesData_t peds,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete calorimeter pedestal record.

This routine formats the supplied data into a complete pedestal data record for one calorimeter board.

Parameters:
id The ID of the calorimeter board.
peds The address of the array of calorimeter pedestal data.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed

References CAL_NCABLE, fesTranRec_u_t::data, and RTYP_CAL_PED.

Referenced by fesDataGenPedes().

int fesDataFmtCalTrec ( int  versn,
int  id,
const int *  treq,
int  intvl,
int  pause,
const int *  nhit,
const fesCalHits_t *const *  hits,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete calorimeter transition record.

This routine formats the supplied data into a complete transition record for one calorimeter board.

Parameters:
versn The format version of the generated data. The value RVER_NULL may be used to generate a record containing no trigger request or hits data.
id The ID of the calorimeter board.
treq The address of the array of trigger request line masks, one per cable. If NULL, the masks are generated from the hit data. Ignored if versn is RVER_NULL.
intvl The interval for this transition, in 50 nsec clock ticks. If non-negative, the transition is the main one of an event, and the interval is from this transition to the main one of the following event. If negative, the transition is subsidiary to the preceding main one, and is the negative of the interval from the main transition to this one.
pause If non-zero, the pause bit is set in the transition vector, causing a pause after the transition.
nhit The address of the array of the number of hits on each cable. Ignored if versn is RVER_NULL.
hits The address of the array of pointers to the arrays cantaining the hit data. There is one such array per cable. Each data array element contains: the log number (0 - 47), numbered so that logs 0 - 11 are those in layer 0, 12 - 23 in layer 1, etc.; some flags (use pedestals, log accept); the range; and the ADC value. Ignored if versn is RVER_NULL.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed

References CAL_DMEM_QUANTUM, CAL_LTVEC, CAL_NCABLE, RTYP_CAL_TRAN, RVER_CABLE, RVER_CBL_TIME, RVER_DET_TIME, and RVER_DETC.

int fesDataFmtCalTrec4 ( int  versn,
int  id,
const int *  treq,
int  intvl,
int  pause,
const int *  nhit,
const fesCalHits4_t *const *  hits,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete calorimeter transition record (four-range).

This routine formats the supplied four-range data into a complete transition record for one calorimeter board.

Parameters:
versn The format version of the generated data. The value RVER_NULL may be used to generate a record containing no trigger request or hits data.
id The ID of the calorimeter board.
treq The address of the array of trigger request line masks, one per cable. If NULL, the masks are generated from the hit data. Ignored if versn is RVER_NULL.
intvl The interval for this transition, in 50 nsec clock ticks. If non-negative, the transition is the main one of an event, and the interval is from this transition to the main one of the following event. If negative, the transition is subsidiary to the preceding main one, and is the negative of the interval from the main transition to this one.
pause If non-zero, the pause bit is set in the transition vector, causing a pause after the transition.
nhit The address of the array of the number of hits on each cable. Ignored if versn is RVER_NULL.
hits The address of the array of pointers to the arrays cantaining the hit data. There is one such array per cable. Each data array element contains: the log number (0 - 47), numbered so that logs 0 - 11 are those in layer 0, 12 - 23 in layer 1, etc.; some flags (use pedestals, log accept, auto-range); the first range to be output; and the ADC values for each range, in range number order. Ignored if versn is RVER_NULL.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed

References CAL_DMEM_QUANTUM, CAL_LTVEC, CAL_NCABLE, RTYP_CAL_TRAN, RVER_CABLE, RVER_CBL_TIME, RVER_DET_TIME, and RVER_DETC.

int fesDataFmtHrec ( int  dType,
long long  dMask,
int  nTran,
int  nEvent,
const char *  desc,
fesFileHead_u_t hRec 
)

Format header record.

This routine formats a complete data file header record using the supplied values.

Parameters:
dType The type of data in the file.
dMask A 40-bit mask containing a set bit for each of the detectors present in the file.
nTran The number of transition records in the file.
nEvent The number of event transition records in the file.
desc The address of a brief descriptive string, up to 80 bytes long.
hRec The address of the buffer to contain the formatted data.
Return values:
FES_SUCCESS Always success

References fesFileHead_u_t::dataType, fesFileHead_u_t::descrip, fesFileHead_u_t::detMask, fesFileHead_u_t::head, fesRecHead_u_t::leng, fesFileHead_u_t::nEvent, fesFileHead_u_t::nTran, RTYP_HEADER, fesRecHead_u_t::type, and fesRecHead_u_t::version.

Referenced by fesDataGen(), fesDataGenPedes(), and fesDataGenTrig().

int fesDataFmtTkrNrec ( int  id,
int  intvl,
int  pause,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete null tracker transition record.

This routine formats the supplied data into a complete null transition record for one tracker board.

Parameters:
id The ID of the tracker board.
intvl The interval for this transition, in 50 nsec clock ticks. If non-negative, the transition is the main one of an event, and the interval is from this transition to the main one of the following event. If negative, the transition is subsidiary to the preceding main one, and is the negative of the interval from the main transition to this one.
pause If non-zero, the pause bit is set in the transition vector, causing a pause after the transition.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed

References RTYP_TKR_TRAN, and RVER_NULL.

int fesDataFmtTkrTrec ( int  versn,
int  id,
const int *  treq,
int  intvl,
int  pause,
const int *  nhit,
const short *const *  hits,
char *  buff,
int  lBuff,
int *  nData 
)

Format a complete tracker transition record.

This routine formats the supplied data into a complete transition record for one tracker board.

Parameters:
versn The format version of the generated data. The value RVER_NULL may be used to generate a record containing no trigger request or hits data.
id The ID of the tracker board.
treq The address of the array of trigger request line masks, one per cable, with two cables per board side. If NULL, the masks are generated from the hit data. Ignored if versn is RVER_NULL.
intvl The interval for this transition, in 50 nsec clock ticks. If non-negative, the transition is the main one of an event, and the interval is from this transition to the main one of the following event. If negative, the transition is subsidiary to the preceding main one, and is the negative of the interval from the main transition to this one.
pause If non-zero, the pause bit is set in the transition vector, causing a pause after the transition.
nhit The address of the array of the number of hits on each cable. Ignored if versn is RVER_NULL.
hits The address of the array of pointers to the arrays containing the hit and TOT data. There is one such array per cable. Each data word (16-bit) contains the layer number (0 - 8) in the high order 4 bits and the strip number (0 - 1535) or TOT value (0 - 1023) in the low order 12 bits. The data must be grouped by layer number, and the layers arranged in ascending order. Within each non-empty layer, the one TOT value comes last preceded by the hit strip numbers in numerical order. Ignored if versn is RVER_NULL.
buff The address of a buffer to contain the formatted data.
lBuff An integer specifying the number of bytes available in the buffer.
nData The address of an integer to receive the number of bytes of data generated in the buffer.
Return values:
FES_SUCCESS Success
FES_BUFFSHRT The data buffer overflowed
FES_INVTKRDT The data is invalid

References RTYP_TKR_TRAN, RVER_CABLE, RVER_CBL_TIME, RVER_DET_TIME, RVER_DETC, TKR_DMEM_QUANTUM, TKR_LTVEC, and TKR_NCABLE.

int fesDataFmtTrecTime ( int  intvl,
int  pause,
char *  recd 
)

Format transition record time.

This routine updates the time field of a transition record using the supplied values. The record header must have previously been formatted correctly.

Parameters:
intvl The time interval for this transition, in 50 nsec clock ticks. If non-negative, the transition is the main one of an event, and the interval is from this transition to the main one of the following event. If negative, the transition is subsidiary to the preceding main one, and intvl is the negative of the interval from the main transition to this one.
pause If non-zero, the pause bit is set in the time field.
recd Address of the transition record to be updated.
Returns:
Always 0.

References ACD_NCABLE, fesTranRec_u_t::data, fesTranRec_u_t::head, RTYP_ACD_TRAN, fesRecHead_u_t::type, and fesRecHead_u_t::version.


Generated on Sat Apr 9 19:57:47 2011 by  doxygen 1.5.8