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
DummyCondObjPrinter::~DummyCondObjPrinter
~DummyCondObjPrinter() override
Definition: DummyCondObjPrinter.h:36
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
MessageLogger.h
ESHandle.h
edm::LogInfo
Definition: MessageLogger.h:254
DummyCondObjPrinter::DummyCondObjPrinter
DummyCondObjPrinter(const edm::ParameterSet &iConfig)
Definition: DummyCondObjPrinter.h:29
EDAnalyzer.h
edm::EDAnalyzer
Definition: EDAnalyzer.h:29
TrackerTopology.h
TrackerTopologyRcd.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
Service.h
edm::ESHandle
Definition: DTSurvey.h:22
DummyCondObjPrinter
Definition: DummyCondObjPrinter.h:17
edm::ParameterSet
Definition: ParameterSet.h:36
DummyCondObjPrinter::iConfig_
edm::ParameterSet iConfig_
Definition: DummyCondObjPrinter.h:24
edm::LogVerbatim
Definition: MessageLogger.h:297
edm::LogPrint
Definition: MessageLogger.h:342
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
DummyCondObjPrinter::cacheID
unsigned long long cacheID
Definition: DummyCondObjPrinter.h:25
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:41
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
ParameterSet.h
edm::Event
Definition: Event.h:73
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37