Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:30

0001 #ifndef CondCore_HDF5ESSource_convertSyncValue_h
0002 #define CondCore_HDF5ESSource_convertSyncValue_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     CondCore/HDF5ESSource
0006 // Class  :     convertSyncValue
0007 //
0008 /**\class convertSyncValue convertSyncValue.h "convertSyncValue.h"
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Christopher Jones
0018 //         Created:  Tue, 20 Jun 2023 18:26:32 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 #include "FWCore/Framework/interface/IOVSyncValue.h"
0025 #include "IOVSyncValue.h"
0026 
0027 // forward declarations
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 }  // namespace cond::hdf5
0044 
0045 #endif