Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-18 22:30:23

0001 // -*- C++ -*-
0002 //
0003 // Package:     Framework
0004 // Class  :     SourceFactory
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Author:      Chris Jones
0010 // Created:     Wed May 25 19:27:37 EDT 2005
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "FWCore/Framework/interface/SourceFactory.h"
0017 #include "FWCore/Framework/interface/EventSetupsController.h"
0018 #include "FWCore/Utilities/interface/EDMException.h"
0019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 
0022 //
0023 // static member functions
0024 //
0025 namespace edm {
0026   namespace eventsetup {
0027 
0028     std::string SourceMakerTraits::name() { return "CMS EDM Framework ESSource"; }
0029 
0030     void SourceMakerTraits::replaceExisting(EventSetupProvider&, std::shared_ptr<EventSetupRecordIntervalFinder>) {
0031       throw edm::Exception(edm::errors::LogicError) << "SourceMakerTraits::replaceExisting\n"
0032                                                     << "This function is not implemented and should never be called.\n"
0033                                                     << "Please report this to a Framework Developer\n";
0034     }
0035 
0036     std::shared_ptr<SourceMakerTraits::base_type> SourceMakerTraits::getComponentAndRegisterProcess(
0037         EventSetupsController& esController, ParameterSet const& iConfiguration) {
0038       return esController.getESSourceAndRegisterProcess(iConfiguration, esController.indexOfNextProcess());
0039     }
0040 
0041     void SourceMakerTraits::putComponent(EventSetupsController& esController,
0042                                          ParameterSet const& iConfiguration,
0043                                          std::shared_ptr<base_type> const& component) {
0044       esController.putESSource(iConfiguration, component, esController.indexOfNextProcess());
0045     }
0046 
0047     void SourceMakerTraits::logInfoWhenSharing(ParameterSet const& iConfiguration) {
0048       std::string edmtype = iConfiguration.getParameter<std::string>("@module_edm_type");
0049       std::string modtype = iConfiguration.getParameter<std::string>("@module_type");
0050       std::string label = iConfiguration.getParameter<std::string>("@module_label");
0051       edm::LogVerbatim("EventSetupSharing")
0052           << "Sharing " << edmtype << ": class=" << modtype << " label='" << label << "'";
0053     }
0054   }  // namespace eventsetup
0055 }  // namespace edm
0056 
0057 COMPONENTFACTORY_GET(edm::eventsetup::SourceMakerTraits);