File indexing completed on 2024-04-06 12:01:30
0001 #ifndef CondCore_HDF5ESSource_convertSyncValue_h
0002 #define CondCore_HDF5ESSource_convertSyncValue_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "FWCore/Framework/interface/IOVSyncValue.h"
0025 #include "IOVSyncValue.h"
0026
0027
0028
0029 namespace cond::hdf5 {
0030 inline IOVSyncValue convertSyncValue(edm::IOVSyncValue const& iFrom, bool iIsRunLumi) {
0031 if (iIsRunLumi) {
0032 return IOVSyncValue{iFrom.eventID().run(), iFrom.eventID().luminosityBlock()};
0033 }
0034 return IOVSyncValue{iFrom.time().unixTime(), iFrom.time().microsecondOffset()};
0035 }
0036
0037 inline edm::IOVSyncValue convertSyncValue(IOVSyncValue const& iFrom, bool iIsRunLumi) {
0038 if (iIsRunLumi) {
0039 return edm::IOVSyncValue{edm::EventID{iFrom.high_, iFrom.low_, 0}};
0040 }
0041 return edm::IOVSyncValue{edm::Timestamp{(static_cast<uint64_t>(iFrom.high_) << 32) + iFrom.low_}};
0042 }
0043 }
0044
0045 #endif