////////////////////////////////////////////////////////////////////////////// // File: L1_Tcc_Monit_Data_BeamX.hpp // Created: 07-OCT-2001 Philippe Laurens (split away from Tcc_Monit_Data.hpp) ////////////////////////////////////////////////////////////////////////////// #ifndef __L1_Tcc_Monit_Data_BeamX__ #define __L1_Tcc_Monit_Data_BeamX__ ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // array dimension parameters (used in definition or usage of some of the structures Below) #define kTcc_L1fw_Tot_TurnScaler 6 // Total Number of Turn Number Scalers ////////////////////////////////////////////////////////////////////////////// // 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 /////////////////////////////////////////////////////////////////////////////////// //Tick and Turn Scaler Sub-Structure (used in definition of Monitoring Data Blocks) /////////////////////////////////////////////////////////////////////////////////// // This data structure is extended for Monitoring Data in implementation phase 6 // as it is replaced by L1_Tcc_Fw_BeamX_Data below. // But it is still used by the Hsro, the Card Info and the L2 Hardware Scaler Block Types // and by the Luminosity Data Block types struct L1_Tcc_L1fw_BeamX_Number { 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 ; } ; #ifdef TCC_SUPPORT_PHASE3_MONIT_DATA typedef L1_Tcc_L1fw_BeamX_Number Tcc_L1fw_BeamX_Number ; // for backwards compatibility #endif // TCC_SUPPORT_PHASE3_MONIT_DATA /////////////////////////////////////////////////////////////////////////////////// //This is the expanded definition starting with Phase 6 struct L1_Tcc_Fw_BeamX_Data { // Tick and Turn Number to use as time stamp for converting // all L1 FW scaler counts to rates and percentages. // This number is reset by an initialize request from COOR, // but NOT by SCL Initialize uint64 uqTurnNum_for_L1fwData ; // Total number of Turns in the machine // ubTickNum_for_L1fwData is the Tick number of the event captured by the snapshot. uint8 ubTickNum_for_L1fwData ; // Tick Number within the current Turn, from 1 to 159. // ubTickNum_for_Current is *NOT* the Tick Number // of the event captured by the snapshot. // ubTickNum_for_Current is the scaler used to generate the Tick Number // for the current beam crossing in the machine (as captured while this event // was processed by the L1FW) which is sent to the front-ends via SCL. // Note that the "Current Tick and Turn Number" sent over the SCL // is actually adjusted to arrive at the front-ends ahead by a defined // number of crossings (7 at the moment). // There is a fixed difference between the "current" crossing tick number // and the crossing processed by the L1FW tick number (30 at the moment). uint8 ubTickNum_for_Current ; // Current Fifo Depth used to hold the Tick and Turn Number for SCL protocol // after the L1 Trigger Framework has issued an L1 Accept // and until the L2 Trigger Framework issues the corresponding L2 Decision uint8 ubFifoDepth ; // Reserved uint8 ubReserved ; uint32 ulReserved ; // Beam Crossing Number to use as time stamp for converting // all L2 FW scaler counts to rates and percentages. // Warning: This is a total tick count, and NOT a Tick and Turn Number as above. // This number is reset by an initialize request from COOR. uint64 uqBeamX_for_L2fwData ; // Turn Number // #0 : Turn Number Current in the machine (as sent to SCL) // #1 : Turn Number currently processed by the L1 Framework // #2 : Total Turn Count since last SCL Initialize // #3 : Total Turn Count since last Luminosity Block Number Increment // #4..5 : Reserved // Scalers #0 & 1 are reset by an initialize request from COOR // AND by each SCL Initialize // Scalers #2 is reset every time an SCL Initialize is performed by TCC // and its current count will thus measure the time since the last SCL init. // Scalers #3 is reset every time TCC increments the luminosity block number. // Turn Scalers #1..3 are associated with tick number ulTickNum_for_L1fwData above. // Turn Scaler #0 is associated with tick number ulTickNum_for_Current above. uint64 auqTurnNum[kTcc_L1fw_Tot_TurnScaler] ; } ; /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // parameters to use as an index with the auqTurnNum field of L1_Tcc_Fw_BeamX_Data #define kTcc_L1fw_Turn_Current 0 // Turn Number Current in the machine #define kTcc_L1fw_Turn_Processed 1 // Turn Number currently processed #define kTcc_L1fw_Turn_Since_SCL_Init 2 // Turn Count since last SCL Initialize #define kTcc_L1fw_Turn_Since_LBN_Incr 3 // Turn Count since last Lum Block Number Increment /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// #endif // __L1_Tcc_Monit_Data_BeamX__