#include <Stepper.h>
Public Member Functions | |
void | defaultWebPage (xgi::Input *in, xgi::Output *out) |
void | postBeginJob () |
void | postEndJob () |
void | postEventProcessing (const edm::Event &, const edm::EventSetup &) |
void | postModule (const edm::ModuleDescription &) |
void | postSource () |
void | preEventProcessing (const edm::EventID &, const edm::Timestamp &) |
void | preModule (const edm::ModuleDescription &) |
void | preSource () |
void | publish (xdata::InfoSpace *) |
Stepper (const edm::ParameterSet &, edm::ActivityRegistry &) | |
~Stepper () | |
Private Member Functions | |
void | wait_on_signal () |
Private Attributes | |
pthread_cond_t | cond_ |
unsigned int | eid_ |
std::string | epstate_ |
std::string | modulelabel_ |
std::string | modulename_ |
pthread_mutex_t | mutex_ |
std::string | original_referrer_ |
unsigned int | rid_ |
bool | step_ |
evf::Stepper::Stepper | ( | const edm::ParameterSet & | iPS, |
edm::ActivityRegistry & | reg | ||
) |
Definition at line 20 of file Stepper.cc.
References cond_, epstate_, modulelabel_, modulename_, mutex_, postBeginJob(), postEndJob(), postEventProcessing(), postModule(), postSource(), preEventProcessing(), preModule(), preSource(), edm::ActivityRegistry::watchPostBeginJob(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostModule(), edm::ActivityRegistry::watchPostProcessEvent(), edm::ActivityRegistry::watchPostSource(), edm::ActivityRegistry::watchPreModule(), edm::ActivityRegistry::watchPreProcessEvent(), and edm::ActivityRegistry::watchPreSource().
: ServiceWeb("Stepper"), rid_(0), eid_(0), step_(false) { reg.watchPostBeginJob(this,&Stepper::postBeginJob); reg.watchPostEndJob(this,&Stepper::postEndJob); reg.watchPreProcessEvent(this,&Stepper::preEventProcessing); reg.watchPostProcessEvent(this,&Stepper::postEventProcessing); reg.watchPreSource(this,&Stepper::preSource); reg.watchPostSource(this,&Stepper::postSource); reg.watchPreModule(this,&Stepper::preModule); reg.watchPostModule(this,&Stepper::postModule); epstate_ = "BJ"; modulename_ = "NOT YET"; modulelabel_ = "INIT"; pthread_mutex_init(&mutex_,0); pthread_cond_init(&cond_,0); }
evf::Stepper::~Stepper | ( | ) |
Definition at line 42 of file Stepper.cc.
{ }
void evf::Stepper::defaultWebPage | ( | xgi::Input * | in, |
xgi::Output * | out | ||
) | [virtual] |
Reimplemented from evf::ServiceWeb.
Definition at line 95 of file Stepper.cc.
References cond_, alignCSCRings::e, eid_, epstate_, exception, LaserDQM_cfg::input, modulelabel_, modulename_, mutex_, original_referrer_, getHLTPrescaleColumns::path, rid_, and evf::ServiceWeb::serviceName_.
{ std::string path; std::string urn; std::string mname; try { cgicc::Cgicc cgi(in); if ( xgi::Utils::hasFormElement(cgi,"service") ) mname = xgi::Utils::getFormElement(cgi, "service")->getValue(); if ( xgi::Utils::hasFormElement(cgi,"step") ) { pthread_mutex_lock(&mutex_); pthread_cond_signal(&cond_); pthread_mutex_unlock(&mutex_); } cgicc::CgiEnvironment cgie(in); if(original_referrer_ == "") original_referrer_ = cgie.getReferrer(); path = cgie.getPathInfo() + "?" + cgie.getQueryString(); } catch (const std::exception & e) { // don't care if it did not work } using std::endl; *out << "<html>" << endl; *out << "<head>" << endl; *out << "<STYLE type=\"text/css\"> #T1 {border-width: 2px; border: solid blue; text-align: center} </STYLE> " << endl; *out << "<link type=\"text/css\" rel=\"stylesheet\""; *out << " href=\"/" << urn << "/styles.css\"/>" << endl; *out << "<title>" << serviceName_ << " MAIN</title>" << endl; *out << "</head>" << endl; *out << "<body onload=\"loadXMLDoc()\">" << endl; *out << "<table border=\"0\" width=\"100%\">" << endl; *out << "<tr>" << endl; *out << " <td align=\"left\">" << endl; *out << " <img" << endl; *out << " align=\"middle\"" << endl; *out << " src=\"/evf/images/stepper.jpg\"" << endl; *out << " alt=\"main\"" << endl; *out << " width=\"90\"" << endl; *out << " height=\"64\"" << endl; *out << " border=\"\"/>" << endl; *out << " <b>" << endl; *out << serviceName_ << endl; *out << " </b>" << endl; *out << " </td>" << endl; *out << " <td width=\"32\">" << endl; *out << " <a href=\"/urn:xdaq-application:lid=3\">" << endl; *out << " <img" << endl; *out << " align=\"middle\"" << endl; *out << " src=\"/hyperdaq/images/HyperDAQ.jpg\"" << endl; *out << " alt=\"HyperDAQ\"" << endl; *out << " width=\"32\"" << endl; *out << " height=\"32\"" << endl; *out << " border=\"\"/>" << endl; *out << " </a>" << endl; *out << " </td>" << endl; *out << " <td width=\"32\">" << endl; *out << " </td>" << endl; *out << " <td width=\"32\">" << endl; *out << " <a href=\"" << original_referrer_ << "\">" << endl; *out << " <img" << endl; *out << " align=\"middle\"" << endl; *out << " src=\"/evf/images/epicon.jpg\"" << endl; *out << " alt=\"main\"" << endl; *out << " width=\"32\"" << endl; *out << " height=\"32\"" << endl; *out << " border=\"\"/>" << endl; *out << " </a>" << endl; *out << " </td>" << endl; *out << "</tr>" << endl; *out << "</table>" << endl; *out << "<hr/>" << endl; *out << "run number " << rid_ << "<br>" << endl; *out << "event number " << eid_ << "<br>" << endl; *out << "event processor " << epstate_ << "<br>" << endl; *out << "next module type " << modulename_ << "<br>" << endl; *out << "next module label " << modulelabel_ << "<br>" << endl; *out << "<hr/>" << endl; *out << cgicc::form().set("method","GET").set("action", path ) << std::endl; *out << cgicc::input().set("type","hidden").set("name","service").set("value", mname) << std::endl; *out << cgicc::input().set("type","hidden").set("name","step").set("value", "yes") << std::endl; *out << cgicc::input().set("type","submit").set("value","Step") << std::endl; *out << cgicc::form() << std::endl; *out << "</body>" << endl; *out << "</html>" << endl; }
void evf::Stepper::postBeginJob | ( | ) |
Definition at line 46 of file Stepper.cc.
References epstate_.
Referenced by Stepper().
{ // wait_on_signal(); epstate_ = "BJD"; }
void evf::Stepper::postEndJob | ( | ) |
Definition at line 52 of file Stepper.cc.
References epstate_, modulelabel_, and wait_on_signal().
Referenced by Stepper().
{ wait_on_signal(); epstate_ = "EJ"; modulelabel_ = "done"; }
void evf::Stepper::postEventProcessing | ( | const edm::Event & | e, |
const edm::EventSetup & | |||
) |
void evf::Stepper::postModule | ( | const edm::ModuleDescription & | desc | ) |
void evf::Stepper::postSource | ( | ) |
Definition at line 78 of file Stepper.cc.
References modulelabel_, and wait_on_signal().
Referenced by Stepper().
{ wait_on_signal(); modulelabel_ = "IND"; }
void evf::Stepper::preEventProcessing | ( | const edm::EventID & | iID, |
const edm::Timestamp & | iTime | ||
) |
Definition at line 59 of file Stepper.cc.
References eid_, epstate_, edm::EventID::event(), rid_, edm::EventID::run(), and wait_on_signal().
Referenced by Stepper().
void evf::Stepper::preModule | ( | const edm::ModuleDescription & | desc | ) |
Definition at line 84 of file Stepper.cc.
References edm::ModuleDescription::moduleLabel(), modulelabel_, edm::ModuleDescription::moduleName(), modulename_, and wait_on_signal().
Referenced by Stepper().
{ wait_on_signal(); modulename_ = desc.moduleName(); modulelabel_ = desc.moduleLabel(); }
void evf::Stepper::preSource | ( | ) |
Definition at line 71 of file Stepper.cc.
References modulelabel_, modulename_, and wait_on_signal().
Referenced by Stepper().
{ wait_on_signal(); modulename_ = "source"; modulelabel_ = "IN"; }
void evf::Stepper::publish | ( | xdata::InfoSpace * | ) | [inline, virtual] |
void evf::Stepper::wait_on_signal | ( | ) | [inline, private] |
Definition at line 43 of file Stepper.h.
Referenced by postEndJob(), postSource(), preEventProcessing(), preModule(), and preSource().
pthread_cond_t evf::Stepper::cond_ [private] |
Definition at line 56 of file Stepper.h.
Referenced by defaultWebPage(), Stepper(), and wait_on_signal().
unsigned int evf::Stepper::eid_ [private] |
Definition at line 53 of file Stepper.h.
Referenced by defaultWebPage(), and preEventProcessing().
std::string evf::Stepper::epstate_ [private] |
Definition at line 49 of file Stepper.h.
Referenced by defaultWebPage(), postBeginJob(), postEndJob(), preEventProcessing(), and Stepper().
std::string evf::Stepper::modulelabel_ [private] |
Definition at line 50 of file Stepper.h.
Referenced by defaultWebPage(), postEndJob(), postSource(), preModule(), preSource(), and Stepper().
std::string evf::Stepper::modulename_ [private] |
Definition at line 51 of file Stepper.h.
Referenced by defaultWebPage(), preModule(), preSource(), and Stepper().
pthread_mutex_t evf::Stepper::mutex_ [private] |
Definition at line 55 of file Stepper.h.
Referenced by defaultWebPage(), Stepper(), and wait_on_signal().
std::string evf::Stepper::original_referrer_ [private] |
Definition at line 54 of file Stepper.h.
Referenced by defaultWebPage().
unsigned int evf::Stepper::rid_ [private] |
Definition at line 52 of file Stepper.h.
Referenced by defaultWebPage(), and preEventProcessing().
bool evf::Stepper::step_ [private] |