#include <SiPixelWebInterface.h>
Public Types | |
enum | SiPixelActionType { NoAction = 0, Summary = 1, setupQTest = 2, QTestResult = 3, CreateTkMap = 4, PlotSingleModuleHistos = 5, PlotSingleHistogram = 6, PlotTkMapHistogram = 7, periodicTrackerMapUpdate = 8, PlotHistogramFromPath = 9, CreatePlots = 10, ComputeGlobalQualityFlag = 11, dumpModIds = 12, Occupancy = 13 } |
Public Member Functions | |
bool | createTkMap () |
SiPixelActionType | getActionFlag () |
void | handleEDARequest (xgi::Input *in, xgi::Output *out, int niter) |
void | performAction () |
void | periodicTkMapUpdate (xgi::Output *out) |
bool | readConfiguration (int &tkmap_freq, int &summary_freq) |
void | setActionFlag (SiPixelActionType flag) |
SiPixelWebInterface (DQMStore *bei, bool offlineXMLfile, bool Tier0Flag) | |
~SiPixelWebInterface () | |
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 | |
SiPixelActionExecutor * | actionExecutor_ |
DQMStore * | bei_ |
SiPixelInformationExtractor * | infoExtractor_ |
bool | offlineXMLfile_ |
std::multimap< std::string, std::string > | requestMap_ |
SiPixelActionType | theActionFlag |
bool | Tier0Flag_ |
bool | tkMapCreated |
std::vector< std::string > | tkMapOptions_ |
Definition at line 13 of file SiPixelWebInterface.h.
Definition at line 18 of file SiPixelWebInterface.h.
{NoAction = 0, Summary = 1, setupQTest = 2, QTestResult = 3, CreateTkMap = 4, PlotSingleModuleHistos = 5, PlotSingleHistogram = 6, PlotTkMapHistogram = 7, periodicTrackerMapUpdate = 8, PlotHistogramFromPath = 9, CreatePlots = 10, ComputeGlobalQualityFlag = 11, dumpModIds = 12, Occupancy = 13};
SiPixelWebInterface::SiPixelWebInterface | ( | DQMStore * | bei, |
bool | offlineXMLfile, | ||
bool | Tier0Flag | ||
) |
Definition at line 20 of file SiPixelWebInterface.cc.
References actionExecutor_, infoExtractor_, NoAction, offlineXMLfile_, theActionFlag, Tier0Flag_, tkMapCreated, and tkMapOptions_.
: bei_(bei), offlineXMLfile_(offlineXMLfile), Tier0Flag_(Tier0Flag) { theActionFlag = NoAction; actionExecutor_ = 0; infoExtractor_ = 0; tkMapOptions_.push_back("Persistant"); tkMapOptions_.push_back("Temporary"); tkMapCreated = false; if (actionExecutor_ == 0) actionExecutor_ = new SiPixelActionExecutor(offlineXMLfile_, Tier0Flag_); if (infoExtractor_ == 0) infoExtractor_ = new SiPixelInformationExtractor(offlineXMLfile_); }
SiPixelWebInterface::~SiPixelWebInterface | ( | ) |
Definition at line 41 of file SiPixelWebInterface.cc.
References actionExecutor_, and infoExtractor_.
{ if (actionExecutor_) delete actionExecutor_; actionExecutor_ = 0; if (infoExtractor_) delete infoExtractor_; infoExtractor_ = 0; }
bool SiPixelWebInterface::createTkMap | ( | ) |
Definition at line 332 of file SiPixelWebInterface.cc.
References actionExecutor_, bei_, CreateTkMap, SiPixelActionExecutor::createTkMap(), get_from_multimap(), requestMap_, lumiContext::sname, and theActionFlag.
Referenced by performAction().
{ //DQMStore * bei = (*mui_p)->getBEInterface(); if (theActionFlag == SiPixelWebInterface::CreateTkMap) { string sname = get_from_multimap(requestMap_, "MEName"); string theTKType = get_from_multimap(requestMap_, "TKMapType"); actionExecutor_->createTkMap(bei_, sname, theTKType); return true; } else { return false; } }
std::string SiPixelWebInterface::get_from_multimap | ( | std::multimap< std::string, std::string > & | mymap, |
std::string | key | ||
) | [private] |
Definition at line 369 of file SiPixelWebInterface.cc.
Referenced by createTkMap(), handleEDARequest(), and periodicTkMapUpdate().
{ std::multimap<std::string, std::string>::iterator it; it = mymap.find(key); if (it != mymap.end()) { return (it->second); } return ""; }
SiPixelActionType SiPixelWebInterface::getActionFlag | ( | ) | [inline] |
Definition at line 42 of file SiPixelWebInterface.h.
References theActionFlag.
{return theActionFlag;}
void SiPixelWebInterface::handleEDARequest | ( | xgi::Input * | in, |
xgi::Output * | out, | ||
int | niter | ||
) |
Definition at line 52 of file SiPixelWebInterface.cc.
References ACBold, ACCyan, ACGreen, ACPlain, ACReverse, bei_, BUF_SIZE, DQMStore::cd(), dtNoiseDBValidation_cfg::cerr, comment, ComputeGlobalQualityFlag, gather_cfg::cout, CreateTkMap, dumpModIds, groupFilesInBlocks::fin, get_from_multimap(), SiPixelInformationExtractor::getHistosFromPath(), SiPixelInformationExtractor::getIMGCImage(), DQMStore::getMEs(), SiPixelInformationExtractor::getSingleModuleHistos(), SiPixelInformationExtractor::getTrackerMapHistos(), infoExtractor_, mergeVDriftHistosByStation::name, NoAction, performAction(), periodicTkMapUpdate(), QTestResult, CgiReader::read_form(), SiPixelInformationExtractor::readAlarmTree(), matplotRender::reader, SiPixelInformationExtractor::readModuleAndHistoList(), SiPixelInformationExtractor::readModuleHistoTree(), SiPixelInformationExtractor::readStatusMessage(), SiPixelInformationExtractor::readSummaryHistoTree(), requestMap_, returnReplyXml(), setupQTest, lumiContext::sname, Summary, theActionFlag, and tkMapCreated.
Referenced by SiPixelEDAClient::defaultWebPage().
{ DQMScope enter; //DQMStore* bei = (*mui_p)->getBEInterface(); CgiReader reader(in); reader.read_form(requestMap_); // get the string that identifies the request: std::string requestID = get_from_multimap(requestMap_, "RequestID"); cout << ACGreen << ACBold << ACReverse << "[SiPixelWebInterface::handleEDARequest]" << ACCyan << " requestID " << ACPlain << requestID << endl; if (requestID == "IsReady") { theActionFlag = NoAction; returnReplyXml(out, "ReadyState", "wait"); } else if (requestID == "CheckQTResults") { theActionFlag = QTestResult; } else if (requestID == "updateIMGCPlots") { // <----------------- theActionFlag = NoAction; std::string MEFolder = get_from_multimap(requestMap_, "MEFolder"); //cout << ACYellow << ACBold // << "[SiPixelWebInterface::handleEDARequest] " // << ACPlain // << "Collecting ME from folder " // << MEFolder // << endl ; out->getHTTPResponseHeader().addHeader("Content-Type", "text/html"); out->getHTTPResponseHeader().addHeader("Pragma", "no-cache"); out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate,max-age=0"); out->getHTTPResponseHeader().addHeader("Expires","Mon, 26 Jul 1997 05:00:00 GMT"); bei_->cd() ; bei_->cd(MEFolder) ; vector<std::string> meList = bei_->getMEs() ; *out << MEFolder << " " ; bei_->cd() ; for(vector<std::string>::iterator it=meList.begin(); it!=meList.end(); it++) { *out << *it << " " ; } } else if (requestID == "getIMGCPlot") { // <----------------- infoExtractor_->getIMGCImage(requestMap_, out); } else if (requestID == "SetupQTest") { // <----------------- theActionFlag = setupQTest; } else if (requestID == "CreateSummary") { // <----------------- theActionFlag = Summary; } else if (requestID == "CreateTkMap") { std::string name = "TkMap"; std::string comment; if (tkMapCreated) comment = "Successful"; else comment = "Failed"; returnReplyXml(out, name, comment); theActionFlag = CreateTkMap; } else if (requestID == "SingleModuleHistoList") { theActionFlag = NoAction; infoExtractor_->readModuleAndHistoList(bei_, out); } else if (requestID == "ModuleHistoList") { theActionFlag = NoAction; string sname = get_from_multimap(requestMap_, "StructureName"); //cout<<"in EDARequest: structure name= "<<sname<<endl; infoExtractor_->readModuleHistoTree(bei_, sname, out); } else if (requestID == "SummaryHistoList") { theActionFlag = NoAction; string sname = get_from_multimap(requestMap_, "StructureName"); infoExtractor_->readSummaryHistoTree(bei_, sname, out); } else if (requestID == "AlarmList") { theActionFlag = NoAction; string sname = get_from_multimap(requestMap_, "StructureName"); infoExtractor_->readAlarmTree(bei_, sname, out); } else if (requestID == "ReadQTestStatus") { theActionFlag = NoAction; //string path = get_from_multimap(requestMap_, "Path"); //infoExtractor_->readStatusMessage(bei_, path, out); infoExtractor_->readStatusMessage(bei_, requestMap_, out); } else if (requestID == "PlotAsModule") { //theActionFlag = PlotSingleModuleHistos; theActionFlag = NoAction; infoExtractor_->getSingleModuleHistos(bei_, requestMap_, out); } else if (requestID == "PlotHistogramFromPath") { //theActionFlag = PlotHistogramFromPath; theActionFlag = NoAction; infoExtractor_->getHistosFromPath(bei_, requestMap_, out); //} else if (requestID == "PlotSingleHistogram") { // theActionFlag = PlotSingleHistogram; } else if (requestID == "PlotTkMapHistogram") { //string theMEName = get_from_multimap(requestMap_, "MEName"); //string theModId = get_from_multimap(requestMap_, "ModId"); //infoExtractor_->plotTkMapHisto(bei, theModId, theMEName); //out->getHTTPResponseHeader().addHeader("Content-Type", "image/png"); //out->getHTTPResponseHeader().addHeader("Pragma", "no-cache"); //out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate,max-age=0"); //out->getHTTPResponseHeader().addHeader("Expires","Mon, 26 Jul 1997 05:00:00 GMT"); //*out << infoExtractor_->getNamedImage(theMEName).str(); theActionFlag = NoAction; infoExtractor_->getTrackerMapHistos(bei_, requestMap_, out); //} else if (requestID == "UpdatePlot") { // string theMEName = get_from_multimap(requestMap_, "MEName"); // out->getHTTPResponseHeader().addHeader("Content-Type", "image/png"); // out->getHTTPResponseHeader().addHeader("Pragma", "no-cache"); // out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate,max-age=0"); // out->getHTTPResponseHeader().addHeader("Expires","Mon, 26 Jul 1997 05:00:00 GMT"); // *out << infoExtractor_->getImage().str(); // theActionFlag = NoAction; // } else if (requestID == "UpdateTkMapPlot") { // string theMEName = get_from_multimap(requestMap_, "MEName"); // out->getHTTPResponseHeader().addHeader("Content-Type", "image/png"); // out->getHTTPResponseHeader().addHeader("Pragma", "no-cache"); // out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate,max-age=0"); // out->getHTTPResponseHeader().addHeader("Expires","Mon, 26 Jul 1997 05:00:00 GMT"); // *out << infoExtractor_->getNamedImage(theMEName).str(); // theActionFlag = NoAction; } else if (requestID == "GetMEList") { theActionFlag = NoAction; infoExtractor_->readModuleAndHistoList(bei_, 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 == "periodicTrackerMapUpdate") { theActionFlag = NoAction; periodicTkMapUpdate(out) ; } else if (requestID == "globalQFlag") { //cout << ACYellow << ACBold << "[SiPixelWebInterface::handleEDARequest] " // << ACPlain << "Compute global Pixel quality flag" << endl; theActionFlag = ComputeGlobalQualityFlag; } else if (requestID == "dumpModIds") { theActionFlag = dumpModIds; } performAction(); }
void SiPixelWebInterface::performAction | ( | ) |
theOut->getHTTPResponseHeader().addHeader("Content-Type", "image/png"); theOut->getHTTPResponseHeader().addHeader("Pragma", "no-cache"); theOut->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate,max-age=0"); theOut->getHTTPResponseHeader().addHeader("Expires","Mon, 26 Jul 1997 05:00:00 GMT"); cout << ACYellow << ACBold << "[SiPixelWebInterface::PlotTkMapHistogram()]" << ACPlain << " Buffer for " << theMEName << " stored away: shipping back data (" << theOut << ")" << endl ; theOut << infoExtractor_->getNamedImage(theMEName).str();
Definition at line 211 of file SiPixelWebInterface.cc.
References actionExecutor_, bei_, SiPixelActionExecutor::checkQTestResults(), ComputeGlobalQualityFlag, SiPixelInformationExtractor::createImages(), SiPixelActionExecutor::createOccupancy(), CreatePlots, SiPixelActionExecutor::createSummary(), CreateTkMap, createTkMap(), dumpModIds, infoExtractor_, NoAction, Occupancy, periodicTrackerMapUpdate, PlotHistogramFromPath, PlotSingleHistogram, PlotSingleModuleHistos, PlotTkMapHistogram, QTestResult, setActionFlag(), setupQTest, SiPixelActionExecutor::setupQTests(), Summary, theActionFlag, and tkMapCreated.
Referenced by SiPixelEDAClient::analyze(), SiPixelEDAClient::endLuminosityBlock(), SiPixelEDAClient::endRun(), and handleEDARequest().
{ //cout<<"entering performAction..."<<endl; //DQMStore * bei_ = (*mui_p)->getBEInterface(); switch (theActionFlag) { case SiPixelWebInterface::CreateTkMap : { if (createTkMap()) { // cout<<"calling the dtor before this?"<<endl; tkMapCreated = true; // theOut->getHTTPResponseHeader().addHeader("Content-Type", "text/xml"); // *theOut << "<?xml version=\"1.0\" ?>" << endl; // *theOut << "<TkMap>" << endl; // *theOut << " <Response>Successfull</Response>" << endl; // *theOut << "</TkMap>" << endl; //cout<<"Done creating the TkMap in WI::performAction, what now?!"<<endl; } break; } case SiPixelWebInterface::Summary : { actionExecutor_->createSummary(bei_); break; } case SiPixelWebInterface::Occupancy : { actionExecutor_->createOccupancy(bei_); break; } case SiPixelWebInterface::setupQTest : { actionExecutor_->setupQTests(bei_); break; } case SiPixelWebInterface::QTestResult : { actionExecutor_->checkQTestResults(bei_); break; } case SiPixelWebInterface::PlotSingleModuleHistos : { // infoExtractor_->plotSingleModuleHistos(bei_, requestMap_); break; } case SiPixelWebInterface::PlotTkMapHistogram : { // string theMEName = get_from_multimap(requestMap_, "MEName"); // string theModId = get_from_multimap(requestMap_, "ModId"); // infoExtractor_->plotTkMapHisto(bei_, theModId, theMEName); // // cout << ACYellow << ACBold // << "[SiPixelWebInterface::PlotTkMapHistogram()]" // << ACPlain // << " Buffer for " // << theMEName // << " stored away: shipping back header (" << theOut << ")" // << endl ; break; } case SiPixelWebInterface::PlotSingleHistogram : { // infoExtractor_->plotSingleHistogram(bei_, requestMap_); break; } case SiPixelWebInterface::periodicTrackerMapUpdate : { break; } case SiPixelWebInterface::PlotHistogramFromPath : { // infoExtractor_->getHistosFromPath(bei_, requestMap_); break; } case SiPixelWebInterface::CreatePlots : { infoExtractor_->createImages(bei_); break; } case SiPixelWebInterface::dumpModIds : { break; } case SiPixelWebInterface::ComputeGlobalQualityFlag : { break; } case SiPixelWebInterface::NoAction : { break; } } setActionFlag(SiPixelWebInterface::NoAction); // cout<<"leaving performAction..."<<endl; }
void SiPixelWebInterface::periodicTkMapUpdate | ( | xgi::Output * | out | ) |
Definition at line 346 of file SiPixelWebInterface.cc.
References bei_, get_from_multimap(), infoExtractor_, requestMap_, SiPixelInformationExtractor::sendTkUpdatedStatus(), and lumiContext::sname.
Referenced by handleEDARequest().
{ //DQMStore * bei = (*mui_p)->getBEInterface(); string sname = get_from_multimap(requestMap_, "MEName"); string theTKType = get_from_multimap(requestMap_, "TKMapType"); infoExtractor_->sendTkUpdatedStatus(bei_, out, sname, theTKType) ; }
bool SiPixelWebInterface::readConfiguration | ( | int & | tkmap_freq, |
int & | summary_freq | ||
) |
Definition at line 355 of file SiPixelWebInterface.cc.
References actionExecutor_, SiPixelActionExecutor::readConfiguration(), and summarizeEdmComparisonLogfiles::success.
Referenced by SiPixelEDAClient::beginRun().
{ bool success=false; tkmap_freq = -1; summary_freq = -1; if (actionExecutor_) { actionExecutor_->readConfiguration(tkmap_freq,summary_freq); if(tkmap_freq!=-1 && summary_freq!=-1) success=true; } return success; }
void SiPixelWebInterface::returnReplyXml | ( | xgi::Output * | out, |
const std::string & | name, | ||
const std::string & | comment | ||
) | [private] |
Definition at line 319 of file SiPixelWebInterface.cc.
Referenced by handleEDARequest().
void SiPixelWebInterface::setActionFlag | ( | SiPixelActionType | flag | ) | [inline] |
Definition at line 43 of file SiPixelWebInterface.h.
References theActionFlag.
Referenced by SiPixelEDAClient::analyze(), SiPixelEDAClient::endLuminosityBlock(), SiPixelEDAClient::endRun(), and performAction().
{theActionFlag = flag;}
Definition at line 57 of file SiPixelWebInterface.h.
Referenced by createTkMap(), performAction(), readConfiguration(), SiPixelWebInterface(), and ~SiPixelWebInterface().
DQMStore* SiPixelWebInterface::bei_ [private] |
Definition at line 67 of file SiPixelWebInterface.h.
Referenced by createTkMap(), handleEDARequest(), performAction(), and periodicTkMapUpdate().
Definition at line 58 of file SiPixelWebInterface.h.
Referenced by handleEDARequest(), performAction(), periodicTkMapUpdate(), SiPixelWebInterface(), and ~SiPixelWebInterface().
bool SiPixelWebInterface::offlineXMLfile_ [private] |
Definition at line 68 of file SiPixelWebInterface.h.
Referenced by SiPixelWebInterface().
std::multimap<std::string, std::string> SiPixelWebInterface::requestMap_ [private] |
Definition at line 66 of file SiPixelWebInterface.h.
Referenced by createTkMap(), handleEDARequest(), and periodicTkMapUpdate().
Definition at line 56 of file SiPixelWebInterface.h.
Referenced by createTkMap(), getActionFlag(), handleEDARequest(), performAction(), setActionFlag(), and SiPixelWebInterface().
bool SiPixelWebInterface::Tier0Flag_ [private] |
Definition at line 69 of file SiPixelWebInterface.h.
Referenced by SiPixelWebInterface().
bool SiPixelWebInterface::tkMapCreated [private] |
Definition at line 65 of file SiPixelWebInterface.h.
Referenced by handleEDARequest(), performAction(), and SiPixelWebInterface().
std::vector<std::string> SiPixelWebInterface::tkMapOptions_ [private] |
Definition at line 64 of file SiPixelWebInterface.h.
Referenced by SiPixelWebInterface().