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
DummyCondObjPrinter::~DummyCondObjPrinter
~DummyCondObjPrinter() override
Definition: DummyCondObjPrinter.h:38
MessageLogger.h
edm::ESWatcher< TRecord >
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
DummyCondObjPrinter::DummyCondObjPrinter
DummyCondObjPrinter(const edm::ParameterSet &iConfig)
Definition: DummyCondObjPrinter.h:31
EDAnalyzer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
DummyCondObjPrinter::tTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: DummyCondObjPrinter.h:27
TrackerTopology.h
TrackerTopologyRcd.h
Service.h
DummyCondObjPrinter
Definition: DummyCondObjPrinter.h:17
DummyCondObjPrinter::token_
edm::ESGetToken< TObject, TRecord > token_
Definition: DummyCondObjPrinter.h:26
edm::ParameterSet
Definition: ParameterSet.h:47
DummyCondObjPrinter::iConfig_
edm::ParameterSet iConfig_
Definition: DummyCondObjPrinter.h:24
edm::EventSetup
Definition: EventSetup.h:57
edm::ESGetToken< TObject, TRecord >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
DummyCondObjPrinter::watcher_
edm::ESWatcher< TRecord > watcher_
Definition: DummyCondObjPrinter.h:25
ESWatcher.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EventSetup.h
Exception.h
DummyCondObjPrinter::analyze
void analyze(const edm::Event &e, const edm::EventSetup &es) override
Definition: DummyCondObjPrinter.h:43
ParameterSet.h
edm::Event
Definition: Event.h:73
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37