CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/DQMServices/Diagnostic/plugins/GenericHistoryDQMService.cc

Go to the documentation of this file.
00001 #include "DQMServices/Diagnostic/plugins/GenericHistoryDQMService.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include "DQMServices/Core/interface/MonitorElement.h"
00004 
00005 
00006 GenericHistoryDQMService::GenericHistoryDQMService(const edm::ParameterSet& iConfig,const edm::ActivityRegistry& aReg)
00007 : DQMHistoryServiceBase::DQMHistoryServiceBase(iConfig, aReg), iConfig_(iConfig)
00008 {
00009   edm::LogInfo("GenericHistoryDQMService") <<  "[GenericHistoryDQMService::GenericHistoryDQMService]";
00010 }
00011 
00012 GenericHistoryDQMService::~GenericHistoryDQMService()
00013 {
00014   edm::LogInfo("GenericHistoryDQMService") <<  "[GenericHistoryDQMService::~GenericHistoryDQMService]";
00015 }
00016 
00017 uint32_t GenericHistoryDQMService::returnDetComponent(const MonitorElement* ME)
00018 {
00019   LogTrace("GenericHistoryDQMService") <<  "[GenericHistoryDQMService::returnDetComponent] returning value defined in the configuration Pset \"DetectorId\"";
00020   return iConfig_.getParameter<uint32_t>("DetectorId");
00021 }
00022 
00024 bool GenericHistoryDQMService::setDBLabelsForUser  (std::string& keyName, std::vector<std::string>& userDBContent, std::string& quantity )
00025 {
00026   if(quantity=="userExample_XMax"){
00027     userDBContent.push_back(keyName+std::string("@")+std::string("userExample_XMax"));
00028   }
00029   else if(quantity=="userExample_mean"){
00030       userDBContent.push_back(keyName+std::string("@")+std::string("userExample_mean"));
00031   }
00032   else{
00033     edm::LogError("DQMHistoryServiceBase") 
00034       << "Quantity " << quantity
00035       << " cannot be handled\nAllowed quantities are" 
00036       << "\n  'stat'   that includes: entries, mean, rms"
00037       << "\n  'landau' that includes: landauPeak, landauPeakErr, landauSFWHM, landauChi2NDF"
00038       << "\n  'gauss'  that includes: gaussMean, gaussSigma, gaussChi2NDF"
00039       << "\n or a specific user quantity that should be implemented in the user functions GenericHistoryDQMService::setDBLabelsForUser"
00040       << std::endl;
00041     return false;
00042   }
00043   return true;
00044 }
00045 
00046 bool GenericHistoryDQMService::setDBValuesForUser(std::vector<MonitorElement*>::const_iterator iterMes, HDQMSummary::InputVector& values, std::string& quantity )
00047 {
00048   if(quantity=="userExample_XMax"){
00049     values.push_back( (*iterMes)->getTH1F()->GetXaxis()->GetBinCenter((*iterMes)->getTH1F()->GetMaximumBin()));
00050   }
00051   else if(quantity=="userExample_mean"){
00052     values.push_back( (*iterMes)->getMean() );
00053   }
00054   else{
00055     return false;
00056   }
00057   return true;
00058 }
00059 
00060 
00061