Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:52

0001 // -*- C++ -*-
0002 //
0003 // Package:     FWCore/Framework
0004 // Class  :     edm::stream::EDAnalyzerBase
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Fri, 02 Aug 2013 23:49:57 GMT
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "FWCore/Framework/interface/stream/EDAnalyzerBase.h"
0017 #include "FWCore/Framework/src/edmodule_mightGet_config.h"
0018 
0019 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0021 
0022 #include "FWCore/ServiceRegistry/interface/Service.h"
0023 #include "FWCore/Framework/interface/ConstProductRegistry.h"
0024 
0025 using namespace edm::stream;
0026 //
0027 // constants, enums and typedefs
0028 //
0029 
0030 //
0031 // static data member definitions
0032 //
0033 
0034 //
0035 // constructors and destructor
0036 //
0037 EDAnalyzerBase::EDAnalyzerBase() : moduleDescriptionPtr_(nullptr) {}
0038 
0039 // EDAnalyzerBase::EDAnalyzerBase(const EDAnalyzerBase& rhs)
0040 // {
0041 //    // do actual copying here;
0042 // }
0043 
0044 EDAnalyzerBase::~EDAnalyzerBase() {}
0045 
0046 //
0047 // assignment operators
0048 //
0049 // const EDAnalyzerBase& EDAnalyzerBase::operator=(const EDAnalyzerBase& rhs)
0050 // {
0051 //   //An exception safe implementation is
0052 //   EDAnalyzerBase temp(rhs);
0053 //   swap(rhs);
0054 //
0055 //   return *this;
0056 // }
0057 
0058 //
0059 // member functions
0060 //
0061 void EDAnalyzerBase::callWhenNewProductsRegistered(std::function<void(BranchDescription const&)> const& func) {
0062   callWhenNewProductsRegistered_ = func;
0063 }
0064 
0065 void EDAnalyzerBase::registerProductsAndCallbacks(EDAnalyzerBase const*, ProductRegistry* reg) {
0066   if (callWhenNewProductsRegistered_) {
0067     reg->callForEachBranch(callWhenNewProductsRegistered_);
0068 
0069     Service<ConstProductRegistry> regService;
0070     regService->watchProductAdditions(callWhenNewProductsRegistered_);
0071   }
0072 }
0073 
0074 //
0075 // const member functions
0076 //
0077 
0078 //
0079 // static member functions
0080 //
0081 void EDAnalyzerBase::fillDescriptions(ConfigurationDescriptions& descriptions) {
0082   ParameterSetDescription desc;
0083   desc.setUnknown();
0084   descriptions.addDefault(desc);
0085 }
0086 
0087 void EDAnalyzerBase::prevalidate(ConfigurationDescriptions& iConfig) { edmodule_mightGet_config(iConfig); }
0088 
0089 static const std::string kBaseType("EDAnalyzer");
0090 
0091 const std::string& EDAnalyzerBase::baseType() { return kBaseType; }