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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 12 of file DQMMessageLoggerClient.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 14 of file DQMMessageLoggerClient.h.

◆ MonitorElement

Definition at line 15 of file DQMMessageLoggerClient.h.

Constructor & Destructor Documentation

◆ DQMMessageLoggerClient()

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 }

◆ ~DQMMessageLoggerClient()

DQMMessageLoggerClient::~DQMMessageLoggerClient ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 36 of file DQMMessageLoggerClient.cc.

36 {}

◆ beginJob()

void DQMMessageLoggerClient::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 25 of file DQMMessageLoggerClient.cc.

25  {
26  //LogTrace(metname)<<"[DQMMessageLoggerClient] Parameters initialization";
27  theDbe = Service<DQMStore>().operator->();
28 
29  if (theDbe != nullptr) {
31  }
32 }

◆ beginRun()

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 {}

◆ endRun()

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

Reimplemented from edm::EDAnalyzer.

Definition at line 171 of file DQMMessageLoggerClient.cc.

171 { fillHistograms(); }

References RPCNoise_cfi::fillHistograms.

◆ fillHistograms()

void DQMMessageLoggerClient::fillHistograms ( )
private

Definition at line 38 of file DQMMessageLoggerClient.cc.

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 }

References newFWLiteAna::bin, mps_fire::i, hlt_dqm_clientPB-live_cfg::me, and SiStripMonitorCluster_cfi::Nbins.

Member Data Documentation

◆ binContent

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

Definition at line 43 of file DQMMessageLoggerClient.h.

◆ binLabel

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

Definition at line 42 of file DQMMessageLoggerClient.h.

◆ categoriesErrorsFound

MonitorElement* DQMMessageLoggerClient::categoriesErrorsFound
private

Definition at line 50 of file DQMMessageLoggerClient.h.

◆ categoriesWarningsFound

MonitorElement* DQMMessageLoggerClient::categoriesWarningsFound
private

Definition at line 51 of file DQMMessageLoggerClient.h.

◆ directoryName

std::string DQMMessageLoggerClient::directoryName
private

Definition at line 40 of file DQMMessageLoggerClient.h.

◆ modulesErrorsFound

MonitorElement* DQMMessageLoggerClient::modulesErrorsFound
private

Definition at line 48 of file DQMMessageLoggerClient.h.

◆ modulesWarningsFound

MonitorElement* DQMMessageLoggerClient::modulesWarningsFound
private

Definition at line 49 of file DQMMessageLoggerClient.h.

◆ nBinsErrors

int DQMMessageLoggerClient::nBinsErrors
private

Definition at line 45 of file DQMMessageLoggerClient.h.

◆ nBinsWarnings

int DQMMessageLoggerClient::nBinsWarnings
private

Definition at line 46 of file DQMMessageLoggerClient.h.

◆ parameters

edm::ParameterSet DQMMessageLoggerClient::parameters
private

Definition at line 39 of file DQMMessageLoggerClient.h.

◆ theDbe

DQMStore* DQMMessageLoggerClient::theDbe
private

Definition at line 38 of file DQMMessageLoggerClient.h.

mps_fire.i
i
Definition: mps_fire.py:428
DQMMessageLoggerClient::binLabel
std::vector< std::string > binLabel
Definition: DQMMessageLoggerClient.h:42
dqm::implementation::DQMStore::goUp
void goUp() override
Definition: DQMStore.h:566
DQMMessageLoggerClient::parameters
edm::ParameterSet parameters
Definition: DQMMessageLoggerClient.h:39
DQMMessageLoggerClient::modulesErrorsFound
MonitorElement * modulesErrorsFound
Definition: DQMMessageLoggerClient.h:48
DQMMessageLoggerClient::binContent
std::vector< Double_t > binContent
Definition: DQMMessageLoggerClient.h:43
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
DQMMessageLoggerClient::categoriesErrorsFound
MonitorElement * categoriesErrorsFound
Definition: DQMMessageLoggerClient.h:50
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:475
DQMMessageLoggerClient::directoryName
std::string directoryName
Definition: DQMMessageLoggerClient.h:40
SiStripMonitorCluster_cfi.Nbins
Nbins
Definition: SiStripMonitorCluster_cfi.py:32
DQMMessageLoggerClient::modulesWarningsFound
MonitorElement * modulesWarningsFound
Definition: DQMMessageLoggerClient.h:49
DQMMessageLoggerClient::categoriesWarningsFound
MonitorElement * categoriesWarningsFound
Definition: DQMMessageLoggerClient.h:51
edm::Service
Definition: Service.h:30
dqm::impl::MonitorElement::setBinLabel
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)
Definition: MonitorElement.cc:771
DQMMessageLoggerClient::fillHistograms
void fillHistograms()
Definition: DQMMessageLoggerClient.cc:38
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
DQMMessageLoggerClient::theDbe
DQMStore * theDbe
Definition: DQMMessageLoggerClient.h:38
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98