CMS 3D CMS Logo

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

#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< CondDBPlotParametercondDBRequestList_
 
DQMStoredqmStore_
 
SiStripInformationExtractorinfoExtractor_
 
std::multimap< std::string,
std::string > 
requestMap_
 
SiStripActionType theActionFlag
 
std::string TkMapType
 

Detailed Description

Definition at line 20 of file SiStripWebInterface.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

SiStripWebInterface::SiStripWebInterface ( DQMStore dqm_store)

Definition at line 19 of file SiStripWebInterface.cc.

References infoExtractor_, NoAction, theActionFlag, and TkMapType.

19  : dqmStore_(dqm_store) {
20 
22  infoExtractor_ = 0;
24  TkMapType = "QTestAlarm";
25 }
SiStripInformationExtractor * infoExtractor_
SiStripActionType theActionFlag
SiStripWebInterface::~SiStripWebInterface ( )

Definition at line 29 of file SiStripWebInterface.cc.

References infoExtractor_.

29  {
30  if (infoExtractor_) delete infoExtractor_;
31  infoExtractor_ = 0;
32 }
SiStripInformationExtractor * infoExtractor_

Member Function Documentation

void SiStripWebInterface::clearConDBPlotRequests ( )
inline

Definition at line 47 of file SiStripWebInterface.h.

References condDBRequestList_.

Referenced by SiStripAnalyser::analyze().

47 { condDBRequestList_.clear(); }
std::vector< CondDBPlotParameter > condDBRequestList_
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().

223 {
224  std::multimap<std::string, std::string>::iterator it;
225  it = mymap.find(key);
226  if (it != mymap.end())
227  {
228  return (it->second);
229  }
230  return "";
231 }
list key
Definition: combine.py:13
SiStripActionType SiStripWebInterface::getActionFlag ( )
inline

Definition at line 41 of file SiStripWebInterface.h.

References theActionFlag.

41 {return theActionFlag;}
SiStripActionType 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().

236  {
237  if (condDBRequestList_.size() > ival) {
238  det_id = condDBRequestList_[ival].detId;
239  subdet_type = condDBRequestList_[ival].type;
240  subdet_side = condDBRequestList_[ival].side;
241  layer_number = condDBRequestList_[ival].layer;
242  } else {
243  det_id = 999;
244  subdet_type = "";
245  subdet_side = 999;
246  layer_number = 999;
247  }
248 
249 }
std::vector< CondDBPlotParameter > condDBRequestList_
unsigned int SiStripWebInterface::getNumberOfConDBPlotRequest ( )
inline

Definition at line 44 of file SiStripWebInterface.h.

References condDBRequestList_.

Referenced by SiStripAnalyser::analyze().

44 { return condDBRequestList_.size();}
std::vector< CondDBPlotParameter > condDBRequestList_
std::string SiStripWebInterface::getTkMapType ( )
inline

Definition at line 49 of file SiStripWebInterface.h.

References TkMapType.

Referenced by SiStripAnalyser::endLuminosityBlock().

