CMS 3D CMS Logo

RunLumiESSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Integration
4 // Class : RunLumiESSource
5 //
6 // Implementation:
7 // ESSource used for tests of Framework support for
8 // the EventSetup system in run and lumi transitions
9 //
10 // Original Author: W. David Dagenhart
11 // Created: 18 April 2019
12 
20 #include "IOVTestInfo.h"
25 
26 #include <memory>
27 
28 namespace edmtest {
29 
31  public:
33 
34  std::unique_ptr<IOVTestInfo> produce(ESTestRecordC const&);
35 
37 
38  private:
40  edm::IOVSyncValue const&,
41  edm::ValidityInterval&) override;
42 
43  bool isConcurrentFinder() const override { return true; }
44  };
45 
47  findingRecord<ESTestRecordC>();
48  setWhatProduced(this);
49  }
50 
51  std::unique_ptr<IOVTestInfo> RunLumiESSource::produce(ESTestRecordC const& record) {
52  auto data = std::make_unique<IOVTestInfo>();
53 
54  edm::ValidityInterval iov = record.validityInterval();
55  edm::LogAbsolute("RunLumiESSource") << "RunLumiESSource::produce startIOV = " << iov.first().eventID().run() << ":"
56  << iov.first().luminosityBlockNumber()
57  << " endIOV = " << iov.last().eventID().run() << ":"
58  << iov.last().luminosityBlockNumber() << " IOV index = " << record.iovIndex()
59  << " cache identifier = " << record.cacheIdentifier();
60  data->iovStartRun_ = iov.first().eventID().run();
61  data->iovStartLumi_ = iov.first().luminosityBlockNumber();
62  data->iovEndRun_ = iov.last().eventID().run();
63  data->iovEndLumi_ = iov.last().luminosityBlockNumber();
64  data->iovIndex_ = record.iovIndex();
65  data->cacheIdentifier_ = record.cacheIdentifier();
66  return data;
67  }
68 
71  descriptions.addDefault(desc);
72  }
73 
75  edm::IOVSyncValue const& syncValue,
77  interval = edm::ValidityInterval(syncValue, syncValue);
78  }
79 } // namespace edmtest
80 using namespace edmtest;
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
bool isConcurrentFinder() const override
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
static void fillDescriptions(edm::ConfigurationDescriptions &)
void addDefault(ParameterSetDescription const &psetDescription)
void setIntervalFor(edm::eventsetup::EventSetupRecordKey const &, edm::IOVSyncValue const &, edm::ValidityInterval &) override
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:92
std::unique_ptr< IOVTestInfo > produce(ESTestRecordC const &)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
RunLumiESSource(edm::ParameterSet const &)
Log< level::System, true > LogAbsolute