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