Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-24 09:50:49

0001 #ifndef FWCore_Services_monitor_file_utilities_h
0002 #define FWCore_Services_monitor_file_utilities_h
0003 
0004 #include <iomanip>
0005 #include <iostream>
0006 #include <vector>
0007 #include <concepts>
0008 
0009 #include "FWCore/ServiceRegistry/interface/StreamContext.h"
0010 #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
0011 #include "FWCore/ServiceRegistry/interface/ESModuleCallingContext.h"
0012 #include "DataFormats/Provenance/interface/ModuleDescription.h"
0013 #include "FWCore/Framework/interface/ComponentDescription.h"
0014 
0015 namespace edm::service::monitor_file_utilities {
0016 
0017   inline auto stream_id(edm::StreamContext const& cs) { return cs.streamID().value(); }
0018 
0019   inline auto module_id(edm::ModuleCallingContext const& mcc) { return mcc.moduleDescription()->id(); }
0020 
0021   inline auto module_id(edm::ESModuleCallingContext const& mcc) { return mcc.componentDescription()->id_; }
0022 
0023   inline auto module_callid(edm::ModuleCallingContext const& mcc) { return mcc.callID(); }
0024 
0025   inline auto module_callid(edm::ESModuleCallingContext const& mcc) { return mcc.callID(); }
0026 
0027   template <std::integral T>
0028   void concatenate(std::ostream& os, T const t) {
0029     os << ' ' << t;
0030   }
0031 
0032   template <std::integral H, std::integral... T>
0033   void concatenate(std::ostream& os, H const h, T const... t) {
0034     os << ' ' << h;
0035     concatenate(os, t...);
0036   }
0037 
0038   void moduleIdToLabel(std::ostream&,
0039                        std::vector<std::string> const& iModules,
0040                        char moduleIdSymbol,
0041                        std::string const& iIDHeader,
0042                        std::string const& iLabelHeader);
0043 }  // namespace edm::service::monitor_file_utilities
0044 #endif