49 { 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, dtNoiseDBValidation_cfg::cerr, condDBRequestList_, SiStripWebInterface::CondDBPlotParameter::detId, dqmStore_, groupFilesInBlocks::fin, 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(), matplotRender::reader, SiStripInformationExtractor::readGlobalHistoList(), SiStripInformationExtractor::readLayoutNames(), SiStripInformationExtractor::readModuleAndHistoList(), SiStripInformationExtractor::readNonGeomHistoTree(), SiStripInformationExtractor::readQTestSummary(), SiStripInformationExtractor::readStatusMessage(), SiStripInformationExtractor::readSummaryHistoTree(), requestMap_, returnReplyXml(), SiStripWebInterface::CondDBPlotParameter::side, lumiContext::sname, AlCaHLTBitMon_QueryRunRegistry::string, theActionFlag, TkMapType, and SiStripWebInterface::CondDBPlotParameter::type.

Referenced by SiStripAnalyser::defaultWebPage().

36  {
37  DQMScope enter;
38  // put the request information in a multimap...
39  // std::multimap<std::string, std::string> requestMap_;
41  reader.read_form(requestMap_);
42  if (niter < 0) return;
43  std::string requestID = get_from_multimap(requestMap_, "RequestID");
44  // get the string that identifies the request:
45  edm::LogInfo ("SiStripWebInterface") << "SiStripWebInterface::handleAnalyserRequest RequestID = " << requestID ;
46  if (requestID == "IsReady") {
48  if (niter > 0) {
50  } else {
51  returnReplyXml(out, "ReadyState", "wait");
52  }
53  }
54  else if (requestID == "CheckQTResults") {
55  std::string infoType = get_from_multimap(requestMap_, "InfoType");
58  }
59  else if (requestID == "SingleModuleHistoList") {
62  infoExtractor_->readModuleAndHistoList(dqmStore_, sname, detcabling, out);
63  }
64  else if (requestID == "GlobalHistoList") {
66  std::string gname = get_from_multimap(requestMap_, "GlobalFolder");
68  }
69  else if (requestID == "SummaryHistoList") {
71  std::string sname = get_from_multimap(requestMap_, "StructureName");
73  }
74  else if (requestID == "AlarmList") {
76  std::string sname = get_from_multimap(requestMap_, "StructureName");
78  }
79  else if (requestID == "ReadQTestStatus") {
82  }
83  else if (requestID == "PlotAsModule") {
86  }
87  else if (requestID == "PlotGlobalHisto") {
90  }
91  else if (requestID == "PlotHistogramFromPath") {
94  }
95  else if (requestID == "PlotTkMapHistogram") {
97  requestMap_.insert(std::pair<std::string,std::string>("TkMapType", TkMapType));
99  }
100  else if (requestID == "PlotHistogramFromLayout") {
102  }
103  else if (requestID == "GetImage") {
105  }
106  else if (requestID == "GetTkMap") {
108 
109  ifstream fin("dqmtmapviewer.xhtml");
110  char buf[BUF_SIZE];
111  std::ostringstream html_out;
112  if (!fin) {
113  std::cerr << "Input File: dqmtmapviewer.xhtml "<< " could not be opened!" << std::endl;
114  return;
115  }
116  while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character
117  html_out << buf << std::endl;
118  }
119  fin.close();
120 
121  out->getHTTPResponseHeader().addHeader("Content-type","application/xhtml+xml");
122  *out << html_out.str();
123  }
124  else if (requestID == "NonGeomHistoList") {
128  }
129  else if (requestID == "PlotModuleCondDBHistos") {
131  CondDBPlotParameter local_par;
132  uint32_t detId = atoi(get_from_multimap(requestMap_,"ModId").c_str());
133  local_par.detId = detId;
134  local_par.type = "";
135  local_par.side = 999;
136  local_par.layer = 999;
137  bool create_plot;
139  if (create_plot) condDBRequestList_.push_back(local_par);
140  }
141  else if (requestID == "PlotLayerCondDBHistos") {
142 
144  CondDBPlotParameter local_par;
145  std::string sname = get_from_multimap(requestMap_,"StructureName");
146  local_par.detId = 999;
147  local_par.type = sname.substr(sname.find_first_of("/")+1,3);
148  if (sname.find("side_")!=std::string::npos)
149  local_par.side = atoi((sname.substr(sname.find("side_")+5,1)).c_str());
150  else local_par.side = 999;
151  local_par.layer = atoi((sname.substr(sname.find_last_of("_")+1)).c_str());
152  bool create_plot;
154  if (create_plot) condDBRequestList_.push_back(local_par);
155 
156  } else if (requestID == "UpdateTrackerMapOption") {
159  returnReplyXml(out, "TkMapOption", TkMapType);
160  }
161 
162  performAction();
163 }
void readSummaryHistoTree(DQMStore *dqm_store, std::string &str_name, xgi::Output *out)
void getSingleModuleHistos(DQMStore *dqm_store, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void getCondDBHistos(DQMStore *dqm_store, bool &plot_flag, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void getTrackerMapHistos(DQMStore *dqm_store, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void returnReplyXml(xgi::Output *out, const std::string &name, const std::string &comment)
void readModuleAndHistoList(DQMStore *dqm_store, std::string &sname, const edm::ESHandle< SiStripDetCabling > &detcabling, xgi::Output *out)
std::vector< CondDBPlotParameter > condDBRequestList_
SiStripInformationExtractor * infoExtractor_
SiStripActionType theActionFlag
void readStatusMessage(DQMStore *dqm_store, std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void readGlobalHistoList(DQMStore *dqm_store, std::string &dname, xgi::Output *out)
void getImage(const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void readLayoutNames(DQMStore *dqm_store, xgi::Output *out)
void getGlobalHistos(DQMStore *dqm_store, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
tuple out
Definition: dbtoconf.py:99
void getHistosFromPath(DQMStore *dqm_store, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
std::string get_from_multimap(std::multimap< std::string, std::string > &mymap, std::string key)
string fname
main script
void readQTestSummary(DQMStore *dqm_store, std::string type, xgi::Output *out)
#define BUF_SIZE
std::multimap< std::string, std::string > requestMap_
void readNonGeomHistoTree(DQMStore *dqm_store, std::string &fld_name, xgi::Output *out)
void readAlarmTree(DQMStore *dqm_store, std::string &str_name, xgi::Output *out)
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().

167  {
168 
169  switch (theActionFlag) {
171  {
172  // actionExecutor_->createSummary(dqmStore_);
173  break;
174  }
176  {
177 // infoExtractor_->plotSingleModuleHistos(dqmStore_, requestMap_, out);
178  break;
179  }
181  {
182 // infoExtractor_->plotGlobalHistos(dqmStore_, requestMap_, out);
183  break;
184  }
186  {
187 // infoExtractor_->plotTrackerMapHistos(dqmStore_, requestMap_, out);
188  break;
189  }
191  {
192 // infoExtractor_->plotHistosFromPath(dqmStore_, requestMap_, out);
193  break;
194  }
196  {
198  break;
199  }
201  {
203  break;
204  }
206  {
207  break;
208  }
209  }
211 }
void plotHistosFromLayout(DQMStore *dqm_store)
SiStripInformationExtractor * infoExtractor_
SiStripActionType theActionFlag
void createImages(DQMStore *dqm_store)
void setActionFlag(SiStripActionType flag)
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().

212  {
213  out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
214  *out << "<?xml version=\"1.0\" ?>" << std::endl;
215  *out << "<"<<name<<">" << std::endl;
216  *out << " <Response>" << comment << "</Response>" << std::endl;
217  *out << "</"<<name<<">" << std::endl;
218 }
tuple out
Definition: dbtoconf.py:99
#define comment(par)
Definition: vmac.h:162
void SiStripWebInterface::setActionFlag ( SiStripActionType  flag)
inline

Definition at line 42 of file SiStripWebInterface.h.

References theActionFlag.

Referenced by SiStripAnalyser::analyze(), SiStripAnalyser::endLuminosityBlock(), and performAction().

long int flag
Definition: mlp_lapack.h:47
SiStripActionType theActionFlag

Member Data Documentation

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
DQMStore* SiStripWebInterface::dqmStore_
private

Definition at line 63 of file SiStripWebInterface.h.

Referenced by handleAnalyserRequest(), and performAction().

SiStripInformationExtractor* SiStripWebInterface::infoExtractor_
private
std::multimap<std::string, std::string> SiStripWebInterface::requestMap_
private

Definition at line 61 of file SiStripWebInterface.h.

Referenced by handleAnalyserRequest().

SiStripActionType SiStripWebInterface::theActionFlag
private
std::string SiStripWebInterface::TkMapType
private

Definition at line 77 of file SiStripWebInterface.h.

Referenced by getTkMapType(), handleAnalyserRequest(), and SiStripWebInterface().