Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:39

0001 /*
0002   LumiNibble structure definitions
0003 */
0004 
0005 #ifndef LUMISTRUCTURES_HH
0006 #define LUMISTRUCTURES_HH
0007 
0008 // The string and stream definitions
0009 #include <cstdint>
0010 #include <iostream>
0011 #include <string>
0012 #include <vector>
0013 
0014 #define HCAL_HLX_MAX_BUNCHES 4096
0015 #define HCAL_HLX_MAX_HLXS 36
0016 
0017 //#define HCAL_HLX_NUM_BUNCHES 3564
0018 //#define HCAL_HLX_NUM_HLXS 36
0019 
0020 // Changes
0021 // Namespace for the HCAL HLX
0022 namespace HCAL_HLX {
0023 
0024   struct LUMI_SUMMARY {
0025     float DeadtimeNormalization;
0026     float LHCNormalization;  // received from LHC
0027 
0028     float InstantLumi;
0029     float InstantLumiErr;
0030     int16_t InstantLumiQlty;
0031 
0032     float InstantETLumi;
0033     float InstantETLumiErr;
0034     int16_t InstantETLumiQlty;
0035     float ETNormalization;  // Calculated
0036     float InstantOccLumi[2];
0037     float InstantOccLumiErr[2];
0038     int16_t InstantOccLumiQlty[2];
0039     float OccNormalization[2];
0040 
0041     float lumiNoise[2];
0042   };
0043 
0044   struct LUMI_DETAIL {
0045     float LHCLumi[HCAL_HLX_MAX_BUNCHES];  // Sum of LHC.data over all HLX's
0046 
0047     float ETLumi[HCAL_HLX_MAX_BUNCHES];
0048     float ETLumiErr[HCAL_HLX_MAX_BUNCHES];
0049     int16_t ETLumiQlty[HCAL_HLX_MAX_BUNCHES];
0050     float ETBXNormalization[HCAL_HLX_MAX_BUNCHES];
0051 
0052     float OccLumi[2][HCAL_HLX_MAX_BUNCHES];
0053     float OccLumiErr[2][HCAL_HLX_MAX_BUNCHES];
0054     int16_t OccLumiQlty[2][HCAL_HLX_MAX_BUNCHES];
0055     float OccBXNormalization[2][HCAL_HLX_MAX_BUNCHES];
0056   };
0057 
0058   struct LEVEL1_TRIGGER {
0059     std::string GTLumiInfoFormat;
0060     uint32_t GTAlgoCounts[128];
0061     uint32_t GTAlgoPrescaling[128];
0062     uint32_t GTTechCounts[64];
0063     uint32_t GTTechPrescaling[64];
0064     uint32_t GTPartition0TriggerCounts[10];
0065     uint32_t GTPartition0DeadTime[10];
0066   };
0067 
0068   struct HLTPath {
0069     std::string PathName;  //This is the name of trigger path
0070     uint32_t L1Pass;       //Number of times the path was entered
0071     uint32_t PSPass;       //Number after prescaling
0072     uint32_t PAccept;      //Number of accepts by the trigger path
0073     uint32_t PExcept;      //Number of exceptional event encountered
0074     uint32_t PReject;
0075     std::string PrescalerModule;  //Name of the prescale module in the path
0076     uint32_t PSIndex;             //Index into the set of pre defined prescales
0077   };
0078 
0079   struct HLT {
0080     std::string HLT_Config_KEY;
0081     std::vector<HLTPath> HLTPaths;
0082   };
0083 
0084   struct LUMI_RAW_HEADER {  // Used in NibbleCollector
0085     uint16_t marker;
0086     uint8_t hlxID;
0087     uint8_t packetID;
0088     uint32_t startOrbit;
0089     uint16_t numOrbits;
0090     uint16_t startBunch;  // Starting bunch in this packet
0091     uint16_t numBunches;  // Total number of bunches in histogram
0092     uint8_t histogramSet;
0093     uint8_t histogramSequence;
0094     uint16_t allA;
0095     uint16_t allF;
0096   };
0097 
0098   struct LUMI_NIBBLE_HEADER {
0099     uint32_t startOrbit;
0100     uint16_t numOrbits;
0101     uint16_t numBunches;  // Number of bunches histogrammed
0102     bool bCMSLive;
0103     bool bOC0;
0104   };
0105 
0106   struct ET_SUM_NIBBLE {
0107     LUMI_NIBBLE_HEADER hdr;
0108     uint32_t data[HCAL_HLX_MAX_BUNCHES];
0109   };
0110 
0111   struct OCCUPANCY_NIBBLE {
0112     LUMI_NIBBLE_HEADER hdr;
0113     uint16_t data[6][HCAL_HLX_MAX_BUNCHES];
0114   };
0115 
0116   struct LHC_NIBBLE {
0117     LUMI_NIBBLE_HEADER hdr;
0118     uint16_t data[HCAL_HLX_MAX_BUNCHES];
0119   };
0120 
0121   struct RUN_SUMMARY {
0122     uint16_t LS_Quality;         // 0-999
0123     char RunSequenceName[64];    // Cosmic, Pedestal, ....
0124     uint32_t RunSequenceNumber;  // Number that identifies version of RunSequenceName;
0125   };
0126 
0127   struct RCMS_CONFIG {
0128     std::string CMSSW_Tag;
0129     std::string TriDAS_Tag;
0130 
0131     bool UseConfigDB;
0132     std::string CfgDBTag;
0133     uint8_t FirmwareVersion;
0134 
0135     uint8_t OCCMaskTop;
0136     uint8_t OCCMaskBottom;
0137 
0138     uint8_t LHCMaskLowBottom;
0139     uint8_t LHCMaskLowTop;
0140 
0141     uint8_t LHCMaskHighBottom;
0142     uint8_t LHCMaskHighTop;
0143 
0144     uint16_t SumETMaskLowBottom;
0145     uint16_t SumETMaskLowTop;
0146     uint16_t SumETMaskHighBottom;
0147     uint16_t SumETMaskHighTop;
0148 
0149     uint16_t OccThresholdLowBottom;
0150     uint16_t OccThresholdLowTop;
0151     uint16_t OccThresholdHighBottom;
0152     uint16_t OccThresholdHighTop;
0153 
0154     uint16_t LHCThresholdBottom;
0155     uint16_t LHCThresholdTop;
0156     uint16_t ETSumCutoffBottom;
0157     uint16_t ETSumCutoffTop;
0158   };
0159 
0160   struct LUMI_SECTION_HEADER {
0161     uint32_t timestamp;
0162     uint32_t timestamp_micros;
0163     uint32_t runNumber;      // Run number
0164     uint32_t sectionNumber;  // Section number
0165     uint32_t startOrbit;     // Start orbit of lumi section
0166     uint32_t numOrbits;      // Total number of orbits recorded in lumi section
0167     uint16_t numBunches;     // Total number of bunches (from start of orbit)
0168     uint16_t numHLXs;        // Number of HLXs in lumi section
0169     bool bCMSLive;           // Is CMS taking data?
0170     bool bOC0;               // Was section initialised by an OC0?
0171   };
0172 
0173   struct LUMI_SECTION_SUB_HEADER {
0174     uint32_t numNibbles;  // Number of nibbles in this histogram
0175     bool bIsComplete;     // Is this histogram complete (i.e. no missing nibbles)
0176   };
0177 
0178   struct ET_SUM_SECTION {
0179     LUMI_SECTION_SUB_HEADER hdr;
0180     float data[HCAL_HLX_MAX_BUNCHES];
0181   };
0182 
0183   struct OCCUPANCY_SECTION {
0184     LUMI_SECTION_SUB_HEADER hdr;
0185     uint32_t data[6][HCAL_HLX_MAX_BUNCHES];
0186   };
0187 
0188   struct LHC_SECTION {
0189     LUMI_SECTION_SUB_HEADER hdr;
0190     uint32_t data[HCAL_HLX_MAX_BUNCHES];
0191   };
0192 
0193   struct LUMI_SECTION {
0194     LUMI_SECTION_HEADER hdr;
0195     LUMI_SUMMARY lumiSummary;
0196     LUMI_DETAIL lumiDetail;
0197 
0198     ET_SUM_SECTION etSum[HCAL_HLX_MAX_HLXS];
0199     OCCUPANCY_SECTION occupancy[HCAL_HLX_MAX_HLXS];
0200     LHC_SECTION lhc[HCAL_HLX_MAX_HLXS];
0201   };
0202 
0203 }  // namespace HCAL_HLX
0204 
0205 #endif  //~LUMISTRUCTURES_HH