CMS 3D CMS Logo

EgHLTDebugFuncs.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_DEBUGFUNCS
2 #define DQMOFFLINE_TRIGGER_DEBUGFUNCS
3 
4 //collection of usefull functions adding to debug namespace
5 //
6 //author: Sam Harper (July 2008)
7 //
8 //
9 //aim: to store common functions which are usefull for debuging my code,
10 // in theory any function here doesnt contribute to the program
11 // therefore the program should still work when all functions here are
12 // removed from it
13 
16 
19 
20 #include <iostream>
21 
22 namespace egHLT {
23  namespace debug {
24 
25  //function prints to LogInfo the names of all products of type PROD in event
26  //it returns the number of products it finds
27  template <typename PROD>
28  int listAllProducts(const edm::Event& iEvent, const char* moduleName);
29 
30  } // namespace debug
31 
32  template <typename PROD>
34  std::vector<edm::Handle<PROD> > products;
35  iEvent.getManyByType(products);
36 
37  for (size_t i = 0; i < products.size(); i++) {
38  // edm::LogInfo(moduleName) <<"for product "<<i+1<<"/"<<products.size()<<" "<<products[i].provenance()->moduleLabel()<<" "<<products[i].provenance()->moduleName()<<std::endl;
39  std::cout << "for product " << i + 1 << "/" << products.size() << " " << products[i].provenance()->moduleLabel()
40  << " " << products[i].provenance()->moduleName() << std::endl;
41  }
42  return products.size();
43  }
44 } // namespace egHLT
45 
46 #endif
Handle.h
mps_fire.i
i
Definition: mps_fire.py:428
gather_cfg.cout
cout
Definition: gather_cfg.py:144
egHLT::debug::listAllProducts
int listAllProducts(const edm::Event &iEvent, const char *moduleName)
Definition: EgHLTDebugFuncs.h:33
edm::es::products
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&... args)
Definition: ESProducts.h:128
debug
#define debug
Definition: HDRShower.cc:19
Provenance.h
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
EcalCalibMonitorClient_cfi.moduleName
moduleName
Definition: EcalCalibMonitorClient_cfi.py:17
InputTag.h
edm::Event
Definition: Event.h:73
egHLT
Definition: EgHLTBinData.h:10