CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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 edm::EDConsumerBase

Public Member Functions

cscdqm::MonitorObjectbookMonitorObject (const cscdqm::HistoBookRequest &p_req)
 Book Monitor Object on Request. More...
 
 CSCMonitorModule (const edm::ParameterSet &ps)
 Constructor. More...
 
bool getCSCDetId (const unsigned int crateId, const unsigned int dmbId, CSCDetId &detId) const
 
virtual ~CSCMonitorModule ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze Event. More...
 
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. More...
 
void endJob ()
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
void setup ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

cscdqm::Configuration config
 
DQMStoredbe
 
cscdqm::Dispatcherdispatcher
 
edm::InputTag inputTag
 
const CSCCrateMappcrate
 
bool prebookEffParams
 
bool processDcsScalers
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

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.

25  {
26 
27  edm::FileInPath fp;
28 
30  prebookEffParams = ps.getUntrackedParameter<bool>("PREBOOK_EFF_PARAMS", false);
31  processDcsScalers = ps.getUntrackedParameter<bool>("PROCESS_DCS_SCALERS", true);
32  edm::ParameterSet params = ps.getUntrackedParameter<edm::ParameterSet>("EventProcessor");
33  config.load(params);
34 
35  fp = ps.getParameter<edm::FileInPath>("BOOKING_XML_FILE");
36  config.setBOOKING_XML_FILE(fp.fullPath());
37 
39 
40  dispatcher = new cscdqm::Dispatcher(&config, const_cast<CSCMonitorModule*>(this));
41  dispatcher->init();
42 
43  if (ps.exists("MASKEDHW")) {
44  std::vector<std::string> maskedHW = ps.getUntrackedParameter<std::vector<std::string> >("MASKEDHW");
45  dispatcher->maskHWElements(maskedHW);
46  }
47 
48 }
cscdqm::Configuration config
void init()
Initialize Dispatcher: book histograms, init processor, etc.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
cscdqm::Dispatcher * dispatcher
CSCDQM Framework frontend and Histogram Cache controller.
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
static const char INPUT_TAG_LABEL[]
Global stuff.
edm::InputTag inputTag
CSCMonitorModule::~CSCMonitorModule ( )
virtual

Destructor.

Definition at line 53 of file CSCMonitorModule.cc.

References dispatcher.

53  {
54  if (dispatcher) delete dispatcher;
55 }
cscdqm::Dispatcher * dispatcher

Member Function Documentation

void CSCMonitorModule::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

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< class >::product().

75  {
76 
77  // Get crate mapping from database
79  c.get<CSCCrateMapRcd>().get(hcrate);
80  pcrate = hcrate.product();
81 
82  cscdqm::HWStandbyType standby;
83 
84  // Get DCS status scalers
85  if (processDcsScalers) {
87  if (e.getByLabel("scalersRawToDigi", dcsStatus)) {
88  DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
89  for (; dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) {
90  standby.applyMeP(dcsStatusItr->ready(DcsStatus::CSCp));
91  standby.applyMeM(dcsStatusItr->ready(DcsStatus::CSCm));
92  }
93  }
94  standby.process = true;
95  }
96 
97  dispatcher->processEvent(e, inputTag, standby);
98 
99 }
cscdqm::Dispatcher * dispatcher
const CSCCrateMap * pcrate
edm::InputTag inputTag
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void CSCMonitorModule::beginJob ( void  )
inlineprotectedvirtual

EDAnalyzer Implementation

Reimplemented from edm::EDAnalyzer.

Definition at line 115 of file CSCMonitorModule.h.

115 { }
void CSCMonitorModule::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
inlineprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file CSCMonitorModule.h.

119 { }
void CSCMonitorModule::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

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().

62  {
63 
64  if (prebookEffParams) {
66  }
67 
68 }
void updateFractionAndEfficiencyHistos()
On demand update fraction and efficiency MOs.
cscdqm::Dispatcher * dispatcher
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::HistoDef::getId(), cscdqm::HistoDef::getName(), cscdqm::HistoDef::getPath(), cscdqm::H1D, cscdqm::H2D, cscdqm::H3D, cscdqm::HistoBookRequest::hdef, cscdqm::HistoBookRequest::highX, cscdqm::HistoBookRequest::highY, cscdqm::HistoBookRequest::highZ, cscdqm::HistoBookRequest::htype, cscdqm::INT, cscdqm::h::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, getHLTPrescaleColumns::path, cscdqm::PROFILE, cscdqm::PROFILE2D, cscdqm::Utility::regexMatch(), DQMStore::setCurrentFolder(), cscdqm::STRING, AlCaHLTBitMon_QueryRunRegistry::string, and cscdqm::HistoBookRequest::title.

