CMS 3D CMS Logo

AuxiliaryMakers.cc
Go to the documentation of this file.
1 #include <sys/time.h>
2 
6 
7 namespace evf{
8  namespace evtn{
9 
11  unsigned int runNumber,
12  unsigned int lumiSection,
13  std::string const &processGUID,
14  bool verifyLumiSection){
15  edm::EventID eventId(runNumber, // check that runnumber from record is consistent
16  lumiSection,
17  tcds->header.eventNumber);
18 
19  edm::TimeValue_t time = static_cast<edm::TimeValue_t>(((uint64_t)tcds->bst.gpstimehigh << 32) | tcds->bst.gpstimelow);
20  if (time == 0) {
21  timeval stv;
22  gettimeofday(&stv,nullptr);
23  time = stv.tv_sec;
24  time = (time << 32) + stv.tv_usec;
25  }
26 
27  const uint64_t orbitnr = ((uint64_t)tcds->header.orbitHigh << 16) | tcds->header.orbitLow;
28  const uint32_t recordLumiSection = tcds->header.lumiSection;
29 
30  if (verifyLumiSection && recordLumiSection != lumiSection)
31  edm::LogWarning("AuxiliaryMakers") << "Lumisection mismatch, external : " << lumiSection << ", record : " << recordLumiSection;
32  if ((orbitnr >> 18) + 1 != recordLumiSection)
33  edm::LogWarning("AuxiliaryMakers") << "Lumisection and orbit number mismatch, LS : " << lumiSection << ", LS from orbit: " << ((orbitnr >> 18) + 1) << ", orbit:" << orbitnr;
34 
35  return edm::EventAuxiliary(eventId,
36  processGUID,
37  edm::Timestamp(time),
38  true,
40  (int)tcds->header.bxid,
41  ((uint32_t)(tcds->bst.lhcFillHigh)<<16)|tcds->bst.lhcFillLow,
42  (int)(orbitnr&0x7fffffffU));//framework supports only 32-bit signed
43  }
44  }
45 }
const uint16_t orbitLow
Definition: TCDSRaw.h:52
const uint32_t lumiSection
Definition: TCDSRaw.h:46
const uint16_t bxid
Definition: TCDSRaw.h:51
const fedh_t fedHeader
Definition: TCDSRaw.h:117
const uint64_t eventNumber
Definition: TCDSRaw.h:55
Definition: TCDSRaw.h:18
const uint32_t orbitHigh
Definition: TCDSRaw.h:53
const struct BST_v1 bst
Definition: TCDSRaw.h:121
unsigned long long TimeValue_t
Definition: Timestamp.h:28
#define FED_EVTY_EXTRACT(a)
Definition: fed_header.h:38
unsigned long long uint64_t
Definition: Time.h:15
const uint16_t lhcFillLow
Definition: TCDSRaw.h:86
unsigned int eventid
Definition: fed_header.h:33
const uint32_t gpstimelow
Definition: TCDSRaw.h:79
const uint32_t gpstimehigh
Definition: TCDSRaw.h:80
edm::EventAuxiliary makeEventAuxiliary(const tcds::Raw_v1 *, unsigned int runNumber, unsigned int lumiSection, std::string const &processGUID, bool verifyLumiSection)
const struct Header_v1 header
Definition: TCDSRaw.h:119
const uint16_t lhcFillHigh
Definition: TCDSRaw.h:87