CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DQMMessageLoggerClient Class Reference

#include <DQMMessageLoggerClient.h>

Inheritance diagram for DQMMessageLoggerClient:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DQMMessageLoggerClient (const edm::ParameterSet &)
 
virtual ~DQMMessageLoggerClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
void beginJob ()
 
void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
void endJob ()
 
void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
void endRun (const edm::Run &, const edm::EventSetup &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

void fillHistograms ()
 

Private Attributes

std::vector< Double_t > binContent
 
std::vector< std::string > binLabel
 
MonitorElementcategoriesErrorsFound
 
MonitorElementcategoriesWarningsFound
 
std::string directoryName
 
MonitorElementmodulesErrorsFound
 
MonitorElementmodulesWarningsFound
 
int nBinsErrors
 
int nBinsWarnings
 
edm::ParameterSet parameters
 
DQMStoretheDbe
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 14 of file DQMMessageLoggerClient.h.

Constructor & Destructor Documentation

DQMMessageLoggerClient::DQMMessageLoggerClient ( const edm::ParameterSet ps)

Definition at line 15 of file DQMMessageLoggerClient.cc.

References NULL, and HLT_FULL_cff::parameters.

15  {
16 
17  parameters = ps;
18  theDbe = NULL;
23  directoryName = parameters.getParameter<string>("Directory");
24 
25 }
T getParameter(std::string const &) const
MonitorElement * modulesErrorsFound
#define NULL
Definition: scimark2.h:8
MonitorElement * categoriesErrorsFound
MonitorElement * categoriesWarningsFound
MonitorElement * modulesWarningsFound
DQMMessageLoggerClient::~DQMMessageLoggerClient ( )
virtual

Definition at line 28 of file DQMMessageLoggerClient.cc.

28  {
29 
30 }

Member Function Documentation

void DQMMessageLoggerClient::analyze ( const edm::Event e,
const edm::EventSetup context 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 50 of file DQMMessageLoggerClient.cc.

50  {
51 }
void DQMMessageLoggerClient::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 34 of file DQMMessageLoggerClient.cc.

References NULL, and cppFunctionSkipper::operator.

34  {
35 
36  //LogTrace(metname)<<"[DQMMessageLoggerClient] Parameters initialization";
38 
39  if(theDbe!=NULL){
40  theDbe->setCurrentFolder(directoryName);
41  }
42 
43 }
#define NULL
Definition: scimark2.h:8
void DQMMessageLoggerClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup es 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 53 of file DQMMessageLoggerClient.cc.

53  {
54 }
void DQMMessageLoggerClient::beginRun ( const edm::Run r,
const edm::EventSetup es 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file DQMMessageLoggerClient.cc.

45  {
46 }
void DQMMessageLoggerClient::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 206 of file DQMMessageLoggerClient.cc.

206  {
207 
208  //LogTrace(metname)<<"[DQMMessageLoggerClient] EndJob";
209 }
void DQMMessageLoggerClient::endLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup context 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 56 of file DQMMessageLoggerClient.cc.

56  {
57 }
void DQMMessageLoggerClient::endRun ( const edm::Run r,
const edm::EventSetup es 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 201 of file DQMMessageLoggerClient.cc.

References RPCNoise_example::fillHistograms.

201  {
202  fillHistograms();
203 }
void DQMMessageLoggerClient::fillHistograms ( void  )
private

Definition at line 59 of file DQMMessageLoggerClient.cc.

References newFWLiteAna::bin, MonitorElement::getNbinsX(), MonitorElement::getTH1(), i, hlt_dqm_clientPB-live_cfg::me, SiStripMonitorClusterAlca_cfi::Nbins, and NULL.

59  {
60 
61 
62  // directoryName should be the same as for DQMMessageLogger
63  //theDbe->setCurrentFolder(directoryName);
64  /*
65  cout << theDbe->pwd() << endl;
66  vector<string> vec = theDbe->getSubdirs();
67  for(int i=0; i<vec.size(); i++){
68  cout << vec[i] << endl;
69  }
70  */
71  theDbe->goUp();
72 
73 
74 
75  vector<string> entries;
76  entries.push_back(directoryName + "/Warnings/modules_warnings");
77  entries.push_back(directoryName + "/Errors/modules_errors");
78  entries.push_back(directoryName + "/Warnings/categories_warnings");
79  entries.push_back(directoryName + "/Errors/categories_errors");
80 
81 
82  int mel = 0;
83 
84  for(vector<string>::const_iterator ent = entries.begin();
85  ent != entries.end(); ++ent) {
86  mel++;
87  //RESET VECTORS
88  binContent.clear();
89  binLabel.clear();
90 
91 
92  // RETURN ME
93 
94 
95  MonitorElement *me = theDbe->get(*ent);
96  // GET TH1F
97  if(theDbe->get(*ent)){
98  if (TH1 *rootHisto = me->getTH1()) {
99  int nonzeros = 0;
100  int Nbins = me->getNbinsX();
101 
102 
103  // LOOP OVER TH1F
104  for(int bin = 1; bin <= Nbins ; ++bin) {
105  if( rootHisto->GetBinContent(bin)>0){
106  nonzeros++;
107  binContent.push_back(rootHisto->GetBinContent(bin));
108  binLabel.push_back(rootHisto->GetXaxis()->GetBinLabel(bin));
109  }
110 
111  }
112 
113  switch(mel){
114  case 1:
115  theDbe->setCurrentFolder(directoryName + "/Warnings");
116  modulesWarningsFound = theDbe->get(directoryName + "/Warnings/modulesWarningsFound");
118  if(nonzeros>0){
119  modulesWarningsFound = theDbe->book1D("modulesWarningsFound", "Warnings per module", binContent.size(), 0, binContent.size());
120  }else{
121  modulesWarningsFound = theDbe->book1D("modulesWarningsFound", "Warnings per module", 1, 0, 1);
122  modulesWarningsFound->setBinLabel(1,"Module name");
123  }
124  for (int i=0; i<nonzeros; ++i){
126  //gPad->SetBottomMargin(2);
127  //cout << binContent[i] <<" "<<binLabel[i] << endl;
130  }
131  }
132  if(nonzeros>4) modulesWarningsFound->getTH1()->GetXaxis()->LabelsOption("v");
133  break;
134  case 2:
135  theDbe->setCurrentFolder(directoryName + "/Errors");
136  modulesErrorsFound = theDbe->get(directoryName + "/Errors/modulesErrorsFound");
137  if (modulesErrorsFound) theDbe->removeElement(modulesErrorsFound->getName());
138  if(nonzeros>0){
139  modulesErrorsFound = theDbe->book1D("modulesErrorsFound", "Errors per module",binContent.size(), 0, binContent.size() );
140  }else{
141  modulesErrorsFound = theDbe->book1D("modulesErrorsFound", "Errors per module",1, 0, 1 );
142  modulesErrorsFound->setBinLabel(1,"Module name");
143  }
144  for (int i=0; i<nonzeros; ++i){
146  //gPad->SetBottomMargin(2);
149  }
150  }
151  if(nonzeros>4) modulesErrorsFound->getTH1()->GetXaxis()->LabelsOption("v");
152  break;
153  case 3:
154  theDbe->setCurrentFolder(directoryName + "/Warnings");
155  categoriesWarningsFound = theDbe->get(directoryName + "/Warnings/categoriesWarningsFound");
157  if(nonzeros>0){
158  categoriesWarningsFound = theDbe->book1D("categoriesWarningsFound", "Warnings per category", binContent.size(),0,binContent.size());
159  } else{
160  categoriesWarningsFound = theDbe->book1D("categoriesWarningsFound", "Warnings per category", 1,0,1);
161  categoriesWarningsFound->setBinLabel(1,"Category name");
162  }
163  for (int i=0; i<nonzeros; ++i){
165  //gPad->SetBottomMargin(2);
166  //cout << binContent[i] <<" " <<binLabel[i] << endl;
169  }
170  }
171  if(nonzeros>4) categoriesWarningsFound->getTH1()->GetXaxis()->LabelsOption("v");
172  break;
173  case 4:
174  theDbe->setCurrentFolder(directoryName + "/Errors");
175  categoriesErrorsFound = theDbe->get(directoryName + "/Errors/categoriesErrorsFound");
177  if(nonzeros>0){
178  categoriesErrorsFound = theDbe->book1D("categoriesErrorsFound", "Errors per category", binContent.size(),0,binContent.size());
179  }else{
180  categoriesErrorsFound = theDbe->book1D("categoriesErrorsFound", "Errors per category", 1,0,1);
181  categoriesErrorsFound->setBinLabel(1,"Category name");
182  }
183  for (int i=0; i<nonzeros; ++i){
185  //gPad->SetBottomMargin(2);
188  }
189  }
190  if(nonzeros>4) categoriesErrorsFound->getTH1()->GetXaxis()->LabelsOption("v");
191  break;
192  }
193 
194  }
195  }
196  }
197 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * modulesErrorsFound
#define NULL
Definition: scimark2.h:8
std::vector< std::string > binLabel
MonitorElement * categoriesErrorsFound
TH1 * getTH1(void) const
MonitorElement * categoriesWarningsFound
MonitorElement * modulesWarningsFound
int getNbinsX(void) const
get # of bins in X-axis
std::vector< Double_t > binContent

Member Data Documentation

std::vector<Double_t> DQMMessageLoggerClient::binContent
private

Definition at line 50 of file DQMMessageLoggerClient.h.

std::vector<std::string> DQMMessageLoggerClient::binLabel
private

Definition at line 49 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::categoriesErrorsFound
private

Definition at line 57 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::categoriesWarningsFound
private

Definition at line 58 of file DQMMessageLoggerClient.h.

std::string DQMMessageLoggerClient::directoryName
private

Definition at line 47 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::modulesErrorsFound
private

Definition at line 55 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::modulesWarningsFound
private

Definition at line 56 of file DQMMessageLoggerClient.h.

int DQMMessageLoggerClient::nBinsErrors
private

Definition at line 52 of file DQMMessageLoggerClient.h.

int DQMMessageLoggerClient::nBinsWarnings
private

Definition at line 53 of file DQMMessageLoggerClient.h.

edm::ParameterSet DQMMessageLoggerClient::parameters
private
DQMStore* DQMMessageLoggerClient::theDbe
private

Definition at line 45 of file DQMMessageLoggerClient.h.