Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:51

0001 #ifndef __PACKET_GL1_H__
0002 #define __PACKET_GL1_H__
0003 
0004 /*  
0005     GL1 Accepted Event Data - 
0006 
0007     This header file defines a standard structure that can be 
0008     used to map GL1 accepted event data into something a 
0009     bit more "useful".
0010 
0011     The documentation for the GL1 output data packets can be 
0012     found at:
0013 
0014     http://www.physics.iastate.edu/~npexp/papers.html
0015     (the article you want is "GL1 Update: Monitor and L1DD Data")
0016 
0017   HISTORY:
0018 
0019     6/08/99 J.Lajoie - first version
0020     6/09/99 J.Lajoie - updated, added multiple GL1, comments
0021     7/12/99 J.Lajoie - updated, structure made more reasonable to match data
0022     9/12/99 J.Lajoie - updated, removed zero words for GL1-1 and GL1-2
0023 
0024 */
0025 
0026 /* Each GL1 will have an output packet in the data stream */
0027 
0028 #define NUM_GL1_BOARDS  4
0029 
0030 #define HEADER3         0
0031 #define YEAR            1
0032 #define MONTH           2
0033 #define DATE            3
0034 #define DAY             4
0035 #define HOUR            5
0036 #define MIN             6
0037 #define SECGL1          7 // previous SEC collided with /usr/include/sys/time.h
0038 #define ALIGNMENT       8
0039 #define CROSSCTR        9
0040 #define BEAMCTR0       10
0041 #define BEAMCTR1       11
0042 #define GACCEPT        12
0043 #define ACPTORINP      13
0044 #define ACPTCTR        14
0045 #define GRANCTR        15
0046 #define GDISABLE       16
0047 #define FACCEPT        17
0048 #define HEADER2        18
0049 #define PACCEPT        19
0050 #define MODEBITS       20
0051 #define RBITS0         21
0052 #define RBITS1         22
0053 #define DCMFULL        23
0054 #define FEMUNREL       24
0055 #define GBUSY          25
0056 #define PXBAR          26
0057 #define PBUSY          27
0058 #define HEADER1        28
0059 #define LUTINPUT       29
0060 #define RAWTRIG        30
0061 #define TRIGBUSY       31
0062 #define LIVETRIG       32
0063 #define SCALEDTRIG     33
0064 #define TRIGPARXBAR    34
0065 
0066 /* A structure for the GL1-1 accepted event data */
0067 
0068 typedef struct{
0069 
0070   /* GL1 data */
0071   unsigned short int    gl1_header;                 /* 0x1aXX, XX=lower 8 bits of accept counter */
0072   unsigned       int    lut_input[8];               /* packed LUT input data */
0073   unsigned       int    lut_output;                 /* packed LUT output data (raw triggers) */
0074   unsigned       int    trigger_busy;               /* bit-coded trigger busies */
0075   unsigned       int    live_trig_out;              /* bit-coded live trigger output */
0076   unsigned       int    scaled_trig_out;            /* bit-coded scaled trigger output */
0077   unsigned       int    trig_part_xbar_out;         /* bit coded output of trig->part XBAR */ 
0078 
0079 } GL1_1_DATA;
0080 
0081 /* A structure for the GL1-2 accepted event data */
0082 
0083 typedef struct{
0084 
0085   /* GL2 data */
0086   unsigned short int    gl2_header;                 /* 0x2aXX, XX=lower 8 bits of accept counter */
0087   unsigned       int    partition_accept;           /* bit-coded partition accept vector */
0088   unsigned short int    mode_bits;                  /* GL1 mode bits for this event */
0089   unsigned       int    reduced_bits[2];            /* 64 bit reduced bit input for this event */  
0090   unsigned       int    dcm_full_fem_busy;          /* bit-coded dcm busy/FEM full vector */ 
0091   unsigned       int    fem_unreliable;             /* bit-coded FEM unreliable vector */
0092   unsigned       int    granule_busy;               /* bit-coded granule busy vector */
0093   unsigned       int    part_busy_xbar_out;         /* output of partition busy XBAR */
0094   unsigned       int    part_busy_bus;              /* partition busy bus for this event */
0095 
0096 } GL1_2_DATA;
0097 
0098 typedef struct{
0099 
0100 /* Time Stamp Structure */
0101   unsigned short year; 
0102   unsigned short month; 
0103   unsigned short date; 
0104   unsigned short day; 
0105   unsigned short hour; 
0106   unsigned short min; 
0107   unsigned short sec;
0108 
0109 }  GL1_TIME_STAMP ; 
0110 /* A structure for the GL1-3 accepted event data */
0111 
0112 typedef struct{
0113 
0114   /* GL3 data */
0115   unsigned short int   gl3_header;                  /* >0x3aXX, XX=lower 8 bits of accept counter */
0116   GL1_TIME_STAMP       timestamp;                   /* BCD coded timestamp */
0117   unsigned short int   alignment;                   /* system alignment bits */ 
0118   unsigned       int   beam_crossing_counter[2];    /* 64-bit beam crossing counter */
0119   unsigned short int   bunch_crossing_counter;      /* bunch crossing counter (reset by fiducial) */
0120   unsigned       int   granule_accept_vector;       /* bit-coded granule accept vector */
0121   unsigned       int   accept_or_input;             /* bit-coded input to accept OR */
0122   unsigned       int   gl1_accept_counter;          /* 32-bit GL1 accept counter */ 
0123   unsigned short int   granule_accept[32];          /* 16-bit granule accept counters */
0124   unsigned       int   granule_disables;            /* bit-coded granule disables */
0125   unsigned       int   forced_accepts;              /* bit-coded forced accepts */
0126 
0127 } GL1_3_DATA;
0128 
0129 typedef struct{
0130 
0131   GL1_3_DATA   gl3_payload;
0132   GL1_2_DATA   gl2_payload;
0133   int          gl1_boards;
0134   GL1_1_DATA   gl1_payload[NUM_GL1_BOARDS];
0135 
0136 } GL1_EVENT_DATA;
0137 
0138 
0139 #include <packet_w124.h>
0140 
0141 /**
0142    This is the packet which deals with data in GL1 format.
0143    It inherits from Packet\_w4 because the data are 32bit entities.
0144 */
0145 #ifndef __CINT__
0146 class WINDOWSEXPORT Packet_gl1 : public Packet_w4 {
0147 #else
0148 class  Packet_gl1 : public Packet_w4 {
0149 #endif
0150 public:
0151   Packet_gl1(PACKET_ptr);
0152   ~Packet_gl1();
0153  virtual int  iValue(const int channel, const char *what);
0154  virtual int  iValue(const int channel, const int what);
0155  virtual void dump ( OSTREAM& );
0156 
0157 protected:
0158   virtual void demangle ();
0159   virtual int *decode (int *);
0160   GL1_EVENT_DATA* sgl1;
0161 };
0162 
0163 #endif /* __PACKET_GL1_H__ */
0164 
0165 
0166 
0167 
0168 
0169 
0170 
0171 
0172 
0173 
0174 
0175 
0176 
0177 
0178 
0179 
0180