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.
3 #include <string>
4 namespace cond {
6  public:
9  private:
10  virtual void produce(edm::Event & e) override;
12  virtual void initialize(edm::EventID& id, edm::TimeValue_t& time, edm::TimeValue_t& interval) 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( time::timeTypeFromName( 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 == cond::runnumber ){
46  id = edm::EventID(m_current, id.luminosityBlock(), 1);
47  }else if( m_timeType == cond::timestamp ){
48  time = m_current;
49  }else if( m_timeType == cond::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  }
63  interval = 0LL;
64  }else if( m_timeType == cond::timestamp ){
65  time = m_firstValid;
66  interval = m_interval;
67  }else if( m_timeType == cond::lumiid ){
69  id = edm::EventID(l.run(), l.luminosityBlock(), 1);
70  interval = 0LL;
71  }
72  }
73 
74 }//ns cond
75 
78 
virtual bool setRunAndEventInfo(edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &eType) override
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
TimeType
Definition: Time.h:21
unsigned long long Time_t
Definition: Time.h:16
#define DEFINE_FWK_INPUT_SOURCE(type)
TimeType timeTypeFromName(const std::string &name)
Definition: Time.cc:24
RunNumber_t run() const
unsigned long long TimeValue_t
Definition: Timestamp.h:28
LuminosityBlockNumber_t luminosityBlock() const
EmptyIOVSource(edm::ParameterSet const &, edm::InputSourceDescription const &)
LuminosityBlockNumber_t luminosityBlock() const