////////////////////////////////////////////////////////////////////////////// // File: Tcc_Monit_Data.hpp // Created: 29-FEB-2000 Philippe Laurens (implementation phase 2) // Updated: 15-Jun-2000 Move to Monitoring Data Implementation Phase 3 // cf. http://www.pa.msu.edu/hep/d0/ftp/tcc/monitoring/ // trigger_fw_monitoring_april2000.html // Add Per Bunch Scalers // Updated: 15-Dec-2000 Add the Luminosity Data Blocks (Full and Brief) // including a new "extended" header with more global // information reagarding data quality // Updated: 02-Feb-2001 Add the L1 Cal Trigger Tower ADC Monit Block Type // Updated: 18-Apr-2001 Upgrade the Tcc_Luminosity_Block_Number structure // to include the Run Number and Spec Trig Mask // Upgrade Tcc_Block_Luminosity_Full to have L1&L2 Errors // and L1 Event Dumped per ExpoGroup instead of per GeoSect ////////////////////////////////////////////////////////////////////////////// #ifndef __Tcc_Monit_Data__ #define __Tcc_Monit_Data__ ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // Variable Size Definitions ///////////////////////////// // Note: NT is Little-Endian. (OSF1 also, all Intel boxes too). // TCC will pack the data accordingly. // Let me know if that is an issue on any of the online environments. /// 8 bit integer variable typedef char int8; /// 16 bit integer variable typedef short int16; /// 32 bit integer variable typedef int int32; /// 64 bit integer variable #ifdef Linux typedef long long int int64; #elif defined NT_MSVCPP typedef __int64 int64; #else typedef long int64; #endif /// unsigned 8 bit integer variable typedef unsigned char uint8; /// unsigned 16 bit integer variable typedef unsigned short uint16; /// unsigned 32 bit integer variable typedef unsigned int uint32; /// unsigned 64 bit integer variable #ifdef Linux typedef unsigned long long int uint64; #elif defined NT_MSVCPP typedef unsigned __int64 uint64; #else typedef unsigned long uint64; #endif ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // All Data Blocks returned by TCC will start with a Header // Looking in the Header will tell you what the rest of the Data Block content is struct Tcc_Block_Header { uint32 ulBlock_Type ; /* holds a value of enum type Tcc_Block_Type */ uint32 ulFormat_Version ; /* holds a version number */ /* Made 32 bits to avoid all Endian-ness issues */ /* Initially kTcc_Version_L1fw_Prototype */ } ; // Enumerated type to describe the Data Block content type in field Tcc_Block_Header.ulBlock_Type enum Tcc_Block_Type { // eTcc_Block_Type_L1fw_Phase2 = 1, //obsolete eTcc_Block_Type_L1fw_Phase3 = 2, eTcc_Block_Type_L1fw_General = 2, // Still at "Phase 3" eTcc_Block_Type_Per_Bunch_Scaler = 3, // Still at "Phase 3" eTcc_Block_Type_L1fw_Hsro = 4, // Still at "Phase 3" eTcc_Block_Type_Luminosity_Brief = 5, // Now at "Phase 5" eTcc_Block_Type_Luminosity_Full = 6, // Now at "Phase 5" eTcc_Block_Type_Cal_TT_ADC = 7 // Now at "Phase 5" } ; // Cosmetic definition of data format version number // This is used to fill the ulFormat_Version field of the Tcc_Block_Header //#define kTcc_Version_L1fw_Prototype 1 // obsolete //#define kTcc_Version_L1fw_Phase2 kTcc_Version_L1fw_Prototype // obsolete #define kTcc_Version_L1fw_Phase3 2 #define kTcc_Version_L1fw_Phase4 3 #define kTcc_Version_L1fw_Phase5 4 ////////////////////////////////////////////////////////////////////////////// // The Beam Crossing Number is broken down into a Turn Number // and a Tick Number within the Turn. // // Note: The L1FW runs at the 132ns Beam Crossing Rate, // even when only 1 out of 3 bunches are filled. // A more precise number is 53.104 / 7 MHz // // To get a one-dimensional BeamX number, one needs to compute: // kTcc_L1fw_Max_TickNum * ulTurnNum + uiTickNum // // In order to derive a rate from the various counts, one needs to first compute // the difference between two time samples for the counted value // and for the one-dimensional Beam Crossing Number. // Rate_in_Hz = ( kTcc_BeamX_Rate * float(Delta_Counts) ) / float(Delta_BeamX) #define kTcc_L1fw_Max_TickNum 159 #define kTcc_BeamX_Rate 53104000 / 7 struct Tcc_L1fw_BeamX_Number //(used in definition of Data Blocks Below) { uint64 uqTurnNum ; // currently only 32 bits filled, but will become 64 bit Beam Crossing Turn Number uint32 ulTickNum ; // Beam Crossing Tick Number within the turn, from 1 to 159. Padded to 32 bits for alignment uint32 ulReserved ; } ; ////////////////////////////////////////////////////////////////////////////// // array dimension parameters (used in definition of some of the structures Below) #define kTcc_L1fw_Tot_SpTrg 128 // Total Number of Specific Triggers #define kTcc_L1fw_Tot_CorrGlobDis 4 // Total Number of Sources of Correlated Global SpTrg Disable #define kTcc_L1fw_Tot_DeCorrGlobDis 4 // Total Number of Sources of DeCorrelated Global SpTrg Disable #define kTcc_L1fw_Tot_IndivDis 2 // Total Number of Sources of Individual SpTrg Disable #define kTcc_L1fw_Tot_ExpGrp 8 // Total Number of Exposure Groups #define kTcc_L1fw_Tot_AoTerm 256 // Total Number of And-Or Input Terms #define kTcc_L1fw_Tot_GeoSect 128 // Total Number of Geographic Sections /////////////////////////////////////////////////////////////////////////////////// // Specific Trigger Monitoring Structure (used in definition of Data Blocks Below) // All scalers currently only have 32 bits filled, but will become 64 bit in the future struct Tcc_L1fw_Specific_Trigger { // SpTrg Allocated: Non-Zero if COOR has allocated the specific trigger uint8 ubAllocated ; // ID Number of the Exposure Group this Spec Trig belongs to. uint8 ubExpGrpNum ; // Mask of which sources of disable are being obeyed // cf. compiler constants kTcc_SpTrg_Obey_** below for definition of bit location uint16 uwObeyDisableMask ; // SpTrg Fired Count uint64 uqSpTrgFired ; // SpTrg And-Or Fired Count uint64 uqAndOrFired ; // SpTrg Fired Exposed Count // this is the number of crossing for which the SpTrg was enabled to fire // with all possible sources of disable included // i.e. - Exposure Group Front End Busy // - All 4 Sources of Correlated Global Disable // - Coor Disable // - Both Sources of Individual Spec Trig Disable // - All 4 Sources of DeCorrelated Global Disable // - Auto Disable // - Prescaler Disable // - Exposure Group And-Or Requirement uint64 uqSpTrgExposed ; // SpTrg Fired DAQ Enable Count // this is the number of crossing for which the SpTrg was enabled to fire // with all possible sources of DAQ disable included // i.e. all sources of disable except the Exposure Group And-Or Fired // i.e. - Exposure Group Front End Busy // - All 4 Sources of Correlated Global Disable // - Coor Disable // - Both Sources of Individual Spec Trig Disable // - All 4 Sources of DeCorrelated Global Disable // - Auto Disable // - Prescaler Disable uint64 uqDaqEnable ; // SpTrg DAQ DeCorrelated Enable Count // this is the number of crossing for which the SpTrg was enabled to fire // with all possible sources of disable included // i.e. - Coor Disable // - Auto Disable // - Prescaler Disable // - Both Sources of Individual Spec Trig Disable // - All 4 Sources of DeCorrelated Global Disable uint64 uqDeCorrDaqEnable ; // SpTrg DAQ Correlated Enable Count // this is the number of crossing for which the SpTrg was enabled to fire // with all possible sources of disable included // i.e. all correlated sources except the Exposure Group And-Or Fired // i.e. - Exposure Group Front End Busy // - All 4 Sources of Correlated Global Disable uint64 uqCorrDaqEnable ; // SpTrg Individual Disable Count // Correlated Source #0: L3 Individual SpTrg Disable // Correlated Source #1: Unused uint64 auqIndivDisable[kTcc_L1fw_Tot_IndivDis] ; // SpTrg Prescaler Disable Count uint64 uqPrescalerDisable ; // SpTrg Auto Disable Count uint64 uqAutoDisable ; // SpTrg Coor Disable Count uint64 uqCoorDisable ; } ; ////////////////////////////////////////////////////////////////////////////// // constants to use to parse the uwObeyDisableMask field of // the Tcc_L1fw_Specific_Trigger structure above // if the AND of one of these constants with the uwObeyDisableMask field is not Zero, // the Specific Trigger is programmed to obey the corresponding source of disable #define kTcc_SpTrg_Coor_Disable 0x0001 // Spec Trig is currently disabled by COOR #define kTcc_SpTrg_Obey_Prescaler 0x0002 // Spec Trig is Prescaled #define kTcc_SpTrg_Obey_AutoDis 0x0004 // Spec Trig is Auto Disabled #define kTcc_SpTrg_Obey_IndivDis0 0x0010 // Spec Trig Obey Indiv Disable #0 #define kTcc_SpTrg_Obey_IndivDis1 0x0020 // Spec Trig Obey Indiv Disable #1 #define kTcc_SpTrg_Obey_CorrGlobDis0 0x0100 // Spec Trig Obey Global Correlated Disable #0 #define kTcc_SpTrg_Obey_CorrGlobDis1 0x0200 // Spec Trig Obey Global Correlated Disable #1 #define kTcc_SpTrg_Obey_CorrGlobDis2 0x0400 // Spec Trig Obey Global Correlated Disable #2 #define kTcc_SpTrg_Obey_CorrGlobDis3 0x0800 // Spec Trig Obey Global Correlated Disable #3 #define kTcc_SpTrg_Obey_DeCorrGlobDis0 0x1000 // Spec Trig Obey Global DeCorrelated Disable #0 #define kTcc_SpTrg_Obey_DeCorrGlobDis1 0x2000 // Spec Trig Obey Global DeCorrelated Disable #1 #define kTcc_SpTrg_Obey_DeCorrGlobDis2 0x4000 // Spec Trig Obey Global DeCorrelated Disable #2 #define kTcc_SpTrg_Obey_DeCorrGlobDis3 0x8000 // Spec Trig Obey Global DeCorrelated Disable #3 // parameter to use as an index with the auqIndivDisable field of the Tcc_L1fw_Specific_Trigger data structure #define kTcc_L1fw_IndivDisable_L3 0 // parameters to use as an index with the auq*Corr fields of the Tcc_L1fw_Global_Disable data structure #define kTcc_L1fw_CorrGlobDisable_SkipNext 3 //Skip Next Beam Crossing #define kTcc_L1fw_DeCorrGlobDisable_CoorTCC 3 //TCC Global Disable, a.k.a COOR Pause /////////////////////////////////////////////////////////////////////////////////// // Exposure Group Monitoring Structure (used in definition of Data Blocks Below) /////////////////////////////////////////////////////////////////////////////////// // All scalers currently only have 32 bits filled, but will become 64 bit in the future struct Tcc_L1fw_Exposure_Group { // Exposure Group Allocated: // Non-Zero if COOR has allocated the Exposure Group uint8 ubAllocated ; // padding to preserve 64-bit alignment uint8 ubReserved1 ; uint8 ubReserved2 ; uint8 ubReserved3 ; // Exposure Group And-Or Fired Count // This is the result And-Or combination defined for this Exposure Group // This signal will affect all Specific Triggers using // this Exposure Group uint64 uqAoFired ; // Exposure Group Front-End Busy Disable Count // This is the OR of the L1 Busy signal // from all Geographic Sections in this Exposure Group // This signal will affect all Specific Triggers using // this Exposure Group uint64 uqFeBzDisable ; } ; /////////////////////////////////////////////////////////////////////////////////// // Global Sources of Disable Monitoring Structure (used in definition of Data Blocks Below) /////////////////////////////////////////////////////////////////////////////////// // These sources are global for all 128 Spec Triggers. // Each Specific Trigger may be programmed to obey or ignore these global sources // All scalers currently only have 32 bits filled, but will become 64 bit in the future struct Tcc_L1fw_Global_Disable { // SpTrg Correlated Global Disable Count // Correlated Source #0: Unused // Correlated Source #1: Unused // Correlated Source #2: Unused // Correlated Source #3: Skip Next Beam Crossing uint64 auqCorr[kTcc_L1fw_Tot_CorrGlobDis] ; // SpTrg Correlated Global Disable Count // Correlated Source #0: Unused // Correlated Source #1: Unused // Correlated Source #2: Unused // Correlated Source #3: TCC Global Disable, a.k.a COOR Pause uint64 auqDeCorr[kTcc_L1fw_Tot_DeCorrGlobDis] ; } ; /////////////////////////////////////////////////////////////////////////////////// // Geographis Section Structure (used in definition of Data Blocks Below) /////////////////////////////////////////////////////////////////////////////////// // All scalers currently only have 32 bits filled, but will become 64 bit in the future struct Tcc_L1fw_Geographic_Section { // Geo graphic Section Allocated: // Non-Zero if COOR has allocated this Geographic Section uint8 ubAllocated ; // padding to preserve 64-bit alignment uint8 ubReserved1 ; uint8 ubReserved2 ; uint8 ubReserved3 ; // L1 Busy Scaler: i.e. No buffer to store data awaiting L2 Decision uint64 uqL1Busy ; // L2 Busy Raw Scaler: i.e. No buffer to store data awaiting Transfer to L3 uint64 uqL2BusyRaw ; // L2 Busy Delay Scaler: i.e. L2 Busy while a L2 cycle is waiting on this Geo Sect uint64 uqL2BusyDelay ; // L2 Busy Cycles Scaler: i.e. Number of L2 cycles that had to wait because of this Geo Sect uint64 uqL2BusyCycles ; } ; /////////////////////////////////////////////////////////////////////////////////// // And-Or Term Scalers (used in definition of Data Blocks Below) /////////////////////////////////////////////////////////////////////////////////// // All scalers currently only have 32 bits filled, but will become 64 bit in the future struct Tcc_L1fw_Andor_Term { // And-Or Term Allocated: // Non-Zero if at least one SpTrg or Exposure Group is using the AoTerm uint8 ubAllocated ; // padding to preserve 64-bit alignment uint8 ubReserved1 ; uint8 ubReserved2 ; uint8 ubReserved3 ; // And-Or Fired Count uint64 uqAoTermFired ; } ; /////////////////////////////////////////////////////////////////////////////////// // This is the Monitor Data Block Content Definition for Type "L1 Framework General" /////////////////////////////////////////////////////////////////////////////////// // corresponding to now obsolete implementation Phase 2 // (cf. http://www.pa.msu.edu/hep/d0/ftp/tcc/monitoring/trigger_fw_monitoring_april2000.html) // This will be the content of the Opaque ITC message received from TCC struct Tcc_Block_L1fw_General_Phase2 { Tcc_Block_Header xHeader ; Tcc_L1fw_BeamX_Number xBeamX ; uint8 aubSpTrgAllocated[kTcc_L1fw_Tot_SpTrg] ; // Non-Zero if COOR has allocated the specific trigger uint64 aulSpTrgFired[kTcc_L1fw_Tot_SpTrg] ; // currently only 32 bits filled, but will become 64 bit SpTrg Fired Count uint8 aubAoTermAllocated[kTcc_L1fw_Tot_AoTerm] ; // Non-Zero if at least one SpTrg is using the AoTerm uint64 aulAoTermFired[kTcc_L1fw_Tot_AoTerm] ; // currently only 32 bits filled, but will become 64 bit SpTrg Fired Count } ; /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This is the Data Block Content Definition for Type "L1 Framework General" /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // corresponding to implementation Phase 3 // (cf. http://www.pa.msu.edu/hep/d0/ftp/tcc/monitoring/trigger_fw_monitoring_april2000.html) // This will be the content of the Opaque ITC message received from TCC struct Tcc_Block_L1fw_General_Phase3 { Tcc_Block_Header xHeader ; Tcc_L1fw_BeamX_Number xBeamX ; Tcc_L1fw_Specific_Trigger axSpTrg[kTcc_L1fw_Tot_SpTrg] ; Tcc_L1fw_Exposure_Group axExpGrp[kTcc_L1fw_Tot_ExpGrp] ; Tcc_L1fw_Global_Disable xGlobDis ; Tcc_L1fw_Andor_Term axAoTerm[kTcc_L1fw_Tot_AoTerm] ; Tcc_L1fw_Geographic_Section axGeoSect[kTcc_L1fw_Tot_GeoSect] ; } ; ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // This is the Data Block Content Definition for Type "L1 Framework General" // corresponding to the current implementation Phase 3 typedef Tcc_Block_L1fw_General_Phase3 Tcc_Block_L1fw_General ; ////////////////////////////////////////////////////////////////////////////// // array dimension parameters (used in definition of structures Below) #define kTcc_Pbs_Tot_ExpGrp kTcc_L1fw_Tot_ExpGrp // Total Number of Exposure Groups #define kTcc_Pbs_Tot_Foreign 10 // Total Number of Foreign Per Bunch Scaler #define kTcc_Pbs_Tot_Tick kTcc_L1fw_Max_TickNum // Total Number of Ticks in a Turn /////////////////////////////////////////////////////////////////////////////////// // Per Bunch Scalers (used in definition of Data Blocks Below) /////////////////////////////////////////////////////////////////////////////////// // All scalers currently only have 32 bits filled, but will become 64 bit in the future // - Ticks in a turn are numbered from 1 to 159 // - Per Bunch Scalers are arrays of 160x 64-bit scaler counts. // - The first element in each array (at index 0) holds a checksum // of all scaler counts for all 159 ticks. // - The element at index 1 holds the scaler count for tick #1, index 2 is tick #2, etc. // - The location of the populated bunches, typically numbered P1 to Pn by // the Accelerator Control Room needs to be determined separately. struct Tcc_L1fw_Per_Bunch_Scaler { uint64 auqTick[kTcc_Pbs_Tot_Tick+1] ; } ; // parameter to use as an index with the auqTick fields of the Tcc_L1fw_Per_Bunch_Scaler data structure // to retrieve the integrated sum of all ticks (i.e. the NON-per-bunch scaler) #define kTcc_Pbs_AllTicksIntegrated 0 /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This is the Data Block Content Definition for Type "Per Bunch Scalers" /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This will be the content of the Opaque ITC message received from TCC // - The Level 1 Trigger Framework instruments per bunch scalers for // 8 Exposure Groups // and 10 Foreign Per Bunch Scalers (i.e. PBS gated by some signal(s) external to the L1FW) struct Tcc_Block_Per_Bunch_Scaler { Tcc_Block_Header xHeader ; Tcc_L1fw_BeamX_Number xBeamX ; Tcc_L1fw_Per_Bunch_Scaler axExpGrp[kTcc_Pbs_Tot_ExpGrp] ; Tcc_L1fw_Per_Bunch_Scaler axForeign[kTcc_Pbs_Tot_Foreign] ; } ; ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // compiler constants to be used to decode the ubSystemNonOperational, // ubMonitDataNotCurrent, and ubTriggeredBeamX fields // in the Tcc_Block_Extended_Header structure below #define kTcc_System_Operational 0x00 #define kTcc_System_Non_Operational 0x01 #define kTcc_Monit_Data_Current 0x00 #define kTcc_Monit_Data_Not_Current 0x01 #define kTcc_Random_Crossing 0x00 #define kTcc_Triggered_Crossing 0x01 ////////////////////////////////////////////////////////////////////////////// // All Data Blocks returned by TCC will start with a Header // Looking in the Header will tell you what the rest of the Data Block content is // This is an extended version of the legacy Tcc_Block_Header // Tcc_Block_Header is used in "Implementation Phase 2" and "Phase 3" blocks, // Tcc_Block_Extended_Header is used in "Phase 4" blocks, including Luminosity Server Blocks struct Tcc_Block_Extended_Header { uint32 ulBlock_Type ; /* holds a value of enum type Tcc_Block_Type */ uint32 ulFormat_Version ; /* holds a version number */ /* see the kTcc_Version_L1fw_PhaseN compiler constants */ uint8 ubSystemNonOperational ; /* Flag reporting wheather the L1 Trigger System is opearational */ /* 0 = Operational, 1 = Non-Operational */ uint8 ubMonitDataNotCurrent ; /* Flag reporting wheather the Monit Data in the block is current */ /* When the Monit Data is not current, TCC returns mostly zeroes in all fields*/ /* 0 = Data Current, 1 = Data Not Current */ uint8 ubTriggeredBeamX ; /* TCC tries to capture Monit Data for Beam Crossing that resulted in a L1 Accept */ /* (i.e. a triggered Beam X). This may not be successful when the trigger rate is low */ /* 0 = Random Crossing, 1 = Triggered Crossing */ uint8 ubReserved ; /* Place Holder to reach 64 bit boundary */ uint32 ulReserved ; /* Place Holder to reach 64 bit boundary */ } ; ////////////////////////////////////////////////////////////////////////////// // compiler constants to be used to decode the ubIncremented field // in the Tcc_Luminosity_Block_Number structure below #define kTcc_LumBlockNum_Not_Incremented 0x00 #define kTcc_LumBlockNum_Incremented 0x01 ////////////////////////////////////////////////////////////////////////////// // compiler constants to be used to decode the uwLbnIncrementReasonMask bit fields // in the Tcc_Luminosity_Block_Number structure below #define kTcc_LumReason_Not_Incremented 0x0000 #define kTcc_LumReason_Timer 0x0001 #define kTcc_LumReason_ReqFromCoor 0x0002 #define kTcc_LumReason_ReqFromLumClient 0x0004 #define kTcc_LumReason_L1fwInit 0x0010 #define kTcc_LumReason_SclInit 0x0020 #define kTcc_LumReason_BeginStore 0x0040 #define kTcc_LumReason_EndStore 0x0080 #define kTcc_LumReason_StartRun 0x0100 #define kTcc_LumReason_StopRun 0x0200 #define kTcc_LumReason_Pause_Run 0x0400 #define kTcc_LumReason_Resume_Run 0x0800 #define kTcc_LumReason_PrescaleChange 0x1000 ////////////////////////////////////////////////////////////////////////////// // This structure describes the Logical Number and related system status struct Tcc_Luminosity_Block_Number { uint32 ulLuminosityBlockNumber ; // This is the current Luminosity Block Number // When the LBN is incremented, this is the value AFTER increment uint8 ubIncremented ; // Flag showing whether this Luminosity Data corresponds // to the beginning of a new Luminosity Block Number // 0 = No Increment, 1 = LBN Incremented uint8 ubReserved ; // Place Holder to maintain 16 bit alignment for next field uint16 uwIncrementReasonMask ; // When the LBN is incremented, this mask describes the reason for the increment // When ubIncremented = 0, uwIncrementReasonMask = 0x0000 // The format chosen is a bit mask and not a simple code number // because it is conceivable that we may someday want to make a smarter // usage of resources and, for example, delay incrementing a LBN while the system // is paused and no events are flowing (without forgetting the 60 sec limit). // // The bit fields should be decoded using the kTcc_LumReason_xyz constants // LSB Bit #0 Set = Nominal increment 60 sec after last increment // Bit #1 Set = Explicit request for increment from COOR // Bit #2 Set = Explicit request for increment from Luminosity Client // Bit #3 Unsused // Bit #4 Set = 'L1fw_Init' message from COOR // Bit #5 Set = 'SCL_Init' message from COOR // Bit #6 Set = 'Begin_Store' message from COOR // Bit #7 Set = 'End_Store' message from COOR // Bit #8 Set = 'Start_Run' message from COOR // Bit #9 Set = 'Stop_Run' message from COOR // Bit #10 Set = 'Pause_Run' message from COOR // Bit #11 Set = 'Resume_Run' message from COOR // (!) Bit #12 Set = Change of SpTrg prescale ratio from COOR // Bit #13 Unsused // Bit #14 Unsused // MSB Bit #15 Unsused // (!): SpTrg Prescale Ratios are not expected to change during a run, // and TCC will NEVER send a Luminosity Block for that reason, // or until further notice. // This field is only valid when the uwIncrementReasonMask above // is flagging a 'Start_Run', 'Stop_Run', 'Pause_Run', or 'Resume_Run' Message from COOR // This is the Run Number that COOR gave TCC with the corresponding message uint32 ulRunNumber ; uint32 ulReserved ; // Place Holder to maintain 64 bit alignment for next field // These fields are only valid when the uwIncrementReasonMask above // is flagging a 'Start_Run' Message from COOR // This is the mask of all Specific Triggers included in this new run. // bit #N of uqSpTrgMaskLower being set means that Spec Trig #N is part of the run // bit #N of uqSpTrgMaskUpper being set means that Spec Trig #N+64 is part of the run uint64 uqSpTrgMaskLower ; uint64 uqSpTrgMaskUpper ; } ; /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This is the Data Block Content Definition for Type "Luminosity Block Full" /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This structure describes the content of the Opaque ITC message received from TCC. // A block of this type will be pushed to the Luminosity Client (if a client is // connected to the server on port #52163) every 60 sec maximum. // A block of this type will be pushed to the Luminosity Client after 60 sec // have elapsed since a block of this type has last been sent. // A block of this type will also be pushed on certain programming messages from COOR. // A block of this type can also be explicitely requested on the Luminosity Server // Port #52163, and a request on this port will result in an increment of the LBN. // A block of this type can also be requested on the Monitoring Server Port #52162, // but a request on this port will NOT cause an increment of the LBN. struct Tcc_Block_Luminosity_Full { Tcc_Block_Extended_Header xHeader ; Tcc_L1fw_BeamX_Number xBeamX ; Tcc_Luminosity_Block_Number xLbn ; // This is the Foreign Per Bunch Scaler information // in the same format as in block of type Tcc_Block_Per_Bunch_Scaler Tcc_L1fw_Per_Bunch_Scaler axForeign[kTcc_Pbs_Tot_Foreign] ; //Note: DO NOT modify the fields above without updating the Tcc_Block_Luminosity_Brief // This is the Exposure Group Exposed Per Bunch Scaler information // in the same format as in block of type Tcc_Block_Per_Bunch_Scaler Tcc_L1fw_Per_Bunch_Scaler axExpGrp[kTcc_Pbs_Tot_ExpGrp] ; // This is the mapping of Specific Trigger to Exposure Group Number // aubSpTrgExpGrp[N] is the Exposure Group Number (#0:7) for SpTrg #N uint8 aubSpTrgExpGrp[kTcc_L1fw_Tot_SpTrg] ; // These are the Specific Trigger Prescale Ratios // aulSpTrgPrescaleRatio[N] is the prescale ratio for SpTrg #N uint32 aulSpTrgPrescaleRatio[kTcc_L1fw_Tot_SpTrg] ; // These are the Specific Trigger Prescale Percentage // aubSpTrgPrescalePercent[N] is the prescale percentage (1:100) for SpTrg #N // Prescale Ratios and Prescale Percentage are not used simultaneously // If (aubSpTrgPrescalePercent[N] != 1 ), then (aulSpTrgPrescaleRatio[N] == 100%) // If (aulSpTrgPrescaleRatio[N] != 100%), then (aubSpTrgPrescalePercent[N] == 1 ) // The Prescale Percentage feature of the L1fw hardware is not used at the moment uint8 aubSpTrgPrescalePercent[kTcc_L1fw_Tot_SpTrg] ; // These are the Specific Trigger Decorrelated Exposed Scalers // aulSpTrgDecorrExposed[N] is the Decorrelated Exposed count for SpTrg #N uint32 aulSpTrgDecorrExposed[kTcc_L1fw_Tot_SpTrg] ; // These are the Specific Trigger L1 Accept Scalers // aulSpTrgL1Accept[N] is the L1 Accept count for SpTrg #N uint32 aulSpTrgL1Accept[kTcc_L1fw_Tot_SpTrg] ; // These are the Specific Trigger L2 Accept Scalers // aulSpTrgL2Accept[N] is the L2 Accept count for SpTrg #N uint32 aulSpTrgL2Accept[kTcc_L1fw_Tot_SpTrg] ; // These are the Geographic Section L1 Error Scalers projected onto each Exposure Group // aulExpGrpL1Error[N] is the L1 Error for Exposure Group Number #N uint32 aulExpGrpL1Error[kTcc_L1fw_Tot_ExpGrp] ; // These are the Geographic Section L2 Error Scalers projected onto each Exposure Group // aulExpGrpL2Error[N] is the L1 Error for Exposure Group Number #N uint32 aulExpGrpL2Error[kTcc_L1fw_Tot_ExpGrp] ; // These are the Exposure Group L1 Buffer Dumped Scalers // These corresponds to the number of events known to be awaiting a L2 Decision // at the time (before) TCC issues an SCL Init to all Geographic Sections. // aulExpGrpL1Dumped[N] is the L1 Buffer Dumped count for Exposure Group Number #N uint32 aulExpGrpL1Dumped[kTcc_L1fw_Tot_ExpGrp] ; } ; /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This is the Data Block Content Definition for Type "Luminosity Block Brief" /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This structure describes the content of the Opaque ITC message received from TCC // A block of this type will be pushed to the Luminosity Client (if a client is // connected to the server on port #52163) every 5 sec max. // A block of this type will be pushed to the Luminosity Client after 5 sec // have elapsed since a block of this type or of type "Luminosity Block Full" // has last been sent. // A block of this type can also be requested on the Monitoring Server Port #52162. struct Tcc_Block_Luminosity_Brief { // This is a truncated version of the Tcc_Block_Luminosity_Full structure // cf. above for description of the fields Tcc_Block_Extended_Header xHeader ; Tcc_L1fw_BeamX_Number xBeamX ; Tcc_Luminosity_Block_Number xLbn; Tcc_L1fw_Per_Bunch_Scaler axForeign[kTcc_Pbs_Tot_Foreign] ; } ; ////////////////////////////////////////////////////////////////////////////// // array dimension parameters (used in definition of some of the structures Below) #define kTcc_L1ct_Tot_TT_Eta_Sign 2 // Total Number of Polarity // for Trigger Tower Eta Index //(i.e. Pos & Neg) #define kTcc_L1ct_Tot_TT_Eta_Magn 20 // Total Number of Magnitude // for Trigger Tower Eta Index //(i.e. 1..20) #define kTcc_L1ct_Tot_TT_Phi 32 // Total Number Trigger Tower Phi Index //(i.e. 1..32) #define kTcc_L1ct_Tot_TT_ADC_TimeSlice 8 // Total Number of Time Slices // constant to use with Trigger Tower Eta Sign parameter #define kTcc_L1ct_Tot_TT_Eta_Pos 0 // Trigger Tower Positive Eta Index #define kTcc_L1ct_Tot_TT_Eta_Neg 1 // Trigger Tower Negative Eta Index /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This is the Data Block Content Definition for Type "L1 Cal Trig Trigger Tower ADC" /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This structure describes the content of the Opaque ITC message received from TCC // A block of this type (eTcc_Block_Type_Cal_TT_ADC) can be requested on the // Monitoring Server Port #52162. struct Tcc_Block_Cal_TT_ADC { Tcc_Block_Extended_Header xHeader ; Tcc_L1fw_BeamX_Number xBeamX ; // Min/Max Trigger Tower Indices that are currently instrumented // Note: this may change from one sample to the next. unsigned long ulTTEtaSignMin ; // Min Eta Sign (0=Pos, 1=Neg) unsigned long ulTTEtaSignMax ; // Max Eta Sign (0=Pos, 1=Neg) unsigned long ulTTEtaMagnMin ; // Min Eta Magn (1..20) unsigned long ulTTEtaMagnMax ; // Max Eta Magn (1..20) unsigned long ulTTPhiMin ; // Min Phi (1..32) unsigned long ulTTPhiMax ; // Max Phi (1..32) unsigned char a4ubADC_EM [kTcc_L1ct_Tot_TT_Eta_Sign] [kTcc_L1ct_Tot_TT_Eta_Magn] [kTcc_L1ct_Tot_TT_Phi] [kTcc_L1ct_Tot_TT_ADC_TimeSlice] ; unsigned char a4ubADC_HD [kTcc_L1ct_Tot_TT_Eta_Sign] [kTcc_L1ct_Tot_TT_Eta_Magn] [kTcc_L1ct_Tot_TT_Phi] [kTcc_L1ct_Tot_TT_ADC_TimeSlice] ; // Note: The Trigger Tower most recent ADC count for Eta Index +E and Phi Index P // is at array element [kTcc_L1ct_Tot_TT_Eta_Pos][E-1][P-1][0] // and respectively [kTcc_L1ct_Tot_TT_Eta_Neg][E-1][P-1][0] // for Eta Index -E and Phi Index P } ; /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This is the Request packet expected by TCC's Monitoring Server /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // We use the same enumerated type Tcc_Block_Type to request a particular Data Block Type: // the Monitoring client should send an ITC Opaque Message // to the TCC Monitoring Server at d0tcc1.fnal.gov and IP Port #52162 // with the following content struct Tcc_Monit_Request { uint32 ulBlock_Type ; /* Will hold a value of enum type Tcc_Block_Type */ // I don't think we need anything else at the moment // TCC can get source information from ITC // (what executable, what version, from where) } ; /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // This is the Request packet expected by TCC's Luminosity Server /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // We use the same protocol as for the Monitoring Server. // The Luminosity Client should send an ITC Opaque Message // to the TCC Luminosity Server at d0tcc1.fnal.gov and IP Port #52163 // Note that only a request of type eTcc_Block_Type_Luminosity_Full // is accepted on port #52163, and this request will also cause // a LBN Increment. // The same request for type eTcc_Block_Type_Luminosity_Full // on port #52162 will return the latest luminosity block // without incrementing the LBN. // When a Luminosity Client connects to port #52163 *AND* makes // a request of type eTcc_Block_Type_Luminosity_Full, TCC will start // pushing blocks of type eTcc_Block_Type_Luminosity_Full every 60 sec // (nominal), and blocks of type eTcc_Block_Type_Luminosity_Brief // every 5 sec (nominal). #define Tcc_Luminosity_Request Tcc_Monit_Request #endif // __Tcc_Monit_Data__