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 void produce(edm::Event & e) override;
11  virtual bool setRunAndEventInfo(edm::EventID& id, edm::TimeValue_t& time) override;
13  private:
19  };
20 }
21 
25 //#include "DataFormats/Provenance/interface/EventID.h"
26 //#include <iostream>
27 namespace cond{
28  //allowed parameters: firstRun, firstTime, lastRun, lastTime,
29  //common paras: timetype,interval
31  edm::InputSourceDescription const& desc):
32  edm::ProducerSourceBase(pset,desc,true),
33  m_timeType(pset.getParameter<std::string>("timetype")),
34  m_firstValid(pset.getParameter<unsigned long long>("firstValue")),
35  m_lastValid(pset.getParameter<unsigned long long>("lastValue")),
36  m_interval(pset.getParameter<unsigned long long>("interval")){
38  }
40  }
42  }
45  if( m_timeType=="runnumber" ){
46  id = edm::EventID(m_current, id.luminosityBlock(), 1);
47  }else if( m_timeType=="timestamp" ){
48  time = m_current;
49  }else if( m_timeType=="lumiid" ){
51  id = edm::EventID(l.run(), l.luminosityBlock(), 1);
52  //std::cout<<"run "<<l.run()<<std::endl;
53  //std::cout<<"luminosityBlock "<<l.luminosityBlock()<<std::endl;
54  }
55  }
56  bool ok = !(m_lastValid<m_current);
58  return ok;
59  }
61  if( m_timeType=="runnumber" ){
63  interval = 0LL;
64  }else if( m_timeType=="timestamp" ){
65  time = m_firstValid;
66  interval = m_interval;
67  }else if( m_timeType=="lumiid" ){
69  id = edm::EventID(l.run(), l.luminosityBlock(), 1);
70  interval = 0LL;
71  }else{
72  throw edm::Exception(edm::errors::Configuration, std::string("EmptyIOVSource::initialize: ")+m_timeType+std::string("is not one of the supported types: runnumber,timestamp,lumiid") );
73  }
74  }
75 
76 }//ns cond
77 
80 
unsigned long long Time_t
tuple interval
Definition: MergeJob_cfg.py:20
virtual void produce(edm::Event &e) override
virtual void initialize(edm::EventID &id, edm::TimeValue_t &time, edm::TimeValue_t &interval) override
#define DEFINE_FWK_INPUT_SOURCE(type)
RunNumber_t run() const
virtual bool setRunAndEventInfo(edm::EventID &id, edm::TimeValue_t &time) override
unsigned long long TimeValue_t
Definition: Timestamp.h:27
LuminosityBlockNumber_t luminosityBlock() const
EmptyIOVSource(edm::ParameterSet const &, edm::InputSourceDescription const &)
LuminosityBlockNumber_t luminosityBlock() const