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 
17 
18 template< typename TObject, typename TRecord>
20 
21 public:
22 
23  explicit DummyCondObjPrinter(const edm::ParameterSet& iConfig);
24  ~DummyCondObjPrinter() override;
25  void analyze(const edm::Event& e, const edm::EventSetup&es) override;
26 
27 
28  private:
30  unsigned long long cacheID;
31 };
32 
33 template< typename TObject, typename TRecord>
35  edm::LogInfo("DummyCondObjPrinter") << "DummyCondObjPrinter constructor for typename " << typeid(TObject).name() << " and record " << typeid(TRecord).name() << std::endl;
36 }
37 
38 
39 template< typename TObject, typename TRecord>
41  edm::LogInfo("DummyCondObjPrinter") << "DummyCondObjPrinter::~DummyCondObjPrinter()" << std::endl;
42 }
43 
44 template< typename TObject,typename TRecord>
46 
47  if( cacheID == es.get<TRecord>().cacheIdentifier())
48  return;
49 
50  cacheID = es.get<TRecord>().cacheIdentifier();
51 
53  es.get<TRecord>().get( esobj );
55  es.get<TrackerTopologyRcd>().get(tTopo);
56  std::stringstream sSummary, sDebug;
57  esobj->printSummary(sSummary, tTopo.product());
58  esobj->printDebug(sDebug, tTopo.product());
59 
60  // edm::LogInfo("DummyCondObjPrinter") << "\nPrintSummary \n" << sSummary.str() << std::endl;
61  // edm::LogWarning("DummyCondObjPrinter") << "\nPrintDebug \n" << sDebug.str() << std::endl;
62  edm::LogPrint("DummyCondObjContentPrinter") << "\nPrintSummary \n" << sSummary.str() << std::endl;
63  edm::LogVerbatim("DummyCondObjContentPrinter") << "\nPrintDebug \n" << sDebug.str() << std::endl;
64 }
65 
66 #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:63
T const * product() const
Definition: ESHandle.h:86
unsigned long long cacheID