CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DataFormats/Provenance/src/LuminosityBlockID.cc

Go to the documentation of this file.
00001 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
00002 #include <ostream>
00003 #include <limits>
00004 
00005 
00006 
00007 namespace edm {
00008 
00009   static unsigned int const shift = 8 * sizeof(unsigned int);
00010 
00011   LuminosityBlockID::LuminosityBlockID(boost::uint64_t id) :
00012    run_(static_cast<RunNumber_t>(id >> shift)),
00013    luminosityBlock_(static_cast<LuminosityBlockNumber_t>(std::numeric_limits<unsigned int>::max() & id))
00014   {
00015   }
00016 
00017   boost::uint64_t
00018   LuminosityBlockID::value() const {
00019    boost::uint64_t id = run_;
00020    id = id << shift;
00021    id += luminosityBlock_;
00022    return id;
00023   }
00024 
00025   std::ostream& operator<<(std::ostream& oStream, LuminosityBlockID const& iID) {
00026     oStream<< "run: " << iID.run() << " luminosityBlock: " << iID.luminosityBlock();
00027     return oStream;
00028   }
00029 }