CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:
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
edm::ParameterSet iConfig_
edm::ESGetToken< TObject, TRecord > token_
void analyze(const edm::Event &e, const edm::EventSetup &es) override
edm::ESWatcher< TRecord > watcher_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Log< level::Warning, true > LogPrint
Log< level::Info, false > LogInfo
DummyCondObjPrinter(const edm::ParameterSet &iConfig)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
tTopoToken_