Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:04

0001 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
0002 #include <ostream>
0003 #include <limits>
0004 
0005 namespace edm {
0006 
0007   static unsigned int const shift = 8 * sizeof(unsigned int);
0008 
0009   LuminosityBlockID::LuminosityBlockID(uint64_t id)
0010       : run_(static_cast<RunNumber_t>(id >> shift)),
0011         luminosityBlock_(static_cast<LuminosityBlockNumber_t>(std::numeric_limits<unsigned int>::max() & id)) {}
0012 
0013   uint64_t LuminosityBlockID::value() const {
0014     uint64_t id = run_;
0015     id = id << shift;
0016     id += luminosityBlock_;
0017     return id;
0018   }
0019 
0020   std::ostream& operator<<(std::ostream& oStream, LuminosityBlockID const& iID) {
0021     oStream << "run: " << iID.run() << " luminosityBlock: " << iID.luminosityBlock();
0022     return oStream;
0023   }
0024 }  // namespace edm