Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoLuminosity_LumiProducer_LUMIRAWDATASTRUCTURES_H
0002 #define RecoLuminosity_LumiProducer_LUMIRAWDATASTRUCTURES_H
0003 //Note: this header file corresponds to svn.cern.ch/reps/Luminosity/HLXReadOut/HLXCoreLibs/include/LumiStructures.hh - Revision 512 LumiDAQ
0004 /*
0005   LumiNibble structure definitions
0006 */
0007 
0008 // The string and stream definitions
0009 // Type definitions used by the HAL, etc...
0010 
0011 #define HCAL_HLX_MAX_BUNCHES 4096
0012 #define HCAL_HLX_MAX_HLXS 36
0013 
0014 // Changes
0015 // Namespace for the HCAL HLX
0016 #include <cstdint>
0017 
0018 namespace HCAL_HLX {
0019 
0020   struct DAQ_HEART_BEAT {
0021     uint32_t runNumber;
0022     uint32_t sectionNumber;
0023     uint32_t bCMSLive;
0024 
0025     uint32_t timestamp;
0026     uint32_t timestamp_micros;
0027   };
0028 
0029   struct RUN_SUMMARY {
0030     char runSequenceName[128];
0031     uint32_t HLTConfigId;
0032     uint32_t timestamp;
0033     uint32_t timestamp_micros;
0034     uint32_t startOrbitNumber;
0035     uint32_t endOrbitnumber;
0036 
0037     uint32_t runNumber;
0038     uint32_t fillNumber;
0039 
0040     uint32_t numberCMSLumiSections;  // number of lumi sections from the trigger
0041     uint32_t numberLumiDAQLumiSections;
0042   };
0043 
0044   struct RUN_QUALITY {
0045     uint32_t runNumber;
0046     uint32_t sectionNumber;
0047 
0048     int HLX;
0049     int HFLumi;
0050     int ECAL;
0051     int HCAL;
0052     int Tracker;
0053     int RPC;
0054     int DT;
0055     int CSC;
0056   };
0057 
0058   struct RCMS_CONFIG {
0059     uint32_t runNumber;
0060 
0061     char CMSSW_Tag[32];
0062     char TriDAS_Tag[32];
0063 
0064     uint32_t FirmwareVersion;
0065     uint32_t ExpectedFirmwareVersion;
0066     char AddressTablePath[256];
0067 
0068     char CfgDBTag[64];
0069     char CfgDBAccessor[64];
0070     bool UseConfigDB;
0071 
0072     uint32_t DestIPHigh;
0073     uint32_t DestIPLow;
0074 
0075     uint32_t SrcIPBaseHigh;
0076     uint32_t SrcIPBaseLow;
0077 
0078     uint32_t DestMacAddrHigh;
0079     uint32_t DestMacAddrMed;
0080     uint32_t DestMacAddrLow;
0081 
0082     uint32_t SrcMacAddrHigh;
0083     uint32_t SrcMacAddrMed;
0084     uint32_t SrcMacAddrLow;
0085 
0086     uint32_t SrcPort;
0087     uint32_t DestPort;
0088 
0089     uint32_t DebugData;
0090     uint32_t DebugReadout;
0091     uint32_t DebugSingleCycle;
0092 
0093     uint32_t NumOrbits;
0094     uint32_t OrbitPeriod;
0095 
0096     uint32_t Id;
0097 
0098     uint32_t TTCBC0Pattern;
0099     uint32_t TTCSTARTPattern;
0100     uint32_t TTCSTOPPattern;
0101 
0102     uint32_t BC0Delay;
0103 
0104     uint32_t OccThresholdLowBottom;
0105     uint32_t OccThresholdLowTop;
0106     uint32_t OccThresholdHighBottom;
0107     uint32_t OccThresholdHighTop;
0108 
0109     uint32_t LHCThresholdBottom;
0110     uint32_t LHCThresholdTop;
0111 
0112     uint32_t ETSumCutoffBottom;
0113     uint32_t ETSumCutoffTop;
0114 
0115     uint32_t OCCMaskBottom;
0116     uint32_t OCCMaskTop;
0117 
0118     uint32_t LHCMaskLowBottom;
0119     uint32_t LHCMaskLowTop;
0120     uint32_t LHCMaskHighBottom;
0121     uint32_t LHCMaskHighTop;
0122 
0123     uint32_t SumETMaskLowBottom;
0124     uint32_t SumETMaskLowTop;
0125     uint32_t SumETMaskHighBottom;
0126     uint32_t SumETMaskHighTop;
0127   };
0128 
0129   struct LUMI_SUMMARY {
0130     float DeadTimeNormalization;
0131     float LHCNormalization;  // recieved from LHC
0132 
0133     float InstantLumi;
0134     float InstantLumiErr;
0135     int16_t InstantLumiQlty;
0136 
0137     float InstantETLumi;
0138     float InstantETLumiErr;
0139     int16_t InstantETLumiQlty;
0140     float ETNormalization;  // Calculated
0141 
0142     float InstantOccLumi[2];
0143     float InstantOccLumiErr[2];
0144     int16_t InstantOccLumiQlty[2];
0145     float OccNormalization[2];
0146 
0147     float lumiNoise[2];
0148   };
0149 
0150   struct LUMI_DETAIL {
0151     float LHCLumi[HCAL_HLX_MAX_BUNCHES];  // Sum of LHC.data over all HLX's
0152 
0153     float ETLumi[HCAL_HLX_MAX_BUNCHES];
0154     float ETLumiErr[HCAL_HLX_MAX_BUNCHES];
0155     int16_t ETLumiQlty[HCAL_HLX_MAX_BUNCHES];
0156     float ETBXNormalization[HCAL_HLX_MAX_BUNCHES];
0157 
0158     float OccLumi[2][HCAL_HLX_MAX_BUNCHES];
0159     float OccLumiErr[2][HCAL_HLX_MAX_BUNCHES];
0160     int16_t OccLumiQlty[2][HCAL_HLX_MAX_BUNCHES];
0161     float OccBXNormalization[2][HCAL_HLX_MAX_BUNCHES];
0162   };
0163 
0164   /**************** Trigger *********************/
0165 
0166   struct LEVEL1_PATH {
0167     char pathName[128];
0168     uint64_t counts;
0169     uint64_t prescale;
0170   };
0171 
0172   struct LEVEL1_TRIGGER {
0173     uint32_t runNumber;
0174     uint32_t sectionNumber;  // Lumi section number recorded by the daq.
0175 
0176     uint32_t timestamp;
0177     uint32_t timestamp_micros;
0178 
0179     uint64_t deadtimecount;
0180 
0181     char GTLumiInfoFormat[32];
0182 
0183     LEVEL1_PATH GTAlgo[128];
0184     LEVEL1_PATH GTTech[64];
0185   };
0186 
0187   struct HLT_PATH {      // only object that uses STL and is variable size.
0188     char PathName[128];  //This is the name of trigger path
0189     uint32_t L1Pass;     //Number of times the path was entered
0190     uint32_t PSPass;     //Number after prescaling
0191     uint32_t PAccept;    //Number of accepts by the trigger path
0192     uint32_t PExcept;    //Number of exceptional event encountered
0193     uint32_t PReject;
0194     char PrescalerModule[64];  //Name of the prescale module in the path
0195     uint32_t PSIndex;          //Index into the set of pre defined prescales
0196     uint32_t Prescale;
0197 
0198     uint32_t HLTConfigId;
0199   };
0200 
0201   struct HLTRIGGER {
0202     uint32_t runNumber;
0203     uint32_t sectionNumber;
0204     uint32_t numPaths;
0205 
0206     HLT_PATH HLTPaths[256];
0207   };
0208 
0209   /***************** Internal use ****************/
0210   struct LUMI_RAW_HEADER {  // Used in NibbleCollector
0211     uint16_t marker;
0212     uint8_t hlxID;
0213     uint8_t packetID;
0214     uint32_t startOrbit;
0215     uint16_t numOrbits;
0216     uint16_t startBunch;  // Starting bunch in this packet
0217     uint16_t numBunches;  // Total number of bunches in histogram
0218     uint8_t histogramSet;
0219     uint8_t histogramSequence;
0220     uint16_t allA;
0221     uint16_t allF;
0222   };
0223 
0224   struct LUMI_NIBBLE_HEADER {
0225     uint32_t startOrbit;
0226     uint16_t numOrbits;
0227     uint16_t numBunches;  // Number of bunches histogrammed
0228     bool bCMSLive;
0229     bool bOC0;
0230   };
0231 
0232   struct ET_SUM_NIBBLE {
0233     LUMI_NIBBLE_HEADER hdr;
0234     uint32_t data[HCAL_HLX_MAX_BUNCHES];
0235   };
0236 
0237   struct OCCUPANCY_NIBBLE {
0238     LUMI_NIBBLE_HEADER hdr;
0239     uint16_t data[6][HCAL_HLX_MAX_BUNCHES];
0240   };
0241 
0242   struct LHC_NIBBLE {
0243     LUMI_NIBBLE_HEADER hdr;
0244     uint16_t data[HCAL_HLX_MAX_BUNCHES];
0245   };
0246 
0247   //***********************************************************
0248 
0249   struct LUMI_SECTION_HEADER {
0250     uint32_t timestamp;
0251     uint32_t timestamp_micros;
0252 
0253     uint32_t runNumber;      // Run number
0254     uint32_t sectionNumber;  // Section number
0255 
0256     uint32_t startOrbit;  // Start orbit of lumi section
0257     uint32_t numOrbits;   // Total number of orbits recorded in lumi section
0258     uint16_t numBunches;  // Total number of bunches (from start of orbit)
0259     uint16_t numHLXs;     // Number of HLXs in lumi section
0260 
0261     bool bCMSLive;  // Is CMS taking data?
0262     bool bOC0;      // Was section initialised by an OC0?
0263   };
0264 
0265   struct LUMI_SECTION_SUB_HEADER {
0266     uint32_t numNibbles;  // Number of nibbles in this histogram
0267     bool bIsComplete;     // Is this histogram complete (i.e. no missing nibbles)
0268   };
0269 
0270   struct ET_SUM_SECTION {
0271     LUMI_SECTION_SUB_HEADER hdr;
0272     float data[HCAL_HLX_MAX_BUNCHES];
0273   };
0274 
0275   struct OCCUPANCY_SECTION {
0276     LUMI_SECTION_SUB_HEADER hdr;
0277     uint32_t data[6][HCAL_HLX_MAX_BUNCHES];
0278   };
0279 
0280   struct LHC_SECTION {
0281     LUMI_SECTION_SUB_HEADER hdr;
0282     uint32_t data[HCAL_HLX_MAX_BUNCHES];
0283   };
0284 
0285   struct LUMI_SECTION {
0286     LUMI_SECTION_HEADER hdr;
0287     LUMI_SUMMARY lumiSummary;
0288     LUMI_DETAIL lumiDetail;
0289 
0290     ET_SUM_SECTION etSum[HCAL_HLX_MAX_HLXS];
0291     OCCUPANCY_SECTION occupancy[HCAL_HLX_MAX_HLXS];
0292     LHC_SECTION lhc[HCAL_HLX_MAX_HLXS];
0293   };
0294 
0295   struct DIP_STRUCT_BASE {
0296     int MessageQuality;
0297     uint32_t timestamp;
0298     uint32_t timestamp_micros;
0299     uint32_t runNumber;
0300     uint32_t sectionNumber;
0301   };
0302 
0303   struct VDM_SCAN_DATA : public DIP_STRUCT_BASE {
0304     bool VdmMode;  //True when a scan at one of the IPs is imminent, false otherwise
0305     int IP;
0306     bool RecordDataFlag;  // True while data for one of the scan points at one of the IPs is being taken, false otherwise
0307     double BeamSeparation;  //separation in sigma for the scan point
0308     bool isXaxis;           //true if scanning xaxis, otherwise yaxis is being scanned
0309     int Beam;
0310     double StepProgress;
0311   };
0312 
0313   struct BRAN_DATA : public DIP_STRUCT_BASE {
0314     double MeanCrossingAngle;
0315     int AcqMode;
0316     double MeanLuminosity;
0317   };
0318 
0319   struct BRAN_BX_DATA : public DIP_STRUCT_BASE {
0320     double bunchByBunchLuminosity[3564];
0321     int AcqMode;
0322   };
0323 
0324   struct LHC_BEAM_CONFIG : public DIP_STRUCT_BASE {
0325     int beamConfig[3564];
0326   };
0327 
0328   struct LHC_FILL_DATA : public DIP_STRUCT_BASE {
0329     uint32_t FillNumber;
0330   };
0331 
0332   struct CMS_LUMI_DIP_DATA : public DIP_STRUCT_BASE {
0333     uint32_t numHLXs;
0334     uint32_t startOrbit;
0335     uint32_t numOrbits;
0336     uint32_t numBunches;
0337     float instantLumi;
0338     float instantLumiErr;
0339   };
0340 
0341   struct CMS_LUMI_LH_DIP_DATA : public DIP_STRUCT_BASE {
0342     float lumiHisto[3564];
0343     uint32_t numBunches;
0344   };
0345 
0346   struct CMS_STATUS_DATA : public DIP_STRUCT_BASE {
0347     char status[64];
0348   };
0349 
0350   struct TRIGGER_LUMI_SEGMENT : public DIP_STRUCT_BASE {
0351     char state[64];
0352     uint32_t deadtime;
0353     uint32_t deadtimeBeamActive;
0354     uint32_t lumiSegmentNumber;
0355   };
0356 
0357   struct LHC_BEAM_MODE_DATA : public DIP_STRUCT_BASE {
0358     char beamMode[64];
0359   };
0360 
0361   struct LHC_BEAM_ENERGY_DATA : public DIP_STRUCT_BASE {
0362     float singleBeamEnergy;  //GeV
0363   };
0364 
0365   struct LHC_BEAM_INTENSITY_DATA : public DIP_STRUCT_BASE {
0366     double beamIntensity;  //total num protons in beam summed over all bxs
0367     double primitiveLifetime;
0368     uint64_t acqTimeStamp;
0369   };
0370 
0371   struct LHC_BEAM_FBCT_INTENSITY_DATA : public DIP_STRUCT_BASE {
0372     double bestLifetime;
0373     double averageBeamIntensity;
0374     float averageBunchIntensities[3564];
0375   };
0376 
0377   struct CMS_SCAN_TUNE_DATA : public DIP_STRUCT_BASE {
0378     double IntTime;
0379     double CollRate;
0380     double CollRateErr;
0381     bool Preferred;
0382     char Source[64];
0383   };
0384 
0385   struct DIP_ACQUISITION_MODE : public DIP_STRUCT_BASE {
0386     char mode[64];
0387   };
0388 
0389   struct BEAM_INFO {
0390     double totalIntensity;
0391     double primitiveLifetime;
0392     double bestLifeTime;
0393     double averageBeamIntensity;
0394     float orbitFrequency;
0395     float averageBunchIntensities[3564];
0396     int beamConfig[3564];
0397   };
0398 
0399   struct BRANA_INFO {
0400     double meanCrossingAngle;
0401     int acqMode;
0402     double meanLuminosity;
0403     double bunchByBunchLuminosity[3564];
0404   };
0405 
0406   struct BRANP_INFO {
0407     double meanCrossingAngle;
0408     int acqMode;
0409     int counterAcquisition;
0410     double meanLuminosity;
0411     double meanCrossingAngleError;
0412     double meanLuminosityError;
0413     double bunchByBunchLuminosity[3564];
0414   };
0415 
0416   struct BRAN_INFO {
0417     BRANA_INFO branA;
0418     BRANP_INFO branP;
0419   };
0420 
0421   struct DIP_COMBINED_DATA : public DIP_STRUCT_BASE {
0422     char beamMode[128];
0423 
0424     float Energy;
0425 
0426     uint32_t FillNumber;
0427 
0428     BEAM_INFO Beam[2];
0429 
0430     BRAN_INFO BRAN4L1;
0431     BRAN_INFO BRAN4R1;
0432     BRAN_INFO BRAN4L5;
0433     BRAN_INFO BRAN4R5;
0434 
0435     VDM_SCAN_DATA VdMScan;
0436   };
0437 
0438 }  // namespace HCAL_HLX
0439 
0440 #endif  //RecoLuminosity_LumiProducer_LUMIRAWDATASTRUCTURES_H