CMS 3D CMS Logo

SiStripPopConHistoryDQMBase.cc
Go to the documentation of this file.
2 
5  , SiStripDQMHistoryHelper(iConfig)
6  , MEDir_{iConfig.getUntrackedParameter<std::string>("ME_DIR", "DQMData")}
7  , histoList_{iConfig.getParameter<VParameters>("histoList")}
8 {
9  edm::LogInfo("SiStripHistoryDQMService") << "[SiStripHistoryDQMService::SiStripHistoryDQMService]";
10 }
11 
13 {
14  edm::LogInfo("SiStripHistoryDQMService") << "[SiStripHistoryDQMService::~SiStripHistoryDQMService]";
15 }
16 
18 {
19  if ( otherMetaData.empty() )
20  return true;
21 
22  uint32_t previousRun=atoi(otherMetaData.substr(otherMetaData.find("Run ")+4).c_str());
23 
24  edm::LogInfo("DQMHistoryServiceBase") << "[DQMHistoryServiceBase::checkForCompatibility] extracted string " << previousRun ;
25  return previousRun < getRunNumber();
26 }
27 
29 {
30  m_obj = HDQMSummary();
32 
33  // DISCOVER SET OF HISTOGRAMS & QUANTITIES TO BE UPLOADED
34  std::vector<std::string> userDBContent;
35  for ( const auto& histoParams : histoList_ ) {
36  const std::string keyName{histoParams.getUntrackedParameter<std::string>("keyName")};
37  for ( const auto& quant : histoParams.getUntrackedParameter<std::vector<std::string> >("quantitiesToExtract") ) {
38  if ( quant == "landau" )
39  setDBLabelsForLandau(keyName, userDBContent);
40  else if ( quant == "gauss" )
41  setDBLabelsForGauss(keyName, userDBContent);
42  else if ( quant == "stat" )
43  setDBLabelsForStat(keyName, userDBContent);
44  else
45  setDBLabelsForUser(keyName, userDBContent, quant);
46  }
47  }
48  m_obj.setUserDBContent(userDBContent);
49 
50  std::stringstream ss;
51  ss << "[DQMHistoryServiceBase::scanTreeAndFillSummary] QUANTITIES TO BE INSERTED IN DB :" << std::endl;
52  for ( const std::string& iCont : m_obj.getUserDBContent() ) {
53  ss << iCont<< std::endl;
54  }
55  edm::LogInfo("HDQMSummary") << ss.str();
56 
57  // OPEN DQM FILE
58  const std::vector<MonitorElement*> MEs = getter.getAllContents(MEDir_);
59 
60  // FILL SUMMARY
61  edm::LogInfo("HDQMSummary") << "\nSTARTING TO FILL OBJECT ";
62  for ( const auto& histoParams : histoList_ ) {
63  const std::string keyName{histoParams.getUntrackedParameter<std::string>("keyName")};
64  scanTreeAndFillSummary(MEs, &m_obj, keyName, histoParams.getUntrackedParameter<std::vector<std::string> >("quantitiesToExtract"));
65  }
66 }
67 
69 {
70  return new HDQMSummary(m_obj);
71 }
T getUntrackedParameter(std::string const &, T const &) const
void setRunNr(int inputRunNr)
Definition: HDQMSummary.h:112
void dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) override
bool checkForCompatibility(const std::string &otherMetaData)
virtual bool setDBLabelsForUser(const std::string &keyName, std::vector< std::string > &userDBContent, const std::string &quantity) const
std::vector< edm::ParameterSet > VParameters
virtual bool setDBLabelsForStat(const std::string &keyName, std::vector< std::string > &userDBContent) const
void setUserDBContent(const std::vector< std::string > &userDBContent)
Definition: HDQMSummary.h:111
virtual bool setDBLabelsForLandau(const std::string &keyName, std::vector< std::string > &userDBContent) const
virtual void scanTreeAndFillSummary(const std::vector< MonitorElement * > &MEs, HDQMSummary *summary, const std::string &histoName, const std::vector< std::string > &Quantities) const
quant
Definition: HTMonitor.h:44
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0)
Definition: DQMStore.cc:299
HDQMSummary * getObj() const override
virtual bool setDBLabelsForGauss(const std::string &keyName, std::vector< std::string > &userDBContent) const
std::vector< std::string > getUserDBContent() const
Definition: HDQMSummary.h:116
SiStripPopConHistoryDQMBase(const edm::ParameterSet &pset)