CMS 3D CMS Logo

GenericHistoryDQMService.cc
Go to the documentation of this file.
4 
5 
7 : DQMHistoryServiceBase::DQMHistoryServiceBase(iConfig, aReg), iConfig_(iConfig)
8 {
9  edm::LogInfo("GenericHistoryDQMService") << "[GenericHistoryDQMService::GenericHistoryDQMService]";
10 }
11 
13 {
14  edm::LogInfo("GenericHistoryDQMService") << "[GenericHistoryDQMService::~GenericHistoryDQMService]";
15 }
16 
18 {
19  LogTrace("GenericHistoryDQMService") << "[GenericHistoryDQMService::returnDetComponent] returning value defined in the configuration Pset \"DetectorId\"";
20  return iConfig_.getParameter<uint32_t>("DetectorId");
21 }
22 
24 bool GenericHistoryDQMService::setDBLabelsForUser (std::string& keyName, std::vector<std::string>& userDBContent, std::string& quantity )
25 {
26  if(quantity=="userExample_XMax"){
27  userDBContent.push_back(keyName+std::string("@")+std::string("userExample_XMax"));
28  }
29  else if(quantity=="userExample_mean"){
30  userDBContent.push_back(keyName+std::string("@")+std::string("userExample_mean"));
31  }
32  else{
33  edm::LogError("DQMHistoryServiceBase")
34  << "Quantity " << quantity
35  << " cannot be handled\nAllowed quantities are"
36  << "\n 'stat' that includes: entries, mean, rms"
37  << "\n 'landau' that includes: landauPeak, landauPeakErr, landauSFWHM, landauChi2NDF"
38  << "\n 'gauss' that includes: gaussMean, gaussSigma, gaussChi2NDF"
39  << "\n or a specific user quantity that should be implemented in the user functions GenericHistoryDQMService::setDBLabelsForUser"
40  << std::endl;
41  return false;
42  }
43  return true;
44 }
45 
46 bool GenericHistoryDQMService::setDBValuesForUser(std::vector<MonitorElement*>::const_iterator iterMes, HDQMSummary::InputVector& values, std::string& quantity )
47 {
48  if(quantity=="userExample_XMax"){
49  values.push_back( (*iterMes)->getTH1F()->GetXaxis()->GetBinCenter((*iterMes)->getTH1F()->GetMaximumBin()));
50  }
51  else if(quantity=="userExample_mean"){
52  values.push_back( (*iterMes)->getMean() );
53  }
54  else{
55  return false;
56  }
57  return true;
58 }
59 
60 
61 
T getParameter(std::string const &) const
bool setDBValuesForUser(std::vector< MonitorElement * >::const_iterator iterMes, HDQMSummary::InputVector &values, std::string &quantity)
GenericHistoryDQMService(const edm::ParameterSet &, const edm::ActivityRegistry &)
Definition: ME.h:11
std::vector< float > InputVector
Definition: HDQMSummary.h:62
#define LogTrace(id)
bool setDBLabelsForUser(std::string &keyName, std::vector< std::string > &userDBContent, std::string &quantity)
Example on how to define an user function for the statistic extraction.
uint32_t returnDetComponent(const MonitorElement *ME)