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  edm::EventID eventId(runNumber, // check that runnumber from record is consistent
14  //record->getHeader().getData().header.lumiSection,//+1
15  lumiSection,
16  record->getHeader().getData().header.eventNumber);
17 
18  uint64_t gpsh = record->getBST().getBST().gpstimehigh;
19  uint32_t gpsl = record->getBST().getBST().gpstimelow;
20  edm::TimeValue_t time = static_cast<edm::TimeValue_t> ((gpsh << 32) + gpsl);
21  if (time == 0) {
22  timeval stv;
23  gettimeofday(&stv,0);
24  time = stv.tv_sec;
25  time = (time << 32) + stv.tv_usec;
26  }
27  uint64_t orbitnr = (((uint64_t)record->getHeader().getData().header.orbitHigh) << 16) + record->getHeader().getData().header.orbitLow;
28  uint32_t recordLumiSection = record->getHeader().getData().header.lumiSection;
29 
30  if (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)record->getHeader().getData().header.bcid,
42  (int)(orbitnr&0x7fffffffU));//framework supports only 32-bit signed
43  }
44  }
45 }
TCDSBST & getBST()
Definition: FED1024.h:152
struct evf::evtn::TCDSFEDHeader::tcdsfedheader::@317 header
TCDSHeader & getHeader()
Definition: FED1024.h:150
JetCorrectorParameters::Record record
Definition: classes.h:7
edm::EventAuxiliary makeEventAuxiliary(TCDSRecord *record, unsigned int runNumber, unsigned int lumiSection, std::string const &processGUID)
TCDSFEDHeader & getFEDHeader()
Definition: FED1024.h:149
#define FED_EVTY_EXTRACT(a)
Definition: fed_header.h:38
const tcdsheader & getData()
Definition: FED1024.h:84
unsigned long long TimeValue_t
Definition: Timestamp.h:28
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::TCDSHeader::tcdsheader::@318 header