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,
12  bool isRealData,
14  const std::string& processGUID,
15  bool verifyLumiSection,
16  bool suppressWarning) {
17  edm::EventID eventId(runNumber, // check that runnumber from record is consistent
18  lumiSection,
19  tcds->header.eventNumber);
20 
22  static_cast<edm::TimeValue_t>(((uint64_t)tcds->bst.gpstimehigh << 32) | tcds->bst.gpstimelow);
23  if (time == 0) {
24  timeval stv;
25  gettimeofday(&stv, nullptr);
26  time = stv.tv_sec;
27  time = (time << 32) + stv.tv_usec;
28  }
29 
30  const uint64_t orbitnr = ((uint64_t)tcds->header.orbitHigh << 16) | tcds->header.orbitLow;
31  const uint32_t recordLumiSection = tcds->header.lumiSection;
32 
33  if (isRealData && !suppressWarning) {
34  //warnings are disabled for generated data
35  if (verifyLumiSection && recordLumiSection != lumiSection)
36  edm::LogWarning("AuxiliaryMakers")
37  << "Lumisection mismatch, external : " << lumiSection << ", record : " << recordLumiSection;
38  if ((orbitnr >> 18) + 1 != recordLumiSection)
39  edm::LogWarning("AuxiliaryMakers") << "Lumisection and orbit number mismatch, LS : " << lumiSection
40  << ", LS from orbit: " << ((orbitnr >> 18) + 1) << ", orbit:" << orbitnr;
41  }
42 
43  return edm::EventAuxiliary(eventId,
44  processGUID,
46  isRealData,
47  eventType,
48  (int)tcds->header.bxid,
49  ((uint32_t)(tcds->bst.lhcFillHigh) << 16) | tcds->bst.lhcFillLow,
50  (int)(orbitnr & 0x7fffffffU)); //framework supports only 32-bit signed
51  }
52  } // namespace evtn
53 } // namespace evf
evf::evtn::makeEventAuxiliary
edm::EventAuxiliary makeEventAuxiliary(const tcds::Raw_v1 *, unsigned int runNumber, unsigned int lumiSection, bool isRealData, const edm::EventAuxiliary::ExperimentType &, const std::string &processGUID, bool verifyLumiSection, bool suppressWarning)
Definition: AuxiliaryMakers.cc:9
MessageLogger.h
protons_cff.time
time
Definition: protons_cff.py:35
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
AuxiliaryMakers.h
tcds::Raw_v1
Definition: TCDSRaw.h:106
edm::EventAuxiliary
Definition: EventAuxiliary.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
tcds
Definition: TCDSRaw.h:16
hcalcalib_dqm_sourceclient-live_cfg.eventType
eventType
Definition: hcalcalib_dqm_sourceclient-live_cfg.py:197
Log4cplus_cff.suppressWarning
suppressWarning
Definition: Log4cplus_cff.py:6
edm::EventAuxiliary::ExperimentType
ExperimentType
Definition: EventAuxiliary.h:18
evf
Definition: fillJson.h:27
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
edm::EventID
Definition: EventID.h:31
edm::TimeValue_t
unsigned long long TimeValue_t
Definition: Timestamp.h:28
edm::Timestamp
Definition: Timestamp.h:30