GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EFC / dev > gfc / rhel6-64
#include <EDS/EBF_tkr.h>
#include <EFC/../src/TFC_trigger.h>
#include <PBI/FFS.ih>
Defines | |
#define | TFC_TRIGGER_PRINT |
If defined, then the internal debugging macro TFC_TRIGGER_PRINTF is activated. | |
#define | TFC_TRIGGER_PRINTF(_args) |
Internal debugging macro, activated by defining TFC_TRIGGER_PRINT. | |
#define | OFFSET_EVEN 0 |
An additional offset (from the right) in a 32-bit word from where the set of even layers normally begin. | |
#define | OFFSET_ODD 7 |
An additional offset (from the right) in a 32-bit word from where the set of odd layers begin. | |
#define | TFC_TRG_REMAP_INIT(_trigger, _even, _odd, _e, _o) |
Remaps the specified even and odd layers from the trigger word to the canonical (LSB=Layer 0) order. | |
#define | TFC_TRG_REMAP(_trigger, _even, _odd, _e, _o) |
Remaps the specified even and odd layers from the trigger word to the canonical (LSB=Layer 0) order. | |
Functions | |
static __inline int | TFC__triggerRemap (int trigger) |
Remaps the trigger pattern word into the more conventional order. | |
static __inline int | TFC__trigger7of8Form (unsigned int x, unsigned int y, unsigned int xy012, unsigned int xy013, unsigned int xy023, unsigned int xy123) |
Forms the 7 / 8 coincidence pattern. | |
static __inline int | TFC__triggerForm (unsigned int x, unsigned int y) |
Looks for a 7/8 or 6/6 coincidence. If one is found returns the starting layer and number of layers in the coincidence. |
CVS $Id: TFC_triggerForm.h,v 1.4 2011/03/31 22:16:45 russell Exp $
#define OFFSET_EVEN 0 |
An additional offset (from the right) in a 32-bit word from where the set of even layers normally begin.
In order to properly form the coincidences, a buffer area between the bits representing the even and odd layers must be maintained. This defines the beginning of the set of bits representing the even layers. There is also an offset defined for the set of bits representing the odd bits. Only one of these is non-zero, but the code is written in such a way that the non-zero one can be either.
#define OFFSET_ODD 7 |
An additional offset (from the right) in a 32-bit word from where the set of odd layers begin.
In order to properly form the coincidences, a buffer area between the bits representing the even and odd layers must be maintained. This defines the beginning of the set of bits representing the idd layers. There is also an offset defined for the set of bits representing the even bits. Only one of these is non-zero, but the code is written in such a way that the non-zero one can be either.
Referenced by TFC__triggerForm().
#define TFC_TRG_REMAP | ( | _trigger, | |||
_even, | |||||
_odd, | |||||
_e, | |||||
_o | ) |
Value:
_even |= ((((_trigger)>>(EBF_TKR_RIGHT_BIT_K_L ## _e + OFFSET_EVEN)) & 1) \ << (EBF_TKR_K_L ## _e)); \ _odd |= ((((_trigger)>>(EBF_TKR_RIGHT_BIT_K_L ## _o + OFFSET_ODD )) & 1) \ << (EBF_TKR_K_L ## _o))
_trigger | The trigger word to remap | |
_even | Variable to receive the remapped even layers | |
_odd | Variable to receive the remapped odd layers | |
_e | The designator of the even layer to remap (0,2,4,6,8,A,C,E,G) | |
_o | The designator of the odd layer to remap (1,3,5,7,9,B,D,F,H) |
Referenced by TFC__triggerRemap().
#define TFC_TRG_REMAP_INIT | ( | _trigger, | |||
_even, | |||||
_odd, | |||||
_e, | |||||
_o | ) |
Value:
_even = ((((_trigger)>>(EBF_TKR_RIGHT_BIT_K_L ## _e + OFFSET_EVEN)) & 1) \ << (EBF_TKR_K_L ## _e)); \ _odd = ((((_trigger)>>(EBF_TKR_RIGHT_BIT_K_L ## _o + OFFSET_ODD )) & 1) \ << (EBF_TKR_K_L ## _o))
_trigger | The trigger word to remap | |
_even | Variable to receive the remapped even layers | |
_odd | Variable to receive the remapped odd layers | |
_e | The designator of the even layer to remap (0,2,4,6,8,A,C,E,G) | |
_o | The designator of the odd layer to remap (1,3,5,7,9,B,D,F,H) |
Referenced by TFC__triggerRemap().
static int TFC__trigger7of8Form | ( | unsigned int | x, | |
unsigned int | y, | |||
unsigned int | xy012, | |||
unsigned int | xy013, | |||
unsigned int | xy023, | |||
unsigned int | xy123 | |||
) | [static] |
Forms the 7 / 8 coincidence pattern.
x | The bit mask of X layers with hits with Xodd << 16 | Xeven | |
y | The bit mask of Y layers with hits with Yodd << 16 | Xeven | |
xy012 | The bit-wise and of layers 0,1 and 2 | |
xy013 | The bit-wise and of layers 0,1 and 3 | |
xy023 | The bit-wise and of layers 0,2 and 3 | |
xy123 | The bit-wise and of layers 1,2 and 3 |
If the coincidence pattern is over only 4 layers, the minimum, then only one bit will be set. If the pattern is over 5 layers, then 2 consecutive bits will be set.
The 7 of 8 coincidence is formed by and'd all the possible 3-fold coincidence between the x and y with the OR of the 'left-out' layer.
= xy012 & (x_or_y_3) | xy013 & (x_or_y_2) | xy023 & (x_or_y_1) | xy123 & (x_or_y_0)
The notation xy012, for example, means the 6/6 coincidence of the X and Y of layers 0,1,2.
Referenced by TFC__triggerForm().
static int TFC__triggerForm | ( | unsigned int | x, | |
unsigned int | y | |||
) | [static] |
Looks for a 7/8 or 6/6 coincidence. If one is found returns the starting layer and number of layers in the coincidence.
x | A bit mask of the X layers that have a hit strip. | |
y | A bit mask of the Y layers that have a hit strip. |
-1,No | possibiity of a trigger | |
-2,A | possibility of a trigger, but no 7/8 or 6/6 | |
>0,The | starting layer and length of the coincidence packed together as two 16 bit words, with the starting layer number in the MSB 16 bits. |
References _TFC_trigger::bf, _TFC_trigger_bf::layers, _TFC_trigger_bf::length, OFFSET_ODD, _TFC_trigger::si, _TFC_trigger_bf::start, TFC__trigger7of8Form(), TFC__triggerRemap(), TFC_K_TRIGGER_TYPE_4_OF_4, TFC_K_TRIGGER_TYPE_6_OF_6, TFC_K_TRIGGER_TYPE_7_OF_8, TFC_TRIGGER_PRINTF, and _TFC_trigger_bf::type.
Referenced by evaluateAtf(), and TFC_triggerFill().
static int TFC__triggerRemap | ( | int | trigger | ) | [static] |
Remaps the trigger pattern word into the more conventional order.
trigger | The trigger pattern word to remap. This is a bit mask of the struck layers as produced by the hardware |
0123456789abcdef0123456789abcdef fedcba9876543210fedcba9876543210 -------------------------------- 13579bdfh 02468aceg
hgfdebca9876543210
References TFC_TRG_REMAP, TFC_TRG_REMAP_INIT, and TFC_TRIGGER_PRINTF.
Referenced by TFC__triggerForm().