Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:     test
0004 // Class  :     LoadableDummyESSource
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Author:      Chris Jones
0010 // Created:     Thu May 26 13:48:03 EDT 2005
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "FWCore/Framework/test/DummyESProductResolverProvider.h"
0017 
0018 #include "FWCore/Framework/test/DummyFinder.h"
0019 #include "FWCore/Framework/interface/SourceFactory.h"
0020 
0021 namespace edm {
0022   class ParameterSet;
0023 }
0024 
0025 class LoadableDummyESSource : public edm::eventsetup::test::DummyESProductResolverProvider, public DummyFinder {
0026 public:
0027   LoadableDummyESSource(const edm::ParameterSet& iPSet)
0028       : DummyESProductResolverProvider(edm::eventsetup::test::DummyData(iPSet.getUntrackedParameter<int>("value", 2))) {
0029     unsigned int startRun = iPSet.getUntrackedParameter<unsigned int>("startRunForIOV", 0);
0030     if (0 == startRun) {
0031       setInterval(edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime()));
0032     } else {
0033       setInterval(
0034           edm::ValidityInterval(edm::IOVSyncValue(edm::EventID(startRun, 0, 0)), edm::IOVSyncValue::endOfTime()));
0035     }
0036   }
0037 };
0038 
0039 DEFINE_FWK_EVENTSETUP_SOURCE(LoadableDummyESSource);