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:
25  unsigned long long cacheID;
26 };
27 
28 template <typename TObject, typename TRecord>
30  : iConfig_(iConfig), cacheID(0) {
31  edm::LogInfo("DummyCondObjPrinter") << "DummyCondObjPrinter constructor for typename " << typeid(TObject).name()
32  << " and record " << typeid(TRecord).name() << std::endl;
33 }
34 
35 template <typename TObject, typename TRecord>
37  edm::LogInfo("DummyCondObjPrinter") << "DummyCondObjPrinter::~DummyCondObjPrinter()" << std::endl;
38 }
39 
40 template <typename TObject, typename TRecord>
42  if (cacheID == es.get<TRecord>().cacheIdentifier())
43  return;
44 
45  cacheID = es.get<TRecord>().cacheIdentifier();
46 
48  es.get<TRecord>().get(esobj);
50  es.get<TrackerTopologyRcd>().get(tTopo);
51  std::stringstream sSummary, sDebug;
52  esobj->printSummary(sSummary, tTopo.product());
53  esobj->printDebug(sDebug, tTopo.product());
54 
55  // edm::LogInfo("DummyCondObjPrinter") << "\nPrintSummary \n" << sSummary.str() << std::endl;
56  // edm::LogWarning("DummyCondObjPrinter") << "\nPrintDebug \n" << sDebug.str() << std::endl;
57  edm::LogPrint("DummyCondObjContentPrinter") << "\nPrintSummary \n" << sSummary.str() << std::endl;
58  edm::LogVerbatim("DummyCondObjContentPrinter") << "\nPrintDebug \n" << sDebug.str() << std::endl;
59 }
60 
61 #endif
edm::ParameterSet iConfig_
void analyze(const edm::Event &e, const edm::EventSetup &es) override
DummyCondObjPrinter(const edm::ParameterSet &iConfig)
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
unsigned long long cacheID