Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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 #include "FWCore/ParameterSet/interface/ParameterSetDescriptionFillerBase.h"
0022 
0023 //
0024 // static member functions
0025 //
0026 namespace edm {
0027   namespace eventsetup {
0028 
0029     std::string SourceMakerTraits::name() { return "CMS EDM Framework ESSource"; }
0030     std::string const& SourceMakerTraits::baseType() { return ParameterSetDescriptionFillerBase::kBaseForESSource; }
0031 
0032     void SourceMakerTraits::replaceExisting(EventSetupProvider&, std::shared_ptr<EventSetupRecordIntervalFinder>) {
0033       throw edm::Exception(edm::errors::LogicError) << "SourceMakerTraits::replaceExisting\n"
0034                                                     << "This function is not implemented and should never be called.\n"
0035                                                     << "Please report this to a Framework Developer\n";
0036     }
0037 
0038     std::shared_ptr<SourceMakerTraits::base_type> SourceMakerTraits::getComponentAndRegisterProcess(
0039         EventSetupsController& esController, ParameterSet const& iConfiguration) {
0040       return esController.getESSourceAndRegisterProcess(iConfiguration, esController.indexOfNextProcess());
0041     }
0042 
0043     void SourceMakerTraits::putComponent(EventSetupsController& esController,
0044                                          ParameterSet const& iConfiguration,
0045                                          std::shared_ptr<base_type> const& component) {
0046       esController.putESSource(iConfiguration, component, esController.indexOfNextProcess());
0047     }
0048 
0049     void SourceMakerTraits::logInfoWhenSharing(ParameterSet const& iConfiguration) {
0050       std::string edmtype = iConfiguration.getParameter<std::string>("@module_edm_type");
0051       std::string modtype = iConfiguration.getParameter<std::string>("@module_type");
0052       std::string label = iConfiguration.getParameter<std::string>("@module_label");
0053       edm::LogVerbatim("EventSetupSharing")
0054           << "Sharing " << edmtype << ": class=" << modtype << " label='" << label << "'";
0055     }
0056   }  // namespace eventsetup
0057 }  // namespace edm
0058 
0059 COMPONENTFACTORY_GET(edm::eventsetup::SourceMakerTraits);