File indexing completed on 2024-04-06 12:12:23
0001 #ifndef Framework_DummyFinder_h
0002 #define Framework_DummyFinder_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0022 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0023 #include "FWCore/Framework/test/DummyRecord.h"
0024
0025 class DummyFinder : public edm::EventSetupRecordIntervalFinder {
0026 public:
0027 DummyFinder() : edm::EventSetupRecordIntervalFinder(), interval_() { this->findingRecord<DummyRecord>(); }
0028
0029 void setInterval(const edm::ValidityInterval& iInterval) {
0030 interval_ = iInterval;
0031 const edm::eventsetup::EventSetupRecordKey dummyRecordKey = DummyRecord::keyForClass();
0032 resetInterval(dummyRecordKey);
0033 }
0034
0035 protected:
0036 virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0037 const edm::IOVSyncValue& iTime,
0038 edm::ValidityInterval& iInterval) {
0039 if (interval_.validFor(iTime)) {
0040 iInterval = interval_;
0041 } else {
0042 if (interval_.last() == edm::IOVSyncValue::invalidIOVSyncValue() &&
0043 interval_.first() != edm::IOVSyncValue::invalidIOVSyncValue() && interval_.first() <= iTime) {
0044 iInterval = interval_;
0045 } else {
0046 iInterval = edm::ValidityInterval();
0047 }
0048 }
0049 }
0050
0051 private:
0052 edm::ValidityInterval interval_;
0053 };
0054
0055 #endif