CMS 3D CMS Logo

List of all members | Public Types | 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 Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 DQMMessageLoggerClient (const edm::ParameterSet &)
 
 ~DQMMessageLoggerClient () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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 & itemsToGetFrom (BranchType iType) 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 12 of file DQMMessageLoggerClient.h.

Member Typedef Documentation

Definition at line 14 of file DQMMessageLoggerClient.h.

Definition at line 15 of file DQMMessageLoggerClient.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file DQMMessageLoggerClient.cc.

References edm::ParameterSet::getParameter(), and ~DQMMessageLoggerClient().

13  {
14  parameters = ps;
15  theDbe = nullptr;
16  modulesErrorsFound = nullptr;
17  modulesWarningsFound = nullptr;
18  categoriesWarningsFound = nullptr;
19  categoriesErrorsFound = nullptr;
20  directoryName = parameters.getParameter<string>("Directory");
21 }
MonitorElement * modulesErrorsFound
MonitorElement * categoriesErrorsFound
MonitorElement * categoriesWarningsFound
MonitorElement * modulesWarningsFound
DQMMessageLoggerClient::~DQMMessageLoggerClient ( )
overridedefault

Referenced by DQMMessageLoggerClient().

Member Function Documentation

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

Definition at line 36 of file DQMMessageLoggerClient.cc.

36 {}
void DQMMessageLoggerClient::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 25 of file DQMMessageLoggerClient.cc.

References Utilities::operator.

25  {
26  //LogTrace(metname)<<"[DQMMessageLoggerClient] Parameters initialization";
28 
29  if (theDbe != nullptr) {
31  }
32 }
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:639
void DQMMessageLoggerClient::beginRun ( const edm::Run r,
const edm::EventSetup es 
)
overrideprotected

Definition at line 34 of file DQMMessageLoggerClient.cc.

34 {}
void DQMMessageLoggerClient::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 173 of file DQMMessageLoggerClient.cc.

173  {
174  //LogTrace(metname)<<"[DQMMessageLoggerClient] EndJob";
175 }
void DQMMessageLoggerClient::endRun ( const edm::Run r,
const edm::EventSetup es 
)
overrideprotected
void DQMMessageLoggerClient::fillHistograms ( )
private

Definition at line 38 of file DQMMessageLoggerClient.cc.

References newFWLiteAna::bin, dqm::impl::MonitorElement::getNbinsX(), dqm::legacy::MonitorElement::getTH1(), mps_fire::i, hlt_dqm_clientPB-live_cfg::me, and SiStripMonitorCluster_cfi::Nbins.

