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) {
119  const cscdqm::EMUHistoDef def(cscdqm::h::EMU_CSC_STATS_SUMMARY);
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 }
DIR_CRTINFO
static const char DIR_CRTINFO[]
Definition: CSCMonitorModule.h:62
cscdqm::HistoId
unsigned int HistoId
Definition: CSCDQM_HistoDef.h:35
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
cscdqm::FLOAT
Definition: CSCDQM_MonitorObjectProvider.h:29
cscdqm::HistoBookRequest::hdef
const HistoDef * hdef
Definition: CSCDQM_MonitorObjectProvider.h:32
CSCOfflineClient::dispatcher
cscdqm::Dispatcher * dispatcher
Definition: CSCOfflineClient.h:76
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
dqm::implementation::IGetter::getMEs
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:698
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
cscdqm::Dispatcher::updateFractionAndEfficiencyHistos
void updateFractionAndEfficiencyHistos()
On demand update fraction and efficiency MOs.
Definition: CSCDQM_Dispatcher.cc:257
cscdqm::Utility::regexMatch
static bool regexMatch(const std::string &expression, const std::string &message)
Match RegExp expression string against string message and return result.
Definition: CSCDQM_Utility.cc:166
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
DIR_DCSINFO
static const char DIR_DCSINFO[]
Definition: CSCMonitorModule.h:60
config
Definition: config.py:1
CSCMonitorObject
cscdqm::MonitorObject implementation used in CSCMonitorModuleCmn
Definition: CSCMonitorObject.h:29
CSCOfflineClient::maskedHW
std::vector< std::string > maskedHW
Definition: CSCOfflineClient.h:79
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
CSCOfflineClient.h
cscdqm::EMUHistoDef
EMU Level Histogram Definition.
Definition: CSCDQM_HistoDef.h:258
cscdqm::HistoBookRequest
Definition: CSCDQM_MonitorObjectProvider.h:31
CSCOfflineClient::CSCOfflineClient
CSCOfflineClient(const edm::ParameterSet &ps)
Constructor.
Definition: CSCOfflineClient.cc:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
CSCOfflineClient::bookMonitorObject
cscdqm::MonitorObject * bookMonitorObject(const cscdqm::HistoBookRequest &p_req) override
Book Monitor Object on Request.
Definition: CSCOfflineClient.cc:134
edm::ParameterSet
Definition: ParameterSet.h:47
dqm::implementation::IBooker::bookString
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
Definition: DQMStore.h:87
CSCOfflineClient::~CSCOfflineClient
~CSCOfflineClient() override
Destructor.
Definition: CSCOfflineClient.cc:41
cscdqm::Dispatcher::maskHWElements
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
Definition: CSCDQM_Dispatcher.cc:190
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
CSCOfflineClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: CSCOfflineClient.cc:88
cscdqm::HistoDef::getId
const HistoId getId() const
Get Histogram ID.
Definition: CSCDQM_HistoDef.h:84
cuy.ib
ib
Definition: cuy.py:662
cscdqm::HistoDef::getName
virtual const std::string getName() const
Get processed histogram name. It can include additional parameter in formated name....
Definition: CSCDQM_HistoDef.h:98
cscdqm::HistoDef::getPath
virtual const std::string getPath() const
Get path part of the histogram (used only for DDUs and CSCs)
Definition: CSCDQM_HistoDef.h:177
cscdqm::STRING
Definition: CSCDQM_MonitorObjectProvider.h:29
CSCOfflineClient::ibooker
DQMStore::IBooker * ibooker
Definition: CSCOfflineClient.h:78
cscdqm::HistoDef::getHistoIdByName
static const bool getHistoIdByName(const std::string &p_name, HistoId &p_id)
Get Histogram ID by name.
Definition: CSCDQM_HistoDef.h:223
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
dqm::implementation::IGetter
Definition: DQMStore.h:484
cscdqm::HistoBookRequest::default_int
int default_int
Definition: CSCDQM_MonitorObjectProvider.h:50
cscdqm::INT
Definition: CSCDQM_MonitorObjectProvider.h:29
cscdqm::Dispatcher::init
void init()
Initialize Dispatcher: book histograms, init processor, etc.
Definition: CSCDQM_Dispatcher.cc:98
cscdqm::Dispatcher
CSCDQM Framework frontend and Histogram Cache controller.
Definition: CSCDQM_Dispatcher.h:115
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
cscdqm::HistoBookRequest::default_float
float default_float
Definition: CSCDQM_MonitorObjectProvider.h:51
cscdqm::MonitorObject
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
Definition: CSCDQM_MonitorObject.h:35
cscdqm::HistoBookRequest::folder
std::string folder
Definition: CSCDQM_MonitorObjectProvider.h:35
dqm::implementation::IBooker
Definition: DQMStore.h:43
spu::def
int def(FILE *, FILE *, int)
Definition: SherpackUtilities.cc:14
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DIR_EVENTINFO
static const char DIR_EVENTINFO[]
Definition: CSCMonitorModule.h:59
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
cscdqm::Dispatcher::book
void book()
Definition: CSCDQM_Dispatcher.cc:104
cscdqm::HistoBookRequest::htype
HistoType htype
Definition: CSCDQM_MonitorObjectProvider.h:33
cscdqm::HistoBookRequest::default_string
std::string default_string
Definition: CSCDQM_MonitorObjectProvider.h:52
DIR_DAQINFO
static const char DIR_DAQINFO[]
Definition: CSCMonitorModule.h:61