#include <SiStripWebInterface.h>
Classes | |
struct | CondDBPlotParameter |
Public Types | |
enum | SiStripActionType { NoAction = 0, Summary = 2, PlotSingleModuleHistos = 5, PlotGlobalHistos = 6, PlotHistogramFromPath = 7, PlotTkMapHistogram = 8, PlotHistogramFromLayout = 9, CreatePlots = 10 } |
Public Member Functions | |
void | clearConDBPlotRequests () |
SiStripActionType | getActionFlag () |
void | getConDBPlotParameters (unsigned int ival, uint32_t &det_id, std::string &subdet_type, uint32_t &subdet_side, uint32_t &layer_number) |
unsigned int | getNumberOfConDBPlotRequest () |
std::string | getTkMapType () |
void | handleAnalyserRequest (xgi::Input *in, xgi::Output *out, const edm::ESHandle< SiStripDetCabling > &detcabling, int niter) |
void | performAction () |
void | setActionFlag (SiStripActionType flag) |
SiStripWebInterface (DQMStore *dqm_store) | |
~SiStripWebInterface () | |
Private Member Functions | |
std::string | get_from_multimap (std::multimap< std::string, std::string > &mymap, std::string key) |
void | returnReplyXml (xgi::Output *out, const std::string &name, const std::string &comment) |
Private Attributes | |
SiStripActionExecutorQTest * | actionExecutor_ |
bool | condDBFlag_ |
std::vector< CondDBPlotParameter > | condDBRequestList_ |
DQMStore * | dqmStore_ |
SiStripInformationExtractor * | infoExtractor_ |
std::multimap< std::string, std::string > | requestMap_ |
SiStripActionType | theActionFlag |
std::string | TkMapType |
Definition at line 20 of file SiStripWebInterface.h.
NoAction | |
Summary | |
PlotSingleModuleHistos | |
PlotGlobalHistos | |
PlotHistogramFromPath | |
PlotTkMapHistogram | |
PlotHistogramFromLayout | |
CreatePlots |
Definition at line 25 of file SiStripWebInterface.h.
{NoAction=0, Summary=2, PlotSingleModuleHistos=5, PlotGlobalHistos=6, PlotHistogramFromPath=7, PlotTkMapHistogram=8, PlotHistogramFromLayout=9, CreatePlots=10};
SiStripWebInterface::SiStripWebInterface | ( | DQMStore * | dqm_store | ) |
Definition at line 19 of file SiStripWebInterface.cc.
References infoExtractor_, NoAction, theActionFlag, and TkMapType.
: dqmStore_(dqm_store) { theActionFlag = NoAction; infoExtractor_ = 0; if (infoExtractor_ == 0) infoExtractor_ = new SiStripInformationExtractor(); TkMapType = "QTestAlarm"; }
SiStripWebInterface::~SiStripWebInterface | ( | ) |
Definition at line 29 of file SiStripWebInterface.cc.
References infoExtractor_.
{ if (infoExtractor_) delete infoExtractor_; infoExtractor_ = 0; }
void SiStripWebInterface::clearConDBPlotRequests | ( | ) | [inline] |
Definition at line 47 of file SiStripWebInterface.h.
References condDBRequestList_.
Referenced by SiStripAnalyser::analyze().
{ condDBRequestList_.clear(); }
std::string SiStripWebInterface::get_from_multimap | ( | std::multimap< std::string, std::string > & | mymap, |
std::string | key | ||
) | [private] |
Definition at line 222 of file SiStripWebInterface.cc.
Referenced by handleAnalyserRequest().
{ std::multimap<std::string, std::string>::iterator it; it = mymap.find(key); if (it != mymap.end()) { return (it->second); } return ""; }
SiStripActionType SiStripWebInterface::getActionFlag | ( | ) | [inline] |
Definition at line 41 of file SiStripWebInterface.h.
References theActionFlag.
{return theActionFlag;}
void SiStripWebInterface::getConDBPlotParameters | ( | unsigned int | ival, |
uint32_t & | det_id, | ||
std::string & | subdet_type, | ||
uint32_t & | subdet_side, | ||
uint32_t & | layer_number | ||
) |
Definition at line 235 of file SiStripWebInterface.cc.
References condDBRequestList_.
Referenced by SiStripAnalyser::analyze().
{ if (condDBRequestList_.size() > ival) { det_id = condDBRequestList_[ival].detId; subdet_type = condDBRequestList_[ival].type; subdet_side = condDBRequestList_[ival].side; layer_number = condDBRequestList_[ival].layer; } else { det_id = 999; subdet_type = ""; subdet_side = 999; layer_number = 999; } }
unsigned int SiStripWebInterface::getNumberOfConDBPlotRequest | ( | ) | [inline] |
Definition at line 44 of file SiStripWebInterface.h.
References condDBRequestList_.
Referenced by SiStripAnalyser::analyze().
{ return condDBRequestList_.size();}
std::string SiStripWebInterface::getTkMapType | ( | ) | [inline] |
Definition at line 49 of file SiStripWebInterface.h.
References TkMapType.
Referenced by SiStripAnalyser::endLuminosityBlock().
{ return TkMapType;}
void SiStripWebInterface::handleAnalyserRequest | ( | xgi::Input * | in, |
xgi::Output * | out, | ||
const edm::ESHandle< SiStripDetCabling > & | detcabling, | ||
int | niter | ||
) |
Definition at line 36 of file SiStripWebInterface.cc.
References BUF_SIZE, ExpressReco_HICollisions_FallBack::cerr, condDBRequestList_, SiStripWebInterface::CondDBPlotParameter::detId, dqmStore_, alignmentValidation::fname, get_from_multimap(), SiStripInformationExtractor::getCondDBHistos(), SiStripInformationExtractor::getGlobalHistos(), SiStripInformationExtractor::getHistosFromPath(), SiStripInformationExtractor::getImage(), SiStripInformationExtractor::getSingleModuleHistos(), SiStripInformationExtractor::getTrackerMapHistos(), infoExtractor_, SiStripWebInterface::CondDBPlotParameter::layer, NoAction, performAction(), PlotHistogramFromLayout, CgiReader::read_form(), SiStripInformationExtractor::readAlarmTree(), SiStripInformationExtractor::readGlobalHistoList(), SiStripInformationExtractor::readLayoutNames(), SiStripInformationExtractor::readModuleAndHistoList(), SiStripInformationExtractor::readNonGeomHistoTree(), SiStripInformationExtractor::readQTestSummary(), SiStripInformationExtractor::readStatusMessage(), SiStripInformationExtractor::readSummaryHistoTree(), requestMap_, returnReplyXml(), SiStripWebInterface::CondDBPlotParameter::side, theActionFlag, TkMapType, and SiStripWebInterface::CondDBPlotParameter::type.
Referenced by SiStripAnalyser::defaultWebPage().
{ DQMScope enter; // put the request information in a multimap... // std::multimap<std::string, std::string> requestMap_; CgiReader reader(in); reader.read_form(requestMap_); if (niter < 0) return; std::string requestID = get_from_multimap(requestMap_, "RequestID"); // get the string that identifies the request: edm::LogInfo ("SiStripWebInterface") << "SiStripWebInterface::handleAnalyserRequest RequestID = " << requestID ; if (requestID == "IsReady") { theActionFlag = NoAction; if (niter > 0) { infoExtractor_->readLayoutNames(dqmStore_, out); } else { returnReplyXml(out, "ReadyState", "wait"); } } else if (requestID == "CheckQTResults") { std::string infoType = get_from_multimap(requestMap_, "InfoType"); infoExtractor_->readQTestSummary(dqmStore_, infoType, out); theActionFlag = NoAction; } else if (requestID == "SingleModuleHistoList") { theActionFlag = NoAction; std::string sname = get_from_multimap(requestMap_, "FolderName"); infoExtractor_->readModuleAndHistoList(dqmStore_, sname, detcabling, out); } else if (requestID == "GlobalHistoList") { theActionFlag = NoAction; std::string gname = get_from_multimap(requestMap_, "GlobalFolder"); infoExtractor_->readGlobalHistoList(dqmStore_, gname, out); } else if (requestID == "SummaryHistoList") { theActionFlag = NoAction; std::string sname = get_from_multimap(requestMap_, "StructureName"); infoExtractor_->readSummaryHistoTree(dqmStore_, sname, out); } else if (requestID == "AlarmList") { theActionFlag = NoAction; std::string sname = get_from_multimap(requestMap_, "StructureName"); infoExtractor_->readAlarmTree(dqmStore_, sname, out); } else if (requestID == "ReadQTestStatus") { theActionFlag = NoAction; infoExtractor_->readStatusMessage(dqmStore_, requestMap_, out); } else if (requestID == "PlotAsModule") { theActionFlag = NoAction; infoExtractor_->getSingleModuleHistos(dqmStore_, requestMap_, out); } else if (requestID == "PlotGlobalHisto") { theActionFlag = NoAction; infoExtractor_->getGlobalHistos(dqmStore_, requestMap_, out); } else if (requestID == "PlotHistogramFromPath") { theActionFlag = NoAction; infoExtractor_->getHistosFromPath(dqmStore_, requestMap_, out); } else if (requestID == "PlotTkMapHistogram") { theActionFlag = NoAction; requestMap_.insert(std::pair<std::string,std::string>("TkMapType", TkMapType)); infoExtractor_->getTrackerMapHistos(dqmStore_, requestMap_, out); } else if (requestID == "PlotHistogramFromLayout") { theActionFlag = PlotHistogramFromLayout; } else if (requestID == "GetImage") { infoExtractor_->getImage(requestMap_, out); } else if (requestID == "GetTkMap") { theActionFlag = NoAction; ifstream fin("dqmtmapviewer.xhtml"); char buf[BUF_SIZE]; std::ostringstream html_out; if (!fin) { std::cerr << "Input File: dqmtmapviewer.xhtml "<< " could not be opened!" << std::endl; return; } while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character html_out << buf << std::endl; } fin.close(); out->getHTTPResponseHeader().addHeader("Content-type","application/xhtml+xml"); *out << html_out.str(); } else if (requestID == "NonGeomHistoList") { theActionFlag = NoAction; std::string fname = get_from_multimap(requestMap_, "FolderName"); infoExtractor_->readNonGeomHistoTree(dqmStore_, fname, out); } else if (requestID == "PlotModuleCondDBHistos") { theActionFlag = NoAction; CondDBPlotParameter local_par; uint32_t detId = atoi(get_from_multimap(requestMap_,"ModId").c_str()); local_par.detId = detId; local_par.type = ""; local_par.side = 999; local_par.layer = 999; bool create_plot; infoExtractor_->getCondDBHistos(dqmStore_, create_plot, requestMap_, out); if (create_plot) condDBRequestList_.push_back(local_par); } else if (requestID == "PlotLayerCondDBHistos") { theActionFlag = NoAction; CondDBPlotParameter local_par; std::string sname = get_from_multimap(requestMap_,"StructureName"); local_par.detId = 999; local_par.type = sname.substr(sname.find_first_of("/")+1,3); if (sname.find("side_")!=std::string::npos) local_par.side = atoi((sname.substr(sname.find("side_")+5,1)).c_str()); else local_par.side = 999; local_par.layer = atoi((sname.substr(sname.find_last_of("_")+1)).c_str()); bool create_plot; infoExtractor_->getCondDBHistos(dqmStore_, create_plot, requestMap_, out); if (create_plot) condDBRequestList_.push_back(local_par); } else if (requestID == "UpdateTrackerMapOption") { theActionFlag = NoAction; TkMapType = get_from_multimap(requestMap_,"Option"); returnReplyXml(out, "TkMapOption", TkMapType); } performAction(); }
void SiStripWebInterface::performAction | ( | ) |
Definition at line 167 of file SiStripWebInterface.cc.
References SiStripInformationExtractor::createImages(), CreatePlots, dqmStore_, infoExtractor_, NoAction, PlotGlobalHistos, PlotHistogramFromLayout, PlotHistogramFromPath, SiStripInformationExtractor::plotHistosFromLayout(), PlotSingleModuleHistos, PlotTkMapHistogram, setActionFlag(), Summary, and theActionFlag.
Referenced by SiStripAnalyser::analyze(), SiStripAnalyser::endLuminosityBlock(), and handleAnalyserRequest().
{ switch (theActionFlag) { case SiStripWebInterface::Summary : { // actionExecutor_->createSummary(dqmStore_); break; } case SiStripWebInterface::PlotSingleModuleHistos : { // infoExtractor_->plotSingleModuleHistos(dqmStore_, requestMap_, out); break; } case SiStripWebInterface::PlotGlobalHistos : { // infoExtractor_->plotGlobalHistos(dqmStore_, requestMap_, out); break; } case SiStripWebInterface::PlotTkMapHistogram : { // infoExtractor_->plotTrackerMapHistos(dqmStore_, requestMap_, out); break; } case SiStripWebInterface::PlotHistogramFromPath : { // infoExtractor_->plotHistosFromPath(dqmStore_, requestMap_, out); break; } case SiStripWebInterface::PlotHistogramFromLayout : { infoExtractor_->plotHistosFromLayout(dqmStore_); break; } case SiStripWebInterface::CreatePlots : { infoExtractor_->createImages(dqmStore_); break; } case SiStripWebInterface::NoAction : { break; } } setActionFlag(SiStripWebInterface::NoAction); }
void SiStripWebInterface::returnReplyXml | ( | xgi::Output * | out, |
const std::string & | name, | ||
const std::string & | comment | ||
) | [private] |
Definition at line 212 of file SiStripWebInterface.cc.
Referenced by handleAnalyserRequest().
void SiStripWebInterface::setActionFlag | ( | SiStripActionType | flag | ) | [inline] |
Definition at line 42 of file SiStripWebInterface.h.
References theActionFlag.
Referenced by SiStripAnalyser::analyze(), SiStripAnalyser::endLuminosityBlock(), and performAction().
{theActionFlag = flag;}
SiStripActionExecutorQTest* SiStripWebInterface::actionExecutor_ [private] |
Definition at line 56 of file SiStripWebInterface.h.
bool SiStripWebInterface::condDBFlag_ [private] |
Definition at line 65 of file SiStripWebInterface.h.
std::vector<CondDBPlotParameter> SiStripWebInterface::condDBRequestList_ [private] |
Definition at line 76 of file SiStripWebInterface.h.
Referenced by clearConDBPlotRequests(), getConDBPlotParameters(), getNumberOfConDBPlotRequest(), and handleAnalyserRequest().
DQMStore* SiStripWebInterface::dqmStore_ [private] |
Definition at line 63 of file SiStripWebInterface.h.
Referenced by handleAnalyserRequest(), and performAction().
Definition at line 57 of file SiStripWebInterface.h.
Referenced by handleAnalyserRequest(), performAction(), SiStripWebInterface(), and ~SiStripWebInterface().
std::multimap<std::string, std::string> SiStripWebInterface::requestMap_ [private] |
Definition at line 61 of file SiStripWebInterface.h.
Referenced by handleAnalyserRequest().
Definition at line 55 of file SiStripWebInterface.h.
Referenced by getActionFlag(), handleAnalyserRequest(), performAction(), setActionFlag(), and SiStripWebInterface().
std::string SiStripWebInterface::TkMapType [private] |
Definition at line 77 of file SiStripWebInterface.h.
Referenced by getTkMapType(), handleAnalyserRequest(), and SiStripWebInterface().