15 #ifdef WITH_ECAL_COND_DB
24 #include "xgi/Input.h"
25 #include "xgi/Output.h"
27 #include "xgi/Method.h"
28 #include "xgi/Utils.h"
30 #include "cgicc/Cgicc.h"
31 #include "cgicc/FormEntry.h"
32 #include "cgicc/HTMLClasses.h"
50 static bool autorefresh_ =
false;
56 if ( xgi::Utils::hasFormElement(cgi,
"autorefresh") ) {
57 autorefresh_ = xgi::Utils::getFormElement(cgi,
"autorefresh")->getIntegerValue() != 0;
60 if ( xgi::Utils::hasFormElement(cgi,
"module") ) {
61 mname = xgi::Utils::getFormElement(cgi,
"module")->getValue();
64 cgicc::CgiEnvironment cgie(in);
65 path = cgie.getPathInfo() +
"?" + cgie.getQueryString();
69 std::cerr <<
"Standard C++ exception : " << e.what() << std::endl;
73 *out << cgicc::HTMLDoctype(cgicc::HTMLDoctype::eStrict) << std::endl;
74 *out <<
cgicc::html().set(
"lang",
"en").set(
"dir",
"ltr") << std::endl;
76 *out <<
"<html>" << std::endl;
78 *out <<
"<head>" << std::endl;
81 <<
" MAIN</title>" << std::endl;
84 *out <<
"<meta http-equiv=\"refresh\" content=\"3\">" << std::endl;
87 *out <<
"</head>" << std::endl;
89 *out <<
"<body>" << std::endl;
91 *out << cgicc::form().set(
"method",
"GET").set(
"action", path )
93 *out <<
cgicc::input().set(
"type",
"hidden").set(
"name",
"module").set(
"value", mname)
95 *out <<
cgicc::input().set(
"type",
"hidden").set(
"name",
"autorefresh").set(
"value", autorefresh_?
"0":
"1")
97 *out <<
cgicc::input().set(
"type",
"submit").set(
"value",autorefresh_?
"Toggle AutoRefresh OFF":
"Toggle AutoRefresh ON")
99 *out << cgicc::form() << std::endl;
101 *out << cgicc::h3(
"EcalEndcapMonitorXdaqClient Status" ).set(
"style",
"font-family:arial" ) << std::endl;
103 *out <<
"<table style=\"font-family: arial\"><tr><td>" << std::endl;
105 *out <<
"<p style=\"font-family: arial\">"
106 <<
"<table border=1>"
107 <<
"<tr><th>Cycle</th><td align=right>" <<
ievt_;
109 if (
h_ != 0 ) nevt = int(
h_->GetEntries());
110 *out <<
"<tr><th>Event</th><td align=right>" << nevt
111 <<
"</td><tr><th>Run</th><td align=right>" <<
run_
112 <<
"</td><tr><th>Run Type</th><td align=right> " << this->
getRunType()
113 <<
"</td></table></p>" << std::endl;
115 *out <<
"</td><td>" << std::endl;
117 *out <<
"<p style=\"font-family: arial\">"
118 <<
"<table border=1>"
119 <<
"<tr><th>Evt Type</th><th>Evt/Run</th><th>Evt Type</th><th>Evt/Run</th>" << std::endl;
120 for(
unsigned int i = 0,
j = 0;
i <
runTypes_.size();
i++ ) {
121 if ( strcmp(
runTypes_[
i].c_str(),
"UNKNOWN") != 0 ) {
122 if (
j++%2 == 0 ) *out <<
"<tr>";
124 if (
h_ != 0 ) nevt = int(
h_->GetBinContent(
i+1) );
126 <<
"</td><td align=right>" << nevt << std::endl;
129 *out <<
"</td></table></p>" << std::endl;
131 *out <<
"</td><tr><td colspan=2>" << std::endl;
133 *out <<
"<p style=\"font-family: arial\">"
134 <<
"<table border=1>"
135 <<
"<tr><th>Client</th><th>Cyc/Job</th><th>Cyc/Run</th><th>Client</th><th>Cyc/Job</th><th>Cyc/Run</th>" << std::endl;
136 for(
unsigned int i = 0;
i <
clients_.size();
i++ ) {
138 if (
i%2 == 0 ) *out <<
"<tr>";
140 <<
"</td><td align=right>" <<
clients_[
i]->getEvtPerJob()
141 <<
"</td><td align=right>" <<
clients_[
i]->getEvtPerRun() << std::endl;
144 *out <<
"</td></table></p>" << std::endl;
146 *out <<
"</td><tr><td>" << std::endl;
148 #ifdef WITH_ECAL_COND_DB
149 *out <<
"<p style=\"font-family: arial\">"
150 <<
"<table border=1>"
151 <<
"<tr><th colspan=2>RunIOV</th>"
152 <<
"<tr><td>Run Number</td><td align=right> " << runiov_.getRunNumber()
153 <<
"</td><tr><td>Run Start</td><td align=right> " << runiov_.getRunStart().str()
154 <<
"</td><tr><td>Run End</td><td align=right> " << runiov_.getRunEnd().str()
155 <<
"</td></table></p>" << std::endl;
157 *out <<
"</td><td colsapn=2>" << std::endl;
159 *out <<
"<p style=\"font-family: arial\">"
160 <<
"<table border=1>"
161 <<
"<tr><th colspan=2>RunTag</th>"
162 <<
"<tr><td>GeneralTag</td><td align=right> " << runiov_.getRunTag().getGeneralTag()
163 <<
"</td><tr><td>Location</td><td align=right> " << runiov_.getRunTag().getLocationDef().getLocation()
164 <<
"</td><tr><td>Run Type</td><td align=right> " << runiov_.getRunTag().getRunTypeDef().getRunType()
165 <<
"</td></table></p>" << std::endl;
167 *out <<
"</td><tr><td>" << std::endl;
169 *out <<
"<p style=\"font-family: arial\">"
170 <<
"<table border=1>"
171 <<
"<tr><th colspan=2>MonRunIOV</th>"
172 <<
"<tr><td>SubRun Number</td><td align=right> " << moniov_.getSubRunNumber()
173 <<
"</td><tr><td>SubRun Start</td><td align=right> " << moniov_.getSubRunStart().str()
174 <<
"</td><tr><td>SubRun End</td><td align=right> " << moniov_.getSubRunEnd().str()
175 <<
"</td></table></p>" << std::endl;
177 *out <<
"</td><td colspan=2>" << std::endl;
179 *out <<
"<p style=\"font-family: arial\">"
180 <<
"<table border=1>"
181 <<
"<tr><th colspan=2>MonRunTag</th>"
182 <<
"<tr><td>GeneralTag</td><td align=right> " << moniov_.getMonRunTag().getGeneralTag()
183 <<
"</td><tr><td>Monitoring Version</td><td align=right> " << moniov_.getMonRunTag().getMonVersionDef().getMonitoringVersion()
184 <<
"</td></table></p>" << std::endl;
187 *out <<
"</td><table>" << std::endl;
189 *out <<
"</body>" << std::endl;
191 *out <<
"</html>" << std::endl;
std::vector< std::string > runTypes_
#define DEFINE_FWK_MODULE(type)
EcalEndcapMonitorXdaqClient(const edm::ParameterSet &ps)
Constructor.
std::vector< std::string > clientsNames_
virtual ~EcalEndcapMonitorXdaqClient()
Destructor.
void publish(xdata::InfoSpace *)
ModuleWeb(const std::string &)
std::vector< EEClient * > clients_
void defaultWebPage(xgi::Input *in, xgi::Output *out)
XDAQ web page.
const char * getRunType(void)