ZDAB Zebra Data Acquisition/Analysis Bank ========================================= ( SHaRC bank name: PMT ) Contact: R.G. Van de Water (Penn). Revision History:- ================ SNOMAN ZDAB_PMT 2.07 R. Van de Water, First version of DAPM data structure. 2.08 1.0 R. Van de Water, Add record type, ZDAB_PMT format number and MC version and event number. Reorganize and clean up some stuff. Switch to ZDAB format. 3.00 2.0 R. Van de Water Add presource vertex class for MC packing. Add SRC_TYPE. N. West Add JUL_DAY, ISEED1, ISEED2, ISEED_NUM Rename RUN_TYPE -> DATA_TYPE 3.01 2.1 D. Wark TUBE_NO -> CCC (Crate/Card/Channel) 2.2 J. Klein Added packing of full Trigger information R. Van de Water Update PMT bundle information to match production version of electronics. 2.3 N. West Use new CCC (Card/Crate/Channel) Add link to PBUN if required. 3.02 N. West Correct bug in comment on TIME_50MHZ_LO/_HI Add comment about SHaRC bank name. Replace: DAQ_STATUS -> SUB_RUN. 4.01 G. McGregor Add sub fields for TSLH (or general) offset in word 5 of header. N. West CAL_TYPE -> STAT_10MHZ. 4.02 G. McGregor Add sub fields for HCA. 5.00 N. West Add NCD subfields. Revise Multiplexer Record Fix Multiplexer Record scope bits and Scope Time Record latch register width (both reported by P. Skensved) Revised mux data record: Add scope routing/fired/busy Revised trigger card: Add Mux GTID, Shaper GTID. Add GeneralDataType (incomplete). 5.01 A. Anthony Add sub fields for QRC. Description ----------- Holds bit packed event and monte carlo information in a single bank which can be output as a standalone and unMASTed. Reference Links --------------- None. Structural Links ---------------- -1 -KZDAB_PBUN PBUN PMT bundle bank. Bank Format ----------- The bank contains the following types of records, sub-fields and sub-records:- o Event Header o PMT Event Data o Monte Carlo Header o MC Data o TSLH information o HCA information o NCD information o QRC information * o The following is the PMT header and event format for the * production electronics, Sept 15/97. * o Event Header Record (one per event trigger): * Number * Name WORD LSB Pos. of Bits Description * RECORD_TYPE 1 26 7 Record type (e.g. PMT, NCD, etc). * MC_FLAG 1 25 1 0=Real event, 1= MC event. * VER_NUM 1 17 8 ZDAB_PMT format number number. * DATA_TYPE 1 1 16 Run Type (see id_run_types.doc). * RUN_NUMBER 2 1 32 Run number. * EV_NUMBER 3 1 32 Event number in this Run. * SUB_RUN 4 17 16 Sub-run number. =0 if run no. < 10614 * NHITS 4 1 16 Number of fired PMT's. See Note5 * PCK_TYPE 5 29 4 MC packing type: * 0= PMT info only * 1= 0 plus source bank info * 2= 1 plus jitter/cerenkov history * STAT_10MHZ 5 25 4 10MHz clock status. See STAT_10MHZ_* * in bank_zdab_pmt.inc * ----------------extended in SNOMAN v4.01-------------------------------- * SUB_FIELD 5 24 1 0= No sub fields * 1= Sub field to follow * FIELD_LEN 5 1 23 Offset in 4-byte words to first * (OFFSET) sub field (zero if no sub fields) * See note 7. * ------------------------------------------------------------------------ * TIME_10MHZ_LO 6 1 32 Low order 100 nsec ticks. * TIME_10MHZ_HI 7 1 21 High order 100 nsec ticks. * TIME_50MHZ_LO 7 22 11 Low order 20 nsec ticks. * TIME_50MHZ_HI 8 1 32 High order 20 nsec ticks. * GTRIG_ID 9 1 24 Global Trigger ID (24 bit count) * TRIG_TYPE_LO 9 25 8 Low order bits of Trigger Word * TRIG_TYPE_HI 10 1 19 Hi order bits of Trigger Word * SUM_PEAK 10 20 10 Digitized peak of analog sum * SUM_DIFF_LO 10 30 3 Low order bits of a.s. derivative * SUM_DIFF_HI 11 1 7 Hi order bits of a.s. derivative * SUM_INT 11 8 10 Digitized integral of analog sum * TRIG_ERR 11 18 15 Trigger error bits plus spares * o PMT Event Data Record (one per PMT bundle (single hit), where NPMT is * hit number offset): * Number * Name WORD LSB Pos. of Bits Description * FLAG1 NPMT+1 31 2 Bit 32 = CGT ES24 * Bit 31 = CGT ES16. * CCC NPMT+1 17 14 Crate Card Channel. * TRIG_ID1 NPMT+1 1 16 Global Trigger ID Bits 15-0. * FLAG2 NPMT+2 29 4 Bit 32 = CMOS ES16 * Bit 31 = LGISELECT (1=long sample) * Bit 30 = NC/CC Flag * Bit 29 = Missed Count. * ADC_QHS NPMT+2 17 12 Charge ADC counts for the high * gain short integrate channel. * NCELL NPMT+2 13 4 CMOS Cell number. * ADC_QLX NPMT+2 1 12 Charge ADC counts for the low * gain long/short integrate channel. * TRIG_ID3 NPMT+3 29 4 Global Trigger ID Bits 23-20. * ADC_TAC NPMT+3 17 12 PMT Time ADC counts. * TRIG_ID2 NPMT+3 13 4 Global Trigger ID Bits 19-16. * ADC_QHL NPMT+3 1 12 Charge ADC counts for the high * gain long integrate channel. * o Monte Carlo Header Record (one per event, only appended when PCK_TYPE * is set, see above notes. NSRC is the source and NTRK is the track * bank number offsets): Number * Name WORD LSB Pos. of Bits Description * o MC Header (one per event): * MCVER_NUM NSRC+1 17 16 SNOMAN MC version number. * NSVX NSRC+1 1 16 Number of source vertices. * MCEVN NSRC+2 1 32 MC event number, may be different * than EV event number above. * JUL_DAY(1) NSRC+3 1 32 Julian date. * JUL_DAY(2) NSRC+4 1 32 Universal Time seconds. * JUL_DAY(3) NSRC+5 1 32 Universal Time nanoseconds. * ISEED1 NSRC+6 1 16 First random number seed. * ISEED2 NSRC+6 17 16 Second random number seed. * ISEED_NUM NSRC+7 1 32 Random number number. * o MC Data (one per source vertex + hanging tracks): Number * Name WORD LSB Pos. of Bits Description * INT_TYPE NSRC+8 1 32 Vertex Interaction type. * IX0 NSRC+9 1 16 Vertex X position. * IY0 NSRC+9 17 16 Vertex Y position. * IZ0 NSRC+10 1 16 Vertex Z position. * Note: position packing range is 0 to 1000cm with a resolution of 0.03cm. * NTRK NSRC+10 17 8 Number of tracks for this vertex. * SRC_TYPE NSRC+10 25 8 Vertex Class, (Pre)Source=(1)0. * IT0(1) NSRC+11 1 32 First word of double prec. time. * IT0(2) NSRC+12 1 32 Second word of double prec. time. * PTYPE NSRC+NTRK+1 1 16 Particle type. * IENE NSRC+NTRK+2 1 32 Particle energy. * IDCOSX NSRC+NTRK+1 17 16 Track direction x-cosine. * IDCOSY NSRC+NTRK+3 1 16 Track direction y-cosine. * IDCOSZ NSRC+NTRK+3 17 16 Track direction z-cosine. * Note: direction packing range is -1 to +1 with a resolution of 3.1e-5. * TAC_UNJIT NPMT+1 1 12 Unjitter PMT time. * CER_HIST NPMT+1 13 20 Cerenkov history (undefined). * o TSLH information, subfield id=13UL *header LSB Number * Name WORD Pos. of Bits Description * FIELD_LEN OFFSET+1 1 23 Size of this sub-field in 4-byte * words (including header) * SUB_FIELD OFFSET+1 24 1 0= No sub fields * 1= Sub field to follow * SUB_FIELD_ID OFFSET+1 25 8 ID number for this subfield *endheader * TSLH1 OFFSET+1+i 21 10 Time 1, packed * TSLH2 OFFSET+1+i 11 10 Time 2, packed * TSLH3 OFFSET+1+i 1 10 Time 3, packed * o HCA information, subfield id=14UL (new) id=15UL (Queens) *header LSB Number * Name WORD Pos. of Bits Description * FIELD_LEN OFFSET+1 1 23 Size of this sub-field in 4-byte * words (including header) * SUB_FIELD OFFSET+1 24 1 0= No sub fields * 1= Sub field to follow * SUB_FIELD_ID OFFSET+1 25 8 ID number for this subfield *endheader * HCA1 OFFSET+1+i 1 10 Time 1, in 10ths of nsecs * HCA2 OFFSET+1+i 11 10 Time 2, in 10ths of nsecs * HCA3 OFFSET+1+i 21 10 Time 3, in 10ths of nsecs * o NCD information, subfield id=16UL * Name WORD Pos. of Bits Description * FIELD_LEN OFFSET+1 1 23 Size of this sub-field in 4-byte * words (including header) * SUB_FIELD OFFSET+1 24 1 0= No sub fields * 1= Sub field to follow * SUB_FIELD_ID OFFSET+1 25 8 ID number for this subfield The NCD sub-field is a compound one, containing within it a series of NCD sub-records. Currently the form is still being revised but the following have been identified:- o Clock Record (0xF0) o GTID Record (0xC0) o Shaper Card Global Record (0xA0) o Shaper Record (0x50) o Multiplexer Global Record (0x90) o Multiplexer Record (0xE0) o Scope Time Record (0xB0) o Scope Record (0xD0) o Generic Record (0x60) * o Clock Record (One preceeding shaper records, one preceding mux records) *header LSB Number * Name WORD Pos. of Bits Description NCD_CLK_UP OFFSET+1 1 24 Upper 24 bits of clock. NCD_REG OFFSET+1 25 3 Latch register id (0-4) NCD_TYPE OFFSET+1 28 5 Clock record id (0xF0) NCD_CLK_LW OFFSET+2 1 32 Lower clock register (32 bits). Stored in EV bank. * o GTID Record (One per event) *header LSB Number * Name WORD Pos. of Bits Description NCD_GTID OFFSET+1 1 24 GTID (24 bits) NCD_SH_GTID OFFSET+1 25 1 Flag: Record is associated with shaper event. NCD_MX_GTID OFFSET+1 26 1 Flag: Record is associated with mux event. NCD_ SYNC OFFSET+1 27 1 Sync clear error NCD_TYPE OFFSET+1 28 5 GTID record id (0xC0). Stored in EV bank. * o Shaper Card Global Record (One for each shaper card that fired within coin. window). *header LSB Number * Name WORD Pos. of Bits Description NCD_BOARD OFFSET+1 1 4 Board number. NCD_SPARE1 OFFSET+1 5 23 Spare. NCD_TYPE OFFSET+1 28 5 Shaper card global record id (0xA0). NCD_NSCLR OFFSET+2 1 28 Scaler value. NCD_SPARE2 OFFSET+2 29 4 Spare. Stored in NESG bank. * o Shaper Record (One for each shaper that fired within coincidence window). *header LSB Number * Name WORD Pos. of Bits Description NCD_CHARGE OFFSET+1 1 12 ADC value from shaper NCD_CHAN OFFSET+1 13 4 Shaper channel. NCD_SLOT OFFSET+1 17 4 ORCA defined reference number NCD_SPARE OFFSET+1 21 7 Spare NCD_TYPE OFFSET+1 28 5 Shaper record id (0x50). Stored in NES bank. * o Multiplexer Global Record (One for each multiplexer that fired within coincidence window). *header LSB Number * Name WORD Pos. of Bits Description NCD_MUX_FIRED OFFSET+1 1 8 Mux fired register (Mux i fired in bit i+1 set) NCD_SCOPE_BUSY OFFSET+1 9 2 Scope busy (A[=0] is bit 10) (but may be busy from a previous event) NCD_SCOPE_FIRED OFFSET+1 11 2 Scope fired (A[=0] is bit 12) (scope that actually received the event. Should never get both bits set) NCD_SCOPE_ROUTE OFFSET+1 13 2 Scope trigger routing settings.(A[=0] is bit 14) (which scopes can received data. If both set - the normal case - then toggle between them and all events have both these bits set). NCD_UNDEFINED OFFSET+1 15 2 Undefined. NCD_SPARE OFFSET+1 17 11 Spare NCD_TYPE OFFSET+1 28 5 Mux record id (0x90). Stored in NEMG bank. * o Multiplexer Record (One for each multiplexer that fired within coincidence window). *header LSB Number * Name WORD Pos. of Bits Description NCD_CHAN OFFSET+1 1 12 Mux data - Channels that fired. NCD_SPARE OFFSET+1 13 5 Spare NCD_SCOPE_BUSY OFFSET+1 18 2 Scope busy (A[=0] is bit 19) (but may be busy from a previous event) NCD_SCOPE_FIRED OFFSET+1 20 2 Scope fired (A[=0] is bit 21) (scope that actually received the event. Should never get both bits set) NCD_SCOPE_ROUTE OFFSET+1 22 2 Scope trigger routing settings.(A[=0] is bit 23) (which scopes can received data. If both set - the normal case - then toggle between them and all events have both these bits set). NCD_BUS OFFSET+1 24 3 Mux bus number. NCD_TYPE OFFSET+1 28 5 Mux record id (0xE0). Stored in NEMS bank. * o Scope Time Record (One preceeding scope records) *header LSB Number * Name WORD Pos. of Bits Description NCD_CLK_UP OFFSET+1 1 24 Upper 24 bits of clock. NCD_REG OFFSET+1 25 3 Latch register id (0-4) NCD_TYPE OFFSET+1 28 5 Clock record id (0xB0) NCD_CLK_LW OFFSET+2 1 32 Lower clock register (32 bits). Stored in NEMS bank. * o Scope Record (One for each channel of oscilloscope that fired within coincidence window). *header LSB Number * Name WORD Pos. of Bits Description NCD_OS_LEN OFFSET+1 1 16 Length of waveform NCD_SPARE OFFSET+1 17 3 Spare NCD_CHAN OFFSET+1 20 4 Oscilloscope channel. NCD_SCOPE OFFSET+1 24 4 Oscilloscope number. NCD_TYPE OFFSET+1 28 5 Oscilloscope record id (0xD0). *endheader * OFFSET+1+i Byte packed waveform (i = 1 .. Length of waveform) Stored in NEMS bank. * o Generic Record This record holds a number sub types. *header LSB Number * Name WORD Pos. of Bits Description NCD_SIZE OFFSET+1 1 16 Length of generic record (bytes) - including this header word NCD_SPARE OFFSET+1 17 11 Spare NCD_TYPE OFFSET+1 28 5 Generic record id (0x60). NCD_SUB_SIZE OFFSET+2 1 16 Size of generic sub record (bytes) - including this header word NCD_SUB_TYPE OFFSET+2 17 16 Type of generic sub record The following comes from NcdDataTypes.h; it will be tidied up when these records are supported. The generic sub types are:- Undefined 0x00000000 // Undefined generic type. NCDModelPulserSettingsRecord 0x00000001 // Pulser settings. NCDModelLogAmpTask 0x00000002 // Log amp task. NCDModelLinearity 0x00000003 // Linearity task. NCDModelThreshold 0x00000004 // Threshold task. NCDModelStepPDS 0x00000005 // Model step task. ORShaperModelScalers 0x00000006 // Scalers. ORHPPulserModel 0x00000007 // HP Pulser. notes: 1) If a GTID is included with a particular sub record it will be bits 0-24 of the word immediately following the generic sub record header. 2) More than one sub record type can be in a given general data type record. Currently we have not used this capability at this time. The way you know that such a multi sub record exists is that the overall size will be more than 4 bytes larger than the sub record size. And their formats are:- Sub types of generic records Pulser Settings Composed of 5 pieces of data: GTID, waveform, amplitude, burst rate and width of pulser (after header) xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Global Trigger ID xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Pulser waveform (int) xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Pulser amplitude (float) xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Pulser burst rate (float) xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Pulser width (float) Tasks Composed of 2 pieces of data: GTID, stop/start (after header which says which task) xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Global Trigger ID xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx --------------------------------------^- 1==Started, 0==Stopped Scaler records Composed of header, then global scalers (1 per card) and channel scalers (as many as enabled) xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Header Word ^^^^ ^^^^ ^^^^ ^^^^--------------------- Record ID (from header) --------------------^^^^ ^^^^ ^^^^ ^^^^- Length xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Global Scaler Header -----^^^^------------------------------- Crate Number ----------^^^^-------------------------- Card Number xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Global Scaler Value (32 bits) xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx Scaler Value -----^^^^------------------------------- Crate number ----------^^^^-------------------------- Card number ---------------^^^^--------------------- Channel number --------------------^^^^ ^^^^ ^^^^ ^^^^- Scaler Value Scaler Values continue until the total length is used up. Stored in NGGR bank. * o QRC information, subfield id=17UL *header LSB Number * Name WORD Pos. of Bits Description * FIELD_LEN OFFSET+1 1 23 Size of this sub-field in 4-byte * words (including header) * SUB_FIELD OFFSET+1 24 1 0= No sub fields * 1= Sub field to follow * SUB_FIELD_ID OFFSET+1 25 8 ID number for this subfield *endheader * QRC OFFSET+1+i 1 10 Charge Rate Correction * Note1: undefined words mean that at the moment they are not explicitly * defined by the DAQ/electronics. * * Note2: LSB Pos. is the Least Significant Bit position of the bit pattern * packed into WORD (where 1 corresponds to LSB and 32 to MSB of * WORD). * * Note3: When the event builder becomes defined then TRIG_ID will be moved * from each PMT bundle to the Event Header Record. TRIG_ID will * also have to be expanded to 24 bits for the FEC32 card. * * Note4: PCK_TYPE and CAL_TYPE are defined for MC data only. These bits * are free to be redefined for real data. * * Note5: NHITS is actually the number of PMT bundles and so includes outward * looking and low gain PMT signals as well as any calibration signals * fed through the FECs. * * Note6: TSLH times are in the same order as PMT bundles. * * Note7: This offset follows the same rules as the extension header word. * Thus, it is a relative offset from that location or, in other * words, the number of words in the normal zdab bank - 4.