CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
evf::Stepper Class Reference

#include <Stepper.h>

Inheritance diagram for evf::Stepper:
evf::ServiceWeb

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 ()
 
- Public Member Functions inherited from evf::ServiceWeb
std::string const & name () const
 
virtual void publishToXmas (xdata::InfoSpace *)
 
 ServiceWeb (const std::string &)
 
virtual ~ServiceWeb ()
 

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_
 

Additional Inherited Members

- Protected Attributes inherited from evf::ServiceWeb
std::string serviceName_
 

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

21  : ServiceWeb("Stepper"), rid_(0), eid_(0), step_(false)
22  {
23 
26 
31 
34  epstate_ = "BJ";
35  modulename_ = "NOT YET";
36  modulelabel_ = "INIT";
37  pthread_mutex_init(&mutex_,0);
38  pthread_cond_init(&cond_,0);
39  }
pthread_cond_t cond_
Definition: Stepper.h:56
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void watchPostModule(PostModule::slot_type const &iSlot)
bool step_
Definition: Stepper.h:57
void watchPreProcessEvent(PreProcessEvent::slot_type const &iSlot)
void preEventProcessing(const edm::EventID &, const edm::Timestamp &)
Definition: Stepper.cc:59
void postModule(const edm::ModuleDescription &)
Definition: Stepper.cc:91
void watchPreModule(PreModule::slot_type const &iSlot)
std::string epstate_
Definition: Stepper.h:49
void preSource()
Definition: Stepper.cc:71
void watchPostProcessEvent(PostProcessEvent::slot_type const &iSlot)
std::string modulename_
Definition: Stepper.h:51
void postBeginJob()
Definition: Stepper.cc:46
unsigned int eid_
Definition: Stepper.h:53
void watchPreSource(PreSource::slot_type const &iSlot)
void preModule(const edm::ModuleDescription &)
Definition: Stepper.cc:84
pthread_mutex_t mutex_
Definition: Stepper.h:55
std::string modulelabel_
Definition: Stepper.h:50
void postEndJob()
Definition: Stepper.cc:52
unsigned int rid_
Definition: Stepper.h:52
void postEventProcessing(const edm::Event &, const edm::EventSetup &)
Definition: Stepper.cc:68
void watchPostSource(PostSource::slot_type const &iSlot)
ServiceWeb(const std::string &)
Definition: ServiceWeb.cc:14
void postSource()
Definition: Stepper.cc:78
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
evf::Stepper::~Stepper ( )

Definition at line 42 of file Stepper.cc.

43  {
44  }

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_, alignCSCRings::e, eid_, epstate_, cppFunctionSkipper::exception, LaserDQM_cfg::input, modulelabel_, modulename_, mutex_, original_referrer_, scaleCards::path, rid_, and evf::ServiceWeb::serviceName_.

96  {
97 
98  std::string path;
99  std::string urn;
100  std::string mname;
101  try
102  {
103  cgicc::Cgicc cgi(in);
104  if ( xgi::Utils::hasFormElement(cgi,"service") )
105  mname = xgi::Utils::getFormElement(cgi, "service")->getValue();
106  if ( xgi::Utils::hasFormElement(cgi,"step") )
107  {
108  pthread_mutex_lock(&mutex_);
109 
110  pthread_cond_signal(&cond_);
111 
112  pthread_mutex_unlock(&mutex_);
113  }
114  cgicc::CgiEnvironment cgie(in);
115  if(original_referrer_ == "")
116  original_referrer_ = cgie.getReferrer();
117  path = cgie.getPathInfo() + "?" + cgie.getQueryString();
118 
119  }
120  catch (const std::exception & e)
121  {
122  // don't care if it did not work
123  }
124 
125 
126  using std::endl;
127  *out << "<html>" << endl;
128  *out << "<head>" << endl;
129 
130 
131  *out << "<STYLE type=\"text/css\"> #T1 {border-width: 2px; border: solid blue; text-align: center} </STYLE> " << endl;
132  *out << "<link type=\"text/css\" rel=\"stylesheet\"";
133  *out << " href=\"/" << urn
134  << "/styles.css\"/>" << endl;
135 
136  *out << "<title>" << serviceName_
137  << " MAIN</title>" << endl;
138 
139  *out << "</head>" << endl;
140  *out << "<body onload=\"loadXMLDoc()\">" << endl;
141  *out << "<table border=\"0\" width=\"100%\">" << endl;
142  *out << "<tr>" << endl;
143  *out << " <td align=\"left\">" << endl;
144  *out << " <img" << endl;
145  *out << " align=\"middle\"" << endl;
146  *out << " src=\"/evf/images/stepper.jpg\"" << endl;
147  *out << " alt=\"main\"" << endl;
148  *out << " width=\"90\"" << endl;
149  *out << " height=\"64\"" << endl;
150  *out << " border=\"\"/>" << endl;
151  *out << " <b>" << endl;
152  *out << serviceName_ << endl;
153  *out << " </b>" << endl;
154  *out << " </td>" << endl;
155  *out << " <td width=\"32\">" << endl;
156  *out << " <a href=\"/urn:xdaq-application:lid=3\">" << endl;
157  *out << " <img" << endl;
158  *out << " align=\"middle\"" << endl;
159  *out << " src=\"/hyperdaq/images/HyperDAQ.jpg\"" << endl;
160  *out << " alt=\"HyperDAQ\"" << endl;
161  *out << " width=\"32\"" << endl;
162  *out << " height=\"32\"" << endl;
163  *out << " border=\"\"/>" << endl;
164  *out << " </a>" << endl;
165  *out << " </td>" << endl;
166  *out << " <td width=\"32\">" << endl;
167  *out << " </td>" << endl;
168  *out << " <td width=\"32\">" << endl;
169  *out << " <a href=\"" << original_referrer_ << "\">" << endl;
170  *out << " <img" << endl;
171  *out << " align=\"middle\"" << endl;
172  *out << " src=\"/evf/images/epicon.jpg\"" << endl;
173  *out << " alt=\"main\"" << endl;
174  *out << " width=\"32\"" << endl;
175  *out << " height=\"32\"" << endl;
176  *out << " border=\"\"/>" << endl;
177  *out << " </a>" << endl;
178  *out << " </td>" << endl;
179  *out << "</tr>" << endl;
180  *out << "</table>" << endl;
181 
182  *out << "<hr/>" << endl;
183 
184  *out << "run number " << rid_ << "<br>" << endl;
185  *out << "event number " << eid_ << "<br>" << endl;
186 
187  *out << "event processor " << epstate_ << "<br>" << endl;
188 
189  *out << "next module type " << modulename_ << "<br>" << endl;
190  *out << "next module label " << modulelabel_ << "<br>" << endl;
191 
192  *out << "<hr/>" << endl;
193 
194  *out << cgicc::form().set("method","GET").set("action", path )
195  << std::endl;
196  *out << cgicc::input().set("type","hidden").set("name","service").set("value", mname)
197  << std::endl;
198  *out << cgicc::input().set("type","hidden").set("name","step").set("value", "yes")
199  << std::endl;
200  *out << cgicc::input().set("type","submit").set("value","Step") << std::endl;
201  *out << cgicc::form() << std::endl;
202 
203  *out << "</body>" << endl;
204  *out << "</html>" << endl;
205  }
pthread_cond_t cond_
Definition: Stepper.h:56
std::string epstate_
Definition: Stepper.h:49
list path
Definition: scaleCards.py:51
std::string serviceName_
Definition: ServiceWeb.h:26
std::string modulename_
Definition: Stepper.h:51
std::string original_referrer_
Definition: Stepper.h:54
unsigned int eid_
Definition: Stepper.h:53
tuple out
Definition: dbtoconf.py:99
pthread_mutex_t mutex_
Definition: Stepper.h:55
std::string modulelabel_
Definition: Stepper.h:50
unsigned int rid_
Definition: Stepper.h:52
void evf::Stepper::postBeginJob ( )