38  {
39  // directoryName should be the same as for DQMMessageLogger
40  //theDbe->setCurrentFolder(directoryName);
41  /*
42  cout << theDbe->pwd() << endl;
43  vector<string> vec = theDbe->getSubdirs();
44  for(int i=0; i<vec.size(); i++){
45  cout << vec[i] << endl;
46  }
47  */
48  theDbe->goUp();
49 
50  vector<string> entries;
51  entries.push_back(directoryName + "/Warnings/modules_warnings");
52  entries.push_back(directoryName + "/Errors/modules_errors");
53  entries.push_back(directoryName + "/Warnings/categories_warnings");
54  entries.push_back(directoryName + "/Errors/categories_errors");
55 
56  int mel = 0;
57 
58  for (auto ent = entries.begin(); ent != entries.end(); ++ent) {
59  mel++;
60  //RESET VECTORS
61  binContent.clear();
62  binLabel.clear();
63 
64  // RETURN ME
65 
66  MonitorElement* me = theDbe->get(*ent);
67  // GET TH1F
68  if (theDbe->get(*ent)) {
69  if (TH1* rootHisto = me->getTH1()) {
70  int nonzeros = 0;
71  int Nbins = me->getNbinsX();
72 
73  // LOOP OVER TH1F
74  for (int bin = 1; bin <= Nbins; ++bin) {
75  if (rootHisto->GetBinContent(bin) > 0) {
76  nonzeros++;
77  binContent.push_back(rootHisto->GetBinContent(bin));
78  binLabel.emplace_back(rootHisto->GetXaxis()->GetBinLabel(bin));
79  }
80  }
81 
82  switch (mel) {
83  case 1:
84  theDbe->setCurrentFolder(directoryName + "/Warnings");
85  modulesWarningsFound = theDbe->get(directoryName + "/Warnings/modulesWarningsFound");
86  if (nonzeros > 0) {
88  "modulesWarningsFound", "Warnings per module", binContent.size(), 0, binContent.size());
89  } else {
90  modulesWarningsFound = theDbe->book1D("modulesWarningsFound", "Warnings per module", 1, 0, 1);
91  modulesWarningsFound->setBinLabel(1, "Module name");
92  }
93  for (int i = 0; i < nonzeros; ++i) {
94  if (modulesWarningsFound != nullptr) {
95  //gPad->SetBottomMargin(2);
96  //cout << binContent[i] <<" "<<binLabel[i] << endl;
99  }
100  }
101  if (nonzeros > 4)
102  modulesWarningsFound->getTH1()->GetXaxis()->LabelsOption("v");
103  break;
104  case 2:
105  theDbe->setCurrentFolder(directoryName + "/Errors");
106  modulesErrorsFound = theDbe->get(directoryName + "/Errors/modulesErrorsFound");
107  if (nonzeros > 0) {
109  theDbe->book1D("modulesErrorsFound", "Errors per module", binContent.size(), 0, binContent.size());
110  } else {
111  modulesErrorsFound = theDbe->book1D("modulesErrorsFound", "Errors per module", 1, 0, 1);
112  modulesErrorsFound->setBinLabel(1, "Module name");
113  }
114  for (int i = 0; i < nonzeros; ++i) {
115  if (modulesErrorsFound != nullptr) {
116  //gPad->SetBottomMargin(2);
119  }
120  }
121  if (nonzeros > 4)
122  modulesErrorsFound->getTH1()->GetXaxis()->LabelsOption("v");
123  break;
124  case 3:
125  theDbe->setCurrentFolder(directoryName + "/Warnings");
126  categoriesWarningsFound = theDbe->get(directoryName + "/Warnings/categoriesWarningsFound");
127  if (nonzeros > 0) {
129  "categoriesWarningsFound", "Warnings per category", binContent.size(), 0, binContent.size());
130  } else {
131  categoriesWarningsFound = theDbe->book1D("categoriesWarningsFound", "Warnings per category", 1, 0, 1);
132  categoriesWarningsFound->setBinLabel(1, "Category name");
133  }
134  for (int i = 0; i < nonzeros; ++i) {
135  if (categoriesWarningsFound != nullptr) {
136  //gPad->SetBottomMargin(2);
137  //cout << binContent[i] <<" " <<binLabel[i] << endl;
140  }
141  }
142  if (nonzeros > 4)
143  categoriesWarningsFound->getTH1()->GetXaxis()->LabelsOption("v");
144  break;
145  case 4:
146  theDbe->setCurrentFolder(directoryName + "/Errors");
147  categoriesErrorsFound = theDbe->get(directoryName + "/Errors/categoriesErrorsFound");
148  if (nonzeros > 0) {
150  "categoriesErrorsFound", "Errors per category", binContent.size(), 0, binContent.size());
151  } else {
152  categoriesErrorsFound = theDbe->book1D("categoriesErrorsFound", "Errors per category", 1, 0, 1);
153  categoriesErrorsFound->setBinLabel(1, "Category name");
154  }
155  for (int i = 0; i < nonzeros; ++i) {
156  if (categoriesErrorsFound != nullptr) {
157  //gPad->SetBottomMargin(2);
160  }
161  }
162  if (nonzeros > 4)
163  categoriesErrorsFound->getTH1()->GetXaxis()->LabelsOption("v");
164  break;
165  }
166  }
167  }
168  }
169 }
void goUp()
equivalent to "cd .."
Definition: DQMStore.cc:648
MonitorElement * modulesErrorsFound
std::vector< std::string > binLabel
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1509
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * categoriesErrorsFound
MonitorElement * categoriesWarningsFound
virtual 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)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * modulesWarningsFound
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:639
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
Definition: DQMStore.cc:1121
std::vector< Double_t > binContent
virtual TH1 * getTH1() const

Member Data Documentation

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

Definition at line 44 of file DQMMessageLoggerClient.h.

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

Definition at line 43 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::categoriesErrorsFound
private

Definition at line 51 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::categoriesWarningsFound
private

Definition at line 52 of file DQMMessageLoggerClient.h.

std::string DQMMessageLoggerClient::directoryName
private

Definition at line 41 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::modulesErrorsFound
private

Definition at line 49 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::modulesWarningsFound
private

Definition at line 50 of file DQMMessageLoggerClient.h.

int DQMMessageLoggerClient::nBinsErrors
private

Definition at line 46 of file DQMMessageLoggerClient.h.

int DQMMessageLoggerClient::nBinsWarnings
private

Definition at line 47 of file DQMMessageLoggerClient.h.

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

Definition at line 39 of file DQMMessageLoggerClient.h.