CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DQMMessageLoggerClient Class Reference
Inheritance diagram for DQMMessageLoggerClient:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase 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::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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< Bconsumes (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 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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 10 of file DQMMessageLoggerClient.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 12 of file DQMMessageLoggerClient.cc.

◆ MonitorElement

Definition at line 13 of file DQMMessageLoggerClient.cc.

Constructor & Destructor Documentation

◆ DQMMessageLoggerClient()

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

Definition at line 59 of file DQMMessageLoggerClient.cc.

59  {
60  parameters = ps;
61  theDbe = nullptr;
62  modulesErrorsFound = nullptr;
63  modulesWarningsFound = nullptr;
64  categoriesWarningsFound = nullptr;
65  categoriesErrorsFound = nullptr;
66  directoryName = parameters.getParameter<string>("Directory");
67 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MonitorElement * modulesErrorsFound
MonitorElement * categoriesErrorsFound
MonitorElement * categoriesWarningsFound
MonitorElement * modulesWarningsFound

◆ ~DQMMessageLoggerClient()

DQMMessageLoggerClient::~DQMMessageLoggerClient ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 82 of file DQMMessageLoggerClient.cc.

82 {}

◆ beginJob()

void DQMMessageLoggerClient::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 71 of file DQMMessageLoggerClient.cc.

References Utilities::operator.

71  {
72  //LogTrace(metname)<<"[DQMMessageLoggerClient] Parameters initialization";
74 
75  if (theDbe != nullptr) {
77  }
78 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656

◆ beginRun()

void DQMMessageLoggerClient::beginRun ( const edm::Run r,
const edm::EventSetup es 
)
overrideprotected

Definition at line 80 of file DQMMessageLoggerClient.cc.

80 {}

◆ endRun()

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

◆ fillHistograms()

void DQMMessageLoggerClient::fillHistograms ( )
private

Definition at line 84 of file DQMMessageLoggerClient.cc.

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

84  {
85  // directoryName should be the same as for DQMMessageLogger
86  //theDbe->setCurrentFolder(directoryName);
87  /*
88  cout << theDbe->pwd() << endl;
89  vector<string> vec = theDbe->getSubdirs();
90  for(int i=0; i<vec.size(); i++){
91  cout << vec[i] << endl;
92  }
93  */
94  theDbe->goUp();
95 
96  vector<string> entries;
97  entries.push_back(directoryName + "/Warnings/modules_warnings");
98  entries.push_back(directoryName + "/Errors/modules_errors");
99  entries.push_back(directoryName + "/Warnings/categories_warnings");
100  entries.push_back(directoryName + "/Errors/categories_errors");
101 
102  int mel = 0;
103 
104  for (auto ent = entries.begin(); ent != entries.end(); ++ent) {
105  mel++;
106  //RESET VECTORS
107  binContent.clear();
108  binLabel.clear();
109 
110  // RETURN ME
111 
112  MonitorElement *me = theDbe->get(*ent);
113  // GET TH1F
114  if (theDbe->get(*ent)) {
115  if (TH1 *rootHisto = me->getTH1()) {
116  int nonzeros = 0;
117  int Nbins = me->getNbinsX();
118 
119  // LOOP OVER TH1F
120  for (int bin = 1; bin <= Nbins; ++bin) {
121  if (rootHisto->GetBinContent(bin) > 0) {
122  nonzeros++;
123  binContent.push_back(rootHisto->GetBinContent(bin));
124  binLabel.emplace_back(rootHisto->GetXaxis()->GetBinLabel(bin));
125  }
126  }
127 
128  switch (mel) {
129  case 1:
130  theDbe->setCurrentFolder(directoryName + "/Warnings");
131  modulesWarningsFound = theDbe->get(directoryName + "/Warnings/modulesWarningsFound");
132  if (nonzeros > 0) {
134  "modulesWarningsFound", "Warnings per module", binContent.size(), 0, binContent.size());
135  } else {
136  modulesWarningsFound = theDbe->book1D("modulesWarningsFound", "Warnings per module", 1, 0, 1);
137  modulesWarningsFound->setBinLabel(1, "Module name");
138  }
139  for (int i = 0; i < nonzeros; ++i) {
140  if (modulesWarningsFound != nullptr) {
141  //gPad->SetBottomMargin(2);
142  //cout << binContent[i] <<" "<<binLabel[i] << endl;
145  }
146  }
147  if (nonzeros > 4)
148  modulesWarningsFound->getTH1()->GetXaxis()->LabelsOption("v");
149  break;
150  case 2:
151  theDbe->setCurrentFolder(directoryName + "/Errors");
152  modulesErrorsFound = theDbe->get(directoryName + "/Errors/modulesErrorsFound");
153  if (nonzeros > 0) {
155  theDbe->book1D("modulesErrorsFound", "Errors per module", binContent.size(), 0, binContent.size());
156  } else {
157  modulesErrorsFound = theDbe->book1D("modulesErrorsFound", "Errors per module", 1, 0, 1);
158  modulesErrorsFound->setBinLabel(1, "Module name");
159  }
160  for (int i = 0; i < nonzeros; ++i) {
161  if (modulesErrorsFound != nullptr) {
162  //gPad->SetBottomMargin(2);
165  }
166  }
167  if (nonzeros > 4)
168  modulesErrorsFound->getTH1()->GetXaxis()->LabelsOption("v");
169  break;
170  case 3:
171  theDbe->setCurrentFolder(directoryName + "/Warnings");
172  categoriesWarningsFound = theDbe->get(directoryName + "/Warnings/categoriesWarningsFound");
173  if (nonzeros > 0) {
175  "categoriesWarningsFound", "Warnings per category", binContent.size(), 0, binContent.size());
176  } else {
177  categoriesWarningsFound = theDbe->book1D("categoriesWarningsFound", "Warnings per category", 1, 0, 1);
178  categoriesWarningsFound->setBinLabel(1, "Category name");
179  }
180  for (int i = 0; i < nonzeros; ++i) {
181  if (categoriesWarningsFound != nullptr) {
182  //gPad->SetBottomMargin(2);
183  //cout << binContent[i] <<" " <<binLabel[i] << endl;
186  }
187  }
188  if (nonzeros > 4)
189  categoriesWarningsFound->getTH1()->GetXaxis()->LabelsOption("v");
190  break;
191  case 4:
192  theDbe->setCurrentFolder(directoryName + "/Errors");
193  categoriesErrorsFound = theDbe->get(directoryName + "/Errors/categoriesErrorsFound");
194  if (nonzeros > 0) {
196  "categoriesErrorsFound", "Errors per category", binContent.size(), 0, binContent.size());
197  } else {
198  categoriesErrorsFound = theDbe->book1D("categoriesErrorsFound", "Errors per category", 1, 0, 1);
199  categoriesErrorsFound->setBinLabel(1, "Category name");
200  }
201  for (int i = 0; i < nonzeros; ++i) {
202  if (categoriesErrorsFound != nullptr) {
203  //gPad->SetBottomMargin(2);
206  }
207  }
208  if (nonzeros > 4)
209  categoriesErrorsFound->getTH1()->GetXaxis()->LabelsOption("v");
210  break;
211  }
212  }
213  }
214  }
215 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
MonitorElement * modulesErrorsFound
std::vector< std::string > binLabel
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
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual TH1 * getTH1() const
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

Member Data Documentation

◆ binContent

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

Definition at line 41 of file DQMMessageLoggerClient.cc.

◆ binLabel

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

Definition at line 40 of file DQMMessageLoggerClient.cc.

◆ categoriesErrorsFound

MonitorElement* DQMMessageLoggerClient::categoriesErrorsFound
private

Definition at line 48 of file DQMMessageLoggerClient.cc.

◆ categoriesWarningsFound

MonitorElement* DQMMessageLoggerClient::categoriesWarningsFound
private

Definition at line 49 of file DQMMessageLoggerClient.cc.

◆ directoryName

std::string DQMMessageLoggerClient::directoryName
private

Definition at line 38 of file DQMMessageLoggerClient.cc.

◆ modulesErrorsFound

MonitorElement* DQMMessageLoggerClient::modulesErrorsFound
private

Definition at line 46 of file DQMMessageLoggerClient.cc.

◆ modulesWarningsFound

MonitorElement* DQMMessageLoggerClient::modulesWarningsFound
private

Definition at line 47 of file DQMMessageLoggerClient.cc.

◆ nBinsErrors

int DQMMessageLoggerClient::nBinsErrors
private

Definition at line 43 of file DQMMessageLoggerClient.cc.

◆ nBinsWarnings

int DQMMessageLoggerClient::nBinsWarnings
private

Definition at line 44 of file DQMMessageLoggerClient.cc.

◆ parameters

edm::ParameterSet DQMMessageLoggerClient::parameters
private

Definition at line 37 of file DQMMessageLoggerClient.cc.

◆ theDbe

DQMStore* DQMMessageLoggerClient::theDbe
private

Definition at line 36 of file DQMMessageLoggerClient.cc.