Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:23

0001 #ifndef Framework_DummyFinder_h
0002 #define Framework_DummyFinder_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Framework
0006 // Class  :     DummyFinder
0007 //
0008 /**\class DummyFinder DummyFinder.h FWCore/Framework/interface/DummyFinder.h
0009 
0010  Description: <one line class summary>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Author:      Chris Jones
0018 // Created:     Sat Apr 16 18:47:04 EDT 2005
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