CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWEPWrapper.cc
Go to the documentation of this file.
1 #include "FWEPWrapper.h"
2 
10 
12 
13 #include "toolbox/task/WorkLoopFactory.h"
14 #include "xdaq/ApplicationDescriptorImpl.h"
15 #include "xdaq/ContextDescriptor.h"
16 #include "xdaq/ApplicationContext.h"
17 #include "xdata/Boolean.h"
18 #include "xdata/TableIterator.h"
19 #include "xdata/exdr/Serializer.h"
20 #include "xdata/exdr/AutoSizeOutputStreamBuffer.h"
21 
23 #undef HAVE_STAT
30 
32 
33 #include "xoap/MessageFactory.h"
34 #include "xoap/SOAPEnvelope.h"
35 #include "xoap/SOAPBody.h"
36 #include "xoap/domutils.h"
37 #include "xoap/Method.h"
38 #include "xmas/xmas.h"
39 
40 #include "cgicc/CgiDefs.h"
41 #include "cgicc/Cgicc.h"
42 #include "cgicc/FormEntry.h"
43 
44 #include "utils.icc"
45 
46 #include <vector>
47 
48 namespace evf{
49 
50  const std::string FWEPWrapper::unknown = "unknown";
51  FWEPWrapper::FWEPWrapper(log4cplus::Logger &log, unsigned int instance)
52  : evtProcessor_(0)
53  , serviceToken_()
54  , servicesDone_(false)
55  , epInitialized_(false)
56  , prescaleSvc_(0)
57  , log_(log)
58  , isPython_(true)
59  , hasPrescaleService_(false)
60  , hasModuleWebRegistry_(false)
61  , hasServiceWebRegistry_(false)
62  , monitorInfoSpace_(0)
63  , monitorInfoSpaceLegend_(0)
64  , timeoutOnStop_(10)
65  , monSleepSec_(1)
66  , nbProcessed_(0)
67  , nbAccepted_(0)
68  , wlMonitoring_(0)
69  , asMonitoring_(0)
70  , wlMonitoringActive_(false)
71  , watching_(false)
72  , allPastLumiProcessed_(0)
73  , lsid_(0)
74  , psid_(0)
75  , lsTimeOut_(100000000)
76  , lumiSectionIndex_(1)
77  , prescaleSetIndex_(0)
78  , lastLumiPrescaleIndex_(0)
79  , lsTimedOut_(false)
80  , lsToBeRecovered_(true)
81  , scalersUpdateAttempted_(0)
82  , scalersUpdateCounter_(0)
83  , lumiSectionsCtr_(lsRollSize_+1)
84  , lumiSectionsTo_(lsRollSize_)
85  , rollingLsIndex_(lsRollSize_-1)
86  , rollingLsWrap_(false)
87  , rcms_(0)
88  , instance_(instance)
89  , waitingForLs_(false)
90  {
91  //list of variables for scalers flashlist
92  names_.push_back("lumiSectionIndex");
93  names_.push_back("prescaleSetIndex");
94  names_.push_back("scalersTable");
95  namesStatusLegenda_.push_back("macroStateLegenda");
96  namesStatusLegenda_.push_back("microStateLegenda");
97  namesScalersLegenda_.push_back("scalersLegenda");
98  //some initialization of state data
99  epMAltState_ = -1;
100  epmAltState_ = -1;
101  pthread_mutex_init(&ep_guard_lock_,0);
102  }
103 
105 
107  {
108 
109  applicationInfoSpace_->fireItemAvailable("monSleepSec", &monSleepSec_);
110  applicationInfoSpace_->fireItemAvailable("timeoutOnStop", &timeoutOnStop_);
111  applicationInfoSpace_->fireItemAvailable("lsTimeOut", &lsTimeOut_);
112 
113  applicationInfoSpace_->fireItemAvailable("lumiSectionIndex", &lumiSectionIndex_);
114  applicationInfoSpace_->fireItemAvailable("prescaleSetIndex", &prescaleSetIndex_);
115  applicationInfoSpace_->fireItemAvailable("lastLumiPrescaleIndex", &lastLumiPrescaleIndex_);
116  applicationInfoSpace_->fireItemAvailable("lsTimedOut", &lsTimedOut_);
117  applicationInfoSpace_->fireItemAvailable("lsToBeRecovered", &lsToBeRecovered_);
118 
119  monitorLegendaInfoSpace_->fireItemAvailable("macroStateLegenda", &macro_state_legend_);
120  monitorLegendaInfoSpace_->fireItemAvailable("microStateLegenda", &micro_state_legend_);
121 
122  monitorInfoSpace_->fireItemAvailable("epMacroState", &epMState_);
123  monitorInfoSpace_->fireItemAvailable("epMicroState", &epmState_);
124 
125  xdata::Table &stbl = trh_.getTable();
126  scalersInfoSpace_->fireItemAvailable("scalersTable", &stbl);
127  scalersInfoSpace_->fireItemAvailable("lumiSectionIndex", &lumiSectionIndex_);
128  scalersInfoSpace_->fireItemAvailable("prescaleSetIndex", &prescaleSetIndex_);
129  scalersInfoSpace_->fireItemAvailable("lastLumiPrescaleIndex", &lastLumiPrescaleIndex_);
130  scalersLegendaInfoSpace_->fireItemAvailable("scalersLegenda", trh_.getPathLegenda());
131 
132  scalersComplete_.addColumn("instance", "unsigned int 32");
133  scalersComplete_.addColumn("lsid", "unsigned int 32");
134  scalersComplete_.addColumn("psid", "unsigned int 32");
135  scalersComplete_.addColumn("proc", "unsigned int 32");
136  scalersComplete_.addColumn("acc", "unsigned int 32");
137  scalersComplete_.addColumn("exprep", "unsigned int 32");
138  scalersComplete_.addColumn("effrep", "unsigned int 32");
139  scalersComplete_.addColumn("triggerReport", "table");
140 
141  xdata::Table::iterator it = scalersComplete_.begin();
142  if( it == scalersComplete_.end())
143  {
144  it = scalersComplete_.append();
145  it->setField("instance",instance_);
146  }
147 
148 
149  //fill initial macrostate legenda information
150  unsigned int i = 0;
151  std::stringstream oss;
152  for(i = (unsigned int)edm::event_processor::sInit; i < (unsigned int)edm::event_processor::sInvalid; i++)
153  {
154  oss << i << "=" << evtProcessor_->stateName((edm::event_processor::State) i) << " ";
156  }
157  oss << i << "=" << "NotStarted ";
158  statmod_.push_back("NotStarted");
160  std::stringstream oss2;
161  oss2 << 0 << "=Invalid ";
162  modmap_["Invalid"]=0;
163  mapmod_.resize(1);
164  mapmod_[0]="Invalid";
165 
166  monitorInfoSpace_->lock();
167  macro_state_legend_ = oss.str();
168  micro_state_legend_ = oss2.str();
169  monitorInfoSpace_->unlock();
170 
171  if(!multi) publishConfigAndMonitorItemsSP();
172 
173  }
174 
176  {
177  monitorInfoSpace_->fireItemAvailable("epSPMacroStateInt", &epMAltState_);
178  monitorInfoSpace_->fireItemAvailable("epSPMicroStateInt", &epmAltState_);
179 
180  monitorInfoSpace_->fireItemAvailable("nbProcessed", &nbProcessed_);
181  monitorInfoSpace_->fireItemAvailable("nbAccepted", &nbAccepted_);
182  }
183 
184 
185  void FWEPWrapper::init(unsigned short serviceMap, std::string &configString)
186  {
187  hasPrescaleService_ = serviceMap & 0x1;
188  hasModuleWebRegistry_ = serviceMap & 0x2;
189  hasServiceWebRegistry_ = serviceMap & 0x4;
190  bool instanceZero = serviceMap & 0x8;
191  hasSubProcesses = serviceMap & 0x10;
192  configString_ = configString;
193  trh_.resetFormat(); //reset the report table even if HLT didn't change
195  if (epInitialized_) {
196  LOG4CPLUS_INFO(log_,"CMSSW EventProcessor already initialized: skip!");
197  return;
198  }
199 
200  LOG4CPLUS_INFO(log_,"Initialize CMSSW EventProcessor.");
201  LOG4CPLUS_INFO(log_,"CMSSW_BASE:"<<getenv("CMSSW_BASE"));
202 
203 
204  // job configuration string
208 
209  if (configString_.size() > 3 && configString_.substr(configString_.size()-3) == ".py") isPython_ = true;
210  boost::shared_ptr<edm::ParameterSet> params; // change this name!
211  boost::shared_ptr<std::vector<edm::ParameterSet> > pServiceSets;
212  boost::shared_ptr<edm::ProcessDesc> pdesc;
213  if(isPython_)
214  {
216  pdesc = ppdesc.processDesc();
217  }
218  else
219  pdesc = boost::shared_ptr<edm::ProcessDesc>(new edm::ProcessDesc(configuration_));
220  pServiceSets = pdesc->getServicesPSets();
221  // add default set of services
222  if(!servicesDone_) {
223  //DQMStore should not be created in the Master (MP case) since this poses problems in the slave
224  if(!hasSubProcesses){
225  internal::addServiceMaybe(*pServiceSets,"DQMStore");
226  internal::addServiceMaybe(*pServiceSets,"DQM");
227  }
228  else{
229  internal::removeServiceMaybe(*pServiceSets,"DQMStore");
230  internal::removeServiceMaybe(*pServiceSets,"DQM");
231  }
232  internal::addServiceMaybe(*pServiceSets,"MLlog4cplus");
233  internal::addServiceMaybe(*pServiceSets,"MicroStateService");
234  internal::addServiceMaybe(*pServiceSets,"ShmOutputModuleRegistry");
235  if(hasPrescaleService_) internal::addServiceMaybe(*pServiceSets,"PrescaleService");
236  if(hasModuleWebRegistry_) internal::addServiceMaybe(*pServiceSets,"ModuleWebRegistry");
237  if(hasServiceWebRegistry_) internal::addServiceMaybe(*pServiceSets,"ServiceWebRegistry");
238 
239  try{
241  internal::addServiceMaybe(*pServiceSets,"DQMStore");
242  internal::addServiceMaybe(*pServiceSets,"DQM");
243  // slaveServiceToken_ = edm::ServiceRegistry::createSet(*pServiceSets);
244  }
245  catch(cms::Exception &e) {
246  LOG4CPLUS_ERROR(log_,e.explainSelf());
247  }
248  catch(std::exception &e) {
249  LOG4CPLUS_ERROR(log_,e.what());
250  }
251  catch(...) {
252  LOG4CPLUS_ERROR(log_,"Unknown Exception");
253  }
254  servicesDone_ = true;
255  }
256 
258 
259 
260  //test rerouting of fwk logging to log4cplus
261  edm::LogInfo("FWEPWrapper")<<"started MessageLogger Service.";
262  edm::LogInfo("FWEPWrapper")<<"Using config \n"<<configuration_;
263 
264  DQMStore *dqm = 0;
265  try{
266  if(edm::Service<DQMStore>().isAvailable())
267  dqm = edm::Service<DQMStore>().operator->();
268  }
269  catch(...) {
270  LOG4CPLUS_INFO(log_,
271  "exception when trying to get service DQMStore");
272  }
273  if(dqm!=0) dqm->rmdir("");
274 
275 
276  ModuleWebRegistry *mwr = 0;
277  try{
278  if(edm::Service<ModuleWebRegistry>().isAvailable())
280  }
281  catch(...) {
282  LOG4CPLUS_INFO(log_,
283  "exception when trying to get service ModuleWebRegistry");
284  }
285 
286  if(mwr) mwr->clear(); // in case we are coming from stop we need to clear the mwr
287 
288  ServiceWebRegistry *swr = 0;
289  try{
290  if(edm::Service<ServiceWebRegistry>().isAvailable())
292  }
293  catch(...) {
294  LOG4CPLUS_INFO(log_,
295  "exception when trying to get service ModuleWebRegistry");
296  }
297 
298  ShmOutputModuleRegistry *sor = 0;
299  try{
300  if(edm::Service<ShmOutputModuleRegistry>().isAvailable())
302  }
303  catch(...) {
304  LOG4CPLUS_INFO(log_,
305  "exception when trying to get service ShmOutputModuleRegistry");
306  }
307 
308  if(sor) sor->clear();
309  // if(swr) swr->clear(); // in case we are coming from stop we need to clear the swr
310 
311 
312  // instantiate the event processor - fatal exceptions are caught in the main application
313 
314  std::vector<std::string> defaultServices;
315  std::vector<std::string> forcedServices;
316  defaultServices.push_back("MessageLogger");
317  defaultServices.push_back("InitRootHandlers");
318  defaultServices.push_back("JobReportService");
319  pdesc->addServices(defaultServices, forcedServices);
320  pthread_mutex_lock(&ep_guard_lock_);
321  if (0!=evtProcessor_) delete evtProcessor_;
322 
326  pthread_mutex_unlock(&ep_guard_lock_);
327  // evtProcessor_->setRunNumber(runNumber_.value_);
328  /* removed
329  if(!outPut_)
330  evtProcessor_->enableEndPaths(outPut_);
331  outprev_=outPut_;
332  */
333  // publish all module names to XDAQ infospace
334 
335  if(mwr)
336  {
339  }
340  if(swr)
341  {
343  }
344  // get the prescale service
345  LOG4CPLUS_INFO(log_,
346  "Checking for edm::service::PrescaleService!");
347  try {
349  {
350  LOG4CPLUS_INFO(log_,
351  "edm::service::PrescaleService is available!");
353  LOG4CPLUS_INFO(log_,
354  "Obtained pointer to PrescaleService");
355  }
356  }
357  catch(...) {
358  LOG4CPLUS_INFO(log_,
359  "exception when trying to get service "
360  <<"edm::service::PrescaleService");
361  }
362  const edm::ParameterSet *prescaleSvcConfig = internal::findService(*pServiceSets,"PrescaleService");
363  if(prescaleSvc_ != 0 && prescaleSvcConfig !=0) prescaleSvc_->reconfigure(*prescaleSvcConfig);
364 
365  monitorLegendaInfoSpace_->lock();
366  //fill microstate legenda information
368 
369  std::stringstream oss2;
370  unsigned int outcount = 0;
371  oss2 << 0 << "=Invalid ";
372  oss2 << 1 << "=FwkOvh ";
373  oss2 << 2 << "=Input ";
374  modmap_["Invalid"]=0;
375  modmap_["FWKOVH"]=1;
376  modmap_["INPUT"]=2;
377  mapmod_.resize(descs_.size()+4); // all modules including output plus one input plus DQM plus the invalid state 0
378  mapmod_[0]="Invalid";
379  mapmod_[1]="FWKOVH";
380  mapmod_[2]="INPUT";
381  outcount+=2;
382  for(unsigned int j = 0; j < descs_.size(); j++)
383  {
384  if(descs_[j]->moduleName() == "ShmStreamConsumer") // find something better than hardcoding name
385  {
386  outcount++;
387  oss2 << outcount << "=" << descs_[j]->moduleLabel() << " ";
388  modmap_[descs_[j]->moduleLabel()]=outcount;
389  mapmod_[outcount] = descs_[j]->moduleLabel();
390  }
391  }
392  modmap_["DQM"]=outcount+1;
393  mapmod_[outcount+1]="DQM";
394  oss2 << outcount+1 << "=DQMHistograms ";
395  unsigned int modcount = 1;
396  for(unsigned int i = 0; i < descs_.size(); i++)
397  {
398  if(descs_[i]->moduleName() != "ShmStreamConsumer")
399  {
400  modcount++;
401  oss2 << outcount+modcount << "=" << descs_[i]->moduleLabel() << " ";
402  modmap_[descs_[i]->moduleLabel()]=outcount+modcount;
403  mapmod_[outcount+modcount] = descs_[i]->moduleLabel();
404  }
405  }
406 // std::cout << "*******************************microstate legend**************************" << std::endl;
407 // std::cout << oss2.str() << std::endl;
408 // std::cout << "*******************************microstate legend**************************" << std::endl;
409 
410  if(instanceZero){
411  micro_state_legend_ = oss2.str().c_str();
412  }
413  monitorLegendaInfoSpace_->unlock();
414  try{
415  monitorLegendaInfoSpace_->fireItemGroupChanged(namesStatusLegenda_,0);
416  scalersLegendaInfoSpace_->fireItemGroupChanged(namesScalersLegenda_,0);
417  ::usleep(10);
418  }
420  {
421  LOG4CPLUS_ERROR(log_, "Exception from fireItemGroupChanged: " << e.what());
422  }
423  LOG4CPLUS_INFO(log_," edm::EventProcessor configuration finished.");
426  trh_.formatReportTable(tr,descs_,pathTable_,instanceZero);
427  epInitialized_ = true;
428  return;
429  }
430 
432  {
434  }
435 
436 
437  //______________________________________________________________________________
439  {
441 
442  LOG4CPLUS_WARN(log_,"FUEventProcessor::stopEventProcessor.1 state "
443  << evtProcessor_->stateName(st));
447  ::sleep(1);
448  st = evtProcessor_->getState();
450  LOG4CPLUS_WARN(log_,
451  "FUEventProcessor::stopEventProcessor.2 After 1s - state: "
452  << evtProcessor_->stateName(st));
454  }
455  }
456  LOG4CPLUS_WARN(log_,"FUEventProcessor::stopEventProcessor.3 state "
457  << evtProcessor_->stateName(st));
458 
459  try {
461  watching_ = false;
462  }
463  catch(cms::Exception &e) {
464  XCEPT_RAISE(evf::Exception,e.explainSelf());
465  }
466  catch(std::exception &e) {
467  XCEPT_RAISE(evf::Exception,e.what());
468  }
469  catch(...) {
470  XCEPT_RAISE(evf::Exception,"Unknown Exception");
471  }
473  return rc;
474 
475  }
476 
478  {
480  ModuleWebRegistry *mwr = 0;
481  try{
482  if(edm::Service<ModuleWebRegistry>().isAvailable())
484  }
485  catch(...) {
486  LOG4CPLUS_INFO(log_,
487  "exception when trying to get service ModuleWebRegistry");
488  }
489 
490  if(mwr)
491  {
492  mwr->clear();
493  }
494 
495  ServiceWebRegistry *swr = 0;
496  try{
497  if(edm::Service<ServiceWebRegistry>().isAvailable())
499  }
500  catch(...) {
501  LOG4CPLUS_INFO(log_,
502  "exception when trying to get service ModuleWebRegistry");
503  }
504 
505  if(swr)
506  {
507  swr->clear();
508  }
509 
512  watching_ = false;
514  {
515 
518  pthread_mutex_lock(&ep_guard_lock_);
519  delete evtProcessor_;
520  evtProcessor_ = 0;
521  pthread_mutex_unlock(&ep_guard_lock_);
522  epInitialized_ = false;
523  }
524  else
525  {
526  XCEPT_RAISE(evf::Exception,"EventProcessor stop timed out");
527  }
529  }
530 
532  {
533  pid_t pid = getpid();
534  nbProcessed_.value_ = 0;
535  nbAccepted_.value_ = 0;
536  struct timezone timezone;
537  gettimeofday(&monStartTime_,&timezone);
538 
539  std::ostringstream ost;
540  ost << "Monitoring" << pid;
541  try {
543  toolbox::task::getWorkLoopFactory()->getWorkLoop(ost.str().c_str(),
544  "waiting");
545 
546  if (!wlMonitoring_->isActive()) wlMonitoring_->activate();
547  asMonitoring_ = toolbox::task::bind(this,&FWEPWrapper::monitoring,
548  ost.str().c_str());
549 
550  wlMonitoring_->submit(asMonitoring_);
551  wlMonitoringActive_ = true;
552 
553  }
554  catch (xcept::Exception& e) {
555  std::string msg = "Failed to start workloop 'Monitoring'.";
556 
557  XCEPT_RETHROW(evf::Exception,msg,e);
558  }
559  }
560 
561 
562 
563  //______________________________________________________________________________
564  bool FWEPWrapper::monitoring(toolbox::task::WorkLoop* wl)
565  {
566 
567  struct timeval monEndTime;
568  struct timezone timezone;
569  gettimeofday(&monEndTime,&timezone);
571  MicroStateService *mss = 0;
572  if(!hasSubProcesses) monitorInfoSpace_->lock();
573  if(evtProcessor_)
574  {
577  }
578  else
579  {
580  epMState_ = "Off";
581  epMAltState_ = -1;
582  }
584  {
585  try{
587  }
588  catch(...) {
589  LOG4CPLUS_INFO(log_,
590  "exception when trying to get service MicroStateService");
591  }
592  lsid_ = lumiSectionIndex_.value_;
593  psid_ = prescaleSetIndex_.value_;
594  }
595  if(mss)
596  {
597  epmState_ = mss->getMicroState2();
599  }
600  if(evtProcessor_)
601  {
604  }
605  if(!hasSubProcesses) monitorInfoSpace_->unlock();
606 
607  ::sleep(monSleepSec_.value_);
608  return true;
609  }
610 
611  bool FWEPWrapper::getTriggerReport(bool useLock)
612  {
614  // Calling this method results in calling
615  // evtProcessor_->getTriggerReport, the value returned is encoded as
616  // a xdata::Table.
617 
618  LOG4CPLUS_DEBUG(log_,"getTriggerReport action invoked");
619 
620  //Get the trigger report.
621  ModuleWebRegistry *mwr = 0;
622  try{
623  if(edm::Service<ModuleWebRegistry>().isAvailable())
625  }
626  catch(...) {
627  LOG4CPLUS_INFO(log_,
628  "exception when trying to get service ModuleWebRegistry");
629  return false;
630  }
631  edm::TriggerReport tr;
632  if(mwr==0) return false;
633 
634  unsigned int ls = 0;
635  unsigned int ps = 0;
636  timeval tv;
637  if(useLock) {
638  gettimeofday(&tv,0);
639  // std::cout << getpid() << " calling openBackdoor " << std::endl;
640  waitingForLs_ = true;
641  mwr->openBackDoor("DaqSource",lsTimeOut_);
642  // std::cout << getpid() << " opened Backdoor " << std::endl;
643  }
644 
645  xdata::Table::iterator it = scalersComplete_.begin();
646  ps = lastLumiPrescaleIndex_.value_;
647  // if(prescaleSvc_ != 0) prescaleSvc_->setIndex(ps);
648  it->setField("psid",lastLumiPrescaleIndex_);
649  psid_ = prescaleSetIndex_.value_;
651  ls = lumiSectionIndex_.value_;
652  localLsIncludingTimeOuts_.value_ = ls;
653  it->setField("lsid", localLsIncludingTimeOuts_);
654 
655  lsTriplet lst;
656  lst.ls = localLsIncludingTimeOuts_.value_;
662 
663 
665 
666  if(useLock){
667  // std::cout << getpid() << " calling closeBackdoor " << std::endl;
668  mwr->closeBackDoor("DaqSource");
669  // std::cout << getpid() << " closed Backdoor " << std::endl;
670  }
671 
673 
674 
676  ShmOutputModuleRegistry *sor = 0;
677  try{
679  sor = edm::Service<ShmOutputModuleRegistry>().operator->();
680  }
681  catch(...) {
682  LOG4CPLUS_INFO(log_,
683  "exception when trying to get service ShmOutputModuleRegistry");
684  return false;
685  }
686 
687 
688  trh_.packTriggerReport(tr,sor);
689  it->setField("triggerReport",trh_.getTableWithNames());
690  // std::cout << getpid() << " returning normally from gettriggerreport " << std::endl;
691  return true;
692  }
693 
695  {
696  // trh_.printReportTable();
698  try{
699  // scalersInfoSpace_->unlock();
700  scalersInfoSpace_->fireItemGroupChanged(names_,0);
701  ::usleep(10);
702  // scalersInfoSpace_->lock();
703  }
705  {
706  LOG4CPLUS_ERROR(log_, "Exception from fireItemGroupChanged: " << e.what());
707  // localLog(e.what());
708  return false;
709  }
710  //if there is no state listener then do not attempt to send to monitorreceiver
711  if(rcms_==0) return false;
712  try{
713  if(trh_.getProcThisLumi()!=0U)
716  }
717  catch(...){return false;}
718  return true;
719  }
720 
721 
722  //______________________________________________________________________________
723  void FWEPWrapper::summaryWebPage(xgi::Input *in, xgi::Output *out,const std::string &urn)
724  {
725  // std::string urn = xappDesc_->getURN();
726 
727  *out << "<table>" << std::endl;
728 
729  *out << "<tr valign=\"top\">" << std::endl;
730  *out << "<td>" << std::endl;
731 
733  // trigger summary table
734  *out << "<table border=1 bgcolor=\"#CFCFCF\">" << std::endl;
735  *out << " <tr>" << std::endl;
736  *out << " <th colspan=7>" << std::endl;
737  *out << " " << "Trigger Summary up to LS "
738  << trh_.getLumiSectionReferenceIndex()-1 << std::endl;
739  *out << " </th>" << std::endl;
740  *out << " </tr>" << std::endl;
741 
742  *out << " <tr >" << std::endl;
743  *out << " <th >Path</th>" << std::endl;
744  *out << " <th >Exec</th>" << std::endl;
745  *out << " <th >Pass</th>" << std::endl;
746  *out << " <th >Fail</th>" << std::endl;
747  *out << " <th >Except</th>" << std::endl;
748  *out << " </tr>" << std::endl;
749 
750 
751  for(int i=0; i<tr->trigPathsInMenu; i++) {
752  *out << " <tr>" << std::endl;
753  *out << " <td>"<< i << "</td>" << std::endl;
754  *out << " <td>" << trh_.getl1pre(i) << "</td>" << std::endl;
755  *out << " <td>" << trh_.getaccept(i) << "</td>" << std::endl;
756  *out << " <td >" << trh_.getfailed(i) << "</td>" << std::endl;
757  *out << " <td ";
758  if(trh_.getexcept(i) !=0)
759  *out << "bgcolor=\"red\"" << std::endl;
760  *out << ">" << trh_.getexcept(i) << "</td>" << std::endl;
761  *out << " </tr >" << std::endl;
762 
763  }
764  *out << " <tr><th colspan=7>EndPaths</th></tr>" << std::endl;
765 
766  for(int i=tr->trigPathsInMenu; i<tr->endPathsInMenu + tr->trigPathsInMenu; i++) {
767  *out << " <tr>" << std::endl;
768  *out << " <td>"<< i << "</td>" << std::endl;
769  *out << " <td>" << trh_.getl1pre(i) << "</td>" << std::endl;
770  *out << " <td>" << trh_.getaccept(i) << "</td>" << std::endl;
771  *out << " <td >" << trh_.getfailed(i) << "</td>" << std::endl;
772  *out << " <td ";
773  if(trh_.getexcept(i) !=0)
774  *out << "bgcolor=\"red\"" << std::endl;
775  *out << ">" << trh_.getexcept(i) << "</td>" << std::endl;
776  *out << " </tr >" << std::endl;
777 
778  }
779 
780 
781  *out << "</table>" << std::endl;
782  *out << "</td>" << std::endl;
783  *out << "</tr>" << std::endl;
784  *out << "</table>" << std::endl;
785  }
786 
787 
788  //______________________________________________________________________________
789  void FWEPWrapper::taskWebPage(xgi::Input *in, xgi::Output *out,const std::string &urn)
790  {
791  // std::string urn = xappDesc_->getURN();
792  ModuleWebRegistry *mwr = 0;
794  try{
796  mwr = edm::Service<ModuleWebRegistry>().operator->();
797  }
798  catch(...) {
799  LOG4CPLUS_WARN(log_,
800  "Exception when trying to get service ModuleWebRegistry");
801  }
802  TimeProfilerService *tpr = 0;
803  try{
804  if(edm::Service<TimeProfilerService>().isAvailable())
806  }
807  catch(...) {
808  }
809 
810  *out << "<table>" << std::endl;
811 
812  *out << "<tr valign=\"top\">" << std::endl;
813  *out << "<td>" << std::endl;
814 
815 
816  edm::TriggerReport tr;
818 
819  // trigger summary table
820  *out << "<table border=1 bgcolor=\"#CFCFCF\">" << std::endl;
821  *out << " <tr>" << std::endl;
822  *out << " <th colspan=7>" << std::endl;
823  *out << " " << "Trigger Summary" << std::endl;
824  *out << " </th>" << std::endl;
825  *out << " </tr>" << std::endl;
826 
827  *out << " <tr >" << std::endl;
828  *out << " <th >Path</th>" << std::endl;
829  *out << " <th >Exec</th>" << std::endl;
830  *out << " <th >Pass</th>" << std::endl;
831  *out << " <th >Fail</th>" << std::endl;
832  *out << " <th >Except</th>" << std::endl;
833  *out << " <th >TargetPF</th>" << std::endl;
834  *out << " </tr>" << std::endl;
835  xdata::Serializable *psid = 0;
836  try{
837  psid = applicationInfoSpace_->find("prescaleSetIndex");
838  }
840  }
841  ShmOutputModuleRegistry *sor = 0;
842  try{
843  if(edm::Service<ShmOutputModuleRegistry>().isAvailable())
845  }
846  catch(...) {
847  LOG4CPLUS_INFO(log_,
848  "exception when trying to get service ShmOutputModuleRegistry");
849  }
850 
851 
852  for(unsigned int i=0; i<tr.trigPathSummaries.size(); i++) {
853  *out << " <tr>" << std::endl;
854  *out << " <td>"<< tr.trigPathSummaries[i].name << "</td>" << std::endl;
855  *out << " <td>" << tr.trigPathSummaries[i].timesRun << "</td>" << std::endl;
856 
857  *out << " <td>" << tr.trigPathSummaries[i].timesPassed << "</td>" << std::endl;
858  *out << " <td >" << tr.trigPathSummaries[i].timesFailed << "</td>" << std::endl;
859 
860  *out << " <td ";
861  if(tr.trigPathSummaries[i].timesExcept !=0)
862  *out << "bgcolor=\"red\"" << std::endl;
863  *out << ">" << tr.trigPathSummaries[i].timesExcept << "</td>" << std::endl;
864  if(psid != 0)
865  {
866  *out << " <td>"
868  << "</td>" << std::endl;
869  }
870  else *out << " <td>N/A</td>" << std::endl;
871  *out << " </tr >" << std::endl;
872 
873  }
874 
875 
876 
877  for(unsigned int i=0; i<tr.endPathSummaries.size(); i++) {
878  std::string olab = trh_.findLabelOfModuleTypeInEndPath(tr,descs_,
879  i,"ShmStreamConsumer");
880  edm::FUShmOutputModule *o = sor->get(olab);
881  *out << " <tr>" << std::endl;
882  *out << " <td>"<< tr.endPathSummaries[i].name << "</td>" << std::endl;
883  *out << " <td>" << tr.endPathSummaries[i].timesRun << "</td>" << std::endl;
884  *out << " <td>" << (o ? o->getCounts() : -1) << "</td>" << std::endl;
885  *out << " <td >" << (o ? (tr.endPathSummaries[i].timesRun - o->getCounts()) : -1) << "</td>" << std::endl;
886  *out << " <td ";
887  if(tr.endPathSummaries[i].timesExcept !=0)
888  *out << "bgcolor=\"red\"" << std::endl;
889  *out << ">" << tr.endPathSummaries[i].timesExcept << "</td>" << std::endl;
890  *out << " <td>N/A</td>" << std::endl;
891  *out << " </tr >" << std::endl;
892 
893  }
894 
895  *out << "</table>" << std::endl;
896 
897  *out << "</td>" << std::endl;
898 
899 
900 
901  *out << "<td>" << std::endl;
902  //Process details table
903  *out << "<table frame=\"void\" rules=\"rows\" class=\"modules\">" << std::endl;
904  *out << " <tr>" << std::endl;
905  *out << " <th colspan=3>" << std::endl;
906  *out << " " << "HLT" << std::endl;
907  if(descs_.size()>0)
908  *out << " (Process " << descs_[0]->processName() << ")" << std::endl;
909  *out << " </th>" << std::endl;
910  *out << " </tr>" << std::endl;
911 
912  *out << " <tr >" << std::endl;
913  *out << " <th >" << std::endl;
914  *out << " Module" << std::endl;
915  *out << " </th>" << std::endl;
916  *out << " <th >" << std::endl;
917  *out << " Label" << std::endl;
918  *out << " </th>" << std::endl;
919  *out << " <th >" << std::endl;
920  *out << " Version" << std::endl;
921  *out << " </th>" << std::endl;
922  if(tpr)
923  {
924  *out << " <th >" << std::endl;
925  *out << " first" << std::endl;
926  *out << " </th>" << std::endl;
927  *out << " <th >" << std::endl;
928  *out << " ave" << std::endl;
929  *out << " </th>" << std::endl;
930  *out << " <th >" << std::endl;
931  *out << " max" << std::endl;
932  *out << " </th>" << std::endl;
933  }
934  *out << " </tr>" << std::endl;
935  if(mwr && mwr->checkWeb("DaqSource"))
936  *out << " <tr><td ><a href=\"/" << urn
937  << "module=DaqSource\">DaqSource</a> </td></tr>";
938 
939  for(unsigned int idesc = 0; idesc < descs_.size(); idesc++)
940  {
941  *out << " <tr>" << std::endl;
942  *out << " <td >";
943  if(mwr && mwr->checkWeb(descs_[idesc]->moduleName()))
944  *out << "<a href=\"/" << urn
945  << "module="
946  << descs_[idesc]->moduleName() << "\">"
947  << descs_[idesc]->moduleName() << "</a>";
948  else
949  *out << descs_[idesc]->moduleName();
950  *out << "</td>" << std::endl;
951  *out << " <td >";
952  *out << descs_[idesc]->moduleLabel();
953  *out << "</td>" << std::endl;
954  *out << " <td >";
955  *out << descs_[idesc]->releaseVersion();
956  *out << "</td>" << std::endl;
957  if(tpr)
958  {
959  *out << " <td align=\"right\">";
960  *out << tpr->getFirst(descs_[idesc]->moduleLabel());
961  *out << "</td>" << std::endl;
962  *out << " <td align=\"right\"";
963  *out << (tpr->getAve(descs_[idesc]->moduleLabel())>1. ? "bgcolor=\"red\"" : "")
964  << ">";
965  *out << tpr->getAve(descs_[idesc]->moduleLabel());
966  *out << "</td>" << std::endl;
967  *out << " <td align=\"right\">";
968  *out << tpr->getMax(descs_[idesc]->moduleLabel());
969  *out << "</td>" << std::endl;
970  }
971  *out << " </tr>" << std::endl;
972  }
973  *out << "</table>" << std::endl;
974  *out << "</td>" << std::endl;
975  }
976 
977  //______________________________________________________________________________
979  {
980  using namespace cgicc;
981  Cgicc cgi(in);
982  std::vector<FormEntry> el1;
983  cgi.getElement("module",el1);
984  if(evtProcessor_) {
985  if(el1.size()!=0) {
986  std::string mod = el1[0].getValue();
988  ModuleWebRegistry *mwr = 0;
989  try{
991  mwr = edm::Service<ModuleWebRegistry>().operator->();
992  }
993  catch(...) {
994  LOG4CPLUS_WARN(log_,
995  "Exception when trying to get service ModuleWebRegistry");
996  }
997  mwr->invoke(in,out,mod);
998  }
999  }
1000  else {
1001  *out<<"EventProcessor just disappeared "<<std::endl;
1002  }
1003  }
1004 
1005 
1006  //______________________________________________________________________________
1008  {
1009  using namespace cgicc;
1010  Cgicc cgi(in);
1011  std::vector<FormEntry> el1;
1012  cgi.getElement("service",el1);
1013  if(evtProcessor_) {
1014  if(el1.size()!=0) {
1015  std::string ser = el1[0].getValue();
1017  ServiceWebRegistry *swr = 0;
1018  try{
1020  swr = edm::Service<ServiceWebRegistry>().operator->();
1021  }
1022  catch(...) {
1023  LOG4CPLUS_WARN(log_,
1024  "Exception when trying to get service ModuleWebRegistry");
1025  }
1026  swr->invoke(in,out,ser);
1027  }
1028  }
1029  else {
1030  *out<<"EventProcessor just disappeared "<<std::endl;
1031  }
1032  }
1033 
1034 //______________________________________________________________________________
1036  {
1038  MicroStateService *mss = 0;
1039  std::string micro1 = "unavailable";
1040  if(epInitialized_)
1041  micro1 = "initialized";
1042  std::string micro2 = "unavailable";
1044  {
1045  try{
1047  }
1048  catch(...) {
1049  LOG4CPLUS_INFO(log_,
1050  "exception when trying to get service MicroStateService");
1051  }
1052  pthread_mutex_lock(&ep_guard_lock_);
1053  if(evtProcessor_!=0) micro1 = evtProcessor_->currentStateName();
1054  pthread_mutex_unlock(&ep_guard_lock_);
1055  }
1056 
1057  if(mss) {
1058  micro2 = mss->getMicroState2();
1059  }
1060 
1061  // *out << fsm_.stateName()->toString() << std::endl;
1062  *out << "<td>" << micro1 << "</td>";
1063  *out << "<td>" << micro2 << "</td>";
1064  *out << "<td>" << nbAccepted_.value_ << "/" << nbProcessed_.value_
1065  << " (" << float(nbAccepted_.value_)/float(nbProcessed_.value_)*100. <<"%)" << "</td>";
1066  *out << "<td>" << lsid_ << "/" << lsidTimedOutAsString_ << "</td>";
1067  *out << "<td>" << psid_ << "</td>";
1068 
1069 
1070  }
1071 
1073  {
1074  // lumisection summary table
1075  *out << " <table border=1 bgcolor=\"#CFCFCF\">" << std::endl;
1076  *out << " <tr>" << std::endl;
1077  *out << " <td> LS </td>";
1078  if(rollingLsWrap_)
1079  {
1080  for(unsigned int i = rollingLsIndex_; i < lumiSectionsCtr_.size(); i++)
1081  *out << "<td " << (lumiSectionsTo_[i] ? "bgcolor=\"red\"" : "")
1082  << ">" << lumiSectionsCtr_[i].ls << "</td>" << std::endl;
1083  for(unsigned int i = 0; i < rollingLsIndex_; i++)
1084  *out << "<td " << (lumiSectionsTo_[i] ? "bgcolor=\"red\"" : "")
1085  << ">" << lumiSectionsCtr_[i].ls << "</td>" << std::endl;
1086  }
1087  else
1088  for(unsigned int i = rollingLsIndex_; i < lumiSectionsCtr_.size(); i++)
1089  *out << "<td " << (lumiSectionsTo_[i] ? "bgcolor=\"red\"" : "")
1090  << ">" << lumiSectionsCtr_[i].ls << "</td>" << std::endl;
1091 
1092  *out << " </tr>" << std::endl;
1093  *out << " <tr>" << std::endl;
1094  *out << " <td> Ev </td>";
1095  if(rollingLsWrap_)
1096  {
1097  for(unsigned int i = rollingLsIndex_; i < lumiSectionsCtr_.size(); i++)
1098  *out << "<td>" << lumiSectionsCtr_[i].proc << "</td>" << std::endl;
1099  for(unsigned int i = 0; i < rollingLsIndex_; i++)
1100  *out << "<td>" << lumiSectionsCtr_[i].proc << "</td>" << std::endl;
1101  }
1102  else
1103  for(unsigned int i = rollingLsIndex_; i < lumiSectionsCtr_.size(); i++)
1104  *out << "<td>" << lumiSectionsCtr_[i].proc << "</td>" << std::endl;
1105  *out << " </tr>" << std::endl;
1106  *out << " <tr>" << std::endl;
1107  *out << " <td> Acc </td>";
1108  if(rollingLsWrap_)
1109  {
1110  for(unsigned int i = rollingLsIndex_; i < lumiSectionsCtr_.size(); i++)
1111  *out << "<td>" << lumiSectionsCtr_[i].acc << "</td>" << std::endl;
1112  for(unsigned int i = 0; i < rollingLsIndex_; i++)
1113  *out << "<td>" << lumiSectionsCtr_[i].acc << "</td>" << std::endl;
1114  }
1115  else
1116  for(unsigned int i = rollingLsIndex_; i < lumiSectionsCtr_.size(); i++)
1117  *out << "<td>" << lumiSectionsCtr_[i].acc << "</td>" << std::endl;
1118  *out << " </tr>" << std::endl;
1119  *out << "</table>" << std::endl;
1120  }
1121 
1122 
1124  {
1126  }
1128  {
1131  rollingLsIndex_--;
1132  xdata::UnsignedInteger32* lsp = 0;
1133  xdata::UnsignedInteger32* psp = 0;
1135  lsTriplet lst;
1136  lst.ls = tr->lumiSection;
1137  lsid_ = tr->lumiSection;
1138  lst.proc = tr->eventSummary.totalEvents;
1140  xdata::Serializable *psid = 0;
1141  xdata::Serializable *lsid = 0;
1142  xdata::Serializable *nbs = 0;
1143  xdata::Serializable *nbsr = 0;
1144  try{
1145  lsid =applicationInfoSpace_->find("lumiSectionIndex");
1146  if(lsid!=0){
1147  lsp = ((xdata::UnsignedInteger32*)lsid);
1148  lsp->value_= tr->lumiSection;
1149  }
1150  psid = applicationInfoSpace_->find("lastLumiPrescaleIndex");
1151  if(psid!=0) {
1152  psp = ((xdata::UnsignedInteger32*)psid);
1153  if(tr->eventSummary.totalEvents != 0)
1154  psp->value_ = tr->prescaleIndex;
1155  }
1156  nbs = applicationInfoSpace_->find("nbSubProcesses");
1157  nbsr = applicationInfoSpace_->find("nbSubProcessesReporting");
1158  }
1160  }
1161 
1162  xdata::Table::iterator it = scalersComplete_.begin();
1163  if(lsp)
1164  it->setField("lsid", *lsp);
1165  if(psp)
1166  it->setField("psid", *psp);
1167  if(nbs)
1168  it->setField("exprep", *nbs);
1169  else
1170  std::cout << "nbSubProcesses item not found !!!" << std::endl;
1171  if(nbsr)
1172  it->setField("effrep", *nbsr);
1173  else
1174  std::cout << "nbSubProcessesReporting item not found !!!" << std::endl;
1175 
1176  it->setField("proc",trh_.getProcThisLumi());
1177  it->setField("acc",trh_.getAccThisLumi());
1178  it->setField("triggerReport",trh_.getTableWithNames());
1180 
1181  }
1182 
1183 
1185  {
1186  toolbox::net::URL url(rcms_->getContextDescriptor()->getURL());
1187  toolbox::net::URL at(xappDesc_->getContextDescriptor()->getURL() + "/" + xappDesc_->getURN());
1188  toolbox::net::URL properurl(url.getProtocol(),url.getHost(),url.getPort(),"");
1189  xdaq::ContextDescriptor *ctxdsc = new xdaq::ContextDescriptor(properurl.toString());
1190  xdaq::ApplicationDescriptor *appdesc = new xdaq::ApplicationDescriptorImpl(ctxdsc,rcms_->getClassName(),rcms_->getLocalId(), "pippo");
1191 
1192  appdesc->setAttribute("path","/rcms/servlet/monitorreceiver");
1193 
1194  xoap::MessageReference msg = xoap::createMessage();
1195  xoap::SOAPEnvelope envelope = msg->getSOAPPart().getEnvelope();
1196  xoap::SOAPName responseName = envelope.createName( "report", xmas::NamespacePrefix, xmas::NamespaceUri);
1197  (void) envelope.getBody().addBodyElement ( responseName );
1198  xoap::SOAPName reportName ("report", xmas::NamespacePrefix, xmas::NamespaceUri);
1199  xoap::SOAPElement reportElement = envelope.getBody().getChildElements(reportName)[0];
1200  reportElement.addNamespaceDeclaration (xmas::sensor::NamespacePrefix, xmas::sensor::NamespaceUri);
1201  xoap::SOAPName sampleName = envelope.createName( "sample", xmas::NamespacePrefix, xmas::NamespaceUri);
1202  xoap::SOAPElement sampleElement = reportElement.addChildElement(sampleName);
1203  xoap::SOAPName flashListName = envelope.createName( "flashlist", "", "");
1204  sampleElement.addAttribute(flashListName,"urn:xdaq-flashlist:scalers");
1205  xoap::SOAPName tagName = envelope.createName( "tag", "", "");
1206  sampleElement.addAttribute(tagName,"tag");
1207  xoap::MimeHeaders* headers = msg->getMimeHeaders();
1208  headers->removeHeader("x-xdaq-tags");
1209  headers->addHeader("x-xdaq-tags", "tag");
1210  tagName = envelope.createName( "originator", "", "");
1211  sampleElement.addAttribute(tagName,at.toString());
1212 
1213  xdata::exdr::AutoSizeOutputStreamBuffer outBuffer;
1214  xdata::exdr::Serializer serializer;
1215  try
1216  {
1217  serializer.exportAll( &scalersComplete_, &outBuffer );
1218  }
1220  {
1221  LOG4CPLUS_WARN(log_,
1222  "Exception in serialization of scalers table");
1223  // localLog("-W- Exception in serialization of scalers table");
1224  throw;
1225  }
1226 
1227  xoap::AttachmentPart * attachment = msg->createAttachmentPart(outBuffer.getBuffer(), outBuffer.tellp(), "application/x-xdata+exdr");
1228  attachment->setContentEncoding("binary");
1229  tagName = envelope.createName( "tag", "", "");
1230  sampleElement.addAttribute(tagName,"tag");
1231  std::stringstream contentId;
1232 
1233  contentId << "<" << "urn:xdaq-flashlist:scalers" << "@" << at.getHost() << ">";
1234  attachment->setContentId(contentId.str());
1235  std::stringstream contentLocation;
1236  contentId << at.toString();
1237  attachment->setContentLocation(contentLocation.str());
1238 
1239  std::stringstream disposition;
1240  disposition << "attachment; filename=" << "urn:xdaq-flashlist:scalers" << ".exdr; creation-date=" << "\"" << "dummy" << "\"";
1241  attachment->addMimeHeader("Content-Disposition",disposition.str());
1242  msg->addAttachmentPart(attachment);
1243 
1244  try{
1245  xappCtxt_->postSOAP(msg,*(xappDesc_),*appdesc);
1246  }
1247  catch(xdaq::exception::Exception &ex)
1248  {
1249  std::string message = "exception when posting SOAP message to MonitorReceiver";
1250  message += ex.what();
1251  LOG4CPLUS_WARN(log_,message.c_str());
1252  std::string lmessage = "-W- "+message;
1253  delete appdesc;
1254  delete ctxdsc;
1255  throw;
1256  // localLog(lmessage);
1257  }
1258  delete appdesc;
1259  delete ctxdsc;
1260  }
1261 }
xdata::InfoSpace * monitorLegendaInfoSpace_
Definition: FWEPWrapper.h:163
xdata::String macro_state_legend_
Definition: FWEPWrapper.h:195
void summaryWebPage(xgi::Input *, xgi::Output *, const std::string &)
Definition: FWEPWrapper.cc:723
std::vector< PathSummary > endPathSummaries
Definition: TriggerReport.h:65
int i
Definition: DBlmapReader.cc:9
unsigned int getfailed(unsigned int ind)
FWEPWrapper(log4cplus::Logger &, unsigned int instance)
Definition: FWEPWrapper.cc:51
std::vector< bool > lumiSectionsTo_
Definition: FWEPWrapper.h:222
#define Input(cl)
Definition: vmac.h:189
event_processor::State getState() const
xdata::String epMState_
Definition: FWEPWrapper.h:178
double getAve(std::string const &name) const
void setIndex(unsigned int lvl1Index)
void updateRollingReport()
TriggerReportStatic * getPackedTriggerReportAsStruct()
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2296
static ServiceToken createSet(std::vector< ParameterSet > &)
void serviceWeb(xgi::Input *in, xgi::Output *out)
bool checkWeb(const std::string &)
xdata::Integer epmAltState_
Definition: FWEPWrapper.h:191
void moduleWeb(xgi::Input *in, xgi::Output *out)
Definition: FWEPWrapper.cc:978
std::string findLabelOfModuleTypeInEndPath(edm::TriggerReport &, std::vector< edm::ModuleDescription const * > &, unsigned int, std::string)
void startMonitoringWorkLoop()
Definition: FWEPWrapper.cc:531
TrainProcessor *const proc
Definition: MVATrainer.cc:101
virtual std::string explainSelf() const
Definition: Exception.cc:56
void taskWebPage(xgi::Input *, xgi::Output *, const std::string &)
Definition: FWEPWrapper.cc:789
struct timeval monStartTime_
Definition: FWEPWrapper.h:175
unsigned int acc
Definition: FWEPWrapper.h:42
void createAndSendScalersMessage()
std::string configString_
Definition: FWEPWrapper.h:145
void init(unsigned short, std::string &)
Definition: FWEPWrapper.cc:185
xdata::InfoSpace * scalersInfoSpace_
Definition: FWEPWrapper.h:207
xdata::UnsignedInteger32 localLsIncludingTimeOuts_
Definition: FWEPWrapper.h:209
xdaq::ApplicationContext * xappCtxt_
Definition: FWEPWrapper.h:228
xdata::UnsignedInteger32 lastLumiPrescaleIndex_
Definition: FWEPWrapper.h:215
xdata::Boolean lsToBeRecovered_
Definition: FWEPWrapper.h:217
double getFirst(std::string const &name) const
xdata::UnsignedInteger32 & getProcThisLumi()
void sleep(Duration_t)
Definition: Utils.h:163
xdata::InfoSpace * scalersLegendaInfoSpace_
Definition: FWEPWrapper.h:208
std::vector< std::string > mapmod_
Definition: FWEPWrapper.h:170
StatusCode waitTillDoneAsync(unsigned int timeout_seconds=0)
void makeServicesOnly()
Definition: FWEPWrapper.cc:431
toolbox::task::WorkLoop * wlMonitoring_
Definition: FWEPWrapper.h:184
void openBackDoor(const std::string &, unsigned int timeout_sec=0)
static const std::string unknown
Definition: FWEPWrapper.h:139
bool checkLumiSection(unsigned int ls)
int notstarted_state_code_
Definition: FWEPWrapper.h:235
unsigned int getexcept(unsigned int ind)
std::list< std::string > namesScalersLegenda_
Definition: FWEPWrapper.h:202
bool fireScalersUpdate()
Definition: FWEPWrapper.cc:694
xdata::Boolean lsTimedOut_
Definition: FWEPWrapper.h:216
std::vector< PathSummary > trigPathSummaries
Definition: TriggerReport.h:64
static const unsigned int lsRollSize_
Definition: FWEPWrapper.h:225
unsigned int lsid_
Definition: FWEPWrapper.h:204
void publish(xdata::InfoSpace *)
void lumiSumTable(xgi::Output *out)
std::vector< std::string > statmod_
Definition: FWEPWrapper.h:171
edm::ServiceToken serviceToken_
Definition: FWEPWrapper.h:142
xdata::String epmState_
Definition: FWEPWrapper.h:179
unsigned int proc
Definition: FWEPWrapper.h:41
bool monitoring(toolbox::task::WorkLoop *wl)
Definition: FWEPWrapper.cc:564
unsigned int psid_
Definition: FWEPWrapper.h:205
void reconfigure(ParameterSet const &ps)
bool isAvailable() const
Definition: Service.h:47
std::string getPathTableAsString() const
bool hasPrescaleService_
Definition: FWEPWrapper.h:154
xdata::UnsignedInteger32 & getAccThisLumi()
int j
Definition: DBlmapReader.cc:9
std::list< std::string > namesStatusLegenda_
Definition: FWEPWrapper.h:201
void publish(xdata::InfoSpace *)
double getMax(std::string const &name) const
xdata::Table scalersComplete_
Definition: FWEPWrapper.h:211
xdata::String micro_state_legend_
Definition: FWEPWrapper.h:196
std::list< std::string > names_
Definition: FWEPWrapper.h:200
unsigned int getl1pre(unsigned int ind)
xdata::InfoSpace * monitorInfoSpace_
Definition: FWEPWrapper.h:162
int totalEvents() const
std::map< std::string, int > modmap_
Definition: FWEPWrapper.h:169
char const * stateName(event_processor::State s) const
char const * currentStateName() const
tuple out
Definition: dbtoconf.py:99
unsigned int allPastLumiProcessed_
Definition: FWEPWrapper.h:199
std::vector< edm::ModuleDescription const * > descs_
Definition: FWEPWrapper.h:168
unsigned int getaccept(unsigned int ind)
xdata::UnsignedInteger32 lumiSectionIndex_
Definition: FWEPWrapper.h:213
Log< T >::type log(const T &t)
Definition: Log.h:22
edm::EventProcessor::StatusCode stop()
Definition: FWEPWrapper.cc:438
edm::FUShmOutputModule * get(std::string &name)
xdata::UnsignedInteger32 nbProcessed_
Definition: FWEPWrapper.h:180
boost::shared_ptr< edm::ProcessDesc > processDesc()
void formatReportTable(edm::TriggerReport &, std::vector< edm::ModuleDescription const * > &, std::string &pathIndexTable, bool noNukeLegenda)
bool getTriggerReport(bool useLock)
Definition: FWEPWrapper.cc:611
void closeBackDoor(const std::string &)
log4cplus::Logger log_
Definition: FWEPWrapper.h:152
string message
Definition: argparse.py:126
ServiceToken getToken()
pthread_mutex_t ep_guard_lock_
Definition: FWEPWrapper.h:234
edm::service::PrescaleService * prescaleSvc_
Definition: FWEPWrapper.h:148
xdata::UnsignedInteger32 instance_
Definition: FWEPWrapper.h:231
xdata::UnsignedInteger32 monSleepSec_
Definition: FWEPWrapper.h:174
void publishConfigAndMonitorItemsSP()
Definition: FWEPWrapper.cc:175
unsigned int scalersUpdateCounter_
Definition: FWEPWrapper.h:220
#define Output(cl)
Definition: vmac.h:193
toolbox::task::ActionSignature * asMonitoring_
Definition: FWEPWrapper.h:185
unsigned int ls
Definition: FWEPWrapper.h:40
xdata::UnsignedInteger32 prescaleSetIndex_
Definition: FWEPWrapper.h:214
unsigned int rollingLsIndex_
Definition: FWEPWrapper.h:223
std::vector< lsTriplet > lumiSectionsCtr_
Definition: FWEPWrapper.h:221
fuep::TriggerReportHelpers trh_
Definition: FWEPWrapper.h:151
edm::EventProcessor * evtProcessor_
Definition: FWEPWrapper.h:140
xdata::Integer epMAltState_
Definition: FWEPWrapper.h:190
tuple cout
Definition: gather_cfg.py:41
edm::EventSummary eventSummary
std::string lsidTimedOutAsString_
Definition: FWEPWrapper.h:203
bool hasServiceWebRegistry_
Definition: FWEPWrapper.h:156
void packTriggerReport(edm::TriggerReport &, ShmOutputModuleRegistry *)
void microState(xgi::Input *in, xgi::Output *out)
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
void sumAndPackTriggerReport(MsgBuf &buf)
std::string pathTable_
Definition: FWEPWrapper.h:230
xdaq::ApplicationDescriptor * rcms_
Definition: FWEPWrapper.h:226
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
bool hasModuleWebRegistry_
Definition: FWEPWrapper.h:155
unsigned int scalersUpdateAttempted_
Definition: FWEPWrapper.h:219
int totalEventsPassed() const
xdata::InfoSpace * applicationInfoSpace_
Definition: FWEPWrapper.h:159
xdata::UnsignedInteger32 lsTimeOut_
Definition: FWEPWrapper.h:210
virtual ~FWEPWrapper()
Definition: FWEPWrapper.cc:104
void publishConfigAndMonitorItems(bool)
Definition: FWEPWrapper.cc:106
std::string configuration_
Definition: FWEPWrapper.h:229
bool wlMonitoringActive_
Definition: FWEPWrapper.h:186
void triggerReportUpdate(edm::TriggerReport &, unsigned int, unsigned int, bool=true)
xdaq::ApplicationDescriptor * xappDesc_
Definition: FWEPWrapper.h:227
xdata::UnsignedInteger32 timeoutOnStop_
Definition: FWEPWrapper.h:166
list at
Definition: asciidump.py:428
void publishToXmas(xdata::InfoSpace *)
xdata::UnsignedInteger32 nbAccepted_
Definition: FWEPWrapper.h:181
const std::string * moduleLabel() const
Definition: HLTadd.h:40
void getTriggerReport(TriggerReport &rep) const
unsigned int getPrescale(unsigned int lvl1Index, std::string const &prescaledPath)