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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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::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
 
- 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 74 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, edm::EDConsumerBase::consumesCollector(), 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 #ifdef DQMLOCAL
41  dispatcher = new cscdqm::Dispatcher(&config, const_cast<CSCMonitorModule*>(this));
42 #endif
43 #ifdef DQMGLOBAL
44  // edm::ConsumesCollector coco( consumesCollector() );
45  dispatcher = new cscdqm::Dispatcher(&config, const_cast<CSCMonitorModule*>(this),
47  dcstoken = consumes<DcsStatusCollection>(edm::InputTag("scalersRawToDigi") );
48 
49 #endif
50 
51  dispatcher->init();
52 
53  if (ps.exists("MASKEDHW")) {
54  std::vector<std::string> maskedHW = ps.getUntrackedParameter<std::vector<std::string> >("MASKEDHW");
55  dispatcher->maskHWElements(maskedHW);
56  }
57 
58 }
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!
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
static const char INPUT_TAG_LABEL[]
Global stuff.
edm::InputTag inputTag
CSCMonitorModule::~CSCMonitorModule ( )
virtual

Destructor.

Definition at line 63 of file CSCMonitorModule.cc.

References dispatcher.

63  {
64  if (dispatcher) delete dispatcher;
65 }
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 85 of file CSCMonitorModule.cc.

References cscdqm::HWStandbyType::applyMeM(), cscdqm::HWStandbyType::applyMeP(), DcsStatus::CSCm, DcsStatus::CSCp, dispatcher, edm::EventSetup::get(), edm::Event::getByLabel(), edm::Event::getByToken(), inputTag, pcrate, cscdqm::HWStandbyType::process, processDcsScalers, and edm::ESHandle< class >::product().

85  {
86 
87  // Get crate mapping from database
89  c.get<CSCCrateMapRcd>().get(hcrate);
90  pcrate = hcrate.product();
91 
92  cscdqm::HWStandbyType standby;
93 
94  // Get DCS status scalers
95  if (processDcsScalers) {
97 #ifdef DQMLOCAL
98  if (e.getByLabel("scalersRawToDigi", dcsStatus)) {
99 #endif
100 #ifdef DQMGLOBAL
101  if (e.getByToken(dcstoken, dcsStatus) ) {
102 #endif
103  DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
104  for (; dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) {
105  standby.applyMeP(dcsStatusItr->ready(DcsStatus::CSCp));
106  standby.applyMeM(dcsStatusItr->ready(DcsStatus::CSCm));
107  }
108  }
109  standby.process = true;
110  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
const CSCCrateMap * pcrate
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
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 124 of file CSCMonitorModule.h.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 128 of file CSCMonitorModule.h.

128 { }
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 72 of file CSCMonitorModule.cc.

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

72  {
73 
74  if (prebookEffParams) {
76  }
77 
78 }
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 121 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.

121  {
122 
124  std::string name = req.hdef->getName();
125 
126  std::string path = req.folder;
127  if (req.hdef->getPath().size() > 0) {
128  path = path + req.hdef->getPath() + "/";
129  }
130 
131  //std::cout << "Moving to " << path << " for name = " << name << " with fullPath = " << req.hdef->getFullPath() << "\n";
132 
133  dbe->setCurrentFolder(path);
134 
135  if (req.htype == cscdqm::INT) {
136  me = new CSCMonitorObject(dbe->bookInt(name));
137  me->Fill(req.default_int);
138  } else
139  if (req.htype == cscdqm::FLOAT) {
140  if (req.hdef->getId() == cscdqm::h::PAR_REPORT_SUMMARY ||
141  req.hdef->getId() == cscdqm::h::PAR_CRT_SUMMARY ||
142  req.hdef->getId() == cscdqm::h::PAR_DAQ_SUMMARY ||
143  req.hdef->getId() == cscdqm::h::PAR_DCS_SUMMARY) {
145  } else if (cscdqm::Utility::regexMatch("^PAR_DCS_", cscdqm::h::keys[req.hdef->getId()])) {
147  } else if (cscdqm::Utility::regexMatch("^PAR_DAQ_", cscdqm::h::keys[req.hdef->getId()])) {
149  } else if (cscdqm::Utility::regexMatch("^PAR_CRT_", cscdqm::h::keys[req.hdef->getId()])) {
151  }
152  me = new CSCMonitorObject(dbe->bookFloat(name));
153  me->Fill(req.default_float);
154  } else
155  if (req.htype == cscdqm::STRING) {
156  me = new CSCMonitorObject(dbe->bookString(name, req.default_string));
157  } else
158  if (req.htype == cscdqm::H1D) {
159  me = new CSCMonitorObject(dbe->book1D(name, req.title, req.nchX, req.lowX, req.highX));
160  } else
161  if (req.htype == cscdqm::H2D) {
162  if (req.hdef->getId() == cscdqm::h::EMU_CSC_STATS_SUMMARY) {
164  name = "reportSummaryMap";
165  }
166  me = new CSCMonitorObject(dbe->book2D(name, req.title, req.nchX, req.lowX, req.highX, req.nchY, req.lowY, req.highY));
167  } else
168  if (req.htype == cscdqm::H3D) {
169  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));
170  } else
171  if (req.htype == cscdqm::PROFILE) {
172  me = new CSCMonitorObject(dbe->bookProfile(name, req.title, req.nchX, req.lowX, req.highX, req.nchY, req.lowY, req.highY, req.option.c_str()));
173  } else
174  if (req.htype == cscdqm::PROFILE2D) {
175  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()));
176  }
177 
178  return me;
179 
180 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
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:1134
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:809
const HistoId getId() const
Get Histogram ID.
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:838
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:1186
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:779
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:1000
static const HistoName keys[]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
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:1330
void CSCMonitorModule::endJob ( void  )
inlineprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 130 of file CSCMonitorModule.h.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 129 of file CSCMonitorModule.h.

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

