CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
26 
27  edm::ParameterSet params = ps.getUntrackedParameter<edm::ParameterSet>("EventProcessor");
28  config.load(params);
29 
31 
32  dispatcher = new cscdqm::Dispatcher(&config, const_cast<CSCOfflineClient*>(this));
33  dispatcher->init();
34 
35  if (ps.exists("MASKEDHW")) {
36  std::vector<std::string> maskedHW = ps.getUntrackedParameter<std::vector<std::string> >("MASKEDHW");
37  dispatcher->maskHWElements(maskedHW);
38  }
39 
40 }
41 
46  if (dispatcher) delete dispatcher;
47 }
48 
50 
51  /*
52  * Putting histograms to internal cache: EMU stuff
53  */
54 
55  dbe->setCurrentFolder(config.getFOLDER_EMU());
56  std::vector<std::string> me_names = dbe->getMEs();
57  for (std::vector<std::string>::iterator iter = me_names.begin(); iter != me_names.end(); iter++) {
58  std::string me_name = *iter;
59  MonitorElement* me = dbe->get(config.getFOLDER_EMU() + me_name);
60  cscdqm::HistoId id;
61  if (me && cscdqm::HistoDef::getHistoIdByName(me_name, id)) {
62  const cscdqm::EMUHistoDef def(id);
64  config.fnPutHisto(def, mo);
65  }
66  }
67 
68  /*
69  * Putting histograms to internal cache: EventInfo
70  */
71 
72  {
74  name += "reportSummaryMap";
75  MonitorElement* me = dbe->get(name);
76  if (me) {
77  const cscdqm::EMUHistoDef def(cscdqm::h::EMU_CSC_STATS_SUMMARY);
79  config.fnPutHisto(def, mo);
80  }
81  }
82 
85 
86 }
87 
94 
96  std::string name = req.hdef->getName();
97 
98  std::string path = req.folder;
99  if (req.hdef->getPath().size() > 0) {
100  path = path + req.hdef->getPath() + "/";
101  }
102 
103  dbe->setCurrentFolder(path);
104 
105  if (req.htype == cscdqm::INT) {
106  me = new CSCMonitorObject(dbe->bookInt(name));
107  me->Fill(req.default_int);
108  } else
109  if (req.htype == cscdqm::FLOAT) {
110  if (req.hdef->getId() == cscdqm::h::PAR_REPORT_SUMMARY) {
112  } else if (cscdqm::Utility::regexMatch("^PAR_DCS_", cscdqm::h::keys[req.hdef->getId()])) {
114  } else if (cscdqm::Utility::regexMatch("^PAR_DAQ_", cscdqm::h::keys[req.hdef->getId()])) {
116  } else if (cscdqm::Utility::regexMatch("^PAR_CRT_", cscdqm::h::keys[req.hdef->getId()])) {
118  }
119  me = new CSCMonitorObject(dbe->bookFloat(name));
120  me->Fill(req.default_float);
121  } else
122  if (req.htype == cscdqm::STRING) {
123  me = new CSCMonitorObject(dbe->bookString(name, req.default_string));
124  }
125 
126  return me;
127 
128 }
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.
T getUntrackedParameter(std::string const &, T const &) const
int def(FILE *, FILE *, int)
static const char DIR_DAQINFO[]
cscdqm::MonitorObject implementation used in CSCMonitorModuleCmn
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 ...
bool exists(std::string const &parameterName) const
checks if a parameter exists
#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.
CSCDQM Framework frontend and Histogram Cache controller.
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:809
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
virtual ~CSCOfflineClient()
Destructor.
void endRun(const edm::Run &r, const edm::EventSetup &c)
unsigned int HistoId
const HistoId getId() const
Get Histogram ID.
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:838
cscdqm::Dispatcher * dispatcher
static const char DIR_DCSINFO[]
EMU Level Histogram Definition.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
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[]
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1597
cscdqm::Configuration config
boost::function< void(const HistoDef &histoT, MonitorObject *&) > fnPutHisto
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.
CSCOfflineClient(const edm::ParameterSet &ps)
Constructor.
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:779
static const HistoName keys[]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
cscdqm::MonitorObject * bookMonitorObject(const cscdqm::HistoBookRequest &p_req)
Book Monitor Object on Request.
Definition: Run.h:41