CMS 3D CMS Logo

evf::Stepper Class Reference

#include <EventFilter/Utilities/interface/Stepper.h>

Inheritance diagram for evf::Stepper:

evf::ServiceWeb

List of all members.

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_


Detailed Description

Definition at line 20 of file Stepper.h.


Constructor & Destructor Documentation

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().

00021                                              : ServiceWeb("Stepper"), rid_(0), eid_(0), step_(false)
00022   {
00023   
00024     reg.watchPostBeginJob(this,&Stepper::postBeginJob);
00025     reg.watchPostEndJob(this,&Stepper::postEndJob);
00026   
00027     reg.watchPreProcessEvent(this,&Stepper::preEventProcessing);
00028     reg.watchPostProcessEvent(this,&Stepper::postEventProcessing);
00029     reg.watchPreSource(this,&Stepper::preSource);
00030     reg.watchPostSource(this,&Stepper::postSource);
00031   
00032     reg.watchPreModule(this,&Stepper::preModule);
00033     reg.watchPostModule(this,&Stepper::postModule);
00034     epstate_ = "BJ";
00035     modulename_ = "NOT YET";
00036     modulelabel_ = "INIT";
00037     pthread_mutex_init(&mutex_,0);
00038     pthread_cond_init(&cond_,0);
00039   }

evf::Stepper::~Stepper (  ) 

Definition at line 42 of file Stepper.cc.

00043   {
00044   }


Member Function Documentation

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_, e, eid_, lat::endl(), epstate_, exception, iggi_31X_cfg::input, modulelabel_, modulename_, mutex_, original_referrer_, path(), rid_, and evf::ServiceWeb::serviceName_.

00096   {
00097 
00098     std::string path;
00099     std::string urn;
00100     std::string mname;
00101     try 
00102       {
00103         cgicc::Cgicc cgi(in);
00104         if ( xgi::Utils::hasFormElement(cgi,"service") )
00105           mname = xgi::Utils::getFormElement(cgi, "service")->getValue();
00106         if ( xgi::Utils::hasFormElement(cgi,"step") )
00107           {
00108             pthread_mutex_lock(&mutex_);
00109             
00110             pthread_cond_signal(&cond_);
00111             
00112             pthread_mutex_unlock(&mutex_);
00113           }
00114         cgicc::CgiEnvironment cgie(in);
00115         if(original_referrer_ == "")
00116           original_referrer_ = cgie.getReferrer();
00117         path = cgie.getPathInfo() + "?" + cgie.getQueryString();
00118         
00119       }
00120       catch (const std::exception & e) 
00121         {
00122           // don't care if it did not work
00123         }
00124       
00125       
00126       using std::endl;
00127       *out << "<html>"                                                   << endl;
00128       *out << "<head>"                                                   << endl;
00129 
00130 
00131       *out << "<STYLE type=\"text/css\"> #T1 {border-width: 2px; border: solid blue; text-align: center} </STYLE> "                                      << endl; 
00132       *out << "<link type=\"text/css\" rel=\"stylesheet\"";
00133       *out << " href=\"/" <<  urn
00134            << "/styles.css\"/>"                   << endl;
00135 
00136       *out << "<title>" << serviceName_
00137            << " MAIN</title>"                                            << endl;
00138 
00139       *out << "</head>"                                                  << endl;
00140       *out << "<body onload=\"loadXMLDoc()\">"                           << endl;
00141       *out << "<table border=\"0\" width=\"100%\">"                      << endl;
00142       *out << "<tr>"                                                     << endl;
00143       *out << "  <td align=\"left\">"                                    << endl;
00144       *out << "    <img"                                                 << endl;
00145       *out << "     align=\"middle\""                                    << endl;
00146       *out << "     src=\"/evf/images/stepper.jpg\""                     << endl;
00147       *out << "     alt=\"main\""                                        << endl;
00148       *out << "     width=\"90\""                                        << endl;
00149       *out << "     height=\"64\""                                       << endl;
00150       *out << "     border=\"\"/>"                                       << endl;
00151       *out << "    <b>"                                                  << endl;
00152       *out <<             serviceName_                                   << endl;
00153       *out << "    </b>"                                                 << endl;
00154       *out << "  </td>"                                                  << endl;
00155       *out << "  <td width=\"32\">"                                      << endl;
00156       *out << "    <a href=\"/urn:xdaq-application:lid=3\">"             << endl;
00157       *out << "      <img"                                               << endl;
00158       *out << "       align=\"middle\""                                  << endl;
00159       *out << "       src=\"/hyperdaq/images/HyperDAQ.jpg\""             << endl;
00160       *out << "       alt=\"HyperDAQ\""                                  << endl;
00161       *out << "       width=\"32\""                                      << endl;
00162       *out << "       height=\"32\""                                     << endl;
00163       *out << "       border=\"\"/>"                                     << endl;
00164       *out << "    </a>"                                                 << endl;
00165       *out << "  </td>"                                                  << endl;
00166       *out << "  <td width=\"32\">"                                      << endl;
00167       *out << "  </td>"                                                  << endl;
00168       *out << "  <td width=\"32\">"                                      << endl;
00169       *out << "    <a href=\"" << original_referrer_  << "\">"           << endl;
00170       *out << "      <img"                                               << endl;
00171       *out << "       align=\"middle\""                                  << endl;
00172       *out << "       src=\"/evf/images/epicon.jpg\""                    << endl;
00173       *out << "       alt=\"main\""                                      << endl;
00174       *out << "       width=\"32\""                                      << endl;
00175       *out << "       height=\"32\""                                     << endl;
00176       *out << "       border=\"\"/>"                                     << endl;
00177       *out << "    </a>"                                                 << endl;
00178       *out << "  </td>"                                                  << endl;
00179       *out << "</tr>"                                                    << endl;
00180       *out << "</table>"                                                 << endl;
00181 
00182       *out << "<hr/>"                                                    << endl;
00183       
00184       *out << "run number        " << rid_ << "<br>" << endl;
00185       *out << "event number      " << eid_ << "<br>" << endl;
00186 
00187       *out << "event processor   " << epstate_ << "<br>" << endl;
00188 
00189       *out << "next module type  " << modulename_ << "<br>" << endl;
00190       *out << "next module label " << modulelabel_ << "<br>" << endl;
00191 
00192       *out << "<hr/>"                                                    << endl;
00193   
00194       *out << cgicc::form().set("method","GET").set("action", path ) 
00195            << std::endl;
00196       *out << cgicc::input().set("type","hidden").set("name","service").set("value", mname) 
00197            << std::endl;
00198       *out << cgicc::input().set("type","hidden").set("name","step").set("value", "yes") 
00199            << std::endl;
00200       *out << cgicc::input().set("type","submit").set("value","Step")      << std::endl;
00201       *out << cgicc::form()                                                << std::endl;  
00202 
00203       *out << "</body>"                                                  << endl;
00204       *out << "</html>"                                                  << endl;
00205   }

