CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCMonitorModule.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: CSCMonitorModule.cc
5  *
6  * Description: CSC Monitor Module
7  *
8  * Version: 1.0
9  * Created: 11/13/2008 02:31:12 PM
10  * Revision: none
11  * Compiler: gcc
12  *
13  * Author: Valdas Rapsevicius (VR), valdas.rapsevicius@cern.ch
14  * Company: CERN, CH
15  *
16  * =====================================================================================
17  */
18 
20 
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 }
49 
54  if (dispatcher) delete dispatcher;
55 }
56 
63 
64  if (prebookEffParams) {
66  }
67 
68 }
69 
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 }
100 
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 }
166 
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
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
static const char DIR_DAQINFO[]
cscdqm::MonitorObject implementation used in CSCMonitorModuleCmn
CSCMonitorModule(const edm::ParameterSet &ps)
Constructor.
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:979
void updateFractionAndEfficiencyHistos()
On demand update fraction and efficiency MOs.
virtual void Fill(float x)=0
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
virtual ~CSCMonitorModule()
Destructor.
bool exists(std::string const &parameterName) const
checks if a parameter exists
#define NULL
Definition: scimark2.h:8
cscdqm::Dispatcher * dispatcher
static bool regexMatch(const std::string &expression, const std::string &message)
Match RegExp expression string against string message and return result.
CSCDQM Framework frontend and Histogram Cache controller.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
Begin the run.
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
list path
Definition: scaleCards.py:51
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze Event.
const HistoId getId() const
Get Histogram ID.
cscdqm::MonitorObject * bookMonitorObject(const cscdqm::HistoBookRequest &p_req)
Book Monitor Object on Request.
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:683
static const char DIR_DCSINFO[]
const CSCCrateMap * pcrate
static const char INPUT_TAG_LABEL[]
Global stuff.
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:1031
static const char DIR_EVENTINFO[]
edm::InputTag inputTag
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
virtual const std::string getPath() const
Get path part of the histogram (used only for DDUs and CSCs)
static const char DIR_CRTINFO[]
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
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.
std::string fullPath() const
Definition: FileInPath.cc:171
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
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:845
static const HistoName keys[]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
Definition: Run.h:33
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:1175