CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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.

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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DQMMessageLoggerClient::~DQMMessageLoggerClient ( )
overridedefault

Member Function Documentation

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

Implements edm::EDAnalyzer.

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) override
Definition: DQMStore.h:569
void DQMMessageLoggerClient::beginRun ( const edm::Run r,
const edm::EventSetup es 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 34 of file DQMMessageLoggerClient.cc.

34 {}
void DQMMessageLoggerClient::endRun ( const edm::Run r,
const edm::EventSetup es 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 171 of file DQMMessageLoggerClient.cc.

References RPCNoise_example::fillHistograms.

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, and hlt_dqm_clientPB-live_cfg::me.

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 setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
MonitorElement * modulesErrorsFound
std::vector< std::string > binLabel
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * categoriesErrorsFound
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
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
std::vector< Double_t > binContent
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual TH1 * getTH1() const

Member Data Documentation

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

Definition at line 43 of file DQMMessageLoggerClient.h.

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

Definition at line 42 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::categoriesErrorsFound
private

Definition at line 50 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::categoriesWarningsFound
private

Definition at line 51 of file DQMMessageLoggerClient.h.

std::string DQMMessageLoggerClient::directoryName
private

Definition at line 40 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::modulesErrorsFound
private

Definition at line 48 of file DQMMessageLoggerClient.h.

MonitorElement* DQMMessageLoggerClient::modulesWarningsFound
private

Definition at line 49 of file DQMMessageLoggerClient.h.

int DQMMessageLoggerClient::nBinsErrors
private

Definition at line 45 of file DQMMessageLoggerClient.h.

int DQMMessageLoggerClient::nBinsWarnings
private

Definition at line 46 of file DQMMessageLoggerClient.h.

edm::ParameterSet DQMMessageLoggerClient::parameters
private

Definition at line 39 of file DQMMessageLoggerClient.h.

DQMStore* DQMMessageLoggerClient::theDbe
private

Definition at line 38 of file DQMMessageLoggerClient.h.