00001 #ifndef RecoLuminosity_LumiProducer_LUMIRAWDATASTRUCTURES_H 00002 #define RecoLuminosity_LumiProducer_LUMIRAWDATASTRUCTURES_H 00003 //Note: this header file corresponds to svn.cern.ch/reps/Luminosity/HLXReadOut/HLXCoreLibs/include/LumiStructures.hh - Revision 512 LumiDAQ 00004 /* 00005 LumiNibble structure definitions 00006 */ 00007 00008 // The string and stream definitions 00009 // Type definitions used by the HAL, etc... 00010 00011 #define HCAL_HLX_MAX_BUNCHES 4096 00012 #define HCAL_HLX_MAX_HLXS 36 00013 00014 // Changes 00015 // Namespace for the HCAL HLX 00016 #include <stdint.h> 00017 00018 namespace HCAL_HLX{ 00019 00020 struct DAQ_HEART_BEAT { 00021 00022 uint32_t runNumber; 00023 uint32_t sectionNumber; 00024 uint32_t bCMSLive; 00025 00026 uint32_t timestamp; 00027 uint32_t timestamp_micros; 00028 }; 00029 00030 struct RUN_SUMMARY { 00031 00032 char runSequenceName[128]; 00033 uint32_t HLTConfigId; 00034 uint32_t timestamp; 00035 uint32_t timestamp_micros; 00036 uint32_t startOrbitNumber; 00037 uint32_t endOrbitnumber; 00038 00039 uint32_t runNumber; 00040 uint32_t fillNumber; 00041 00042 uint32_t numberCMSLumiSections; // number of lumi sections from the trigger 00043 uint32_t numberLumiDAQLumiSections; 00044 }; 00045 00046 struct RUN_QUALITY { 00047 uint32_t runNumber; 00048 uint32_t sectionNumber; 00049 00050 int HLX; 00051 int HFLumi; 00052 int ECAL; 00053 int HCAL; 00054 int Tracker; 00055 int RPC; 00056 int DT; 00057 int CSC; 00058 }; 00059 00060 struct RCMS_CONFIG { 00061 00062 uint32_t runNumber; 00063 00064 char CMSSW_Tag[32]; 00065 char TriDAS_Tag[32]; 00066 00067 uint32_t FirmwareVersion; 00068 uint32_t ExpectedFirmwareVersion; 00069 char AddressTablePath[256]; 00070 00071 char CfgDBTag[64]; 00072 char CfgDBAccessor[64]; 00073 bool UseConfigDB; 00074 00075 uint32_t DestIPHigh; 00076 uint32_t DestIPLow; 00077 00078 uint32_t SrcIPBaseHigh; 00079 uint32_t SrcIPBaseLow; 00080 00081 uint32_t DestMacAddrHigh; 00082 uint32_t DestMacAddrMed; 00083 uint32_t DestMacAddrLow; 00084 00085 uint32_t SrcMacAddrHigh; 00086 uint32_t SrcMacAddrMed; 00087 uint32_t SrcMacAddrLow; 00088 00089 uint32_t SrcPort; 00090 uint32_t DestPort; 00091 00092 uint32_t DebugData; 00093 uint32_t DebugReadout; 00094 uint32_t DebugSingleCycle; 00095 00096 uint32_t NumOrbits; 00097 uint32_t OrbitPeriod; 00098 00099 uint32_t Id; 00100 00101 uint32_t TTCBC0Pattern; 00102 uint32_t TTCSTARTPattern; 00103 uint32_t TTCSTOPPattern; 00104 00105 uint32_t BC0Delay; 00106 00107 uint32_t OccThresholdLowBottom; 00108 uint32_t OccThresholdLowTop; 00109 uint32_t OccThresholdHighBottom; 00110 uint32_t OccThresholdHighTop; 00111 00112 uint32_t LHCThresholdBottom; 00113 uint32_t LHCThresholdTop; 00114 00115 uint32_t ETSumCutoffBottom; 00116 uint32_t ETSumCutoffTop; 00117 00118 uint32_t OCCMaskBottom; 00119 uint32_t OCCMaskTop; 00120 00121 uint32_t LHCMaskLowBottom; 00122 uint32_t LHCMaskLowTop; 00123 uint32_t LHCMaskHighBottom; 00124 uint32_t LHCMaskHighTop; 00125 00126 uint32_t SumETMaskLowBottom; 00127 uint32_t SumETMaskLowTop; 00128 uint32_t SumETMaskHighBottom; 00129 uint32_t SumETMaskHighTop; 00130 }; 00131 00132 struct LUMI_SUMMARY { 00133 00134 float DeadTimeNormalization; 00135 float LHCNormalization; // recieved from LHC 00136 00137 float InstantLumi; 00138 float InstantLumiErr; 00139 int16_t InstantLumiQlty; 00140 00141 float InstantETLumi; 00142 float InstantETLumiErr; 00143 int16_t InstantETLumiQlty; 00144 float ETNormalization; // Calculated 00145 00146 float InstantOccLumi[2]; 00147 float InstantOccLumiErr[2]; 00148 int16_t InstantOccLumiQlty[2]; 00149 float OccNormalization[2]; 00150 00151 float lumiNoise[2]; 00152 }; 00153 00154 struct LUMI_DETAIL { 00155 00156 float LHCLumi[HCAL_HLX_MAX_BUNCHES]; // Sum of LHC.data over all HLX's 00157 00158 float ETLumi[HCAL_HLX_MAX_BUNCHES]; 00159 float ETLumiErr[HCAL_HLX_MAX_BUNCHES]; 00160 int16_t ETLumiQlty[HCAL_HLX_MAX_BUNCHES]; 00161 float ETBXNormalization[HCAL_HLX_MAX_BUNCHES]; 00162 00163 float OccLumi[2][HCAL_HLX_MAX_BUNCHES]; 00164 float OccLumiErr[2][HCAL_HLX_MAX_BUNCHES]; 00165 int16_t OccLumiQlty[2][HCAL_HLX_MAX_BUNCHES]; 00166 float OccBXNormalization[2][HCAL_HLX_MAX_BUNCHES]; 00167 }; 00168 00169 /**************** Trigger *********************/ 00170 00171 struct LEVEL1_PATH { 00172 00173 char pathName[128]; 00174 uint64_t counts; 00175 uint64_t prescale; 00176 }; 00177 00178 struct LEVEL1_TRIGGER { 00179 uint32_t runNumber; 00180 uint32_t sectionNumber; // Lumi section number recorded by the daq. 00181 00182 uint32_t timestamp; 00183 uint32_t timestamp_micros; 00184 00185 uint64_t deadtimecount; 00186 00187 char GTLumiInfoFormat[32]; 00188 00189 LEVEL1_PATH GTAlgo[128]; 00190 LEVEL1_PATH GTTech[64]; 00191 }; 00192 00193 struct HLT_PATH { // only object that uses STL and is variable size. 00194 char PathName[128]; //This is the name of trigger path 00195 uint32_t L1Pass; //Number of times the path was entered 00196 uint32_t PSPass; //Number after prescaling 00197 uint32_t PAccept; //Number of accepts by the trigger path 00198 uint32_t PExcept; //Number of exceptional event encountered 00199 uint32_t PReject; 00200 char PrescalerModule[64]; //Name of the prescale module in the path 00201 uint32_t PSIndex; //Index into the set of pre defined prescales 00202 uint32_t Prescale; 00203 00204 uint32_t HLTConfigId; 00205 }; 00206 00207 struct HLTRIGGER { 00208 uint32_t runNumber; 00209 uint32_t sectionNumber; 00210 uint32_t numPaths; 00211 00212 HLT_PATH HLTPaths[256]; 00213 }; 00214 00215 /***************** Internal use ****************/ 00216 struct LUMI_RAW_HEADER { // Used in NibbleCollector 00217 uint16_t marker; 00218 uint8_t hlxID; 00219 uint8_t packetID; 00220 uint32_t startOrbit; 00221 uint16_t numOrbits; 00222 uint16_t startBunch; // Starting bunch in this packet 00223 uint16_t numBunches; // Total number of bunches in histogram 00224 uint8_t histogramSet; 00225 uint8_t histogramSequence; 00226 uint16_t allA; 00227 uint16_t allF; 00228 }; 00229 00230 struct LUMI_NIBBLE_HEADER { 00231 uint32_t startOrbit; 00232 uint16_t numOrbits; 00233 uint16_t numBunches; // Number of bunches histogrammed 00234 bool bCMSLive; 00235 bool bOC0; 00236 }; 00237 00238 struct ET_SUM_NIBBLE { 00239 LUMI_NIBBLE_HEADER hdr; 00240 uint32_t data[HCAL_HLX_MAX_BUNCHES]; 00241 }; 00242 00243 struct OCCUPANCY_NIBBLE { 00244 LUMI_NIBBLE_HEADER hdr; 00245 uint16_t data[6][HCAL_HLX_MAX_BUNCHES]; 00246 }; 00247 00248 struct LHC_NIBBLE { 00249 LUMI_NIBBLE_HEADER hdr; 00250 uint16_t data[HCAL_HLX_MAX_BUNCHES]; 00251 }; 00252 00253 //*********************************************************** 00254 00255 struct LUMI_SECTION_HEADER { 00256 uint32_t timestamp; 00257 uint32_t timestamp_micros; 00258 00259 uint32_t runNumber; // Run number 00260 uint32_t sectionNumber; // Section number 00261 00262 uint32_t startOrbit; // Start orbit of lumi section 00263 uint32_t numOrbits; // Total number of orbits recorded in lumi section 00264 uint16_t numBunches; // Total number of bunches (from start of orbit) 00265 uint16_t numHLXs; // Number of HLXs in lumi section 00266 00267 bool bCMSLive; // Is CMS taking data? 00268 bool bOC0; // Was section initialised by an OC0? 00269 }; 00270 00271 struct LUMI_SECTION_SUB_HEADER { 00272 uint32_t numNibbles; // Number of nibbles in this histogram 00273 bool bIsComplete; // Is this histogram complete (i.e. no missing nibbles) 00274 }; 00275 00276 struct ET_SUM_SECTION { 00277 LUMI_SECTION_SUB_HEADER hdr; 00278 float data[HCAL_HLX_MAX_BUNCHES]; 00279 }; 00280 00281 struct OCCUPANCY_SECTION { 00282 LUMI_SECTION_SUB_HEADER hdr; 00283 uint32_t data[6][HCAL_HLX_MAX_BUNCHES]; 00284 }; 00285 00286 struct LHC_SECTION { 00287 LUMI_SECTION_SUB_HEADER hdr; 00288 uint32_t data[HCAL_HLX_MAX_BUNCHES]; 00289 }; 00290 00291 struct LUMI_SECTION { 00292 LUMI_SECTION_HEADER hdr; 00293 LUMI_SUMMARY lumiSummary; 00294 LUMI_DETAIL lumiDetail; 00295 00296 ET_SUM_SECTION etSum[HCAL_HLX_MAX_HLXS]; 00297 OCCUPANCY_SECTION occupancy[HCAL_HLX_MAX_HLXS]; 00298 LHC_SECTION lhc[HCAL_HLX_MAX_HLXS]; 00299 }; 00300 00301 struct DIP_STRUCT_BASE { 00302 int MessageQuality; 00303 uint32_t timestamp; 00304 uint32_t timestamp_micros; 00305 uint32_t runNumber; 00306 uint32_t sectionNumber; 00307 }; 00308 00309 struct VDM_SCAN_DATA: public DIP_STRUCT_BASE { 00310 bool VdmMode; //True when a scan at one of the IPs is imminent, false otherwise 00311 int IP; 00312 bool RecordDataFlag; // True while data for one of the scan points at one of the IPs is being taken, false otherwise 00313 double BeamSeparation; //separation in sigma for the scan point 00314 bool isXaxis; //true if scanning xaxis, otherwise yaxis is being scanned 00315 int Beam; 00316 double StepProgress; 00317 }; 00318 00319 struct BRAN_DATA: public DIP_STRUCT_BASE { 00320 double MeanCrossingAngle; 00321 int AcqMode; 00322 double MeanLuminosity; 00323 }; 00324 00325 struct BRAN_BX_DATA: public DIP_STRUCT_BASE { 00326 double bunchByBunchLuminosity[3564]; 00327 int AcqMode; 00328 }; 00329 00330 struct LHC_BEAM_CONFIG: public DIP_STRUCT_BASE { 00331 int beamConfig[3564]; 00332 }; 00333 00334 struct LHC_FILL_DATA: public DIP_STRUCT_BASE { 00335 uint32_t FillNumber; 00336 }; 00337 00338 00339 struct CMS_LUMI_DIP_DATA: public DIP_STRUCT_BASE { 00340 uint32_t numHLXs; 00341 uint32_t startOrbit; 00342 uint32_t numOrbits; 00343 uint32_t numBunches; 00344 float instantLumi; 00345 float instantLumiErr; 00346 }; 00347 00348 struct CMS_LUMI_LH_DIP_DATA: public DIP_STRUCT_BASE { 00349 float lumiHisto[3564]; 00350 uint32_t numBunches; 00351 }; 00352 00353 struct CMS_STATUS_DATA: public DIP_STRUCT_BASE { 00354 char status[64]; 00355 }; 00356 00357 struct TRIGGER_LUMI_SEGMENT: public DIP_STRUCT_BASE { 00358 char state[64]; 00359 uint32_t deadtime; 00360 uint32_t deadtimeBeamActive; 00361 uint32_t lumiSegmentNumber; 00362 00363 }; 00364 00365 struct LHC_BEAM_MODE_DATA: public DIP_STRUCT_BASE { 00366 char beamMode[64]; 00367 }; 00368 00369 struct LHC_BEAM_ENERGY_DATA: public DIP_STRUCT_BASE { 00370 float singleBeamEnergy; //GeV 00371 }; 00372 00373 struct LHC_BEAM_INTENSITY_DATA: public DIP_STRUCT_BASE { 00374 double beamIntensity; //total num protons in beam summed over all bxs 00375 double primitiveLifetime; 00376 uint64_t acqTimeStamp; 00377 }; 00378 00379 struct LHC_BEAM_FBCT_INTENSITY_DATA: public DIP_STRUCT_BASE { 00380 double bestLifetime; 00381 double averageBeamIntensity; 00382 float averageBunchIntensities[3564]; 00383 }; 00384 00385 struct CMS_SCAN_TUNE_DATA: public DIP_STRUCT_BASE { 00386 double IntTime; 00387 double CollRate; 00388 double CollRateErr; 00389 bool Preferred; 00390 char Source[64]; 00391 }; 00392 00393 struct DIP_ACQUISITION_MODE: public DIP_STRUCT_BASE { 00394 char mode[64]; 00395 }; 00396 00397 struct BEAM_INFO { 00398 double totalIntensity; 00399 double primitiveLifetime; 00400 double bestLifeTime; 00401 double averageBeamIntensity; 00402 float orbitFrequency; 00403 float averageBunchIntensities[3564]; 00404 int beamConfig[3564]; 00405 }; 00406 00407 00408 struct BRANA_INFO { 00409 double meanCrossingAngle; 00410 int acqMode; 00411 double meanLuminosity; 00412 double bunchByBunchLuminosity[3564]; 00413 }; 00414 00415 struct BRANP_INFO { 00416 double meanCrossingAngle; 00417 int acqMode; 00418 int counterAcquisition; 00419 double meanLuminosity; 00420 double meanCrossingAngleError; 00421 double meanLuminosityError; 00422 double bunchByBunchLuminosity[3564]; 00423 }; 00424 00425 struct BRAN_INFO { 00426 00427 BRANA_INFO branA; 00428 BRANP_INFO branP; 00429 }; 00430 00431 struct DIP_COMBINED_DATA: public DIP_STRUCT_BASE { 00432 00433 char beamMode[128]; 00434 00435 float Energy; 00436 00437 uint32_t FillNumber; 00438 00439 BEAM_INFO Beam[2]; 00440 00441 BRAN_INFO BRAN4L1; 00442 BRAN_INFO BRAN4R1; 00443 BRAN_INFO BRAN4L5; 00444 BRAN_INFO BRAN4R5; 00445 00446 VDM_SCAN_DATA VdMScan; 00447 00448 }; 00449 00450 }//~namespace HCAL_HLX 00451 00452 #endif //RecoLuminosity_LumiProducer_LUMIRAWDATASTRUCTURES_H