Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-03-14 23:36:19

0001 #include "DataFormats/Provenance/interface/ProcessConfiguration.h"
0002 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0003 #include "FWCore/Framework/interface/Event.h"
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
0007 #include "FWCore/ServiceRegistry/interface/ProcessContext.h"
0008 #include "FWCore/ServiceRegistry/interface/StreamContext.h"
0009 
0010 namespace edmtest {
0011   class PrintProcessInformation : public edm::global::EDAnalyzer<> {
0012   public:
0013     explicit PrintProcessInformation(edm::ParameterSet const&) {}
0014 
0015     void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const final {
0016       auto const* processConfiguration =
0017           e.moduleCallingContext()->getStreamContext()->processContext()->processConfiguration();
0018       assert(processConfiguration);
0019       auto reduced = *processConfiguration;
0020       reduced.reduce();
0021       edm::LogSystem("PrintProcessInformation")
0022           << "Name:" << processConfiguration->processName() << "\nReducedConfigurationID:" << reduced.id()
0023           << "\nParameterSetID:" << processConfiguration->parameterSetID();
0024     }
0025   };
0026 }  // namespace edmtest
0027 
0028 #include "FWCore/Framework/interface/MakerMacros.h"
0029 DEFINE_FWK_MODULE(edmtest::PrintProcessInformation);