Definition at line 46 of file Stepper.cc.

References epstate_.

Referenced by Stepper().

47  {
48  // wait_on_signal();
49  epstate_ = "BJD";
50  }
std::string epstate_
Definition: Stepper.h:49
void evf::Stepper::postEndJob ( )

Definition at line 52 of file Stepper.cc.

References epstate_, modulelabel_, and wait_on_signal().

Referenced by Stepper().

53  {
55  epstate_ = "EJ";
56  modulelabel_ = "done";
57  }
std::string epstate_
Definition: Stepper.h:49
void wait_on_signal()
Definition: Stepper.h:43
std::string modulelabel_
Definition: Stepper.h:50
void evf::Stepper::postEventProcessing ( const edm::Event e,
const edm::EventSetup  
)

Definition at line 68 of file Stepper.cc.

Referenced by Stepper().

69  {
70  }
void evf::Stepper::postModule ( const edm::ModuleDescription desc)

Definition at line 91 of file Stepper.cc.

Referenced by Stepper().

92  {
93  }
void evf::Stepper::postSource ( )

Definition at line 78 of file Stepper.cc.

References modulelabel_, and wait_on_signal().

Referenced by Stepper().

79  {
81  modulelabel_ = "IND";
82  }
void wait_on_signal()
Definition: Stepper.h:43
std::string modulelabel_
Definition: Stepper.h:50
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().

61  {
62  rid_ = iID.run();
63  eid_ = iID.event();
65  epstate_ = "PRO";
66  }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
std::string epstate_
Definition: Stepper.h:49
unsigned int eid_
Definition: Stepper.h:53
void wait_on_signal()
Definition: Stepper.h:43
unsigned int rid_
Definition: Stepper.h:52
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().

85  {
87  modulename_ = desc.moduleName();
88  modulelabel_ = desc.moduleLabel();
89  }
std::string const & moduleName() const
std::string const & moduleLabel() const
std::string modulename_
Definition: Stepper.h:51
void wait_on_signal()
Definition: Stepper.h:43
std::string modulelabel_
Definition: Stepper.h:50
void evf::Stepper::preSource ( )

Definition at line 71 of file Stepper.cc.

References modulelabel_, modulename_, and wait_on_signal().

Referenced by Stepper().

72  {
74  modulename_ = "source";
75  modulelabel_ = "IN";
76  }
std::string modulename_
Definition: Stepper.h:51
void wait_on_signal()
Definition: Stepper.h:43
std::string modulelabel_
Definition: Stepper.h:50
void evf::Stepper::publish ( xdata::InfoSpace *  )
inlinevirtual

Implements evf::ServiceWeb.

Definition at line 39 of file Stepper.h.

39 {}
void evf::Stepper::wait_on_signal ( )
inlineprivate

Definition at line 43 of file Stepper.h.

References cond_, and mutex_.

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

44  {
45  pthread_mutex_lock(&mutex_);
46  pthread_cond_wait(&cond_,&mutex_);
47  pthread_mutex_unlock(&mutex_);
48  }
pthread_cond_t cond_
Definition: Stepper.h:56
pthread_mutex_t mutex_
Definition: Stepper.h:55

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.