CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SiStripInformationExtractor Class Reference

#include <SiStripInformationExtractor.h>

List of all members.

Public Member Functions

void createImages (DQMStore *dqm_store)
void getCondDBHistos (DQMStore *dqm_store, bool &plot_flag, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void getGlobalHistos (DQMStore *dqm_store, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void getHistosFromPath (DQMStore *dqm_store, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void getImage (const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void getSingleModuleHistos (DQMStore *dqm_store, 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 plotHistosFromLayout (DQMStore *dqm_store)
void readAlarmTree (DQMStore *dqm_store, std::string &str_name, xgi::Output *out)
 (Documentation under construction).
void readGlobalHistoList (DQMStore *dqm_store, std::string &dname, xgi::Output *out)
void readLayoutNames (DQMStore *dqm_store, xgi::Output *out)
void readModuleAndHistoList (DQMStore *dqm_store, std::string &sname, const edm::ESHandle< SiStripDetCabling > &detcabling, xgi::Output *out)
void readNonGeomHistoTree (DQMStore *dqm_store, std::string &fld_name, xgi::Output *out)
void readQTestSummary (DQMStore *dqm_store, std::string type, xgi::Output *out)
void readStatusMessage (DQMStore *dqm_store, std::multimap< std::string, std::string > &req_map, xgi::Output *out)
void readSummaryHistoTree (DQMStore *dqm_store, std::string &str_name, xgi::Output *out)
 (Documentation under construction).
 SiStripInformationExtractor ()
 ~SiStripInformationExtractor ()

Private Member Functions

void getItemList (const std::multimap< std::string, std::string > &req_map, std::string item_name, std::vector< std::string > &items)
 (Documentation under construction).
std::string getItemValue (const std::multimap< std::string, std::string > &req_map, std::string item_name)
bool hasItem (const std::multimap< std::string, std::string > &req_map, std::string item_name)
 (Documentation under construction).
void printAlarmList (DQMStore *dqm_store, std::ostringstream &str_val)
 (Documentation under construction).
void printNonGeomHistoList (DQMStore *dqm_store, std::ostringstream &str_val)
void printSummaryHistoList (DQMStore *dqm_store, std::ostringstream &str_val)
 (Documentation under construction).
void readConfiguration ()
void selectColor (std::string &col, int status)
void selectColor (std::string &col, std::vector< QReport * > &reports)
void selectImage (std::string &name, int status)
void selectImage (std::string &name, std::vector< QReport * > &reports)
void setHTMLHeader (xgi::Output *out)
void setPlainHeader (xgi::Output *out)
void setXMLHeader (xgi::Output *out)

Private Attributes

SiStripHistoPlotterhistoPlotter_
std::map< std::string,
std::vector< std::string > > 
layoutMap
SiStripLayoutParserlayoutParser_
bool readReference_
std::vector< std::string > subdetVec

Detailed Description

Definition at line 25 of file SiStripInformationExtractor.h.


Constructor & Destructor Documentation

SiStripInformationExtractor::SiStripInformationExtractor ( )

Definition at line 22 of file SiStripInformationExtractor.cc.

References histoPlotter_, layoutMap, layoutParser_, and readConfiguration().

                                                         {
  edm::LogInfo("SiStripInformationExtractor") << 
    " Creating SiStripInformationExtractor " << "\n" ;
  layoutParser_ = 0;
  layoutMap.clear();
  histoPlotter_=0;
  histoPlotter_ = new SiStripHistoPlotter();
  readConfiguration();
}
SiStripInformationExtractor::~SiStripInformationExtractor ( )

Definition at line 34 of file SiStripInformationExtractor.cc.

References histoPlotter_, and layoutParser_.

                                                          {
  edm::LogInfo("SiStripInformationExtractor") << 
    " Deleting SiStripInformationExtractor " << "\n" ;
  if (layoutParser_) delete layoutParser_;
  if (histoPlotter_) delete histoPlotter_;

}

Member Function Documentation

void SiStripInformationExtractor::createImages ( DQMStore dqm_store)
void SiStripInformationExtractor::getCondDBHistos ( DQMStore dqm_store,
bool &  plot_flag,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 343 of file SiStripInformationExtractor.cc.

References DQMStore::getContents(), SiStripFolderOrganizer::getFolderName(), getItemValue(), MonitorElement::getName(), hasItem(), histoPlotter_, SiStripHistoPlotter::setNewCondDBPlot(), setXMLHeader(), and split.

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                                                                        {

  plot_flag = true;
  std::string sname = getItemValue(req_map,"StructureName");
  int width  = atoi(getItemValue(req_map, "width").c_str());
  int height = atoi(getItemValue(req_map, "height").c_str());

  std::string path = "";
  uint32_t detId;
  if (hasItem(req_map,std::string("ModId"))) {
    detId = atoi(getItemValue(req_map,"ModId").c_str());
    if (detId != 0) {
      SiStripFolderOrganizer folder_organizer;
      folder_organizer.getFolderName(detId,path);
    }
  } else {
    if (sname.size() > 0) path = "SiStrip/" + sname;
  }
  if (path.size() == 0) path = "dummy_path";

  setXMLHeader(out);
  *out << "<HPathAndHNameList>" << std::endl;
  *out << "<HPath>" << path << "</HPath>" << std::endl;
  
  if (path == "dummy_path") {
    *out << "<HName>" << "Dummy" << "</HName>" << std::endl;
    plot_flag = false;
  } else {
    std::string opt = getItemValue(req_map,"option");
    std::vector<std::string> htypes;
    SiStripUtility::split(opt, htypes, ",");
    // Check if CondDB histograms already exists
    std::vector<MonitorElement*> all_mes = dqm_store->getContents(path);
    for (std::vector<std::string>::const_iterator ih = htypes.begin();
         ih!= htypes.end(); ih++) {
      std::string type = (*ih);
      if (type.size() == 0) continue;
      for (std::vector<MonitorElement *>::const_iterator it = all_mes.begin();
           it!= all_mes.end(); it++) {
        MonitorElement * me = (*it);
        if (!me) continue;
        std::string hname = me->getName();
        if (hname.find(type) != std::string::npos) {
          plot_flag = false;
          break;
        } 
      }  
      if (plot_flag == false) break;
    } 
    histoPlotter_->setNewCondDBPlot(path, opt, width, height);
    for (std::vector<std::string>::const_iterator ih = htypes.begin();
         ih != htypes.end(); ih++) {
      if ((*ih).size() > 0) {
        *out << "<HName>" << (*ih)  << "</HName>" << std::endl;
      }
    }
  }
  *out << "</HPathAndHNameList>" << std::endl;
}
void SiStripInformationExtractor::getGlobalHistos ( DQMStore dqm_store,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 206 of file SiStripInformationExtractor.cc.

References DQMStore::getContents(), getItemList(), getItemValue(), MonitorElement::getName(), histoPlotter_, SiStripHistoPlotter::setNewPlot(), and setXMLHeader().

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                                                        {
 
  std::vector<std::string> hlist;  
  getItemList(req_map,"histo", hlist);

  std::string path = getItemValue(req_map, "GlobalFolder");    

  int width  = atoi(getItemValue(req_map, "width").c_str());
  int height = atoi(getItemValue(req_map, "height").c_str());

  std::string opt =" ";

  std::vector<MonitorElement *> all_mes = dqm_store->getContents(path);

  setXMLHeader(out);
  *out << "<HPathAndHNameList>" << std::endl;
  *out << "<HPath>" << path << "</HPath>" << std::endl;

  for (std::vector<std::string>::const_iterator ih = hlist.begin();
       ih != hlist.end(); ih++) {      
    for (std::vector<MonitorElement *>::const_iterator it = all_mes.begin();
         it!= all_mes.end(); it++) {
      MonitorElement * me = (*it);
      if (!me) continue;
      std::string hname = me->getName();
      std::string name = hname.substr(0, hname.find("__det__"));
      if (name == (*ih)) {
        std::string full_path = path + "/" + hname;
        histoPlotter_->setNewPlot(full_path, opt, width, height);
        *out << "<HName>" << name << "</HName>" << std::endl;
      }
    }
  }
  *out << "</HPathAndHNameList>" << std::endl;
}
void SiStripInformationExtractor::getHistosFromPath ( DQMStore dqm_store,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 244 of file SiStripInformationExtractor.cc.

References DQMStore::getContents(), getItemValue(), MonitorElement::getName(), histoPlotter_, mergeVDriftHistosByStation::name, SiStripHistoPlotter::setNewPlot(), and setXMLHeader().

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                                                          {

  std::string path = getItemValue(req_map,"Path");

  if (path.size() == 0) return;

  int width  = atoi(getItemValue(req_map, "width").c_str());
  int height = atoi(getItemValue(req_map, "height").c_str());

  std::string opt =" ";

  setXMLHeader(out);
  *out << "<HPathAndHNameList>" << std::endl;
  *out << "<HPath>" << path << "</HPath>" << std::endl;

  std::vector<MonitorElement*> all_mes = dqm_store->getContents(path);
  for(std::vector<MonitorElement*>::iterator it=all_mes.begin(); it!=all_mes.end(); it++){
    MonitorElement* me = (*it);
    if (!me) continue;
    std::string name = me->getName();
    std::string full_path = path + "/" + name;
    histoPlotter_->setNewPlot(full_path, opt, width, height);
    *out << "<HName>" << name << "</HName>" << std::endl;
  }
  *out << "</HPathAndHNameList>" << std::endl;
}
void SiStripInformationExtractor::getImage ( const std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 405 of file SiStripInformationExtractor.cc.

References getItemValue(), SiStripHistoPlotter::getNamedImageBuffer(), and histoPlotter_.

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                           {
  
  std::string path = getItemValue(req_map,"Path");
  std::string image;
  histoPlotter_->getNamedImageBuffer(path, image);
  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 << image;

}
void SiStripInformationExtractor::getItemList ( const std::multimap< std::string, std::string > &  req_map,
std::string  item_name,
std::vector< std::string > &  items 
) [private]

(Documentation under construction).

This method

Definition at line 678 of file SiPixelInformationExtractor.cc.

Referenced by getGlobalHistos().

                                                                     {
//cout<<"entering SiPixelInformationExtractor::getItemList"<<endl;
  items.clear();
  for (multimap<string, string>::const_iterator it = req_map.begin();
       it != req_map.end(); it++) {
    if (it->first == item_name) {
      items.push_back(it->second);
    }
  }
//cout<<"leaving SiPixelInformationExtractor::getItemList"<<endl;
}
std::string SiStripInformationExtractor::getItemValue ( const std::multimap< std::string, std::string > &  req_map,
std::string  item_name 
) [private]

Definition at line 595 of file SiStripInformationExtractor.cc.

References relativeConstraints::value.

Referenced by getCondDBHistos(), getGlobalHistos(), getHistosFromPath(), getImage(), getTrackerMapHistos(), and readStatusMessage().

                                                                     {
  std::multimap<std::string,std::string>::const_iterator pos = req_map.find(item_name);
  std::string value = " ";
  if (pos != req_map.end()) {
    value = pos->second;
  }
  return value;
}
void SiStripInformationExtractor::getSingleModuleHistos ( DQMStore dqm_store,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 97 of file SiPixelInformationExtractor.cc.

References gather_cfg::cout, spr::find(), DQMStore::getContents(), SiPixelInformationExtractor::getItemList(), SiPixelInformationExtractor::getItemValue(), SiPixelFolderOrganizer::getModuleFolder(), MonitorElement::getName(), SiPixelInformationExtractor::histoPlotter_, path(), DQMStore::pwd(), SiPixelInformationExtractor::setHTMLHeader(), SiPixelHistoPlotter::setNewPlot(), and tablePrinter::width.

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                        {
//cout<<"In SiPixelInformationExtractor::getSingleModuleHistos: "<<endl;
  vector<string> hlist;
  getItemList(req_map,"histo", hlist);

  uint32_t detId = atoi(getItemValue(req_map,"ModId").c_str());
 
  int width  = atoi(getItemValue(req_map, "width").c_str());
  int height = atoi(getItemValue(req_map, "height").c_str());

  string opt =" ";
  
  SiPixelFolderOrganizer folder_organizer;
  string path;
  folder_organizer.getModuleFolder(detId,path);   

  if((bei->pwd()).find("Module_") == string::npos &&
     (bei->pwd()).find("FED_") == string::npos){
    cout<<"This is not a pixel module or FED!"<<endl;
    return;
  }
 
  vector<MonitorElement*> all_mes = bei->getContents(path);
  setHTMLHeader(out);
  *out << path << " ";

  string theME ;
  for (vector<string>::const_iterator ih = hlist.begin();
       ih != hlist.end(); ih++) {
    for (vector<MonitorElement *>::const_iterator it = all_mes.begin();
         it!= all_mes.end(); it++) {
      MonitorElement * me = (*it);
      if (!me) continue;
      theME = me->getName();
      string temp_s ; 
      if(theME.find("siPixel")!=string::npos || theME.find("ctfWithMaterialTracks")!=string::npos) { temp_s = theME.substr(0,theME.find_first_of("_")); }
      //cout<<"should be the variable name: temp_s= "<<temp_s<<endl;
      if (temp_s == (*ih)) {
        string full_path = path + "/" + me->getName();
        histoPlotter_->setNewPlot(full_path, opt, width, height);
        *out << me->getName() << " " ;
      }
    }
  }
}
void SiStripInformationExtractor::getTrackerMapHistos ( DQMStore dqm_store,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 310 of file SiStripInformationExtractor.cc.

References DQMStore::getContents(), SiStripFolderOrganizer::getFolderName(), getItemValue(), MonitorElement::getName(), histoPlotter_, path(), SiStripHistoPlotter::setNewPlot(), and setXMLHeader().

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                                                            {

  uint32_t detId = atoi(getItemValue(req_map,"ModId").c_str());
 
  int width  = atoi(getItemValue(req_map, "width").c_str());
  int height = atoi(getItemValue(req_map, "height").c_str());

  std::string opt =" ";
  
  SiStripFolderOrganizer folder_organizer;
  std::string path;
  folder_organizer.getFolderName(detId,path);   

  std::vector<MonitorElement*> all_mes = dqm_store->getContents(path);
  setXMLHeader(out);
  *out << "<HPathAndHNameList>" << std::endl;
  *out << "<HPath>" << path << "</HPath>" << std::endl;
  for (std::vector<MonitorElement *>::const_iterator it = all_mes.begin();
       it!= all_mes.end(); it++) {
    MonitorElement * me = (*it);
    if (!me) continue;
    std::string hname = me->getName(); 
    std::string full_path;
    full_path = path + "/" + hname;
    histoPlotter_->setNewPlot(full_path, opt, width, height);
    *out << "<HName>" << hname << "</HName>" << std::endl;
  }
  *out << "</HPathAndHNameList>" << std::endl;   

}
bool SiStripInformationExtractor::hasItem ( const std::multimap< std::string, std::string > &  req_map,
std::string  item_name 
) [private]

(Documentation under construction).

This method

Definition at line 697 of file SiPixelInformationExtractor.cc.

References pos.

Referenced by getCondDBHistos().

                                                           {
//cout<<"entering SiPixelInformationExtractor::hasItem"<<endl;
  multimap<string,string>::iterator pos = req_map.find(item_name);
  if (pos != req_map.end()) return true;
  return false;  
//cout<<"leaving SiPixelInformationExtractor::hasItem"<<endl;
}
void SiStripInformationExtractor::plotHistosFromLayout ( DQMStore dqm_store)

Definition at line 273 of file SiStripInformationExtractor.cc.

References SiStripHistoPlotter::createStaticPlot(), alignmentValidation::fname, DQMStore::get(), MonitorElement::getName(), histoPlotter_, layoutMap, Association::map, and dbtoconf::out.

Referenced by SiStripWebInterface::performAction().

                                                                          {
  if (layoutMap.size() == 0) return;

  ofstream image_file;
  
  for (std::map<std::string, std::vector< std::string > >::iterator it = layoutMap.begin() ; it != layoutMap.end(); it++) {
    unsigned int ival = 0;
    std::string image_list = "images/" + it->first +".lis";
    image_file.open(image_list.c_str(), std::ios::out);
    if (!image_file) return;

    image_file << "[";
    for (std::vector<std::string>::iterator im = it->second.begin(); 
         im != it->second.end(); im++) {  
      std::string path_name = (*im);
      if (path_name.size() == 0) continue;
      MonitorElement* me = dqm_store->get(path_name);
      ival++;
      std::ostringstream  fname, ftitle;
      if (!me) {
        fname << "images/EmptyPlot.png";
        ftitle << "EmptyPlot";                 
      } else {
        fname << "images/" << it->first << "_" <<ival << ".png";
        ftitle << me->getName();
        histoPlotter_->createStaticPlot(me, fname.str());
      }
      image_file << "["<< "\"" << fname.str() << "\",\"" << path_name << "\"]";
      if (ival != it->second.size()) image_file << ","<< std::endl;
    }
    image_file << "]" << std::endl;
    image_file.close();
  }
}
void SiStripInformationExtractor::printAlarmList ( DQMStore dqm_store,
std::ostringstream &  str_val 
) [private]

(Documentation under construction).

Returns a stringstream containing an HTML-formatted list of alarms for the current directory. This is a recursive method.

Definition at line 593 of file SiPixelInformationExtractor.cc.

References SiPixelInformationExtractor::alarmCounter_, DQMStore::cd(), DQMStore::get(), DQMStore::getMEs(), MonitorElement::getQReports(), DQMStore::getStatus(), DQMStore::getSubdirs(), DQMStore::goUp(), SiPixelInformationExtractor::printAlarmList(), DQMStore::pwd(), and SiPixelInformationExtractor::selectImage().

                                                                        {
//cout<<"entering SiPixelInformationExtractor::printAlarmList"<<endl;
//   cout << ACRed << ACBold
//        << "[SiPixelInformationExtractor::printAlarmList()]"
//        << ACPlain
//        << " Enter" 
//        << endl ;
  static string indent_str = "";
  string currDir = bei->pwd();
  string dname = currDir.substr(currDir.find_last_of("/")+1);
  string image_name;
  selectImage(image_name,bei->getStatus(currDir));
  if(image_name!="images/LI_green.gif")
    str_val << " <li>\n"
            << "  <a href=\"#\" id=\"" << currDir << "\">\n   " 
            <<     dname 
            << "  </a>\n"
            << "  <img src=\"" 
            <<     image_name 
            << "\">" << endl;
  vector<string> subDirVec = bei->getSubdirs();

  vector<string> meVec = bei->getMEs();
   
  if (subDirVec.size() == 0 && meVec.size() == 0) {
    str_val <<  "</li> "<< endl;    
    return;
  }
  str_val << "<ul>" << endl;
  for (vector<string>::const_iterator it = meVec.begin();
           it != meVec.end(); it++) {
    string full_path = currDir + "/" + (*it);

    MonitorElement * me = bei->get(full_path);
    
    if (!me) continue;
    std::vector<QReport *> my_map = me->getQReports();
    if (my_map.size() > 0) {
      string image_name1;
      selectImage(image_name1,my_map);
      if(image_name1!="images/LI_green.gif") {
        alarmCounter_++;
        str_val << "    <li class=\"dhtmlgoodies_sheet.gif\">\n"
                << "     <input id      = \"selectedME\""
                << "            folder  = \"" << currDir << "\""
                << "            type    = \"checkbox\""
                << "            name    = \"selected\""
                << "            class   = \"smallCheckBox\""
                << "            value   = \"" << (*it) << "\""
                << "            onclick = \"javascript:IMGC.selectedIMGCItems()\" />\n"
//              << "     <a href=\"javascript:IMGC.updateIMGC('" << currDir << "')\">\n       " 
                << "     <a href=\"javascript:IMGC.plotFromPath('" << currDir << "')\">\n       " 
                <<        (*it) << "\n"
                << "     </a>\n"
                << "     <img src=\""
                <<        image_name1 
                << "\">"
                << "    </li>" 
                << endl;
        }       
    }
  }
  for (vector<string>::const_iterator ic = subDirVec.begin();
       ic != subDirVec.end(); ic++) {
    bei->cd(*ic);
    printAlarmList(bei, str_val);
    bei->goUp();
  }
  str_val << "</ul> "<< endl;  
  str_val << "</li> "<< endl;  
//   cout << ACGreen << ACBold
//        << "[SiPixelInformationExtractor::printAlarmList()]"
//        << ACPlain
//        << " Done" 
//        << endl ;
//cout<<"leaving SiPixelInformationExtractor::printAlarmList"<<endl;
}
void SiStripInformationExtractor::printNonGeomHistoList ( DQMStore dqm_store,
std::ostringstream &  str_val 
) [private]

Definition at line 834 of file SiStripInformationExtractor.cc.

References DQMStore::cd(), DQMStore::getContents(), MonitorElement::getName(), DQMStore::getSubdirs(), DQMStore::goUp(), and DQMStore::pwd().

Referenced by readNonGeomHistoTree().

                                                                                                      {
  static std::string indent_str = "";

  std::string currDir = dqm_store->pwd();
  std::string dname = currDir.substr(currDir.find_last_of("/")+1);
  str_val << "<li><span class=\"folder\">" << dname << "</span>" << std::endl;
  std::vector<MonitorElement *> meVec = dqm_store->getContents(currDir);
  std::vector<std::string> subDirVec = dqm_store->getSubdirs();
  if ( meVec.size()== 0  && subDirVec.size() == 0 ) {
    str_val << "</li> "<< std::endl;    
    return;
  }
  str_val << "<ul>" << std::endl;      
  for (std::vector<MonitorElement *>::const_iterator it = meVec.begin();
         it != meVec.end(); it++) {
    MonitorElement* me = (*it);
    if (!me) continue;
    std::string name = (*it)->getName();
    str_val << "<li> <span class=\"file\"><a href=\"javascript:RequestHistos.DrawSummaryHistogram('" 
            << currDir
            << "')\">" << name << "</a></span></li>" << std::endl;
  }
  for (std::vector<std::string>::const_iterator ic = subDirVec.begin();
       ic != subDirVec.end(); ic++) {
    dqm_store->cd(*ic);
    printNonGeomHistoList(dqm_store, str_val);
    dqm_store->goUp();
  }
  str_val << "</ul> "<< std::endl;  
  str_val << "</li> "<< std::endl;  
}
void SiStripInformationExtractor::printSummaryHistoList ( DQMStore dqm_store,
std::ostringstream &  str_val 
) [private]

(Documentation under construction).

Returns a stringstream containing an HTML-formatted list of ME in the current directory. This is a recursive method.

Definition at line 495 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), DQMStore::getMEs(), DQMStore::getSubdirs(), DQMStore::goUp(), SiPixelInformationExtractor::printSummaryHistoList(), and DQMStore::pwd().

                                                                               {
//cout<<"entering SiPixelInformationExtractor::printSummaryHistoList"<<endl;
  static string indent_str = "";
  string currDir = bei->pwd();
  string dname = currDir.substr(currDir.find_last_of("/")+1);
  if (dname.find("Module_") ==0 || dname.find("FED_")==0) return;
  str_val << " <li>\n"
          << "  <a href=\"#\" id=\"" << currDir << "\">\n   " 
          <<     dname 
          << "  </a>" 
          << endl;

  vector<string> meVec     = bei->getMEs(); 
  
  vector<string> subDirVec = bei->getSubdirs();
  if ( meVec.size()== 0  && subDirVec.size() == 0 ) {
    str_val << " </li> "<< endl;    
    return;
  }
  str_val << "\n   <ul>" << endl;      
  for (vector<string>::const_iterator it = meVec.begin();
       it != meVec.end(); it++) {
    if ((*it).find("SUM") == 0) {
      str_val << "    <li class=\"dhtmlgoodies_sheet.gif\">\n"
              << "     <input id      = \"selectedME\""
              << "            folder  = \"" << currDir << "\""
              << "            type    = \"checkbox\""
              << "            name    = \"selected\""
              << "            class   = \"smallCheckBox\""
              << "            value   = \"" << (*it) << "\""
              << "            onclick = \"javascript:IMGC.selectedIMGCItems()\" />\n"
//              << "     <a href=\"javascript:IMGC.updateIMGC('" << currDir << "')\">\n       " 
              << "     <a href=\"javascript:IMGC.plotFromPath('" << currDir << "')\">\n       " 
              <<       (*it) << "\n"
              << "     </a>\n"
              << "    </li>" 
              << endl;
    }
  }

  for (vector<string>::const_iterator ic = subDirVec.begin();
       ic != subDirVec.end(); ic++) {
    bei->cd(*ic);
    printSummaryHistoList(bei, str_val);
    bei->goUp();
  }
  str_val << "   </ul> "<< endl;  
  str_val << "  </li> "<< endl;  
//cout<<"leaving SiPixelInformationExtractor::printSummaryHistoList"<<endl;
}
void SiStripInformationExtractor::readAlarmTree ( DQMStore dqm_store,
std::string &  str_name,
xgi::Output *  out 
)

(Documentation under construction).

This method

Definition at line 553 of file SiPixelInformationExtractor.cc.

References ACBold, ACPlain, ACYellow, SiPixelInformationExtractor::alarmCounter_, DQMStore::cd(), gather_cfg::cout, SiPixelInformationExtractor::goToDir(), and SiPixelInformationExtractor::printAlarmList().

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                {
//cout<<"entering SiPixelInformationExtractor::readAlarmTree"<<endl;
  ostringstream alarmtree;
  if (goToDir(bei, str_name)) {
    alarmtree << "<ul id=\"dhtmlgoodies_tree\" class=\"dhtmlgoodies_tree\">" << endl;
    alarmCounter_=0;
    printAlarmList(bei,alarmtree);
    if(alarmCounter_==0) alarmtree <<"<li>No problematic modules found, all ok!</li>" << endl;
    alarmtree <<"</ul>" << endl; 
  } else {
    alarmtree << "Desired Directory does not exist";
  }
  cout << ACYellow << ACBold
       << "[SiPixelInformationExtractor::readAlarmTree()]"
       << ACPlain << endl ;
  //     << "html string follows: " << endl ;
  //cout << alarmtree.str() << endl ;
  //cout << ACYellow << ACBold
  //     << "[SiPixelInformationExtractor::readAlarmTree()]"
  //     << ACPlain
  //     << "String complete " << endl ;
  out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
 *out << alarmtree.str();
  bei->cd();
  cout << ACYellow << ACBold
       << "[SiPixelInformationExtractor::readAlarmTree()]"
       << ACPlain 
       << " Done!"
       << endl ;
//cout<<"leaving SiPixelInformationExtractor::readAlarmTree"<<endl;
}
void SiStripInformationExtractor::readConfiguration ( ) [private]

Definition at line 44 of file SiStripInformationExtractor.cc.

References SiStripLayoutParser::getAllLayouts(), DQMParserBase::getDocument(), layoutMap, layoutParser_, and subdetVec.

Referenced by SiStripInformationExtractor().

                                                    {
  std::string localPath = std::string("DQM/SiStripMonitorClient/data/sistrip_plot_layout.xml");
  if (layoutParser_ == 0) {
    layoutParser_ = new SiStripLayoutParser();
    layoutParser_->getDocument(edm::FileInPath(localPath).fullPath());
  }
  if (layoutParser_->getAllLayouts(layoutMap)) {
     edm::LogInfo("SiStripInformationExtractor") << 
    " Layouts correctly readout " << "\n" ;
  } else  edm::LogInfo("SiStripInformationExtractor") << 
          " Problem in reading Layout " << "\n" ;
  if (layoutParser_) delete layoutParser_;

  subdetVec.push_back("SiStrip/MechanicalView/TIB");
  subdetVec.push_back("SiStrip/MechanicalView/TOB");
  subdetVec.push_back("SiStrip/MechanicalView/TID/side_2");
  subdetVec.push_back("SiStrip/MechanicalView/TID/side_1");
  subdetVec.push_back("SiStrip/MechanicalView/TEC/side_2");
  subdetVec.push_back("SiStrip/MechanicalView/TEC/side_1");

}
void SiStripInformationExtractor::readGlobalHistoList ( DQMStore dqm_store,
std::string &  dname,
xgi::Output *  out 
)

Definition at line 508 of file SiStripInformationExtractor.cc.

References DQMStore::dirExists(), DQMStore::getContents(), MonitorElement::getName(), and setXMLHeader().

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                              {
   std::vector<std::string> hnames;
   std::string dname = str_name;
  
   setXMLHeader(out);
   *out << "<GlobalHistoList>" << std::endl;
   if (dqm_store->dirExists(dname)) {
     std::vector<MonitorElement*> meVec = dqm_store->getContents(dname);
     for (std::vector<MonitorElement *>::const_iterator it = meVec.begin();
          it != meVec.end(); it++) {
       MonitorElement* me = (*it);
       if (!me) continue;
       *out << "<GHisto>" << (*it)->getName() << "</GHisto>" << std::endl;           
     }
   } else {   
     *out << "<GHisto>" << " Desired directory : " << "</GHisto>" << std::endl;
     *out << "<GHisto>" <<       dname             << "</GHisto>" << std::endl;
     *out << "<GHisto>" << " does not exist!!!!  " << "</GHisto>" << std::endl;      
   }
   *out << "</GlobalHistoList>" << std::endl;
}
void SiStripInformationExtractor::readLayoutNames ( DQMStore dqm_store,
xgi::Output *  out 
)

Definition at line 420 of file SiStripInformationExtractor.cc.

References DQMStore::cd(), DQMStore::dirExists(), DQMStore::getMEs(), DQMStore::getSubdirs(), layoutMap, Association::map, setXMLHeader(), and subdetVec.

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                     {
  setXMLHeader(out);
  *out << "<LayoutAndTKMapList>" << std::endl;
  if (layoutMap.size() > 0) {
    *out << "<LayoutList>" << std::endl;
    for (std::map<std::string, std::vector< std::string > >::iterator it = layoutMap.begin();
        it != layoutMap.end(); it++) {
     *out << "<LName>" << it->first << "</LName>" << std::endl;  
   }
   *out << "</LayoutList>" << std::endl;
  }
  dqm_store->cd();
  *out << "<TKMapOptionList>" << std::endl;
  *out << "<TkMapOption>" << "QTestAlarm" << "</TkMapOption>" << std::endl;

  for (std::vector<std::string>::const_iterator isubdet = subdetVec.begin(); isubdet != subdetVec.end(); isubdet++) {
    std::string dname = (*isubdet);
    if (!dqm_store->dirExists(dname)) continue;
    dqm_store->cd(dname);
    std::vector<std::string> subDirVec = dqm_store->getSubdirs();
    if (subDirVec.size() == 0) continue;
    for (std::vector<std::string>::const_iterator ilayer = subDirVec.begin(); ilayer != subDirVec.end(); ilayer++) {
      std::string lname = (*ilayer);
      if (lname.find("BadModuleList") != std::string::npos) continue; 
      dqm_store->cd(lname);
      break;
    }
    std::vector<std::string> meVec = dqm_store->getMEs();
    for (std::vector<std::string>::const_iterator it = meVec.begin();
         it != meVec.end(); it++) {
      std::string hname = (*it); 
      if (hname.find("TkHMap_") != std::string::npos) {
        std::string name = hname.substr(hname.find("TkHMap_")+7);
        name = name.substr(0,name.find_first_of("_")); 
        *out << "<TkMapOption>" << name << "</TkMapOption>" << std::endl;
      }
    }
    break;
  }
  *out << "</TKMapOptionList>" << std::endl;      
  *out << "</LayoutAndTKMapList>" << std::endl;
   dqm_store->cd();
}
void SiStripInformationExtractor::readModuleAndHistoList ( DQMStore dqm_store,
std::string &  sname,
const edm::ESHandle< SiStripDetCabling > &  detcabling,
xgi::Output *  out 
)

Definition at line 466 of file SiStripInformationExtractor.cc.

References DQMStore::cd(), DQMStore::dirExists(), DQMStore::getContents(), SiStripUtility::getModuleFolderList(), MonitorElement::getName(), and setXMLHeader().

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                                                                                {

  std::string dname = "SiStrip/" + sname;
  if (!dqm_store->dirExists(dname)) return;

  dqm_store->cd(dname);
  std::vector<std::string> mids; 
  SiStripUtility::getModuleFolderList(dqm_store, mids);
  dqm_store->cd();

  setXMLHeader(out);
  *out << "<ModuleAndHistoList>" << std::endl;
  
  // Fill Module List
  *out << "<ModuleList>" << std::endl;
  uint32_t aDetId  = 0;
  for (std::vector<std::string>::const_iterator it=mids.begin(); it != mids.end(); it++){    
    std::string moduleId = (*it);
    moduleId = moduleId.substr(moduleId.find("module_")+7); 
    *out << "<ModuleNum>" << moduleId << "</ModuleNum>" << std::endl;     
    if (aDetId == 0) aDetId = atoi(moduleId.c_str());
  }
  
  *out << "</ModuleList>" << std::endl;
  // Fill Histo list
  *out << "<HistoList>" << std::endl;
  
  std::vector<MonitorElement*> detector_mes = dqm_store->getContents(mids[0]);
  for (std::vector<MonitorElement *>::const_iterator it = detector_mes.begin();
         it!= detector_mes.end(); it++) {
    MonitorElement * me = (*it);     
    if (!me) continue;
    std::string hname_full = me->getName();
    std::string hname = hname_full.substr(0, hname_full.find("__det__"));
    *out << "<Histo>" << hname << "</Histo>" << std::endl;     
  }
  *out << "</HistoList>" << std::endl;
  *out << "</ModuleAndHistoList>" << std::endl;
}
void SiStripInformationExtractor::readNonGeomHistoTree ( DQMStore dqm_store,
std::string &  fld_name,
xgi::Output *  out 
)

Definition at line 814 of file SiStripInformationExtractor.cc.

References DQMStore::cd(), DQMStore::dirExists(), printNonGeomHistoList(), and setPlainHeader().

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                                {
  std::ostringstream sumtree;
  std::string dname = "SiStrip/" + fld_name;
  if (dqm_store->dirExists(dname)) {    
    dqm_store->cd(dname);
    sumtree << "<ul id=\"non_geo_tree\" class=\"filetree\">" << std::endl;
    printNonGeomHistoList(dqm_store,sumtree);
    sumtree <<"</ul>" << std::endl;   
  } else {
    sumtree << " Desired Directory :  " << std::endl;
    sumtree <<       dname              << std::endl;
    sumtree <<  " does not exist !!!! " << std::endl;
  }
  setPlainHeader(out);
  *out << sumtree.str();
  dqm_store->cd();
}
void SiStripInformationExtractor::readQTestSummary ( DQMStore dqm_store,
std::string  type,
xgi::Output *  out 
)

Definition at line 714 of file SiStripInformationExtractor.cc.

References DQMStore::cd(), DQMStore::dirExists(), SiStripUtility::getBadModuleStatus(), DQMStore::getContents(), SiStripUtility::getModuleFolderList(), python::rootplot::argparse::message, setHTMLHeader(), and subdetVec.

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                       {

  int nDetsWithError = 0;
  int nDetsTotal = 0;
  std::ostringstream qtest_summary, lite_summary;
  
  dqm_store->cd();
  SiStripFolderOrganizer folder_organizer;
  for (std::vector<std::string>::const_iterator isubdet = subdetVec.begin(); isubdet != subdetVec.end(); isubdet++) {
    std::string dname = (*isubdet);
    std::string bad_module_folder = dname + "/" + "BadModuleList";
    if (!dqm_store->dirExists(dname)) continue;

    dqm_store->cd(dname);
    std::vector<std::string> mids;
    SiStripUtility::getModuleFolderList(dqm_store, mids);
  
    int ndet    = mids.size();
    int errdet = 0;
    dqm_store->cd();
    dqm_store->cd(dname);

    qtest_summary << dname.substr(dname.find("View/")+5) << " : <br/>";
    qtest_summary << "=============================="<< "<br/>";
    if (dqm_store->dirExists(bad_module_folder)) {

      std::vector<MonitorElement *> meVec = dqm_store->getContents(bad_module_folder);
      for (std::vector<MonitorElement *>::const_iterator it = meVec.begin();
           it != meVec.end(); it++) {
        errdet++;
        int flag = (*it)->getIntValue();
        std::string message;
        SiStripUtility::getBadModuleStatus(flag, message);
        qtest_summary << " Module Id " << (*it)->getName() << " has "<< message << "<br/>";
      }
    }
    qtest_summary << "--------------------------------------------------------------------"<< "<br/>";
    qtest_summary << " Detectors :  Total "<< ndet
                  << " with Error " << errdet << "<br/>";
    qtest_summary << "--------------------------------------------------------------------"<< "<br/>";
    nDetsWithError += errdet;
    nDetsTotal     += ndet;
  }
  qtest_summary << "--------------------------------------------------------------------"<< "<br/>";
  qtest_summary << "--------------------------------------------------------------------"<< "<br/>";
  qtest_summary << " Total Detectors " << nDetsTotal;
  qtest_summary << " # of Detectors with Error " << nDetsWithError << "<br/>";
  qtest_summary << "--------------------------------------------------------------------"<< "<br/>";
  qtest_summary << "--------------------------------------------------------------------"<< "<br/>";

  lite_summary << " Total Detectors " << nDetsTotal << "<br/>";
  lite_summary << " # of Detectors with Error " << nDetsWithError << "<br/>";

  setHTMLHeader(out);
  if (type == "Lite") *out << lite_summary.str();
  else {
    *out << qtest_summary.str();
  }
  dqm_store->cd();
}
void SiStripInformationExtractor::readStatusMessage ( DQMStore dqm_store,
std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 653 of file SiStripInformationExtractor.cc.

References dqm::qstatus::ERROR, DQMStore::getContents(), getItemValue(), MonitorElement::getName(), MonitorElement::getQReports(), histoPlotter_, mergeVDriftHistosByStation::name, dqm::qstatus::OTHER, SiStripHistoPlotter::setNewPlot(), setXMLHeader(), ntuplemaker::status, dqm::qstatus::STATUS_OK, and dqm::qstatus::WARNING.

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                                                                                   {

  std::string path = getItemValue(req_map,"Path");

  int width  = atoi(getItemValue(req_map, "width").c_str());
  int height = atoi(getItemValue(req_map, "height").c_str());

  std::string opt =" ";

  std::ostringstream test_status;
  
  setXMLHeader(out);
  *out << "<StatusAndPath>" << std::endl;
  *out << "<PathList>" << std::endl;
  if (path.size() == 0) {
    *out << "<HPath>" << "NONE" << "</HPath>" << std::endl;     
    test_status << " ME Does not exist ! " << std::endl;
  } else {
    std::vector<MonitorElement*> all_mes = dqm_store->getContents(path);
    *out << "<HPath>" << path << "</HPath>" << std::endl;     
    for(std::vector<MonitorElement*>::iterator it=all_mes.begin(); it!=all_mes.end(); it++){
      MonitorElement* me = (*it);
      if (!me) continue;
      std::string name = me->getName();  

      std::vector<QReport*> q_reports = me->getQReports();
      if (q_reports.size() == 0 && name.find("StripQualityFromCondDB") == std::string::npos) continue;
      std::string full_path = path + "/" + name;
      histoPlotter_->setNewPlot(full_path, opt, width, height);

      if (q_reports.size() != 0) {
        test_status << " QTest Status for " << name << " : " << std::endl;
        test_status << " ======================================================== " << std::endl; 
        for (std::vector<QReport*>::const_iterator it = q_reports.begin(); it != q_reports.end();
             it++) {
          int status = (*it)->getStatus();
          if (status == dqm::qstatus::WARNING) test_status << " Warning ";
          else if (status == dqm::qstatus::ERROR) test_status << " Error  ";
          else if (status == dqm::qstatus::STATUS_OK) test_status << " Ok  ";
          else if (status == dqm::qstatus::OTHER) test_status << " Other(" << status << ") ";
          std::string mess_str = (*it)->getMessage();
          test_status <<  " &lt;br/&gt;";
          mess_str = mess_str.substr(mess_str.find(" Test")+5);
          test_status <<  " QTest Name  : " << mess_str.substr(0, mess_str.find(")")+1) << std::endl;
          test_status << " &lt;br/&gt;";
          test_status <<  " QTest Detail  : " << mess_str.substr(mess_str.find(")")+2) << std::endl;
        } 
        test_status << " ======================================================== " << std::endl;
      }
      *out << "<HName>" << name << "</HName>" << std::endl;         
    }    
  }
  *out << "</PathList>" << std::endl;
  *out << "<StatusList>" << std::endl;
  *out << "<Status>" << test_status.str() << "</Status>" << std::endl;      
  *out << "</StatusList>" << std::endl;
  *out << "</StatusAndPath>" << std::endl;
}
void SiStripInformationExtractor::readSummaryHistoTree ( DQMStore dqm_store,
std::string &  str_name,
xgi::Output *  out 
)

(Documentation under construction).

This method

Definition at line 462 of file SiPixelInformationExtractor.cc.

References ACBold, ACPlain, ACYellow, DQMStore::cd(), gather_cfg::cout, SiPixelInformationExtractor::goToDir(), and SiPixelInformationExtractor::printSummaryHistoList().

Referenced by SiStripWebInterface::handleAnalyserRequest().

                                                                        {
//cout<<"entering  SiPixelInformationExtractor::readSummaryHistoTree"<<endl;
  ostringstream sumtree;
  if (goToDir(bei, str_name)) {
    sumtree << "<ul id=\"dhtmlgoodies_tree\" class=\"dhtmlgoodies_tree\">" << endl;
    printSummaryHistoList(bei,sumtree);
    sumtree <<"</ul>" << endl;   
  } else {
    sumtree << "Desired Directory does not exist";
  }
  cout << ACYellow << ACBold
       << "[SiPixelInformationExtractor::readSummaryHistoTree()]"
       << ACPlain << endl ;
  //     << "html string follows: " << endl ;
  //cout << sumtree.str() << endl ;
  //cout << ACYellow << ACBold
  //     << "[SiPixelInformationExtractor::readSummaryHistoTree()]"
  //     << ACPlain
  //     << "String complete " << endl ;
  out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
  *out << sumtree.str();
   bei->cd();
//cout<<"leaving  SiPixelInformationExtractor::readSummaryHistoTree"<<endl;
}
void SiStripInformationExtractor::selectColor ( std::string &  col,
std::vector< QReport * > &  reports 
) [private]

Definition at line 617 of file SiStripInformationExtractor.cc.

References selectColor(), and ntuplemaker::status.

                                                                                         {
  int istat = 999;
  int status = 0;
  for (std::vector<QReport*>::const_iterator it = reports.begin(); it != reports.end();
       it++) {
    status = (*it)->getStatus();
    if (status > istat) istat = status;
  }
  selectColor(col, status);
}
void SiStripInformationExtractor::selectColor ( std::string &  col,
int  status 
) [private]

Definition at line 607 of file SiStripInformationExtractor.cc.

References dqm::qstatus::ERROR, dqm::qstatus::OTHER, dqm::qstatus::STATUS_OK, and dqm::qstatus::WARNING.

Referenced by selectColor().

                                                                       {
  if (status == dqm::qstatus::STATUS_OK)    col = "#00ff00";
  else if (status == dqm::qstatus::WARNING) col = "#ffff00";
  else if (status == dqm::qstatus::ERROR)   col = "#ff0000";
  else if (status == dqm::qstatus::OTHER)   col = "#ffa500";
  else  col = "#0000ff";
}
void SiStripInformationExtractor::selectImage ( std::string &  name,
std::vector< QReport * > &  reports 
) [private]

Definition at line 640 of file SiStripInformationExtractor.cc.

References selectImage(), and ntuplemaker::status.

                                                                                          {
  int istat = 999;
  int status = 0;
  for (std::vector<QReport*>::const_iterator it = reports.begin(); it != reports.end();
       it++) {
    status = (*it)->getStatus();
    if (status > istat) istat = status;
  }
  selectImage(name, status);
}
void SiStripInformationExtractor::selectImage ( std::string &  name,
int  status 
) [private]

Definition at line 630 of file SiStripInformationExtractor.cc.

References dqm::qstatus::ERROR, dqm::qstatus::OTHER, dqm::qstatus::STATUS_OK, and dqm::qstatus::WARNING.

Referenced by selectImage().

                                                                        {
  if (status == dqm::qstatus::STATUS_OK) name="images/LI_green.gif";
  else if (status == dqm::qstatus::WARNING) name="images/LI_yellow.gif";
  else if (status == dqm::qstatus::ERROR) name="images/LI_red.gif";
  else if (status == dqm::qstatus::OTHER) name="images/LI_orange.gif";
  else  name="images/LI_blue.gif";
}
void SiStripInformationExtractor::setHTMLHeader ( xgi::Output *  out) [private]

Definition at line 784 of file SiStripInformationExtractor.cc.

Referenced by readQTestSummary().

                                                               {
  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");
}
void SiStripInformationExtractor::setPlainHeader ( xgi::Output *  out) [private]

Definition at line 804 of file SiStripInformationExtractor.cc.

Referenced by readNonGeomHistoTree().

                                                                {
  out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
  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");

}
void SiStripInformationExtractor::setXMLHeader ( xgi::Output *  out) [private]

Definition at line 793 of file SiStripInformationExtractor.cc.

Referenced by getCondDBHistos(), getGlobalHistos(), getHistosFromPath(), getTrackerMapHistos(), readGlobalHistoList(), readLayoutNames(), readModuleAndHistoList(), and readStatusMessage().

                                                              {
  out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
  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 << "<?xml version=\"1.0\" ?>" << std::endl;

}

Member Data Documentation

std::map<std::string, std::vector< std::string > > SiStripInformationExtractor::layoutMap [private]

Definition at line 92 of file SiStripInformationExtractor.h.

std::vector<std::string> SiStripInformationExtractor::subdetVec [private]