CMS 3D CMS Logo

EmptyIOVSource.cc
Go to the documentation of this file.
5 #include <string>
6 namespace cond {
8  public:
10  ~EmptyIOVSource() override;
11  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
12 
13  private:
14  void produce(edm::Event& e) override;
17  edm::EventAuxiliary::ExperimentType& eType) override;
19 
20  private:
26  };
27 } // namespace cond
28 
32 //#include "DataFormats/Provenance/interface/EventID.h"
33 //#include <iostream>
34 namespace cond {
35  //allowed parameters: firstRun, firstTime, lastRun, lastTime,
36  //common paras: timetype,interval
38  : edm::ProducerSourceBase(pset, desc, true),
39  m_timeType(time::timeTypeFromName(pset.getParameter<std::string>("timetype"))),
40  m_firstValid(pset.getParameter<unsigned long long>("firstValue")),
41  m_lastValid(pset.getParameter<unsigned long long>("lastValue")),
42  m_interval(pset.getParameter<unsigned long long>("interval")) {
44  }
50  if (m_current <= m_lastValid) {
51  if (m_timeType == cond::runnumber) {
52  id = edm::EventID(m_current, id.luminosityBlock(), 1);
53  } else if (m_timeType == cond::timestamp) {
54  time = m_current;
55  } else if (m_timeType == cond::lumiid) {
57  id = edm::EventID(l.run(), l.luminosityBlock(), 1);
58  //std::cout<<"run "<<l.run()<<std::endl;
59  //std::cout<<"luminosityBlock "<<l.luminosityBlock()<<std::endl;
60  }
61  }
62  bool ok = !(m_lastValid < m_current);
64  return ok;
65  }
67  if (m_timeType == cond::runnumber) {
69  interval = 0LL;
70  } else if (m_timeType == cond::timestamp) {
73  } else if (m_timeType == cond::lumiid) {
75  id = edm::EventID(l.run(), l.luminosityBlock(), 1);
76  interval = 0LL;
77  }
78  }
79 
82  desc.setComment("Creates runs, lumis and events containing no products.");
83  ProducerSourceBase::fillDescription(desc);
84 
85  desc.add<std::string>("timetype");
86  desc.add<unsigned long long>("firstValue")->setComment("The first run number to use or the first time");
87  desc.add<unsigned long long>("lastValue")->setComment("The last run number to use or the last time");
88  desc.add<unsigned long long>("interval");
89 
90  descriptions.add("source", desc);
91  }
92 
93 } // namespace cond
94 
97 
ConfigurationDescriptions.h
cond::EmptyIOVSource::EmptyIOVSource
EmptyIOVSource(edm::ParameterSet const &, edm::InputSourceDescription const &)
Definition: EmptyIOVSource.cc:37
cond::lumiid
Definition: Time.h:19
cond::EmptyIOVSource::m_lastValid
Time_t m_lastValid
Definition: EmptyIOVSource.cc:23
cond::TimeType
TimeType
Definition: Time.h:19
cond::EmptyIOVSource::m_timeType
TimeType m_timeType
Definition: EmptyIOVSource.cc:21
edm
HLT enums.
Definition: AlignableModifier.h:19
cond::EmptyIOVSource::m_interval
Time_t m_interval
Definition: EmptyIOVSource.cc:24
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ProducerSourceBase
Definition: ProducerSourceBase.h:23
edm::InputSourceDescription
Definition: InputSourceDescription.h:20
protons_cff.time
time
Definition: protons_cff.py:39
edm::IDGeneratorSourceBase< PuttableSourceBase >::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: IDGeneratorSourceBase.h:39
cond::EmptyIOVSource::setRunAndEventInfo
bool setRunAndEventInfo(edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &eType) override
Definition: EmptyIOVSource.cc:47
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
cond::EmptyIOVSource::initialize
void initialize(edm::EventID &id, edm::TimeValue_t &time, edm::TimeValue_t &interval) override
Definition: EmptyIOVSource.cc:66
EDMException.h
cond::timestamp
Definition: Time.h:19
cond::EmptyIOVSource
Definition: EmptyIOVSource.cc:7
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
DEFINE_FWK_INPUT_SOURCE
#define DEFINE_FWK_INPUT_SOURCE(type)
Definition: InputSourceMacros.h:8
cond::EmptyIOVSource::m_current
Time_t m_current
Definition: EmptyIOVSource.cc:25
ParameterSetDescription.h
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond
Definition: plugin.cc:23
funct::true
true
Definition: Factorize.h:173
Time.h
edm::ParameterSet
Definition: ParameterSet.h:47
cond::EmptyIOVSource::m_firstValid
Time_t m_firstValid
Definition: EmptyIOVSource.cc:22
cond::runnumber
Definition: Time.h:19
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
readEcalDQMStatus.interval
interval
Definition: readEcalDQMStatus.py:18
cond::EmptyIOVSource::produce
void produce(edm::Event &e) override
Definition: EmptyIOVSource.cc:46
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
InputSourceMacros.h
L1DTConfigBti_cff.LL
LL
Definition: L1DTConfigBti_cff.py:25
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
edm::EventAuxiliary::ExperimentType
ExperimentType
Definition: EventAuxiliary.h:18
cond::time::timeTypeFromName
TimeType timeTypeFromName(const std::string &name)
Definition: Time.cc:25
ParameterSet.h
edm::EventID
Definition: EventID.h:31
cond::EmptyIOVSource::~EmptyIOVSource
~EmptyIOVSource() override
Definition: EmptyIOVSource.cc:45
edm::Event
Definition: Event.h:73
IOVSyncValue.h
cond::EmptyIOVSource::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EmptyIOVSource.cc:80
edm::TimeValue_t
unsigned long long TimeValue_t
Definition: Timestamp.h:28
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
ProducerSourceBase.h