CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

CSCMonitorModule Class Reference

Common CSC DQM Module that uses CSCDQM Framework. More...

#include <CSCMonitorModule.h>

Inheritance diagram for CSCMonitorModule:
edm::EDAnalyzer cscdqm::MonitorObjectProvider

List of all members.

Public Member Functions

cscdqm::MonitorObjectbookMonitorObject (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
DQMStoredbe
cscdqm::Dispatcherdispatcher
edm::InputTag inputTag
const CSCCrateMappcrate
bool prebookEffParams
bool processDcsScalers

Detailed Description

Common CSC DQM Module that uses CSCDQM Framework.

Definition at line 69 of file CSCMonitorModule.h.


Constructor & Destructor Documentation

CSCMonitorModule::CSCMonitorModule ( const edm::ParameterSet ps)

Constructor.

Global stuff

Parameters:
psParameters.

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(), 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;
}

Member Function Documentation

void CSCMonitorModule::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Analyze Event.

Parameters:
eEvent to analyze
cEvent Setup

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]

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file CSCMonitorModule.h.

{ }
void CSCMonitorModule::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

Begin the run.

Parameters:
rRun object
cEvent setup

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file CSCMonitorModule.cc.

References dispatcher, prebookEffParams, and cscdqm::Dispatcher::updateFractionAndEfficiencyHistos().

cscdqm::MonitorObject * CSCMonitorModule::bookMonitorObject ( const cscdqm::HistoBookRequest req) [virtual]

Book Monitor Object on Request.

Parameters:
reqRequest.
Returns:
MonitorObject created.

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, scaleCards::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]

Reimplemented from edm::EDAnalyzer.

Definition at line 121 of file CSCMonitorModule.h.

{ }
void CSCMonitorModule::endRun ( const edm::Run r,
const edm::EventSetup c 
) [inline, protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 120 of file CSCMonitorModule.h.

{ }
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.

{ }

Member Data Documentation

Definition at line 82 of file CSCMonitorModule.h.

Referenced by CSCMonitorModule().

Definition at line 84 of file CSCMonitorModule.h.

Referenced by bookMonitorObject(), and CSCMonitorModule().

Definition at line 83 of file CSCMonitorModule.h.

Referenced by analyze(), beginRun(), CSCMonitorModule(), and ~CSCMonitorModule().

Definition at line 85 of file CSCMonitorModule.h.

Referenced by analyze(), and CSCMonitorModule().

Pointer to crate mapping from database

Definition at line 90 of file CSCMonitorModule.h.

Referenced by analyze(), and getCSCDetId().

Definition at line 86 of file CSCMonitorModule.h.

Referenced by beginRun(), and CSCMonitorModule().

Definition at line 87 of file CSCMonitorModule.h.

Referenced by analyze(), and CSCMonitorModule().