void evf::Stepper::postBeginJob (  ) 

Definition at line 46 of file Stepper.cc.

References epstate_.

Referenced by Stepper().

00047   {
00048     //    wait_on_signal();
00049     epstate_ = "BJD";
00050   }

void evf::Stepper::postEndJob (  ) 

Definition at line 52 of file Stepper.cc.

References epstate_, modulelabel_, and wait_on_signal().

Referenced by Stepper().

00053   {
00054     wait_on_signal();
00055     epstate_ = "EJ";
00056     modulelabel_ = "done";
00057   }

void evf::Stepper::postEventProcessing ( const edm::Event e,
const edm::EventSetup  
)

Definition at line 68 of file Stepper.cc.

Referenced by Stepper().

00069   {
00070   }

void evf::Stepper::postModule ( const edm::ModuleDescription desc  ) 

Definition at line 91 of file Stepper.cc.

Referenced by Stepper().

00092   {
00093   }

void evf::Stepper::postSource (  ) 

Definition at line 78 of file Stepper.cc.

References modulelabel_, and wait_on_signal().

Referenced by Stepper().

00079   {
00080     wait_on_signal();
00081     modulelabel_ = "IND";
00082   }

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().

00061   {
00062     rid_ = iID.run();
00063     eid_ = iID.event();
00064     wait_on_signal();
00065     epstate_ = "PRO";
00066   }

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().

00085   {
00086     wait_on_signal();
00087     modulename_ = desc.moduleName_;
00088     modulelabel_ = desc.moduleLabel_;
00089   }

void evf::Stepper::preSource (  ) 

Definition at line 71 of file Stepper.cc.

References modulelabel_, modulename_, and wait_on_signal().

Referenced by Stepper().

00072   {
00073     wait_on_signal();
00074     modulename_ = "source";
00075     modulelabel_ = "IN";
00076   }

void evf::Stepper::publish ( xdata::InfoSpace *   )  [inline, virtual]

Implements evf::ServiceWeb.

Definition at line 39 of file Stepper.h.

00039 {}

void evf::Stepper::wait_on_signal (  )  [inline, private]

Definition at line 43 of file Stepper.h.

References cond_, and mutex_.

Referenced by postEndJob(), postSource(), preEventProcessing(), preModule(), and preSource().

00044         {
00045           pthread_mutex_lock(&mutex_);
00046           pthread_cond_wait(&cond_,&mutex_);
00047           pthread_mutex_unlock(&mutex_);
00048         }


Member Data Documentation

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]

Definition at line 57 of file Stepper.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:46:50 2009 for CMSSW by  doxygen 1.5.4