CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EmptyIOVSource.cc
Go to the documentation of this file.
2 #include <string>
3 namespace cond {
5  public:
6  typedef unsigned long long Time_t;
9  private:
10  virtual bool produce(edm::Event & e);
11  virtual void setRunAndEventInfo();
12  private:
13  std::string m_timeType;
18  };
19 }
20 
24 //#include "DataFormats/Provenance/interface/EventID.h"
25 //#include <iostream>
26 namespace cond{
27  //allowed parameters: firstRun, firstTime, lastRun, lastTime,
28  //common paras: timetype,interval
30  edm::InputSourceDescription const& desc):
31  edm::ConfigurableInputSource(pset,desc),
32  m_timeType(pset.getParameter<std::string>("timetype")),
33  m_firstValid(pset.getParameter<unsigned long long>("firstValue")),
34  m_lastValid(pset.getParameter<unsigned long long>("lastValue")),
35  m_interval(pset.getParameter<unsigned long long>("interval")){
38  }
40  }
42  bool ok = !(m_lastValid<m_current);
44  return ok;
45  }
48  if( m_timeType=="runnumber" ){
50  }else if( m_timeType=="timestamp" ){
52  }else if( m_timeType=="lumiid" ){
54  setRunNumber(l.run());
55  //std::cout<<"run "<<l.run()<<std::endl;
56  //std::cout<<"luminosityBlock "<<l.luminosityBlock()<<std::endl;
58  }else{
59  throw edm::Exception(edm::errors::Configuration, std::string("EmptyIOVSource::setRunAndEventInfo: ")+m_timeType+std::string("is not one of the supported types: runnumber,timestamp,lumiid") );
60  }
61  setEventNumber(1);
62  }
63  }
64 }//ns cond
65 
69 
unsigned long long Time_t
void setLuminosityBlockNumber_t(LuminosityBlockNumber_t lb)
Set the luminosity block ID.
Definition: InputSource.h:146
virtual void setRunAndEventInfo()
#define DEFINE_FWK_INPUT_SOURCE(type)
RunNumber_t run() const
virtual bool produce(edm::Event &e)
LuminosityBlockNumber_t luminosityBlock() const
EmptyIOVSource(edm::ParameterSet const &, edm::InputSourceDescription const &)
void setRunNumber(RunNumber_t r)
Set the run number.
Definition: InputSource.h:143
void setEventNumber(EventNumber_t e)