106  {
107 
109  std::string name = req.hdef->getName();
110 
111  std::string path = req.folder;
112  if (req.hdef->getPath().size() > 0) {
113  path = path + req.hdef->getPath() + "/";
114  }
115 
116  //std::cout << "Moving to " << path << " for name = " << name << " with fullPath = " << req.hdef->getFullPath() << "\n";
117 
118  dbe->setCurrentFolder(path);
119 
120  if (req.htype == cscdqm::INT) {
121  me = new CSCMonitorObject(dbe->bookInt(name));
122  me->Fill(req.default_int);
123  } else
124  if (req.htype == cscdqm::FLOAT) {
125  if (req.hdef->getId() == cscdqm::h::PAR_REPORT_SUMMARY ||
126  req.hdef->getId() == cscdqm::h::PAR_CRT_SUMMARY ||
127  req.hdef->getId() == cscdqm::h::PAR_DAQ_SUMMARY ||
128  req.hdef->getId() == cscdqm::h::PAR_DCS_SUMMARY) {
130  } else if (cscdqm::Utility::regexMatch("^PAR_DCS_", cscdqm::h::keys[req.hdef->getId()])) {
132  } else if (cscdqm::Utility::regexMatch("^PAR_DAQ_", cscdqm::h::keys[req.hdef->getId()])) {
134  } else if (cscdqm::Utility::regexMatch("^PAR_CRT_", cscdqm::h::keys[req.hdef->getId()])) {
136  }
137  me = new CSCMonitorObject(dbe->bookFloat(name));
138  me->Fill(req.default_float);
139  } else
140  if (req.htype == cscdqm::STRING) {
141  me = new CSCMonitorObject(dbe->bookString(name, req.default_string));
142  } else
143  if (req.htype == cscdqm::H1D) {
144  me = new CSCMonitorObject(dbe->book1D(name, req.title, req.nchX, req.lowX, req.highX));
145  } else
146  if (req.htype == cscdqm::H2D) {
147  if (req.hdef->getId() == cscdqm::h::EMU_CSC_STATS_SUMMARY) {
149  name = "reportSummaryMap";
150  }
151  me = new CSCMonitorObject(dbe->book2D(name, req.title, req.nchX, req.lowX, req.highX, req.nchY, req.lowY, req.highY));
152  } else
153  if (req.htype == cscdqm::H3D) {
154  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));
155  } else
156  if (req.htype == cscdqm::PROFILE) {
157  me = new CSCMonitorObject(dbe->bookProfile(name, req.title, req.nchX, req.lowX, req.highX, req.nchY, req.lowY, req.highY, req.option.c_str()));
158  } else
159  if (req.htype == cscdqm::PROFILE2D) {
160  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()));
161  }
162 
163  return me;
164 
165 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
static const char DIR_DAQINFO[]
cscdqm::MonitorObject implementation used in CSCMonitorModuleCmn
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:984
virtual void Fill(float x)=0
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
#define NULL
Definition: scimark2.h:8
static bool regexMatch(const std::string &expression, const std::string &message)
Match RegExp expression string against string message and return result.
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
const HistoId getId() const
Get Histogram ID.
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:688
static const char DIR_DCSINFO[]
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1036
static const char DIR_EVENTINFO[]
virtual const std::string getPath() const
Get path part of the histogram (used only for DDUs and CSCs)
static const char DIR_CRTINFO[]
virtual const std::string getName() const
Get processed histogram name. It can include additional parameter in formated name. This Name is being constructed from raw name and additional parameter.
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:629
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:850
static const HistoName keys[]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1180
void CSCMonitorModule::endJob ( void  )
inlineprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 121 of file CSCMonitorModule.h.

121 { }
void CSCMonitorModule::endRun ( const edm::Run r,
const edm::EventSetup c 
)
inlineprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 120 of file CSCMonitorModule.h.

120 { }
bool CSCMonitorModule::getCSCDetId ( const unsigned int  crateId,
const unsigned int  dmbId,
CSCDetId detId 
) const
inlinevirtual

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().

98  {
99  // Check parameter values
100  if (crateId < MIN_CRATE_ID || crateId > MAX_CRATE_ID || dmbId < MIN_DMB_SLOT || dmbId > MAX_DMB_SLOT) {
101  return false;
102  }
103  detId = pcrate->detId(crateId, dmbId, 0, 0);
104  return (detId.rawId() != 0);
105  }
static const unsigned int MAX_CRATE_ID
CSCDetId detId(int vme, int dmb, int cfeb, int layer=0) const
Definition: CSCCrateMap.cc:11
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const CSCCrateMap * pcrate
static const unsigned int MAX_DMB_SLOT
void CSCMonitorModule::setup ( )
inlineprotected

Definition at line 117 of file CSCMonitorModule.h.

117 { }

Member Data Documentation

cscdqm::Configuration CSCMonitorModule::config
private

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().