Common CSC DQM Module that uses CSCDQM Framework. More...
#include <CSCMonitorModule.h>
Public Member Functions | |
cscdqm::MonitorObject * | bookMonitorObject (const cscdqm::HistoBookRequest &p_req) |
Book Monitor Object on Request. | |
CSCMonitorModule (const edm::ParameterSet &ps) | |
Constructor. | |
bool | getCSCDetId (const unsigned int crateId, const unsigned int dmbId, CSCDetId &detId) const |
virtual | ~CSCMonitorModule () |
Destructor. | |
Protected Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &c) |
Analyze Event. | |
void | beginJob () |
void | beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) |
void | beginRun (const edm::Run &r, const edm::EventSetup &c) |
Begin the run. | |
void | endJob () |
void | endRun (const edm::Run &r, const edm::EventSetup &c) |
void | setup () |
Private Attributes | |
cscdqm::Configuration | config |
DQMStore * | dbe |
cscdqm::Dispatcher * | dispatcher |
edm::InputTag | inputTag |
const CSCCrateMap * | pcrate |
bool | prebookEffParams |
bool | processDcsScalers |
Common CSC DQM Module that uses CSCDQM Framework.
Definition at line 69 of file CSCMonitorModule.h.
CSCMonitorModule::CSCMonitorModule | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Global stuff
ps | Parameters. |
Definition at line 25 of file CSCMonitorModule.cc.
References config, dbe, dispatcher, edm::ParameterSet::exists(), edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cscdqm::Dispatcher::init(), INPUT_TAG_LABEL, inputTag, cscdqm::Dispatcher::maskHWElements(), cmsCodeRules::cppFunctionSkipper::operator, prebookEffParams, and processDcsScalers.
{ edm::FileInPath fp; inputTag = ps.getUntrackedParameter<edm::InputTag>("InputObjects", (edm::InputTag)INPUT_TAG_LABEL); prebookEffParams = ps.getUntrackedParameter<bool>("PREBOOK_EFF_PARAMS", false); processDcsScalers = ps.getUntrackedParameter<bool>("PROCESS_DCS_SCALERS", true); edm::ParameterSet params = ps.getUntrackedParameter<edm::ParameterSet>("EventProcessor"); config.load(params); fp = ps.getParameter<edm::FileInPath>("BOOKING_XML_FILE"); config.setBOOKING_XML_FILE(fp.fullPath()); dbe = edm::Service<DQMStore>().operator->(); dispatcher = new cscdqm::Dispatcher(&config, const_cast<CSCMonitorModule*>(this)); dispatcher->init(); if (ps.exists("MASKEDHW")) { std::vector<std::string> maskedHW = ps.getUntrackedParameter<std::vector<std::string> >("MASKEDHW"); dispatcher->maskHWElements(maskedHW); } }
CSCMonitorModule::~CSCMonitorModule | ( | ) | [virtual] |
Destructor.
Definition at line 53 of file CSCMonitorModule.cc.
References dispatcher.
{ if (dispatcher) delete dispatcher; }
void CSCMonitorModule::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Analyze Event.
Implements edm::EDAnalyzer.
Definition at line 75 of file CSCMonitorModule.cc.
References cscdqm::HWStandbyType::applyMeM(), cscdqm::HWStandbyType::applyMeP(), DcsStatus::CSCm, DcsStatus::CSCp, dispatcher, edm::EventSetup::get(), edm::Event::getByLabel(), inputTag, pcrate, cscdqm::HWStandbyType::process, processDcsScalers, and edm::ESHandle< T >::product().
{ // Get crate mapping from database edm::ESHandle<CSCCrateMap> hcrate; c.get<CSCCrateMapRcd>().get(hcrate); pcrate = hcrate.product(); cscdqm::HWStandbyType standby; // Get DCS status scalers if (processDcsScalers) { edm::Handle<DcsStatusCollection> dcsStatus; if (e.getByLabel("scalersRawToDigi", dcsStatus)) { DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); for (; dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) { standby.applyMeP(dcsStatusItr->ready(DcsStatus::CSCp)); standby.applyMeM(dcsStatusItr->ready(DcsStatus::CSCm)); } } standby.process = true; } dispatcher->processEvent(e, inputTag, standby); }
void CSCMonitorModule::beginJob | ( | void | ) | [inline, protected, virtual] |
EDAnalyzer Implementation
Reimplemented from edm::EDAnalyzer.
Definition at line 115 of file CSCMonitorModule.h.
{ }
void CSCMonitorModule::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | context | ||
) | [inline, protected, virtual] |
void CSCMonitorModule::beginRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Begin the run.
Reimplemented from edm::EDAnalyzer.
Definition at line 62 of file CSCMonitorModule.cc.
References dispatcher, prebookEffParams, and cscdqm::Dispatcher::updateFractionAndEfficiencyHistos().
{ if (prebookEffParams) { dispatcher->updateFractionAndEfficiencyHistos(); } }
cscdqm::MonitorObject * CSCMonitorModule::bookMonitorObject | ( | const cscdqm::HistoBookRequest & | req | ) | [virtual] |
Book Monitor Object on Request.
req | Request. |
Implements cscdqm::MonitorObjectProvider.
Definition at line 106 of file CSCMonitorModule.cc.
References DQMStore::book1D(), DQMStore::book2D(), DQMStore::book3D(), DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), DQMStore::bookString(), dbe, cscdqm::HistoBookRequest::default_float, cscdqm::HistoBookRequest::default_int, cscdqm::HistoBookRequest::default_string, DIR_CRTINFO, DIR_DAQINFO, DIR_DCSINFO, DIR_EVENTINFO, cscdqm::MonitorObject::Fill(), cscdqm::FLOAT, cscdqm::HistoBookRequest::folder, cscdqm::H1D, cscdqm::H2D, cscdqm::H3D, cscdqm::HistoBookRequest::hdef, cscdqm::HistoBookRequest::highX, cscdqm::HistoBookRequest::highY, cscdqm::HistoBookRequest::highZ, cscdqm::HistoBookRequest::htype, cscdqm::INT, relativeConstraints::keys, cscdqm::HistoBookRequest::lowX, cscdqm::HistoBookRequest::lowY, cscdqm::HistoBookRequest::lowZ, mergeVDriftHistosByStation::name, cscdqm::HistoBookRequest::nchX, cscdqm::HistoBookRequest::nchY, cscdqm::HistoBookRequest::nchZ, NULL, cscdqm::HistoBookRequest::option, path(), cscdqm::PROFILE, cscdqm::PROFILE2D, cscdqm::Utility::regexMatch(), DQMStore::setCurrentFolder(), cscdqm::STRING, and cscdqm::HistoBookRequest::title.
{ cscdqm::MonitorObject *me = NULL; std::string name = req.hdef->getName(); std::string path = req.folder; if (req.hdef->getPath().size() > 0) { path = path + req.hdef->getPath() + "/"; } //std::cout << "Moving to " << path << " for name = " << name << " with fullPath = " << req.hdef->getFullPath() << "\n"; dbe->setCurrentFolder(path); if (req.htype == cscdqm::INT) { me = new CSCMonitorObject(dbe->bookInt(name)); me->Fill(req.default_int); } else if (req.htype == cscdqm::FLOAT) { if (req.hdef->getId() == cscdqm::h::PAR_REPORT_SUMMARY || req.hdef->getId() == cscdqm::h::PAR_CRT_SUMMARY || req.hdef->getId() == cscdqm::h::PAR_DAQ_SUMMARY || req.hdef->getId() == cscdqm::h::PAR_DCS_SUMMARY) { dbe->setCurrentFolder(DIR_EVENTINFO); } else if (cscdqm::Utility::regexMatch("^PAR_DCS_", cscdqm::h::keys[req.hdef->getId()])) { dbe->setCurrentFolder(DIR_DCSINFO); } else if (cscdqm::Utility::regexMatch("^PAR_DAQ_", cscdqm::h::keys[req.hdef->getId()])) { dbe->setCurrentFolder(DIR_DAQINFO); } else if (cscdqm::Utility::regexMatch("^PAR_CRT_", cscdqm::h::keys[req.hdef->getId()])) { dbe->setCurrentFolder(DIR_CRTINFO); } me = new CSCMonitorObject(dbe->bookFloat(name)); me->Fill(req.default_float); } else if (req.htype == cscdqm::STRING) { me = new CSCMonitorObject(dbe->bookString(name, req.default_string)); } else if (req.htype == cscdqm::H1D) { me = new CSCMonitorObject(dbe->book1D(name, req.title, req.nchX, req.lowX, req.highX)); } else if (req.htype == cscdqm::H2D) { if (req.hdef->getId() == cscdqm::h::EMU_CSC_STATS_SUMMARY) { dbe->setCurrentFolder(DIR_EVENTINFO); name = "reportSummaryMap"; } me = new CSCMonitorObject(dbe->book2D(name, req.title, req.nchX, req.lowX, req.highX, req.nchY, req.lowY, req.highY)); } else if (req.htype == cscdqm::H3D) { me = new CSCMonitorObject(dbe->book3D(name, req.title, req.nchX, req.lowX, req.highX, req.nchY, req.lowY, req.highY, req.nchZ, req.lowZ, req.highZ)); } else if (req.htype == cscdqm::PROFILE) { me = new CSCMonitorObject(dbe->bookProfile(name, req.title, req.nchX, req.lowX, req.highX, req.nchY, req.lowY, req.highY, req.option.c_str())); } else if (req.htype == cscdqm::PROFILE2D) { me = new CSCMonitorObject(dbe->bookProfile2D(name, req.title, req.nchX, req.lowX, req.highX, req.nchY, req.lowY, req.highY, req.nchZ, req.lowZ, req.highZ, req.option.c_str())); } return me; }
void CSCMonitorModule::endJob | ( | void | ) | [inline, protected, virtual] |
void CSCMonitorModule::endRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [inline, protected, virtual] |
bool CSCMonitorModule::getCSCDetId | ( | const unsigned int | crateId, |
const unsigned int | dmbId, | ||
CSCDetId & | detId | ||
) | const [inline, virtual] |
MonitorObjectProvider Implementation
Implements cscdqm::MonitorObjectProvider.
Definition at line 98 of file CSCMonitorModule.h.
References CSCCrateMap::detId(), MAX_CRATE_ID, MAX_DMB_SLOT, pcrate, and DetId::rawId().
{ // Check parameter values if (crateId < MIN_CRATE_ID || crateId > MAX_CRATE_ID || dmbId < MIN_DMB_SLOT || dmbId > MAX_DMB_SLOT) { return false; } detId = pcrate->detId(crateId, dmbId, 0, 0); return (detId.rawId() != 0); }
void CSCMonitorModule::setup | ( | ) | [inline, protected] |
Definition at line 117 of file CSCMonitorModule.h.
{ }
Definition at line 82 of file CSCMonitorModule.h.
Referenced by CSCMonitorModule().
DQMStore* CSCMonitorModule::dbe [private] |
Definition at line 84 of file CSCMonitorModule.h.
Referenced by bookMonitorObject(), and CSCMonitorModule().
cscdqm::Dispatcher* CSCMonitorModule::dispatcher [private] |
Definition at line 83 of file CSCMonitorModule.h.
Referenced by analyze(), beginRun(), CSCMonitorModule(), and ~CSCMonitorModule().
edm::InputTag CSCMonitorModule::inputTag [private] |
Definition at line 85 of file CSCMonitorModule.h.
Referenced by analyze(), and CSCMonitorModule().
const CSCCrateMap* CSCMonitorModule::pcrate [private] |
Pointer to crate mapping from database
Definition at line 90 of file CSCMonitorModule.h.
Referenced by analyze(), and getCSCDetId().
bool CSCMonitorModule::prebookEffParams [private] |
Definition at line 86 of file CSCMonitorModule.h.
Referenced by beginRun(), and CSCMonitorModule().
bool CSCMonitorModule::processDcsScalers [private] |
Definition at line 87 of file CSCMonitorModule.h.
Referenced by analyze(), and CSCMonitorModule().