CMS 3D CMS Logo

EmptyIOVSource.cc

Go to the documentation of this file.
00001 #include "CondCore/Modules/src/EmptyIOVSource.h"
00002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00003 #include "FWCore/Framework/interface/IOVSyncValue.h"
00004 #include "DataFormats/Provenance/interface/EventID.h"
00005 #include <iostream>
00006 namespace cond{
00007   //allowed parameters: firstRun, firstTime, lastRun, lastTime, 
00008   //common paras: timetype,interval
00009   EmptyIOVSource::EmptyIOVSource(edm::ParameterSet const& pset,
00010                                  edm::InputSourceDescription const& desc):
00011     edm::ConfigurableInputSource(pset,desc),
00012     m_timeType(pset.getParameter<std::string>("timetype")),
00013     m_firstValid((cond::Time_t)pset.getParameter<boost::uint64_t>("firstValue")),
00014     m_lastValid((cond::Time_t)pset.getParameter<boost::uint64_t>("lastValue")),
00015     m_interval((cond::Time_t)pset.getParameter<boost::uint64_t>("interval")){
00016     
00017     for(cond::Time_t i=(cond::Time_t)m_firstValid; i<=m_lastValid; i+=(cond::Time_t)m_interval){
00018       m_iovs.insert(i);
00019     }
00020     m_iovit=m_iovs.begin();
00021     m_current=m_iovit;
00022     setRunAndEventInfo(); 
00023   }
00024   EmptyIOVSource::~EmptyIOVSource() {
00025   }
00026   bool EmptyIOVSource::produce( edm::Event & e ) {
00027     ++m_iovit;
00028     if( m_current != m_iovs.end() ){
00029       m_current=m_iovit;
00030       return true;
00031     }
00032     return false;
00033   }  
00034   void EmptyIOVSource::setRunAndEventInfo(){
00035     if( m_timeType=="runnumber" ){
00036       setRunNumber(*m_current);
00037     }else{
00038       setTime(*m_current);
00039     }
00040     setEventNumber(1);
00041   }
00042 }//ns cond

Generated on Tue Jun 9 17:26:10 2009 for CMSSW by  doxygen 1.5.4