GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSE / V2-0-2 > lsew / rad750
#include "LSE/CDF_acd_std.h"
#include "LSE/CDF_acd_maps.h"
#include "CDF_acd_def.h"
#include "EDS/ACD_unpack.h"
#include "EDS/ACD_rec.h"
#include "EDS/ACD_map.h"
#include "EDS/EDR_acd.h"
#include "EDS/ECR_acd.h"
#include "EDS/EDA_acd.h"
#include "EDS/EBF_gem.h"
#include "EDS/FFS.h"
#include "LDT/BFP.h"
#include <string.h>
#include "LSE/cdf_buf_print.h"
#include "dprintf.h"
Classes | |
struct | _Summary |
Hit summary status. This is the OR of the Ha,Hb,Pa,Pb,V bits. More... | |
Typedefs | |
typedef struct _Summary | Summary |
Typedef for struct _Summary. | |
Functions | |
static __inline unsigned int | acd_std_pack_adrs (CDF_acd *cdf, unsigned int *buf, unsigned int pos, const EDR_acd *acd, const EBF_gem *gem, Summary *summary) |
Packs the list of ACD addresses. | |
static __inline unsigned int | acd_std_pack_adr (unsigned int *buf, unsigned int pos, unsigned int summary, unsigned int adr) |
Packs the ACD addressing information. This is an 8 bit value, 7-bits of actual address, 1 bit of stop information. | |
static __inline unsigned int | acd_std_pack_pats (CDF_acd *cdf, unsigned int *buf, unsigned int pos, const EDR_acd *acd, const EBF_gem *gem, const Summary *sum, const unsigned short int *map) |
Packs the list of ACD discriminator patterns. | |
static __inline unsigned int | acd_std_pack_pat32 (unsigned int *buf, unsigned int pos, const unsigned short int *map, unsigned int summary, unsigned int v, unsigned int hb, unsigned int ha, unsigned int pb, unsigned int pa) |
Packs the ACD discriminator pattern information for 32 channels. | |
static __inline unsigned int | acd_std_pack_phas (CDF_acd *cdf, unsigned int *buf, unsigned int pos, const EDR_acd *acd) |
Adds the ACD phas. | |
static __inline unsigned short int | acd_std_assess_phas (const unsigned int paccepts[2][4], const unsigned short int *phas, const unsigned short int *peds) |
Assesses the global properties of the PHAs, by effectively oring all 14 bits together. | |
static __inline unsigned int | acd_std_pack_pha (unsigned int *buf, unsigned int pos, unsigned int pb, unsigned int pa, unsigned int msk, unsigned int chn, const unsigned short int *phas, int shift, int width) |
Packs the ACD Pha values. | |
unsigned int | CDF_acd_std_compress (CDF_acd *cdf, unsigned int *buf, unsigned int pos, const EDR_acd *acd, const EBF_gem *gem) |
Adds the ACD record proper and the ACD portion of the GEM. | |
static __inline unsigned int | prepare (unsigned int w) |
Prepares the initial word of being used in the formation of the pattern word. | |
static __inline unsigned int | form (unsigned int v, unsigned int hb, unsigned int ha, unsigned int pb, unsigned int pa, int bit) |
Creates a 5 bit number with 5 bits representing the pattern of hit discriminators for the selected bit. |
CVS $Id: CDF_acd_std.c,v 1.4 2007/02/14 04:21:53 russell Exp $
This repacks the ACD and the ACD hit list in the GEM using non-statistical methods, effectively just rearranging the bit patterns. This reformatting of the ACD/GEM information can be done in a variety of ways determined by the format definition block. This block begins with a single escape bit, which
This bit provides a path to future expansion. At this time, only the standard encoding has been implemented
At the highest level, the standard encoding consists of 3 major blocks.
is run through a static Huffman code table that gives a code and code length. Thisis emitted into the output stream. For example, the pattern 0x1f, i.e. all bits set, is very common and given the code 0 with a length of 1 bit. Note that, by definition, the discriminator pattern list must be non-zero.
GEM Record ---------- Trigger : ThrTkr 10001100 CalHiLo 00000000 CondCno 0c030000 Acd : XZ 00010000 YZ 00000000 XY 00000000 RU 00000000 Times : Livetime 0075deda Event 01511659 PPS 7e6704e9 Counters: Discarded 00476cdc Prescaled 00000000 CondTim 3ffffc1f dWin d117d274 ACD Record ---------- Missing Start Bit: 0000 Header Parity Errors : 0000 PHA Unmatched : 0000 PHA Parity Summary: 0000 ACD hits : 00010000 00000000 00000000 00000000 00010000 00000000 00000000 00000000 PAccepts : 00010000 00000020 00000000 00000000 00010000 00000060 00000000 00000000 NAccepts : 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Number of PHAs : 5 XZ PhaA PhaB YZ PhaA PhaB XY PhaA PhaB RU PhaA PhaB --- ---- ---- --- ---- ---- --- ---- ---- --- ---- ---- 400 6b3 7a6 111 10f 110 0d4 130
Tile Address | Pattern | PHA B | PHA A |
0xf | 0x1f | 0x7a6 | 0x6b3 |
0x39 | 0x01 | 0x10f | |
0x3a | 0x03 | 0x0d4 | 0x130 |
Value | Binary | Description
|
0 | 0 | No exception, use standard encoding
|
0 | 0 | Stop address list, no
|
0x0f | 000 1111 | Tile address
|
0 | 0 | Stop address list, no
|
0x39 | 011 1001 | Tile address
|
1 | 1 | Stop address list, yes
|
0x3a | 011 1010 | Tile address
|
0x2 | 10 | Use static Pattern Encoding Table
|
0> | 0> | Code for pattern 0x1f
|
0x22 | 100010 | Code for pattern 0x2
|
0x23 | 100011 | Code for pattern 0x3
|
0 | 00 | No PHAs with either range 1 or data parity error
|
0x6b3 | 0110 1101 0011 | PHA value for A side, tile 0xf
|
0x7a6 | 0111 1010 0110 | PHA value for B side, tile 0xf
|
0x10f | 0001 1000 1111 | PHA value for B side, tile 0x39
|
0xd4 | 0000 1101 0010 | PHA value for A side, tile 0x3a
|
0x130 | 0001 0011 0000 | PHA value for B side, tile 0x3a
|
00000111100111001101110101100100 01010001101101001101111010011000 01100011110000110100100001001100 0
static __inline unsigned short int acd_std_assess_phas | ( | const unsigned int | paccepts[2][4], | |
const unsigned short int * | phas, | |||
const unsigned short int * | peds | |||
) | [static] |
Assesses the global properties of the PHAs, by effectively oring all 14 bits together.
paccepts | The PHA accepts | |
phas | The array of pha values | |
peds | The pedestals, arranged by GEM order |
static __inline unsigned int acd_std_pack_adr | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
unsigned int | summary, | |||
unsigned int | adr | |||
) | [static] |
Packs the ACD addressing information. This is an 8 bit value, 7-bits of actual address, 1 bit of stop information.
buf | The output buffer | |
pos | n The current bit offset | |
summary | The summary of any bit set for this base address | |
adr | Starting address |
static __inline unsigned int acd_std_pack_adrs | ( | CDF_acd * | cdf, | |
unsigned int * | buf, | |||
unsigned int | pos, | |||
const EDR_acd * | acd, | |||
const EBF_gem * | gem, | |||
Summary * | sum | |||
) | [static] |
Packs the list of ACD addresses.
cdf | The ACD compression data formatting handle | |
buf | The output buffer | |
pos | The current bit offset | |
acd | The input EDR_acd record | |
gem | The input EBF_gem record | |
sum | Returned as the 'or' of any action in the discriminator bits |
static __inline unsigned int acd_std_pack_pat32 | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
const unsigned short int * | map, | |||
unsigned int | summary, | |||
unsigned int | v, | |||
unsigned int | hb, | |||
unsigned int | ha, | |||
unsigned int | pb, | |||
unsigned int | pa | |||
) | [static] |
Packs the ACD discriminator pattern information for 32 channels.
buf | The output buffer | |
pos | The current bit offset | |
map | Mapping array translating a hit pattern into a variable length bit pattern (lower 4 bits are the length, upper 12 bits are the pattern. | |
summary | The OR of v, hb, ha, pb and pa | |
v | The GEM list of veto bits | |
hb | The ACD hit bits for side b | |
ha | The ACD hit bits for side a | |
pb | The ACD pulse height accept bits for side b | |
pa | The ACD pulse height accept bits for side a |
static __inline unsigned int acd_std_pack_pats | ( | CDF_acd * | cdf, | |
unsigned int * | buf, | |||
unsigned int | pos, | |||
const EDR_acd * | acd, | |||
const EBF_gem * | gem, | |||
const Summary * | sum, | |||
const unsigned short int * | map | |||
) | [static] |
Packs the list of ACD discriminator patterns.
cdf | The ACD compression data formatting handle | |
buf | The output buffer | |
pos | The current bit offset | |
acd | The input EDR_acd record | |
gem | The input EBF_gem record | |
sum | The 'or' of any action in the discriminator bits | |
map | The map used to pack the patterns |
static __inline unsigned int acd_std_pack_pha | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
unsigned int | pb, | |||
unsigned int | pa, | |||
unsigned int | msk, | |||
unsigned int | chn, | |||
const unsigned short int * | phas, | |||
int | shift, | |||
int | width | |||
) | [static] |
Packs the ACD Pha values.
buf | The output buffer | |
pos | The bit index into the output buffer | |
pb | The PHA B accept pattern | |
pa | The PHA A accept pattern | |
msk | Mask of the target channel | |
chn | The GEM ACD channel number | |
phas | The array of pha values | |
shift | The number of bits to shift the PHA value | |
width | The number of bits per PHA to store |
static __inline unsigned int acd_std_pack_phas | ( | CDF_acd * | cdf, | |
unsigned int * | buf, | |||
unsigned int | pos, | |||
const EDR_acd * | acd | |||
) | [static] |
Adds the ACD phas.
cdf | The ACD compression data formatting handle | |
buf | The output buffer | |
pos | The current bit offset | |
acd | The input EDR_acd record |
unsigned int CDF_acd_std_compress | ( | CDF_acd * | cdf, | |
unsigned int * | buf, | |||
unsigned int | pos, | |||
const EDR_acd * | acd, | |||
const EBF_gem * | gem | |||
) |
Adds the ACD record proper and the ACD portion of the GEM.
cdf | The ACD compression data formatting handle | |
buf | The output buffer | |
pos | The current bit offset | |
acd | The input EDR_acd record | |
gem | The input EBF_gem record |
static __inline unsigned int form | ( | unsigned int | v, | |
unsigned int | hb, | |||
unsigned int | ha, | |||
unsigned int | pb, | |||
unsigned int | pa, | |||
int | bit | |||
) | [static] |
Creates a 5 bit number with 5 bits representing the pattern of hit discriminators for the selected bit.
v | The GEM veto word | |
hb | The ACD hit map b word | |
ha | The ACD hit map a word | |
pb | The ACD pulse height accept b word | |
pa | The ACD pulse height accept a word | |
bit | The bit number (MSB = 0) to strobe out of the above 32-bit words |
V Hb Ha Pb Pa Bit#(5)
unsigned int prepare | ( | unsigned int | w | ) | [static] |
Prepares the initial word of being used in the formation of the pattern word.
w | The word to prepare |