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