MonitorObjectProvider Implementation

Implements cscdqm::MonitorObjectProvider.

Definition at line 107 of file CSCMonitorModule.h.

References CSCCrateMap::detId(), MAX_CRATE_ID, MAX_DMB_SLOT, pcrate, and DetId::rawId().

107  {
108  // Check parameter values
109  if (crateId < MIN_CRATE_ID || crateId > MAX_CRATE_ID || dmbId < MIN_DMB_SLOT || dmbId > MAX_DMB_SLOT) {
110  return false;
111  }
112  detId = pcrate->detId(crateId, dmbId, 0, 0);
113  return (detId.rawId() != 0);
114  }
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:43
const CSCCrateMap * pcrate
static const unsigned int MAX_DMB_SLOT
void CSCMonitorModule::setup ( )
inlineprotected

Definition at line 126 of file CSCMonitorModule.h.

126 { }

Member Data Documentation

cscdqm::Configuration CSCMonitorModule::config
private

Definition at line 87 of file CSCMonitorModule.h.

Referenced by CSCMonitorModule().

DQMStore* CSCMonitorModule::dbe
private

Definition at line 89 of file CSCMonitorModule.h.

Referenced by bookMonitorObject(), and CSCMonitorModule().

cscdqm::Dispatcher* CSCMonitorModule::dispatcher
private

Definition at line 88 of file CSCMonitorModule.h.

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

edm::InputTag CSCMonitorModule::inputTag
private

Definition at line 90 of file CSCMonitorModule.h.

Referenced by analyze(), and CSCMonitorModule().

const CSCCrateMap* CSCMonitorModule::pcrate
private

Pointer to crate mapping from database

Definition at line 95 of file CSCMonitorModule.h.

Referenced by analyze(), and getCSCDetId().

bool CSCMonitorModule::prebookEffParams
private

Definition at line 91 of file CSCMonitorModule.h.

Referenced by beginRun(), and CSCMonitorModule().

bool CSCMonitorModule::processDcsScalers
private

Definition at line 92 of file CSCMonitorModule.h.

Referenced by analyze(), and CSCMonitorModule().