CMS 3D CMS Logo

DummyCondObjPrinter.h
Go to the documentation of this file.
1 #ifndef CalibTracker_SiStripESProducer_DummyCondObjPrinter_h
2 #define CalibTracker_SiStripESProducer_DummyCondObjPrinter_h
3 
4 // user include files
14 #include <string>
15 
16 template <typename TObject, typename TRecord>
18 public:
19  explicit DummyCondObjPrinter(const edm::ParameterSet& iConfig);
20  ~DummyCondObjPrinter() override;
21  void analyze(const edm::Event& e, const edm::EventSetup& es) override;
22 
23 private:
28 };
29 
30 template <typename TObject, typename TRecord>
32  : iConfig_(iConfig), token_(esConsumes()), tTopoToken_(esConsumes()) {
33  edm::LogInfo("DummyCondObjPrinter") << "DummyCondObjPrinter constructor for typename " << typeid(TObject).name()
34  << " and record " << typeid(TRecord).name() << std::endl;
35 }
36 
37 template <typename TObject, typename TRecord>
39  edm::LogInfo("DummyCondObjPrinter") << "DummyCondObjPrinter::~DummyCondObjPrinter()" << std::endl;
40 }
41 
42 template <typename TObject, typename TRecord>
44  if (!watcher_.check(es))
45  return;
46 
47  const auto& esobj = es.getData(token_);
48  const auto tTopo = &es.getData(tTopoToken_);
49  std::stringstream sSummary, sDebug;
50  esobj.printSummary(sSummary, tTopo);
51  esobj.printDebug(sDebug, tTopo);
52 
53  // edm::LogInfo("DummyCondObjPrinter") << "\nPrintSummary \n" << sSummary.str() << std::endl;
54  // edm::LogWarning("DummyCondObjPrinter") << "\nPrintDebug \n" << sDebug.str() << std::endl;
55  edm::LogPrint("DummyCondObjContentPrinter") << "\nPrintSummary \n" << sSummary.str() << std::endl;
56  edm::LogVerbatim("DummyCondObjContentPrinter") << "\nPrintDebug \n" << sDebug.str() << std::endl;
57 }
58 
59 #endif
Log< level::Info, true > LogVerbatim
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::ParameterSet iConfig_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< TObject, TRecord > token_
void analyze(const edm::Event &e, const edm::EventSetup &es) override
edm::ESWatcher< TRecord > watcher_
Log< level::Warning, true > LogPrint
Log< level::Info, false > LogInfo
DummyCondObjPrinter(const edm::ParameterSet &iConfig)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_