EventFilter
Utilities
src
AuxiliaryMakers.cc
Go to the documentation of this file.
1
#include <sys/time.h>
2
3
#include "
EventFilter/Utilities/interface/AuxiliaryMakers.h
"
4
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
5
6
namespace
evf
{
7
namespace
evtn {
8
9
edm::EventAuxiliary
makeEventAuxiliary
(
const
tcds::Raw_v1
*
tcds
,
10
unsigned
int
runNumber
,
11
unsigned
int
lumiSection,
12
bool
isRealData,
13
const
edm::EventAuxiliary::ExperimentType
&
eventType
,
14
const
std::string
& processGUID,
15
bool
verifyLumiSection) {
16
edm::EventID
eventId(
runNumber
,
// check that runnumber from record is consistent
17
lumiSection,
18
tcds
->header.eventNumber);
19
20
edm::TimeValue_t
time
=
21
static_cast<edm::TimeValue_t>(((
uint64_t
)
tcds
->bst.gpstimehigh << 32) |
tcds
->bst.gpstimelow);
22
if
(
time
== 0) {
23
timeval stv;
24
gettimeofday(&stv,
nullptr
);
25
time
= stv.tv_sec;
26
time
= (
time
<< 32) + stv.tv_usec;
27
}
28
29
const
uint64_t
orbitnr = ((
uint64_t
)
tcds
->header.orbitHigh << 16) |
tcds
->header.orbitLow;
30
const
uint32_t recordLumiSection =
tcds
->header.lumiSection;
31
32
if
(isRealData) {
33
//warnings are disabled for generated data
34
if
(verifyLumiSection && recordLumiSection != lumiSection)
35
edm::LogWarning
(
"AuxiliaryMakers"
)
36
<<
"Lumisection mismatch, external : "
<< lumiSection <<
", record : "
<< recordLumiSection;
37
if
((orbitnr >> 18) + 1 != recordLumiSection)
38
edm::LogWarning
(
"AuxiliaryMakers"
) <<
"Lumisection and orbit number mismatch, LS : "
<< lumiSection
39
<<
", LS from orbit: "
<< ((orbitnr >> 18) + 1) <<
", orbit:"
<< orbitnr;
40
}
41
42
return
edm::EventAuxiliary
(eventId,
43
processGUID,
44
edm::Timestamp
(
time
),
45
isRealData,
46
eventType
,
47
(
int
)
tcds
->header.bxid,
48
((uint32_t)(
tcds
->bst.lhcFillHigh) << 16) |
tcds
->bst.lhcFillLow,
49
(
int
)(orbitnr & 0x7fffffffU));
//framework supports only 32-bit signed
50
}
51
}
// namespace evtn
52
}
// namespace evf
MessageLogger.h
convertSQLiteXML.runNumber
runNumber
Definition:
convertSQLiteXML.py:91
AuxiliaryMakers.h
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)
Definition:
AuxiliaryMakers.cc:9
tcds::Raw_v1
Definition:
TCDSRaw.h:106
edm::EventAuxiliary
Definition:
EventAuxiliary.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition:
MessageLogger.h:141
tcds
Definition:
TCDSRaw.h:16
hcalcalib_dqm_sourceclient-live_cfg.eventType
eventType
Definition:
hcalcalib_dqm_sourceclient-live_cfg.py:205
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
ntuplemaker.time
time
Definition:
ntuplemaker.py:310
edm::EventID
Definition:
EventID.h:31
edm::TimeValue_t
unsigned long long TimeValue_t
Definition:
Timestamp.h:28
edm::Timestamp
Definition:
Timestamp.h:30
Generated for CMSSW Reference Manual by
1.8.16