CMS 3D CMS Logo

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