CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  std::string const &processGUID,
13  bool verifyLumiSection){
14  edm::EventID eventId(runNumber, // check that runnumber from record is consistent
15  //record->getHeader().getData().header.lumiSection,//+1
16  lumiSection,
17  record->getHeader().getData().header.eventNumber);
18 
19  uint64_t gpsh = record->getBST().getBST().gpstimehigh;
20  uint32_t gpsl = record->getBST().getBST().gpstimelow;
21  edm::TimeValue_t time = static_cast<edm::TimeValue_t> ((gpsh << 32) + gpsl);
22  if (time == 0) {
23  timeval stv;
24  gettimeofday(&stv,0);
25  time = stv.tv_sec;
26  time = (time << 32) + stv.tv_usec;
27  }
28  uint64_t orbitnr = (((uint64_t)record->getHeader().getData().header.orbitHigh) << 16) + record->getHeader().getData().header.orbitLow;
29  uint32_t recordLumiSection = record->getHeader().getData().header.lumiSection;
30 
31  if (verifyLumiSection && recordLumiSection != lumiSection)
32  edm::LogWarning("AuxiliaryMakers") << "Lumisection mismatch, external : "<<lumiSection << ", record : " << recordLumiSection;
33  if ((orbitnr >> 18) + 1 != recordLumiSection)
34  edm::LogWarning("AuxiliaryMakers") << "Lumisection and orbit number mismatch, LS : " << lumiSection << ", LS from orbit: " << ((orbitnr >> 18) + 1) << ", orbit:" << orbitnr;
35 
36  return edm::EventAuxiliary(eventId,
37  processGUID,
38  edm::Timestamp(time),
39  true,
41  (int)record->getHeader().getData().header.bcid,
43  (int)(orbitnr&0x7fffffffU));//framework supports only 32-bit signed
44  }
45  }
46 }
TCDSBST & getBST()
Definition: FED1024.h:152
TCDSHeader & getHeader()
Definition: FED1024.h:150
JetCorrectorParameters::Record record
Definition: classes.h:7
TCDSFEDHeader & getFEDHeader()
Definition: FED1024.h:149
#define FED_EVTY_EXTRACT(a)
Definition: fed_header.h:38
const tcdsheader & getData()
Definition: FED1024.h:84
edm::EventAuxiliary makeEventAuxiliary(TCDSRecord *record, unsigned int runNumber, unsigned int lumiSection, std::string const &processGUID, bool verifyLumiSection)
unsigned long long TimeValue_t
Definition: Timestamp.h:28
struct evf::evtn::TCDSHeader::tcdsheader::@322 header
unsigned long long uint64_t
Definition: Time.h:15
const tcdsfedheader & getData()
Definition: FED1024.h:41
const bst & getBST()
Definition: FED1024.h:133
static int const invalidStoreNumber
struct evf::evtn::TCDSFEDHeader::tcdsfedheader::@321 header