CMS 3D CMS Logo

CSCOfflineClient.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: CSCOfflineClient.cc
5  *
6  * Description: CSC Offline Client
7  *
8  * Version: 1.0
9  * Created: 08/20/2009 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 
19 #include "CSCOfflineClient.h"
20 
27  config.load(params);
28 
29  dispatcher = new cscdqm::Dispatcher(&config, const_cast<CSCOfflineClient*>(this));
30  dispatcher->init();
31 
32  if (ps.exists("MASKEDHW")) {
33  maskedHW = ps.getUntrackedParameter<std::vector<std::string> >("MASKEDHW");
34  // dispatcher->maskHWElements(maskedHW);
35  }
36 }
37 
42  if (dispatcher)
43  delete dispatcher;
44 }
45 
46 /*** No longer triggered for DQMEDHarvester ***/
47 /*
48 void CSCOfflineClient::endRun(const edm::Run& r, const edm::EventSetup& c) {
49 
50  // *
51  // * Putting histograms to internal cache: EMU stuff
52  // * /
53  dbe->setCurrentFolder(config.getFOLDER_EMU());
54  std::vector<std::string> me_names = dbe->getMEs();
55  for (std::vector<std::string>::iterator iter = me_names.begin(); iter != me_names.end(); iter++) {
56  std::string me_name = *iter;
57  MonitorElement* me = dbe->get(config.getFOLDER_EMU() + me_name);
58  cscdqm::HistoId id;
59  if (me && cscdqm::HistoDef::getHistoIdByName(me_name, id)) {
60  const cscdqm::EMUHistoDef def(id);
61  cscdqm::MonitorObject* mo = new CSCMonitorObject(me);
62  config.fnPutHisto(def, mo);
63  }
64  }
65 
66  // *
67  // * Putting histograms to internal cache: EventInfo
68  // * /
69 
70  {
71  std::string name = DIR_EVENTINFO;
72  name += "reportSummaryMap";
73  MonitorElement* me = dbe->get(name);
74  if (me) {
75  const cscdqm::EMUHistoDef def(cscdqm::h::EMU_CSC_STATS_SUMMARY);
76  cscdqm::MonitorObject* mo = new CSCMonitorObject(me);
77  config.fnPutHisto(def, mo);
78  }
79  }
80 
81  config.incNEvents();
82  dispatcher->updateFractionAndEfficiencyHistos();
83 
84 }
85 */
86 
87 // void CSCOfflineClient::bookHistograms(DQMStore::IBooker & ib, edm::Run const &, edm::EventSetup const &)
89  ibooker = &ib;
90  dispatcher->book();
91  if (!maskedHW.empty())
93 
94  /*
95  * Putting histograms to internal cache: EMU stuff
96  */
97  ibooker->setCurrentFolder(config.getFOLDER_EMU());
98  std::vector<std::string> me_names = igetter.getMEs();
99  for (std::vector<std::string>::iterator iter = me_names.begin(); iter != me_names.end(); iter++) {
100  std::string me_name = *iter;
101  MonitorElement* me = igetter.get(config.getFOLDER_EMU() + me_name);
103  if (me && cscdqm::HistoDef::getHistoIdByName(me_name, id)) {
104  const cscdqm::EMUHistoDef def(id);
106  config.fnPutHisto(def, mo);
107  }
108  }
109 
110  /*
111  * Putting histograms to internal cache: EventInfo
112  */
113 
114  {
116  name += "reportSummaryMap";
117  MonitorElement* me = igetter.get(name);
118  if (me) {
121  config.fnPutHisto(def, mo);
122  }
123  }
124 
125  config.incNEvents();
127 }
128 
135  cscdqm::MonitorObject* me = nullptr;
136  std::string name = req.hdef->getName();
137 
138  std::string path = req.folder;
139  if (!req.hdef->getPath().empty()) {
140  path = path + req.hdef->getPath() + "/";
141  }
142 
143  ibooker->cd();
145 
146  if (req.htype == cscdqm::INT) {
148  me->Fill(req.default_int);
149  } else if (req.htype == cscdqm::FLOAT) {
150  if (req.hdef->getId() == cscdqm::h::PAR_REPORT_SUMMARY) {
151  ibooker->cd();
153  } else if (cscdqm::Utility::regexMatch("^PAR_DCS_", cscdqm::h::keys[req.hdef->getId()])) {
154  ibooker->cd();
156  } else if (cscdqm::Utility::regexMatch("^PAR_DAQ_", cscdqm::h::keys[req.hdef->getId()])) {
157  ibooker->cd();
159  } else if (cscdqm::Utility::regexMatch("^PAR_CRT_", cscdqm::h::keys[req.hdef->getId()])) {
160  ibooker->cd();
162  }
164  me->Fill(req.default_float);
165  } else if (req.htype == cscdqm::STRING) {
167  }
168 
169  return me;
170 }
void init()
Initialize Dispatcher: book histograms, init processor, etc.
static const bool getHistoIdByName(const std::string &p_name, HistoId &p_id)
Get Histogram ID by name.
int def(FILE *, FILE *, int)
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
~CSCOfflineClient() override
Destructor.
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
static const char DIR_DAQINFO[]
cscdqm::MonitorObject implementation used in CSCMonitorModuleCmn
void updateFractionAndEfficiencyHistos()
On demand update fraction and efficiency MOs.
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:720
cscdqm::MonitorObject * bookMonitorObject(const cscdqm::HistoBookRequest &p_req) override
Book Monitor Object on Request.
bool exists(std::string const &parameterName) const
checks if a parameter exists
DQMStore::IBooker * ibooker
Definition: config.py:1
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.
const HistoId getId() const
Get Histogram ID.
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
Definition: DQMStore.h:87
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
T getUntrackedParameter(std::string const &, T const &) const
unsigned int HistoId
cscdqm::Dispatcher * dispatcher
static const char DIR_DCSINFO[]
EMU Level Histogram Definition.
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[]
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
CSCOfflineClient(const edm::ParameterSet &ps)
Constructor.
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.
static const HistoName keys[]
std::vector< std::string > maskedHW
ib
Definition: cuy.py:661