CMS 3D CMS Logo

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

#include <SiPixelInformationExtractor.h>

Public Member Functions

void bookNoisyPixels (DQMStore *bei, float noiseRate, bool Tier0Flag)
 
void computeStatus (MonitorElement *mE, double &colorValue, std::pair< double, double > &norm)
 (Documentation under construction). More...
 
void createImages (DQMStore *bei)
 
void findNoisyPixels (DQMStore *bei, bool init, float noiseRate, int noiseRateDenominator, edm::EventSetup const &eSetup)
 
int getDetId (MonitorElement *mE)
 (Documentation under construction). More...
 
void getHistosFromPath (DQMStore *bei, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
 
void getIMGCImage (const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
 
void getIMGCImage (std::multimap< std::string, std::string > &req_map, xgi::Output *out)
 
void getMEList (DQMStore *bei, std::map< std::string, int > &mEHash)
 (Documentation under construction). More...
 
std::string getMEType (MonitorElement *mE)
 
void getNormalization (MonitorElement *mE, std::pair< double, double > &norm, std::string theMEType)
 (Documentation under construction). More...
 
void getNormalization2D (MonitorElement *mE, std::pair< double, double > &normX, std::pair< double, double > &normY, std::string theMEType)
 (Documentation under construction). More...
 
void getSingleModuleHistos (DQMStore *bei, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
 
void getTrackerMapHistos (DQMStore *bei, const std::multimap< std::string, std::string > &req_map, xgi::Output *out)
 
void readAlarmTree (DQMStore *bei, std::string &str_name, xgi::Output *out)
 (Documentation under construction). More...
 
void readConfiguration ()
 Read Configuration File. More...
 
bool readConfiguration (std::map< std::string, std::vector< std::string > > &layoutMap, std::map< std::string, std::map< std::string, std::string > > &qtestsMap, std::map< std::string, std::vector< std::string > > &meQTestsMap)
 
void readModuleAndHistoList (DQMStore *bei, xgi::Output *out)
 (Documentation under construction). More...
 
void readModuleHistoTree (DQMStore *bei, std::string &str_name, xgi::Output *out)
 (Documentation under construction). More...
 
void readStatusMessage (DQMStore *bei, std::multimap< std::string, std::string > &req_map, xgi::Output *out)
 
void readSummaryHistoTree (DQMStore *bei, std::string &str_name, xgi::Output *out)
 (Documentation under construction). More...
 
void selectMEList (DQMStore *bei, std::string &name, std::vector< MonitorElement * > &mes)
 (Documentation under construction). More...
 
void sendTkUpdatedStatus (DQMStore *bei, xgi::Output *out, std::string &meName, std::string &theTKType)
 (Documentation under construction). More...
 
 SiPixelInformationExtractor (bool offlineXMLfile)
 Constructor of the SiPixelInformationExtractor class. More...
 
 ~SiPixelInformationExtractor ()
 Destructor of the SiPixelInformationExtractor class. More...
 

Private Member Functions

void createDummiesFromLayout ()
 
void fillModuleAndHistoList (DQMStore *bei, std::vector< std::string > &modules, std::map< std::string, std::string > &histos)
 (Documentation under construction). More...
 
void getItemList (const std::multimap< std::string, std::string > &req_map, std::string item_name, std::vector< std::string > &items)
 (Documentation under construction). More...
 
std::string getItemValue (const std::multimap< std::string, std::string > &req_map, std::string item_name)
 (Documentation under construction). More...
 
std::string getItemValue (std::multimap< std::string, std::string > &req_map, std::string item_name)
 
bool goToDir (DQMStore *bei, std::string &sname)
 (Documentation under construction). More...
 
bool hasItem (std::multimap< std::string, std::string > &req_map, std::string item_name)
 (Documentation under construction). More...
 
void printAlarmList (DQMStore *bei, std::ostringstream &str_val)
 (Documentation under construction). More...
 
void printModuleHistoList (DQMStore *bei, std::ostringstream &str_val)
 (Documentation under construction). More...
 
void printSummaryHistoList (DQMStore *bei, std::ostringstream &str_val)
 (Documentation under construction). More...
 
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

SiPixelActionExecutoractionExecutor_
 
int alarmCounter_
 
MonitorElementBarrelNdigisFREQProjection
 
SiPixelConfigParserconfigParser_
 
SiPixelConfigWriterconfigWriter_
 
int count
 
MonitorElementEndcapNdigisFREQProjection
 
bool endOfModules_
 
int errcount
 
MonitorElementEventRateBarrelPixels
 
MonitorElementEventRateEndcapPixels
 
bool flagHotModule_
 
bool gotDigis
 
SiPixelHistoPlotterhistoPlotter_
 
std::map< std::string,
std::vector< std::string > > 
layoutMap
 
SiPixelLayoutParserlayoutParser_
 
std::map< std::string,
std::vector< std::string > > 
meQTestsMap
 
ofstream myfile_
 
int nevents_
 
std::map< uint32_t,
std::vector< std::pair
< std::pair< int, int >, float > > > 
noisyDetIds_
 
bool offlineXMLfile_
 
std::map< std::string,
std::map< std::string,
std::string > > 
qtestsMap
 
bool readMeMap_
 
bool readQTestMap_
 
bool readReference_
 
edm::ESHandle
< SiPixelFedCablingMap
theCablingMap
 

Detailed Description

Definition at line 44 of file SiPixelInformationExtractor.h.

Constructor & Destructor Documentation

SiPixelInformationExtractor::SiPixelInformationExtractor ( bool  offlineXMLfile)

Constructor of the SiPixelInformationExtractor class.

Definition at line 68 of file SiPixelInformationExtractor.cc.

References histoPlotter_, and readReference_.

68  : offlineXMLfile_(offlineXMLfile) {
69  edm::LogInfo("SiPixelInformationExtractor") <<
70  " Creating SiPixelInformationExtractor " << "\n" ;
71 
72  readReference_ = false;
73  histoPlotter_=0;
75 }
SiPixelInformationExtractor::~SiPixelInformationExtractor ( )

Destructor of the SiPixelInformationExtractor class.

Definition at line 81 of file SiPixelInformationExtractor.cc.

References histoPlotter_.

81  {
82  edm::LogInfo("SiPixelInformationExtractor") <<
83  " Deleting SiPixelInformationExtractor " << "\n" ;
84 
85  if (histoPlotter_) delete histoPlotter_;
86 }

Member Function Documentation

void SiPixelInformationExtractor::bookNoisyPixels ( DQMStore bei,
float  noiseRate,
bool  Tier0Flag 
)

Definition at line 1330 of file SiPixelInformationExtractor.cc.

References DQMStore::book1D(), DQMStore::cd(), EventRateBarrelPixels, EventRateEndcapPixels, MonitorElement::setAxisTitle(), and DQMStore::setCurrentFolder().

Referenced by SiPixelEDAClient::beginRun().

1330  {
1331 //std::cout<<"BOOK NOISY PIXEL MEs!"<<std::endl;
1332  bei->cd();
1333  if(noiseRate_>=0.){
1334  bei->setCurrentFolder("Pixel/Barrel");
1335  EventRateBarrelPixels = bei->book1D("barrelEventRate","Digi event rate for all Barrel pixels",1000,0.,0.01);
1336  EventRateBarrelPixels->setAxisTitle("Event Rate",1);
1337  EventRateBarrelPixels->setAxisTitle("Number of Pixels",2);
1338  bei->cd();
1339  bei->setCurrentFolder("Pixel/Endcap");
1340  EventRateEndcapPixels = bei->book1D("endcapEventRate","Digi event rate for all Endcap pixels",1000,0.,0.01);
1341  EventRateEndcapPixels->setAxisTitle("Event Rate",1);
1342  EventRateEndcapPixels->setAxisTitle("Number of Pixels",2);
1343  }
1344 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void SiPixelInformationExtractor::computeStatus ( MonitorElement theME,
double &  colorValue,
std::pair< double, double > &  norm 
)

(Documentation under construction).

Definition at line 898 of file SiPixelInformationExtractor.cc.

References MonitorElement::getMean(), getMEType(), getNormalization(), getNormalization2D(), hitfit::return, and mathSSE::sqrt().

Referenced by sendTkUpdatedStatus().

901 {
902  double normalizationX = 1 ;
903  double normalizationY = 1 ;
904  double meanX = 0 ;
905  double meanY = 0 ;
906 
907  colorValue = 0 ;
908 
909  pair<double,double> normX ;
910  pair<double,double> normY ;
911 
912  string theMEType = getMEType(theME) ;
913 
914 // cout << ACRed << ACReverse
915 // << "[SiPixelInformationExtractor::computeStatus()]"
916 // << ACPlain
917 // << " Computing average for "
918 // << theME->getName()
919 // << endl ;
920 
921  if( theMEType.find("TH1") != string::npos)
922  {
923  meanX = (double)theME->getMean();
924  getNormalization(theME, normX, "TH1") ;
925  normalizationX = fabs( normX.second - normX.first) ;
926  if( normalizationX == 0 ) {normalizationX=1.E-20;}
927  colorValue = meanX / normalizationX ;
928  norm.first = normX.first ;
929  norm.second = normX.second ;
930  }
931 
932  if( theMEType.find("TH2") != string::npos)
933  {
934  meanX = (double)theME->getMean(1);
935  meanY = (double)theME->getMean(2);
936  getNormalization2D(theME, normX, normY, "TH2") ;
937  normalizationX = fabs( normX.second - normX.first) ;
938  normalizationY = fabs( normY.second - normY.first) ;
939  if( normalizationX == 0 ) {normalizationX=1.E-20;}
940  if( normalizationY == 0 ) {normalizationY=1.E-20;}
941  double cVX = meanX / normalizationX ;
942  double cVY = meanY / normalizationY ;
943  colorValue = sqrt(cVX*cVX + cVY*cVY) ;
944  if( normalizationX >= normalizationY )
945  {
946  norm.first = normX.first;
947  norm.second = normX.second ;
948  } else {
949  norm.first = normY.first;
950  norm.second = normY.second ;
951  }
952 // cout << ACBlue << ACBold << ACReverse
953 // << "[SiPixelInformationExtractor::computeStatus()]"
954 // << ACPlain << " "
955 // << theME->getName()
956 // << " meanX:Y "
957 // << meanX << ":" << meanY
958 // << " normX:Y "
959 // << norm.first << ":" << norm.second
960 // << endl ;
961  }
962 
963  return ;
964 }
void getNormalization(MonitorElement *mE, std::pair< double, double > &norm, std::string theMEType)
(Documentation under construction).
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
T sqrt(T t)
Definition: SSEVec.h:46
void getNormalization2D(MonitorElement *mE, std::pair< double, double > &normX, std::pair< double, double > &normY, std::string theMEType)
(Documentation under construction).
std::string getMEType(MonitorElement *mE)
void SiPixelInformationExtractor::createDummiesFromLayout ( )
private
void SiPixelInformationExtractor::createImages ( DQMStore bei)

Definition at line 1588 of file SiPixelInformationExtractor.cc.

References SiPixelHistoPlotter::createPlots(), and histoPlotter_.

Referenced by SiPixelWebInterface::performAction().

1588  {
1589  histoPlotter_->createPlots(bei);
1590 }
void createPlots(DQMStore *bei)
void SiPixelInformationExtractor::fillModuleAndHistoList ( DQMStore bei,
std::vector< std::string > &  modules,
std::map< std::string, std::string > &  histos 
)
private

(Documentation under construction).

This method

Definition at line 315 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), relmon_rootfiles_spy::contents, spr::find(), DQMStore::get(), DQMStore::getMEs(), MonitorElement::getRootObject(), DQMStore::getSubdirs(), DQMStore::goUp(), and DQMStore::pwd().

Referenced by readModuleAndHistoList().

317  {
318 //cout<<"entering SiPixelInformationExtractor::fillModuleAndHistoList"<<endl;
319  string currDir = bei->pwd();
320  //cout<<"currDir= "<<currDir<<endl;
321  if(currDir.find("Module_") != string::npos){
322  if(histos.size() == 0){
323  vector<string> contents = bei->getMEs();
324  for (vector<string>::const_iterator it = contents.begin(); it != contents.end(); it++) {
325  string hname = (*it).substr(0, (*it).find("_siPixel"));
326  if(hname==" ") hname = (*it).substr(0, (*it).find("_generalTracks"));
327  string fullpathname = bei->pwd() + "/" + (*it);
328  // cout<<"fullpathname="<<fullpathname<<endl;
329  MonitorElement * me = bei->get(fullpathname);
330  string htype = "undefined" ;
331  if(me) htype = me->getRootObject()->IsA()->GetName() ;
332  //cout<<"hname="<<hname<<endl;
333  //if(htype=="TH1F" || htype=="TH1D"){
334  histos[hname] = htype ;
335  string mId=" ";
336  if(hname.find("ndigis") !=string::npos) mId = (*it).substr((*it).find("ndigis_siPixelDigis_")+20, 9);
337  if(mId==" " && hname.find("nclusters") !=string::npos) mId = (*it).substr((*it).find("nclusters_siPixelClusters_")+26, 9);
338  if(mId==" " && hname.find("residualX") !=string::npos) mId = (*it).substr((*it).find("residualX_ctfWithMaterialTracks_")+32, 9);
339  if(mId==" " && hname.find("NErrors") !=string::npos) mId = (*it).substr((*it).find("NErrors_siPixelDigis_")+21, 9);
340  if(mId==" " && hname.find("ClustX") !=string::npos) mId = (*it).substr((*it).find("ClustX_siPixelRecHit_")+21, 9);
341  if(mId==" " && hname.find("pixelAlive") !=string::npos) mId = (*it).substr((*it).find("pixelAlive_siPixelCalibDigis_")+29, 9);
342  if(mId==" " && hname.find("Gain1d") !=string::npos) mId = (*it).substr((*it).find("Gain1d_siPixelCalibDigis_")+25, 9);
343  if(mId!=" ") modules.push_back(mId);
344  //cout<<"mId="<<mId<<endl;
345  //}
346  }
347  }
348  } else {
349  vector<string> subdirs = bei->getSubdirs();
350  for (vector<string>::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) {
351  if((bei->pwd()).find("Barrel")==string::npos && (bei->pwd()).find("Endcap")==string::npos) bei->goUp();
352  bei->cd(*it);
353  fillModuleAndHistoList(bei, modules, histos);
354  bei->goUp();
355  }
356  }
357 // fillBarrelList(bei, modules, histos);
358 //cout<<"leaving SiPixelInformationExtractor::fillModuleAndHistoList"<<endl;
359 }
void fillModuleAndHistoList(DQMStore *bei, std::vector< std::string > &modules, std::map< std::string, std::string > &histos)
(Documentation under construction).
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1419
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
TObject * getRootObject(void) const
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1442
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:440
const std::string & pwd(void) const
Definition: DQMStore.cc:401
void SiPixelInformationExtractor::findNoisyPixels ( DQMStore bei,
bool  init,
float  noiseRate,
int  noiseRateDenominator,
edm::EventSetup const &  eSetup 
)

Definition at line 1349 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, cond::rpcobgas::detid, RefreshWebPage::dname, endOfModules_, EventRateBarrelPixels, EventRateEndcapPixels, NewTree::fid, MonitorElement::Fill(), edm::EventSetup::get(), DQMStore::get(), getDetId(), DQMStore::getMEs(), MonitorElement::getPathname(), DQMStore::getSubdirs(), MonitorElement::getTH2F(), DQMStore::goUp(), i, sipixelobjects::PixelROC::idInDetUnit(), PixelBarrelName::isHalfModule(), j, sipixelobjects::ElectronicIndex::link, python.multivaluedict::map(), myfile_, PixelBarrelName::name(), PixelEndcapName::name(), nevents_, noisyDetIds_, edm::ESHandle< class >::product(), DQMStore::pwd(), sipixelobjects::ElectronicIndex::pxid, sipixelobjects::LocalPixel::DcolPxid::pxid, sipixelobjects::ElectronicIndex::roc, sipixelobjects::LocalPixel::rocCol(), sipixelobjects::LocalPixel::rocRow(), DQMStore::setCurrentFolder(), DetId::subdetId(), theCablingMap, and relativeConstraints::value.

Referenced by SiPixelEDAClient::endLuminosityBlock(), and SiPixelEDAClient::endRun().

1350 {
1351 //cout<<"Entering SiPixelInformationExtractor::findNoisyPixels with noiseRate set to "<<noiseRate_<<endl;
1352 
1353 
1354  if(init){
1355  endOfModules_=false;
1356  nevents_=noiseRateDenominator_;
1357  if(nevents_ == -1){
1358  bei->cd();
1359  bei->setCurrentFolder("Pixel/EventInfo");
1360  nevents_ = (bei->get("Pixel/EventInfo/processedEvents"))->getIntValue();
1361  }
1362  bei->cd();
1363  myfile_.open ("NoisyPixelList.txt", ios::app);
1364  myfile_ << "Noise summary, ran over " << nevents_ << " events, threshold was set to " << noiseRate_ << std::endl;
1365  }
1366  string currDir = bei->pwd();
1367  string dname = currDir.substr(currDir.find_last_of("/")+1);
1368 
1369 
1370  if(dname.find("Module_")!=string::npos){
1371  vector<string> meVec = bei->getMEs();
1372  for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end(); it++) {
1373  string full_path = currDir + "/" + (*it);
1374  if(full_path.find("hitmap_siPixelDigis")!=string::npos){
1375  //broken HV bond:
1376  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_01/Panel_2/Module_2")!=string::npos) continue;
1377  //?noisy?
1378  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_1/Module_4")!=string::npos) continue;
1379  //ROG with HV problem (short?):
1380  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_10/Panel_1/Module_3")!=string::npos) continue;
1381  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_10/Panel_1/Module_4")!=string::npos) continue;
1382  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_10/Panel_2/Module_2")!=string::npos) continue;
1383  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_10/Panel_2/Module_3")!=string::npos) continue;
1384  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_11/Panel_1/Module_3")!=string::npos) continue;
1385  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_11/Panel_1/Module_4")!=string::npos) continue;
1386  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_11/Panel_2/Module_2")!=string::npos) continue;
1387  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_11/Panel_2/Module_3")!=string::npos) continue;
1388  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_1/Module_3")!=string::npos) continue;
1389  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_1/Module_4")!=string::npos) continue;
1390  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_2/Module_2")!=string::npos) continue;
1391  //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_2/Module_3")!=string::npos) continue;
1392  MonitorElement * me = bei->get(full_path);
1393  if (!me) continue;
1394  int detid=getDetId(me); int pixcol=-1; int pixrow=-1;
1395 
1396  //cout<<"detid= "<<detid<<endl;
1397  std::vector<std::pair<std::pair<int, int>, float> > noisyPixelsInModule;
1398  TH2F * hothisto = me->getTH2F();
1399  if(hothisto){
1400  for(int i=1; i!=hothisto->GetNbinsX()+1; i++){
1401  for(int j=1; j!=hothisto->GetNbinsY()+1; j++){
1402  float value = (hothisto->GetBinContent(i,j))/float(nevents_);
1403  if(me->getPathname().find("Barrel")!=string::npos){
1404  EventRateBarrelPixels = bei->get("Pixel/Barrel/barrelEventRate");
1406  }else if(me->getPathname().find("Endcap")!=string::npos){
1407  EventRateEndcapPixels = bei->get("Pixel/Endcap/endcapEventRate");
1409  }
1410  if(value > noiseRate_){
1411  pixcol = i-1;
1412  pixrow = j-1;
1413  //cout<<"pixcol= "<<pixcol<<" , pixrow= "<<pixrow<<" , value= "<<value<<endl;
1414 
1415  std::pair<int, int> address(pixcol, pixrow);
1416  std::pair<std::pair<int, int>, float> PixelStats(address, value);
1417  noisyPixelsInModule.push_back(PixelStats);
1418  }
1419  }
1420  }
1421  }
1422  noisyDetIds_[detid] = noisyPixelsInModule;
1423  //if(noisyPixelsInModule.size()>=20) cout<<"This module has 20 or more hot pixels: "<<detid<<","<<bei->pwd()<<","<<noisyPixelsInModule.size()<<endl;
1424  }
1425  }
1426  }
1427  vector<string> subDirVec = bei->getSubdirs();
1428  for (vector<string>::const_iterator ic = subDirVec.begin();
1429  ic != subDirVec.end(); ic++) {
1430  if((*ic).find("AdditionalPixelErrors")!=string::npos) continue;
1431  bei->cd(*ic);
1432  init=false;
1433  findNoisyPixels(bei,init,noiseRate_,noiseRateDenominator_,eSetup);
1434  bei->goUp();
1435  }
1436 
1437  if(bei->pwd().find("EventInfo")!=string::npos) endOfModules_ = true;
1438 
1439  if(!endOfModules_) return;
1440  // myfile_ <<"am in "<<bei->pwd()<<" now!"<<endl;
1441  if(currDir == "Pixel/EventInfo/reportSummaryContents"){
1442  eSetup.get<SiPixelFedCablingMapRcd>().get(theCablingMap);
1443  std::vector<std::pair<sipixelobjects::DetectorIndex,double> > pixelvec;
1444  std::map<uint32_t,int> myfedmap;
1445  std::map<uint32_t,std::string> mynamemap;
1446  int realfedID = -1;
1447  //int Nnoisies = noisyDetIds_.size();
1448  //cout<<"Number of noisy modules: "<<Nnoisies<<endl;
1449  int counter = 0;
1450  int n_noisyrocs_all = 0;
1451  int n_noisyrocs_barrel = 0;
1452  int n_noisyrocs_endcap = 0;
1453  int n_verynoisyrocs_all = 0;
1454  int n_verynoisyrocs_barrel = 0;
1455  int n_verynoisyrocs_endcap = 0;
1456 
1457  for(int fid = 0; fid < 40; fid++){
1458  for(std::map<uint32_t, std::vector< std::pair<std::pair<int, int>, float> > >::const_iterator it = noisyDetIds_.begin();
1459  it != noisyDetIds_.end(); it++){
1460  uint32_t detid = (*it).first;
1461  std::vector< std::pair<std::pair<int, int>, float> > noisyPixels = (*it).second;
1462  //cout<<noisyPixels.size()<<" noisy pixels in a module: "<<detid<<endl;
1463  // now convert into online conventions:
1464  for(int fedid=0; fedid<=40; ++fedid){
1465  SiPixelFrameConverter converter(theCablingMap.product(),fedid);
1466  uint32_t newDetId = detid;
1467  if(converter.hasDetUnit(newDetId)){
1468  realfedID=fedid;
1469  break;
1470  }
1471  }
1472  if(fid == realfedID){
1473  //cout<<"FED ID is = "<<realfedID<<endl;
1474  if(realfedID==-1) continue;
1475  DetId detId(detid);
1476  uint32_t detSubId = detId.subdetId();
1477  std::string outputname;
1478  bool HalfModule = false;
1479  if (detSubId == 2){ //FPIX
1480  PixelEndcapName nameworker(detid);
1481  outputname = nameworker.name();
1482  } else if(detSubId == 1){ //BPIX
1483  PixelBarrelName nameworker(detid);
1484  outputname = nameworker.name();
1485  HalfModule = nameworker.isHalfModule();
1486 
1487  } else{
1488  continue;
1489  }
1490  std::map<int,int> myrocmap;
1491  myfedmap[detid]=realfedID;
1492  mynamemap[detid]=outputname;
1493 
1494  for(std::vector< std::pair< std::pair<int,int>, float> >::const_iterator pxl = noisyPixels.begin();
1495  pxl != noisyPixels.end(); pxl++){
1496  std::pair<int,int> offlineaddress = (*pxl).first;
1497  float Noise_frac = (*pxl).second;
1498  int offlineColumn = offlineaddress.first;
1499  int offlineRow = offlineaddress.second;
1500  counter++;
1501  //cout<<"noisy pixel counter: "<<counter<<endl;
1502 
1504  SiPixelFrameConverter formatter(theCablingMap.product(),realfedID);
1505  sipixelobjects::DetectorIndex detector = {detid, offlineRow, offlineColumn};
1506  formatter.toCabling(cabling,detector);
1507  // cabling should now contain cabling.roc and cabling.dcol and cabling.pxid
1508  // however, the coordinates now need to be converted from dcl,pxid to the row,col coordinates used in the calibration info
1510  loc.dcol = cabling.dcol;
1511  loc.pxid = cabling.pxid;
1512 
1513 
1514  // OLD version, not 31X compatible:
1515 // const sipixelobjects::PixelFEDCabling *theFed= theCablingMap.product()->fed(realfedID);
1516 // const sipixelobjects::PixelFEDLink * link = theFed->link(cabling.link);
1517 // const sipixelobjects::PixelROC *theRoc = link->roc(cabling.roc);
1518 // sipixelobjects::LocalPixel locpixel(loc);
1519 
1520 
1521  // FIX to adhere to new cabling map. To be replaced with CalibTracker/SiPixelTools detid - > hardware id classes ASAP.
1522  // const sipixelobjects::PixelFEDCabling *theFed= theCablingMap.product()->fed(realfedID);
1523  // const sipixelobjects::PixelFEDLink * link = theFed->link(cabling.link);
1524  // const sipixelobjects::PixelROC *theRoc = link->roc(cabling.roc);
1525  sipixelobjects::LocalPixel locpixel(loc);
1526  assert(realfedID >= 0);
1527  assert(cabling.link >= 0);
1528  assert(cabling.roc >= 0);
1529  sipixelobjects::CablingPathToDetUnit path = {static_cast<unsigned int>(realfedID),
1530  static_cast<unsigned int>(cabling.link),
1531  static_cast<unsigned int>(cabling.roc)};
1532  const sipixelobjects::PixelROC *theRoc = theCablingMap->findItem(path);
1533  // END of FIX
1534 
1535  int onlineColumn = locpixel.rocCol();
1536  int onlineRow= locpixel.rocRow();
1537  myrocmap[(theRoc->idInDetUnit())]++;
1538 
1539  // ROC numbers in the barrel go from 8 to 15 instead of 0 to 7 in half modules. This is a
1540  // fix to get the roc number, and add 8 to it if:
1541  // it's a Barrel module AND on the minus side AND a Half module
1542 
1543  int rocnumber = -1;
1544 
1545  if((detSubId == 1) && (outputname.find("mO")!=string::npos || outputname.find("mI")!=string::npos) && (HalfModule)){
1546  rocnumber = theRoc->idInDetUnit() + 8;
1547  }
1548  else{
1549  rocnumber = theRoc->idInDetUnit();
1550  }
1551 
1552  //cout<<counter<<" : \t detid= "<<detid<<" , OFF col,row= "<<offlineColumn<<","<<offlineRow<<" , ON roc,col,row= "<<theRoc->idInDetUnit()<<","<<onlineColumn<<","<<onlineRow<<endl;
1553  myfile_ <<"NAME: "<<outputname<<" , DETID: "<<detid<<" , OFFLINE: col,row: "<<offlineColumn<<","<<offlineRow<<" \t , ONLINE: roc,col,row: "<<rocnumber<<","<<onlineColumn<<","<<onlineRow<< " \t , fed,dcol,pixid,link: "<<realfedID<<","<<loc.dcol<<","<<loc.pxid<<","<<cabling.link << ", Noise fraction: " << Noise_frac << std::endl;
1554  }
1555  for(std::map<int, int>::const_iterator nrc = myrocmap.begin(); nrc != myrocmap.end(); nrc++){
1556  if((*nrc).second > 0){
1557  n_noisyrocs_all++;
1558  if(detSubId == 2){
1559  n_noisyrocs_endcap++;
1560  } else if(detSubId == 1){
1561  n_noisyrocs_barrel++;}
1562  }
1563  if((*nrc).second > 40){
1564  n_verynoisyrocs_all++;
1565  if(detSubId == 2){
1566  n_verynoisyrocs_endcap++;
1567  } else if(detSubId == 1){
1568  n_verynoisyrocs_barrel++;}
1569  }
1570  }
1571  }
1572 
1573  }
1574  }
1575  myfile_ << "There are " << n_noisyrocs_all << " noisy ROCs (ROCs with at least 1 noisy pixel) in the entire detector. " << n_noisyrocs_endcap << " are in the FPIX and " << n_noisyrocs_barrel << " are in the BPIX. " << endl;
1576  myfile_ << "There are " << n_verynoisyrocs_all << " highly noisy ROCs (ROCs with at least 10% of all pixels passing the noise threshold) in the entire detector. " << n_verynoisyrocs_endcap << " are in the FPIX and " << n_verynoisyrocs_barrel << " are in the BPIX. " << endl;
1577 
1578  }
1579  myfile_.close();
1580 //cout<<"...leaving SiPixelInformationExtractor::findNoisyPixels!"<<endl;
1581  return;
1582 }
int i
Definition: DBlmapReader.cc:9
char * address
Definition: mlp_lapack.h:14
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1419
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
int init
Definition: HydjetWrapper.h:63
std::map< uint32_t, std::vector< std::pair< std::pair< int, int >, float > > > noisyDetIds_
identify pixel inside single ROC
Definition: LocalPixel.h:7
void Fill(long long x)
list path
Definition: scaleCards.py:51
const std::string & getPathname(void) const
get pathname of parent folder
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:43
int j
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:22
Definition: DetId.h:20
T const * product() const
Definition: ESHandle.h:62
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1442
int getDetId(MonitorElement *mE)
(Documentation under construction).
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:440
void findNoisyPixels(DQMStore *bei, bool init, float noiseRate, int noiseRateDenominator, edm::EventSetup const &eSetup)
TH2F * getTH2F(void) const
edm::ESHandle< SiPixelFedCablingMap > theCablingMap
list fid
Definition: NewTree.py:51
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
const std::string & pwd(void) const
Definition: DQMStore.cc:401
int SiPixelInformationExtractor::getDetId ( MonitorElement mE)

(Documentation under construction).

Given a pointer to ME returns the associated detId

Definition at line 1209 of file SiPixelInformationExtractor.cc.

References MonitorElement::getName().

Referenced by findNoisyPixels().

1210 {
1211 //cout<<"In SiPixelInformationExtractor::getDetId: for ME= "<<mE->getName()<<endl;
1212  string mEName = mE->getName();
1213 
1214  int detId = 0;
1215 
1216  if( mEName.find("_3") != string::npos )
1217  {
1218  string detIdString = mEName.substr((mEName.find_last_of("_"))+1,9);
1219  //cout<<"string: "<<detIdString<<endl;
1220  std::istringstream isst;
1221  isst.str(detIdString);
1222  isst>>detId;
1223 // } else {
1224 // cout << ACYellow << ACBold
1225 // << "[SiPixelInformationExtractor::getDetId()] "
1226 // << ACPlain
1227 // << "Could not extract detId from "
1228 // << mEName
1229 // << endl ;
1230  }
1231  //cout<<"returning with: "<<detId<<endl;
1232  return detId ;
1233 
1234 }
const std::string & getName(void) const
get name of ME
void SiPixelInformationExtractor::getHistosFromPath ( DQMStore bei,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output out 
)

Definition at line 1299 of file SiPixelInformationExtractor.cc.

References DQMStore::getContents(), getItemValue(), MonitorElement::getName(), histoPlotter_, mergeVDriftHistosByStation::name, setHTMLHeader(), SiPixelHistoPlotter::setNewPlot(), and tablePrinter::width.

Referenced by SiPixelWebInterface::handleEDARequest().

1301  {
1302 //cout<<"Entering SiPixelInformationExtractor::getHistosFromPath: "<<endl;
1303  string path = getItemValue(req_map,"Path");
1304 //cout<<"Path is: "<<path<<endl;
1305  if (path.size() == 0) return;
1306 
1307  int width = atoi(getItemValue(req_map, "width").c_str());
1308  int height = atoi(getItemValue(req_map, "height").c_str());
1309 
1310  string opt =" ";
1311 
1312  setHTMLHeader(out);
1313  vector<MonitorElement*> all_mes = bei->getContents(path);
1314  *out << path << " " ;
1315  for(vector<MonitorElement*>::iterator it=all_mes.begin(); it!=all_mes.end(); it++){
1316  MonitorElement* me = (*it);
1317  //cout<<"I'm in the loop now..."<<endl;
1318  if (!me) continue;
1319  string name = me->getName();
1320  string full_path = path + "/" + name;
1321 //cout<<"Calling HP::setNewPlot now for "<<full_path<<endl;
1322  histoPlotter_->setNewPlot(full_path, opt, width, height);
1323  *out << name << " ";
1324  }
1325 // cout<<"... leaving SiPixelInformationExtractor::getHistosFromPath!"<<endl;
1326 }
const std::string & getName(void) const
get name of ME
list path
Definition: scaleCards.py:51
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1497
tuple out
Definition: dbtoconf.py:99
std::string getItemValue(const std::multimap< std::string, std::string > &req_map, std::string item_name)
(Documentation under construction).
void setNewPlot(std::string &path, std::string &option, int width, int height)
void SiPixelInformationExtractor::getIMGCImage ( const std::multimap< std::string, std::string > &  req_map,
xgi::Output out 
)
void SiPixelInformationExtractor::getIMGCImage ( std::multimap< std::string, std::string > &  req_map,
xgi::Output out 
)
void SiPixelInformationExtractor::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 675 of file SiPixelInformationExtractor.cc.

Referenced by getSingleModuleHistos().

677  {
678 //cout<<"entering SiPixelInformationExtractor::getItemList"<<endl;
679  items.clear();
680  for (multimap<string, string>::const_iterator it = req_map.begin();
681  it != req_map.end(); it++) {
682  if (it->first == item_name) {
683  items.push_back(it->second);
684  }
685  }
686 //cout<<"leaving SiPixelInformationExtractor::getItemList"<<endl;
687 }
std::string SiPixelInformationExtractor::getItemValue ( const std::multimap< std::string, std::string > &  req_map,
std::string  item_name 
)
private

(Documentation under construction).

This method

Definition at line 708 of file SiPixelInformationExtractor.cc.

References pos, and relativeConstraints::value.

Referenced by getHistosFromPath(), getSingleModuleHistos(), getTrackerMapHistos(), and readStatusMessage().

709  {
710 //cout<<"entering SiPixelInformationExtractor::getItemValue for item: "<<item_name<<endl;
711  std::multimap<std::string,std::string>::const_iterator pos = req_map.find(item_name);
712  std::string value = " ";
713  if (pos != req_map.end()) {
714  value = pos->second;
715  }
716 // cout<<"value = "<<value<<endl;
717  return value;
718 //cout<<"leaving SiPixelInformationExtractor::getItemValue"<<endl;
719 }
std::string SiPixelInformationExtractor::getItemValue ( std::multimap< std::string, std::string > &  req_map,
std::string  item_name 
)
private

Definition at line 720 of file SiPixelInformationExtractor.cc.

References pos, and relativeConstraints::value.

721  {
722 //cout<<"entering SiPixelInformationExtractor::getItemValue for item: "<<item_name<<endl;
723  std::multimap<std::string,std::string>::iterator pos = req_map.find(item_name);
724  std::string value = " ";
725  if (pos != req_map.end()) {
726 // cout<<"item found!"<<endl;
727  value = pos->second;
728  }
729 // cout<<"value = "<<value<<endl;
730  return value;
731 //cout<<"leaving SiPixelInformationExtractor::getItemValue"<<endl;
732 }
void SiPixelInformationExtractor::getMEList ( DQMStore bei,
std::map< std::string, int > &  mEHash 
)

(Documentation under construction).

Definition at line 1240 of file SiPixelInformationExtractor.cc.

References ACBold, ACPlain, ACRed, DQMStore::cd(), relmon_rootfiles_spy::contents, gather_cfg::cout, DQMStore::getMEs(), DQMStore::getSubdirs(), DQMStore::goUp(), and DQMStore::pwd().

1242 {
1243  string currDir = bei->pwd();
1244 
1245 // cout << ACRed << ACBold
1246 // << "[SiPixelInformationExtractor::getMEList()]"
1247 // << ACPlain
1248 // << " Requesting ME list in "
1249 // << currDir
1250 // << endl ;
1251 
1252  string theME ;
1253 
1254  // Get ME from Collector/FU0/Tracker/PixelEndcap/HalfCylinder_pX/Disk_X/Blade_XX/Panel_XX/Module_XX
1255  if (currDir.find("Module_") != string::npos ||
1256  currDir.find("FED_") != string::npos)
1257  {
1258  vector<string> contents = bei->getMEs();
1259 
1260  for (vector<string>::const_iterator it = contents.begin(); it != contents.end(); it++)
1261  {
1262  theME = (*it) ;
1263 // cout << ACRed << ACReverse
1264 // << "[SiPixelInformationExtractor::getMEList()]"
1265 // << ACPlain
1266 // << " ME: "
1267 // << (*it)
1268 // << endl ;
1269  if(theME.find("siPixel")==string::npos && theME.find("ctfWithMaterialTracks")==string::npos)
1270  {
1271  cout << ACRed << ACBold
1272  << "[SiPixelInformationExtractor::getMEList()]"
1273  << ACPlain
1274  << " ----> Skipping "
1275  << (*it)
1276  << endl ;
1277  continue ;
1278  } // If the ME is not a Pixel one, skip
1279  string full_path = currDir + "/" + (*it);
1280  string mEName = theME.substr(0,theME.find_first_of("_"));
1281  mEHash[mEName]++ ;
1282  }
1283 
1284  return;
1285  } else { // If not yet reached the desired level in the directory tree, recursively go down one level more
1286  vector<string> subdirs = bei->getSubdirs();
1287  for (vector<string>::const_iterator it = subdirs.begin(); it != subdirs.end(); it++)
1288  {
1289  bei->cd(*it);
1290  getMEList(bei, mEHash);
1291  bei->goUp();
1292  }
1293  }
1294 }
#define ACRed
Definition: ANSIColors.h:15
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1419
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void getMEList(DQMStore *bei, std::map< std::string, int > &mEHash)
(Documentation under construction).
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1442
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:440
tuple cout
Definition: gather_cfg.py:121
#define ACPlain
Definition: ANSIColors.h:28
#define ACBold
Definition: ANSIColors.h:29
const std::string & pwd(void) const
Definition: DQMStore.cc:401
std::string SiPixelInformationExtractor::getMEType ( MonitorElement mE)

Definition at line 259 of file SiPixelInformationExtractor.cc.

References MonitorElement::getRootObject().

Referenced by computeStatus(), and sendTkUpdatedStatus().

260 {
261  string qtype = theMe->getRootObject()->IsA()->GetName() ;
262  if( qtype.find("TH1") != string::npos )
263  {
264  return "TH1" ;
265  } else if ( qtype.find("TH2") != string::npos ) {
266  return "TH2" ;
267  } else if ( qtype.find("TH3") != string::npos ) {
268  return "TH3" ;
269  }
270  return "TH1" ;
271 }
void SiPixelInformationExtractor::getNormalization ( MonitorElement theME,
std::pair< double, double > &  norm,
std::string  theMEType 
)

(Documentation under construction).

Definition at line 970 of file SiPixelInformationExtractor.cc.

References MonitorElement::getNbinsX().

Referenced by computeStatus().

973 {
974  double normLow = 0 ;
975  double normHigh = 0 ;
976 
977  if( theMEType.find("TH1") != string::npos)
978  {
979  normHigh = (double)theME->getNbinsX() ;
980  norm.first = normLow ;
981  norm.second = normHigh ;
982  }
983 }
int getNbinsX(void) const
get # of bins in X-axis
void SiPixelInformationExtractor::getNormalization2D ( MonitorElement theME,
std::pair< double, double > &  normX,
std::pair< double, double > &  normY,
std::string  theMEType 
)

(Documentation under construction).

Definition at line 989 of file SiPixelInformationExtractor.cc.

References MonitorElement::getNbinsX(), and MonitorElement::getNbinsY().

Referenced by computeStatus().

993 {
994  double normLow = 0 ;
995  double normHigh = 0 ;
996 
997  if( theMEType.find("TH2") != string::npos )
998  {
999  normHigh = (double)theME->getNbinsX() ;
1000  normX.first = normLow ;
1001  normX.second = normHigh ;
1002  normHigh = (double)theME->getNbinsY() ;
1003  normY.first = normLow ;
1004  normY.second = normHigh ;
1005 // cout << ACCyan << ACBold << ACReverse
1006 // << "[SiPixelInformationExtractor::getNormalization2D()]"
1007 // << ACPlain << " "
1008 // << theME->getName()
1009 // << " normX: "
1010 // << normX.first << ":" << normX.second
1011 // << " normY: "
1012 // << normY.first << ":" << normY.second
1013 // << endl ;
1014  }
1015 }
int getNbinsY(void) const
get # of bins in Y-axis
int getNbinsX(void) const
get # of bins in X-axis
void SiPixelInformationExtractor::getSingleModuleHistos ( DQMStore bei,
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(), getItemList(), getItemValue(), SiPixelFolderOrganizer::getModuleFolder(), MonitorElement::getName(), histoPlotter_, scaleCards::path, DQMStore::pwd(), setHTMLHeader(), SiPixelHistoPlotter::setNewPlot(), and tablePrinter::width.

Referenced by SiPixelWebInterface::handleEDARequest().

99  {
100 //cout<<"In SiPixelInformationExtractor::getSingleModuleHistos: "<<endl;
101  vector<string> hlist;
102  getItemList(req_map,"histo", hlist);
103 
104  uint32_t detId = atoi(getItemValue(req_map,"ModId").c_str());
105 
106  int width = atoi(getItemValue(req_map, "width").c_str());
107  int height = atoi(getItemValue(req_map, "height").c_str());
108 
109  string opt =" ";
110 
111  SiPixelFolderOrganizer folder_organizer;
112  string path;
113  folder_organizer.getModuleFolder(detId,path);
114 
115  if((bei->pwd()).find("Module_") == string::npos &&
116  (bei->pwd()).find("FED_") == string::npos){
117  cout<<"This is not a pixel module or FED!"<<endl;
118  return;
119  }
120 
121  vector<MonitorElement*> all_mes = bei->getContents(path);
123  *out << path << " ";
124 
125  string theME ;
126  for (vector<string>::const_iterator ih = hlist.begin();
127  ih != hlist.end(); ih++) {
128  for (vector<MonitorElement *>::const_iterator it = all_mes.begin();
129  it!= all_mes.end(); it++) {
130  MonitorElement * me = (*it);
131  if (!me) continue;
132  theME = me->getName();
133  string temp_s ;
134  if(theME.find("siPixel")!=string::npos || theME.find("ctfWithMaterialTracks")!=string::npos) { temp_s = theME.substr(0,theME.find_first_of("_")); }
135  //cout<<"should be the variable name: temp_s= "<<temp_s<<endl;
136  if (temp_s == (*ih)) {
137  string full_path = path + "/" + me->getName();
138  histoPlotter_->setNewPlot(full_path, opt, width, height);
139  *out << me->getName() << " " ;
140  }
141  }
142  }
143 }
const std::string & getName(void) const
get name of ME
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
list path
Definition: scaleCards.py:51
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1497
tuple out
Definition: dbtoconf.py:99
void getModuleFolder(const uint32_t &rawdetid, std::string &path)
std::string getItemValue(const std::multimap< std::string, std::string > &req_map, std::string item_name)
(Documentation under construction).
void getItemList(const std::multimap< std::string, std::string > &req_map, std::string item_name, std::vector< std::string > &items)
(Documentation under construction).
tuple cout
Definition: gather_cfg.py:121
void setNewPlot(std::string &path, std::string &option, int width, int height)
const std::string & pwd(void) const
Definition: DQMStore.cc:401
void SiPixelInformationExtractor::getTrackerMapHistos ( DQMStore bei,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output out 
)

Definition at line 148 of file SiPixelInformationExtractor.cc.

References ACBold, ACCyan, ACPlain, ACRed, ACYellow, gather_cfg::cout, DQMStore::getContents(), DQMParserBase::getDocument(), getItemValue(), SiPixelConfigParser::getMENamesForTrackerMap(), SiPixelFolderOrganizer::getModuleFolder(), MonitorElement::getName(), histoPlotter_, offlineXMLfile_, scaleCards::path, DQMStore::pwd(), SiPixelHistoPlotter::setNewPlot(), setXMLHeader(), and tablePrinter::width.

Referenced by SiPixelWebInterface::handleEDARequest().

150  {
151 
152 // cout << __LINE__ << ACYellow << ACBold
153 // << "[SiPixelInformationExtractor::getTrackerMapHistos] " << ACPlain << endl ;
154 // cout<<"I am in this dir: "<<bei->pwd()<<endl;
155  vector<string> hlist;
156  string tkmap_name;
157  SiPixelConfigParser config_parser;
158  string localPath;
159  if(offlineXMLfile_) localPath = string("DQM/SiPixelMonitorClient/test/sipixel_tier0_config.xml");
160  else localPath = string("DQM/SiPixelMonitorClient/test/sipixel_monitorelement_config.xml");
161  config_parser.getDocument(edm::FileInPath(localPath).fullPath());
162 // if (!config_parser.getMENamesForTrackerMap(tkmap_name, hlist)) return;
163 // if (hlist.size() == 0) return;
164  if (!config_parser.getMENamesForTrackerMap(tkmap_name, hlist))
165  {
166  cout << __LINE__ << ACYellow << ACBold
167  << "[SiPixelInformationExtractor::getTrackerMapHistos] "
168  << ACPlain << ACRed << ACPlain
169  << "getMENamesForTrackerMap return false "
170  << ACPlain << endl ; assert(0) ;
171  return;
172  }
173  if (hlist.size() == 0)
174  {
175  cout << __LINE__ << ACYellow << ACBold
176  << "[SiPixelInformationExtractor::getTrackerMapHistos] "
177  << ACPlain << ACRed << ACPlain
178  << "hlist.size() == 0 "
179  << ACPlain << endl ; assert(0) ;
180  return;
181  }
182 
183 
184  uint32_t detId = atoi(getItemValue(req_map,"ModId").c_str());
185 
186  int width = atoi(getItemValue(req_map, "width").c_str());
187  int height = atoi(getItemValue(req_map, "height").c_str());
188 
189  string opt =" ";
190 
191  SiPixelFolderOrganizer folder_organizer;
192  string path;
193 
194  folder_organizer.getModuleFolder(detId,path);
195  string currDir = bei->pwd();
196 // cout<<"detId= "<<detId<<" , path= "<<path<<" , and now I am in "<<currDir<<endl;
197 
198 /*
199  if((bei->pwd()).find("Module_") == string::npos &&
200  (bei->pwd()).find("FED_") == string::npos){
201  cout<<"This is not a pixel module or FED!"<<endl;
202  cout << __LINE__ << ACYellow << ACBold
203  << "[SiPixelInformationExtractor::getTrackerMapHistos] "
204  << ACPlain << ACRed << ACPlain
205  << "This is not a pixel module or FED!"
206  << ACPlain << endl ; assert(0) ;
207  return;
208  }
209 */
210  vector<MonitorElement*> all_mes = bei->getContents(path);
211  setXMLHeader(out);
212 
213 /* cout << __LINE__ << ACCyan << ACBold
214  << " [SiPixelInformationExtractor::getTrackerMapHistos()] path "
215  << ACPlain << path << endl ;
216  cout << __LINE__ << ACCyan << ACBold
217  << " [SiPixelInformationExtractor::getTrackerMapHistos()] all_mes.size() "
218  << ACPlain << all_mes.size() << endl ;
219 */
220  string theME ;
221  *out << "<pathList>" << endl ;
222  for (vector<string>::iterator ih = hlist.begin();
223  ih != hlist.end(); ih++) {
224  //cout<<"ih iterator (hlist): "<<(*ih)<<endl;
225  for (vector<MonitorElement *>::const_iterator it = all_mes.begin();
226  it!= all_mes.end(); it++) {
227  MonitorElement * me = (*it);
228  if (!me)
229  {
230  cout << __LINE__ << ACCyan << ACBold
231  << " [SiPixelInformationExtractor::getTrackerMapHistos()] skipping "
232  << ACPlain << *ih << endl ;
233  continue;
234  }
235  theME = me->getName();
236  //cout<<"ME iterator (all_mes): "<<theME<<endl;
237  string temp_s ;
238  if(theME.find("siPixel")!=string::npos || theME.find("ctfWithMaterialTracks")!=string::npos) { temp_s = theME.substr(0,theME.find_first_of("_")); }
239  //cout << __LINE__ << ACCyan << ACBold
240  // << " [SiPixelInformationExtractor::getTrackerMapHistos()] temp_s "
241  // << ACPlain << temp_s << " <--> " << *ih << " |" << theME << "|" << endl ;
242  if (temp_s == (*ih)) {
243  string full_path = path + "/" + me->getName();
244  histoPlotter_->setNewPlot(full_path, opt, width, height);
245 //cout << __LINE__ << ACRed << ACBold
246 // << " [SiPixelInformationExtractor::getTrackerMapHistos()] fullPath: "
247 // << ACPlain << full_path << endl ;
248  *out << " <pathElement path='" << full_path << "' />" << endl ;
249  }
250  }
251  }
252  *out << "</pathList>" << endl ;
253 //cout << __LINE__ << " [SiPixelInformationExtractor::getTrackerMapHistos()] endlist: " << endl ;
254 }
const std::string & getName(void) const
get name of ME
#define ACRed
Definition: ANSIColors.h:15
#define ACYellow
Definition: ANSIColors.h:25
void getDocument(std::string configFile, bool UseDB=false)
Methor that parses the xml file configFile.
list path
Definition: scaleCards.py:51
bool getMENamesForTrackerMap(std::string &tkmap_name, std::vector< std::string > &me_names)
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1497
tuple out
Definition: dbtoconf.py:99
void getModuleFolder(const uint32_t &rawdetid, std::string &path)
#define ACCyan
Definition: ANSIColors.h:14
std::string getItemValue(const std::multimap< std::string, std::string > &req_map, std::string item_name)
(Documentation under construction).
tuple cout
Definition: gather_cfg.py:121
void setNewPlot(std::string &path, std::string &option, int width, int height)
#define ACPlain
Definition: ANSIColors.h:28
#define ACBold
Definition: ANSIColors.h:29
const std::string & pwd(void) const
Definition: DQMStore.cc:401
bool SiPixelInformationExtractor::goToDir ( DQMStore bei,
std::string &  sname 
)
private

(Documentation under construction).

This method

Definition at line 818 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), TrackerOfflineValidation_Dqm_cff::dirName, and DQMStore::pwd().

Referenced by readAlarmTree(), readModuleHistoTree(), and readSummaryHistoTree().

819  {
820 //cout<<"entering SiPixelInformationExtractor::goToDir"<<endl;
821  bei->cd();
822  //if(flg) bei->cd("Collector/Collated");
823  bei->cd(sname);
824  string dirName = bei->pwd();
825  if (dirName.find(sname) != string::npos) return true;
826  else return false;
827 //cout<<"leaving SiPixelInformationExtractor::goToDir"<<endl;
828 }
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
const std::string & pwd(void) const
Definition: DQMStore.cc:401
bool SiPixelInformationExtractor::hasItem ( std::multimap< std::string, std::string > &  req_map,
std::string  item_name 
)
private

(Documentation under construction).

This method

Definition at line 694 of file SiPixelInformationExtractor.cc.

References pos.

695  {
696 //cout<<"entering SiPixelInformationExtractor::hasItem"<<endl;
697  multimap<string,string>::iterator pos = req_map.find(item_name);
698  if (pos != req_map.end()) return true;
699  return false;
700 //cout<<"leaving SiPixelInformationExtractor::hasItem"<<endl;
701 }
void SiPixelInformationExtractor::printAlarmList ( DQMStore bei,
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 591 of file SiPixelInformationExtractor.cc.

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

Referenced by readAlarmTree().

592  {
593 //cout<<"entering SiPixelInformationExtractor::printAlarmList"<<endl;
594 // cout << ACRed << ACBold
595 // << "[SiPixelInformationExtractor::printAlarmList()]"
596 // << ACPlain
597 // << " Enter"
598 // << endl ;
599  string currDir = bei->pwd();
600  string dname = currDir.substr(currDir.find_last_of("/")+1);
601  string image_name;
602  selectImage(image_name,bei->getStatus(currDir));
603  if(image_name!="images/LI_green.gif")
604  str_val << " <li>\n"
605  << " <a href=\"#\" id=\"" << currDir << "\">\n "
606  << dname
607  << " </a>\n"
608  << " <img src=\""
609  << image_name
610  << "\">" << endl;
611  vector<string> subDirVec = bei->getSubdirs();
612 
613  vector<string> meVec = bei->getMEs();
614 
615  if (subDirVec.size() == 0 && meVec.size() == 0) {
616  str_val << "</li> "<< endl;
617  return;
618  }
619  str_val << "<ul>" << endl;
620  for (vector<string>::const_iterator it = meVec.begin();
621  it != meVec.end(); it++) {
622  string full_path = currDir + "/" + (*it);
623 
624  MonitorElement * me = bei->get(full_path);
625 
626  if (!me) continue;
627  std::vector<QReport *> my_map = me->getQReports();
628  if (my_map.size() > 0) {
629  string image_name1;
630  selectImage(image_name1,my_map);
631  if(image_name1!="images/LI_green.gif") {
632  alarmCounter_++;
633  str_val << " <li class=\"dhtmlgoodies_sheet.gif\">\n"
634  << " <input id = \"selectedME\""
635  << " folder = \"" << currDir << "\""
636  << " type = \"checkbox\""
637  << " name = \"selected\""
638  << " class = \"smallCheckBox\""
639  << " value = \"" << (*it) << "\""
640  << " onclick = \"javascript:IMGC.selectedIMGCItems()\" />\n"
641 // << " <a href=\"javascript:IMGC.updateIMGC('" << currDir << "')\">\n "
642  << " <a href=\"javascript:IMGC.plotFromPath('" << currDir << "')\">\n "
643  << (*it) << "\n"
644  << " </a>\n"
645  << " <img src=\""
646  << image_name1
647  << "\">"
648  << " </li>"
649  << endl;
650  }
651  }
652  }
653  for (vector<string>::const_iterator ic = subDirVec.begin();
654  ic != subDirVec.end(); ic++) {
655  bei->cd(*ic);
656  printAlarmList(bei, str_val);
657  bei->goUp();
658  }
659  str_val << "</ul> "<< endl;
660  str_val << "</li> "<< endl;
661 // cout << ACGreen << ACBold
662 // << "[SiPixelInformationExtractor::printAlarmList()]"
663 // << ACPlain
664 // << " Done"
665 // << endl ;
666 //cout<<"leaving SiPixelInformationExtractor::printAlarmList"<<endl;
667 }
int getStatus(const std::string &path="") const
Definition: DQMStore.cc:2703
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1419
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void printAlarmList(DQMStore *bei, std::ostringstream &str_val)
(Documentation under construction).
void selectImage(std::string &name, int status)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
std::vector< QReport * > getQReports(void) const
get map of QReports
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1442
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:440
const std::string & pwd(void) const
Definition: DQMStore.cc:401
void SiPixelInformationExtractor::printModuleHistoList ( DQMStore bei,
std::ostringstream &  str_val 
)
private

(Documentation under construction).

This method

Definition at line 402 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), RefreshWebPage::dname, DQMStore::getMEs(), DQMStore::getSubdirs(), DQMStore::goUp(), and DQMStore::pwd().

Referenced by readModuleHistoTree().

403  {
404 //cout<<"entering SiPixelInformationExtractor::printModuleHistoList"<<endl;
405  string currDir = bei->pwd();
406  string dname = currDir.substr(currDir.find_last_of("/")+1);
407  str_val << " <li>\n"
408  << " <a href=\"#\" id=\"" << currDir << "\">\n "
409  << dname << "\n"
410  << " </a>\n"
411  << endl << endl;
412 
413  vector<string> meVec = bei->getMEs();
414 
415  vector<string> subDirVec = bei->getSubdirs();
416  if ( meVec.size()== 0 && subDirVec.size() == 0 ) {
417  str_val << " </li>" << endl;
418  return;
419  }
420  str_val << "\n <ul>" << endl;
421  for (vector<string>::const_iterator it = meVec.begin();
422  it != meVec.end(); it++) {
423  if ((*it).find("_siPixel")!=string::npos ||
424  (*it).find("_ctfWithMaterialTracks")!=string::npos) {
425  string qit = (*it) ;
426  string temp_s;
427  if(qit.find("siPixel")!=string::npos || qit.find("ctfWithMaterialTracks")!=string::npos) { temp_s = qit.substr(0,qit.find_first_of("_")); }
428  str_val << " <li class=\"dhtmlgoodies_sheet.gif\">\n"
429  << " <input id = \"selectedME\""
430  << " folder = \"" << currDir << "\""
431  << " type = \"checkbox\""
432  << " name = \"selected\""
433  << " class = \"smallCheckBox\""
434  << " value = \"" << (*it) << "\""
435  << " onclick = \"javascript:IMGC.selectedIMGCItems()\" />\n"
436 // << " <a href=\"javascript:IMGC.updateIMGC('" << currDir << "')\">\n "
437  << " <a href=\"javascript:IMGC.plotFromPath('" << currDir << "')\">\n "
438 // << temp_s << "\n"
439  << (*it) << "\n"
440  << " </a>\n"
441  << " </li>"
442  << endl;
443  }
444  }
445  for (vector<string>::const_iterator ic = subDirVec.begin();
446  ic != subDirVec.end(); ic++) {
447  bei->cd(*ic);
448  printModuleHistoList(bei, str_val);
449  bei->goUp();
450  }
451  str_val << " </ul>" << endl;
452  str_val << " </li>" << endl;
453 //cout<<"leaving SiPixelInformationExtractor::printModuleHistoList"<<endl;
454 }
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1419
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void printModuleHistoList(DQMStore *bei, std::ostringstream &str_val)
(Documentation under construction).
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1442
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:440
const std::string & pwd(void) const
Definition: DQMStore.cc:401
void SiPixelInformationExtractor::printSummaryHistoList ( DQMStore bei,
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 494 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), RefreshWebPage::dname, DQMStore::getMEs(), DQMStore::getSubdirs(), DQMStore::goUp(), and DQMStore::pwd().

Referenced by readSummaryHistoTree().

495  {
496 //cout<<"entering SiPixelInformationExtractor::printSummaryHistoList"<<endl;
497  string currDir = bei->pwd();
498  string dname = currDir.substr(currDir.find_last_of("/")+1);
499  if (dname.find("Module_") ==0 || dname.find("FED_")==0) return;
500  str_val << " <li>\n"
501  << " <a href=\"#\" id=\"" << currDir << "\">\n "
502  << dname
503  << " </a>"
504  << endl;
505 
506  vector<string> meVec = bei->getMEs();
507 
508  vector<string> subDirVec = bei->getSubdirs();
509  if ( meVec.size()== 0 && subDirVec.size() == 0 ) {
510  str_val << " </li> "<< endl;
511  return;
512  }
513  str_val << "\n <ul>" << endl;
514  for (vector<string>::const_iterator it = meVec.begin();
515  it != meVec.end(); it++) {
516  if ((*it).find("SUM") == 0) {
517  str_val << " <li class=\"dhtmlgoodies_sheet.gif\">\n"
518  << " <input id = \"selectedME\""
519  << " folder = \"" << currDir << "\""
520  << " type = \"checkbox\""
521  << " name = \"selected\""
522  << " class = \"smallCheckBox\""
523  << " value = \"" << (*it) << "\""
524  << " onclick = \"javascript:IMGC.selectedIMGCItems()\" />\n"
525 // << " <a href=\"javascript:IMGC.updateIMGC('" << currDir << "')\">\n "
526  << " <a href=\"javascript:IMGC.plotFromPath('" << currDir << "')\">\n "
527  << (*it) << "\n"
528  << " </a>\n"
529  << " </li>"
530  << endl;
531  }
532  }
533 
534  for (vector<string>::const_iterator ic = subDirVec.begin();
535  ic != subDirVec.end(); ic++) {
536  bei->cd(*ic);
537  printSummaryHistoList(bei, str_val);
538  bei->goUp();
539  }
540  str_val << " </ul> "<< endl;
541  str_val << " </li> "<< endl;
542 //cout<<"leaving SiPixelInformationExtractor::printSummaryHistoList"<<endl;
543 }
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1419
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void printSummaryHistoList(DQMStore *bei, std::ostringstream &str_val)
(Documentation under construction).
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1442
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:440
const std::string & pwd(void) const
Definition: DQMStore.cc:401
void SiPixelInformationExtractor::readAlarmTree ( DQMStore bei,
std::string &  str_name,
xgi::Output out 
)

(Documentation under construction).

This method

Definition at line 551 of file SiPixelInformationExtractor.cc.

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

Referenced by SiPixelWebInterface::handleEDARequest().

553  {
554 //cout<<"entering SiPixelInformationExtractor::readAlarmTree"<<endl;
555  ostringstream alarmtree;
556  if (goToDir(bei, str_name)) {
557  alarmtree << "<ul id=\"dhtmlgoodies_tree\" class=\"dhtmlgoodies_tree\">" << endl;
558  alarmCounter_=0;
559  printAlarmList(bei,alarmtree);
560  if(alarmCounter_==0) alarmtree <<"<li>No problematic modules found, all ok!</li>" << endl;
561  alarmtree <<"</ul>" << endl;
562  } else {
563  alarmtree << "Desired Directory does not exist";
564  }
565  cout << ACYellow << ACBold
566  << "[SiPixelInformationExtractor::readAlarmTree()]"
567  << ACPlain << endl ;
568  // << "html string follows: " << endl ;
569  //cout << alarmtree.str() << endl ;
570  //cout << ACYellow << ACBold
571  // << "[SiPixelInformationExtractor::readAlarmTree()]"
572  // << ACPlain
573  // << "String complete " << endl ;
574  out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
575  *out << alarmtree.str();
576  bei->cd();
577  cout << ACYellow << ACBold
578  << "[SiPixelInformationExtractor::readAlarmTree()]"
579  << ACPlain
580  << " Done!"
581  << endl ;
582 //cout<<"leaving SiPixelInformationExtractor::readAlarmTree"<<endl;
583 }
#define ACYellow
Definition: ANSIColors.h:25
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void printAlarmList(DQMStore *bei, std::ostringstream &str_val)
(Documentation under construction).
tuple out
Definition: dbtoconf.py:99
bool goToDir(DQMStore *bei, std::string &sname)
(Documentation under construction).
tuple cout
Definition: gather_cfg.py:121
#define ACPlain
Definition: ANSIColors.h:28
#define ACBold
Definition: ANSIColors.h:29
void SiPixelInformationExtractor::readConfiguration ( )

Read Configuration File.

Definition at line 92 of file SiPixelInformationExtractor.cc.

92 { }
bool SiPixelInformationExtractor::readConfiguration ( std::map< std::string, std::vector< std::string > > &  layoutMap,
std::map< std::string, std::map< std::string, std::string > > &  qtestsMap,
std::map< std::string, std::vector< std::string > > &  meQTestsMap 
)
void SiPixelInformationExtractor::readModuleAndHistoList ( DQMStore bei,
xgi::Output out 
)

(Documentation under construction).

This method

Definition at line 278 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), and fillModuleAndHistoList().

Referenced by SiPixelWebInterface::handleEDARequest().

279  {
280 //cout<<"entering SiPixelInformationExtractor::readModuleAndHistoList"<<endl;
281  bei->cd("Pixel");
282  std::map<std::string,std::string> hnames;
283  std::vector<std::string> mod_names;
284  fillModuleAndHistoList(bei, mod_names, hnames);
285  out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
286  *out << "<?xml version=\"1.0\" ?>" << std::endl;
287  *out << "<ModuleAndHistoList>" << endl;
288  *out << "<ModuleList>" << endl;
289  for (std::vector<std::string>::iterator im = mod_names.begin();
290  im != mod_names.end(); im++) {
291  *out << "<ModuleNum>" << *im << "</ModuleNum>" << endl;
292  }
293  *out << "</ModuleList>" << endl;
294  *out << "<HistoList>" << endl;
295 
296  for (std::map<std::string,std::string>::iterator ih = hnames.begin();
297  ih != hnames.end(); ih++) {
298  *out << "<Histo type=\""
299  << ih->second
300  << "\">"
301  << ih->first
302  << "</Histo>"
303  << endl;
304  }
305  *out << "</HistoList>" << endl;
306  *out << "</ModuleAndHistoList>" << endl;
307 //cout<<"leaving SiPixelInformationExtractor::readModuleAndHistoList"<<endl;
308 }
void fillModuleAndHistoList(DQMStore *bei, std::vector< std::string > &modules, std::map< std::string, std::string > &histos)
(Documentation under construction).
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
tuple out
Definition: dbtoconf.py:99
void SiPixelInformationExtractor::readModuleHistoTree ( DQMStore bei,
std::string &  str_name,
xgi::Output out 
)

(Documentation under construction).

This method

Definition at line 366 of file SiPixelInformationExtractor.cc.

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

Referenced by SiPixelWebInterface::handleEDARequest().

368  {
369 //cout<<"entering SiPixelInformationExtractor::readModuleHistoTree"<<endl;
370  ostringstream modtree;
371  if (goToDir(bei, str_name)) {
372  modtree << "<form name=\"IMGCanvasItemsSelection\" "
373  << "action=\"javascript:void%200\">"
374  << endl ;
375  modtree << "<ul id=\"dhtmlgoodies_tree\" class=\"dhtmlgoodies_tree\">" << endl;
376  printModuleHistoList(bei,modtree);
377  modtree <<"</ul>" << endl;
378  modtree <<"</form>" << endl;
379  } else {
380  modtree << "Desired Directory does not exist";
381  }
382  cout << ACYellow << ACBold
383  << "[SiPixelInformationExtractor::readModuleHistoTree()]"
384  << ACPlain << endl ;
385  // << "html string follows: " << endl ;
386  //cout << modtree.str() << endl ;
387  //cout << ACYellow << ACBold
388  // << "[SiPixelInformationExtractor::readModuleHistoTree()]"
389  // << ACPlain
390  // << "String complete " << endl ;
391  out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
392  *out << modtree.str();
393  bei->cd();
394 //cout<<"leaving SiPixelInformationExtractor::readModuleHistoTree"<<endl;
395 }
#define ACYellow
Definition: ANSIColors.h:25
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void printModuleHistoList(DQMStore *bei, std::ostringstream &str_val)
(Documentation under construction).
tuple out
Definition: dbtoconf.py:99
bool goToDir(DQMStore *bei, std::string &sname)
(Documentation under construction).
tuple cout
Definition: gather_cfg.py:121
#define ACPlain
Definition: ANSIColors.h:28
#define ACBold
Definition: ANSIColors.h:29
void SiPixelInformationExtractor::readStatusMessage ( DQMStore bei,
std::multimap< std::string, std::string > &  req_map,
xgi::Output out 
)

Definition at line 833 of file SiPixelInformationExtractor.cc.

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

Referenced by SiPixelWebInterface::handleEDARequest().

835  {
836 
837  string path = getItemValue(req_map,"Path");
838 
839  int width = atoi(getItemValue(req_map, "width").c_str());
840  int height = atoi(getItemValue(req_map, "height").c_str());
841 
842  string opt =" ";
843 
844  ostringstream test_status;
845 
846  setXMLHeader(out);
847  *out << "<StatusAndPath>" << endl;
848  *out << "<PathList>" << endl;
849  if (path.size() == 0) {
850  *out << "<HPath>" << "NONE" << "</HPath>" << endl;
851  test_status << " ME Does not exist ! " << endl;
852  } else {
853  vector<MonitorElement*> all_mes = bei->getContents(path);
854  *out << "<HPath>" << path << "</HPath>" << endl;
855  for(vector<MonitorElement*>::iterator it=all_mes.begin(); it!=all_mes.end(); it++){
856  MonitorElement* me = (*it);
857  if (!me) continue;
858  string name = me->getName();
859 
860  vector<QReport*> q_reports = me->getQReports();
861  if (q_reports.size() == 0) continue;
862  string full_path = path + "/" + name;
863  histoPlotter_->setNewPlot(full_path, opt, width, height);
864 
865  if (q_reports.size() != 0) {
866  test_status << " QTest Status for " << name << " : " << endl;
867  test_status << " ======================================================== " << endl;
868  for (vector<QReport*>::const_iterator it = q_reports.begin(); it != q_reports.end();
869  it++) {
870  int status = (*it)->getStatus();
871  if (status == dqm::qstatus::WARNING) test_status << " Warning ";
872  else if (status == dqm::qstatus::ERROR) test_status << " Error ";
873  else if (status == dqm::qstatus::STATUS_OK) test_status << " Ok ";
874  else if (status == dqm::qstatus::OTHER) test_status << " Other(" << status << ") ";
875  string mess_str = (*it)->getMessage();
876  test_status << "&lt;br/&gt;";
877  mess_str = mess_str.substr(mess_str.find(" Test")+5);
878  test_status << " QTest Name : " << mess_str.substr(0, mess_str.find(")")+1) << endl;
879  test_status << "&lt;br/&gt;";
880  test_status << " QTest Detail : " << mess_str.substr(mess_str.find(")")+2) << endl;
881  }
882  test_status << " ======================================================== " << endl;
883  }
884  *out << "<HPath>" << name << "</HPath>" << endl;
885  }
886  }
887  *out << "</PathList>" << endl;
888  *out << "<StatusList>" << endl;
889  *out << "<Status>" << test_status.str() << "</Status>" << endl;
890  *out << "</StatusList>" << endl;
891  *out << "</StatusAndPath>" << endl;
892 }
const std::string & getName(void) const
get name of ME
static const int OTHER
static const int WARNING
list path
Definition: scaleCards.py:51
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1497
tuple out
Definition: dbtoconf.py:99
std::vector< QReport * > getQReports(void) const
get map of QReports
std::string getItemValue(const std::multimap< std::string, std::string > &req_map, std::string item_name)
(Documentation under construction).
static const int STATUS_OK
void setNewPlot(std::string &path, std::string &option, int width, int height)
tuple status
Definition: ntuplemaker.py:245
static const int ERROR
void SiPixelInformationExtractor::readSummaryHistoTree ( DQMStore bei,
std::string &  str_name,
xgi::Output out 
)

(Documentation under construction).

This method

Definition at line 461 of file SiPixelInformationExtractor.cc.

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

Referenced by SiPixelWebInterface::handleEDARequest().

463  {
464 //cout<<"entering SiPixelInformationExtractor::readSummaryHistoTree"<<endl;
465  ostringstream sumtree;
466  if (goToDir(bei, str_name)) {
467  sumtree << "<ul id=\"dhtmlgoodies_tree\" class=\"dhtmlgoodies_tree\">" << endl;
468  printSummaryHistoList(bei,sumtree);
469  sumtree <<"</ul>" << endl;
470  } else {
471  sumtree << "Desired Directory does not exist";
472  }
473  cout << ACYellow << ACBold
474  << "[SiPixelInformationExtractor::readSummaryHistoTree()]"
475  << ACPlain << endl ;
476  // << "html string follows: " << endl ;
477  //cout << sumtree.str() << endl ;
478  //cout << ACYellow << ACBold
479  // << "[SiPixelInformationExtractor::readSummaryHistoTree()]"
480  // << ACPlain
481  // << "String complete " << endl ;
482  out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
483  *out << sumtree.str();
484  bei->cd();
485 //cout<<"leaving SiPixelInformationExtractor::readSummaryHistoTree"<<endl;
486 }
#define ACYellow
Definition: ANSIColors.h:25
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void printSummaryHistoList(DQMStore *bei, std::ostringstream &str_val)
(Documentation under construction).
tuple out
Definition: dbtoconf.py:99
bool goToDir(DQMStore *bei, std::string &sname)
(Documentation under construction).
tuple cout
Definition: gather_cfg.py:121
#define ACPlain
Definition: ANSIColors.h:28
#define ACBold
Definition: ANSIColors.h:29
void SiPixelInformationExtractor::selectColor ( std::string &  col,
int  status 
)
private
void SiPixelInformationExtractor::selectColor ( std::string &  col,
std::vector< QReport * > &  reports 
)
private
void SiPixelInformationExtractor::selectImage ( std::string &  name,
int  status 
)
private

Referenced by printAlarmList().

void SiPixelInformationExtractor::selectImage ( std::string &  name,
std::vector< QReport * > &  reports 
)
private
void SiPixelInformationExtractor::selectMEList ( DQMStore bei,
std::string &  name,
std::vector< MonitorElement * > &  mes 
)

(Documentation under construction).

Definition at line 1022 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), relmon_rootfiles_spy::contents, DQMStore::get(), DQMStore::getMEs(), DQMStore::getSubdirs(), DQMStore::goUp(), and DQMStore::pwd().

Referenced by sendTkUpdatedStatus().

1025 {
1026 // cout<<"In SiPixelInformationExtractor::selectMEList: "<<endl;
1027  string currDir = bei->pwd();
1028 
1029  string theME ;
1030 
1031  // Get ME from Collector/FU0/Tracker/PixelEndcap/HalfCylinder_pX/Disk_X/Blade_XX/Panel_XX/Module_XX
1032  if (currDir.find("Module_") != string::npos ||
1033  currDir.find("FED_") != string::npos)
1034  {
1035  vector<string> contents = bei->getMEs();
1036 
1037  for (vector<string>::const_iterator it = contents.begin(); it != contents.end(); it++)
1038  {
1039  theME = (*it) ;
1040  if(theME.find("siPixel")==string::npos && theME.find("ctfWithMaterialTracks")==string::npos) {continue ;} // If the ME is not a siPixel or ctfWithMaterialTrack one, skip
1041  string temp_s = theME.substr(0,theME.find_first_of("_"));
1042  //cout<<"should be the variable name: temp_s= "<<temp_s<<endl;
1043  if (temp_s == theMEName)
1044  {
1045  string full_path = currDir + "/" + (*it);
1046 
1047  MonitorElement * me = bei->get(full_path.c_str());
1048 
1049  if (me) {mes.push_back(me);}
1050  }
1051  }
1052  return;
1053  } else { // If not yet reached the desired level in the directory tree, recursively go down one level more
1054  vector<string> subdirs = bei->getSubdirs();
1055  for (vector<string>::const_iterator it = subdirs.begin(); it != subdirs.end(); it++)
1056  {
1057  bei->cd(*it);
1058  selectMEList(bei, theMEName, mes);
1059  bei->goUp();
1060  }
1061  }
1062 }
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1419
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void selectMEList(DQMStore *bei, std::string &name, std::vector< MonitorElement * > &mes)
(Documentation under construction).
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1442
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:440
const std::string & pwd(void) const
Definition: DQMStore.cc:401
void SiPixelInformationExtractor::sendTkUpdatedStatus ( DQMStore bei,
xgi::Output out,
std::string &  theMEName,
std::string &  theTKType 
)

(Documentation under construction).

Definition at line 1068 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), computeStatus(), python.tagInventory::entries, dqm::qstatus::ERROR, getMEType(), SiPixelUtility::getStatus(), SiPixelUtility::getStatusColor(), maxEntries, dqm::qstatus::OTHER, selectMEList(), dqm::qstatus::STATUS_OK, and dqm::qstatus::WARNING.

Referenced by SiPixelWebInterface::periodicTkMapUpdate().

1072 {
1073 // cout<<"In SiPixelInformationExtractor::sendTkUpdatedStatus: "<<endl;
1074  int rval, gval, bval;
1075  vector<string> colorMap ;
1076  vector<MonitorElement*> me_list;
1077  pair<double,double> norm ;
1078  double sts ;
1079 
1080  bei->cd();
1081  selectMEList(bei, theMEName, me_list) ;
1082  bei->cd();
1083 
1084  string detId = "undefined";
1085 
1086 /* cout << ACYellow << ACBold
1087  << "[SiPixelInformationExtractor::sendTkUpdatedStatus()] "
1088  << ACPlain
1089  << "Preparing color map update for "
1090  << theMEName
1091  << " type "
1092  << theTKType
1093  << " - List size: "
1094  << me_list.size()
1095  << endl ;
1096 */
1097  int maxEntries = 0 ;
1098  if( theTKType == "Entries") // In this case find the ME with the highest number of entries
1099  { // first and use that as a vertical scale normalization
1100  for(vector<MonitorElement*>::iterator it=me_list.begin(); it!=me_list.end(); it++)
1101  {
1102  int entries = (int)(*it)->getEntries() ;
1103  if( entries > maxEntries ) maxEntries = entries ;
1104  }
1105  }
1106 
1107  int entries = 0 ;
1108  stringstream jsSnippet ;
1109  for(vector<MonitorElement*>::iterator it=me_list.begin(); it!=me_list.end(); it++)
1110  {
1111  string meName = (*it)->getName();
1112  string theMEType = getMEType(*it);
1113  if( meName.find("_3") != string::npos )
1114  {
1115  string detIdString = meName.substr(meName.find_last_of("_")+1,9);
1116  std::istringstream isst;
1117  isst.str(detIdString);
1118  isst>>detId;
1119  entries = (int)(*it)->getEntries() ;
1120  if( theTKType == "Averages")
1121  {
1122  computeStatus(*it, sts, norm) ;
1123  SiPixelUtility::getStatusColor(sts, rval, gval, bval);
1124  } else if( theTKType == "Entries") {
1125  sts = (double)entries / (double)maxEntries ;
1126  SiPixelUtility::getStatusColor(sts, rval, gval, bval);
1127  if( entries > maxEntries ) maxEntries = entries ;
1128  norm.first = 0 ;
1129  norm.second = maxEntries ;
1130  } else {
1131  int status = SiPixelUtility::getStatus((*it));
1132  if( status == dqm::qstatus::ERROR )
1133  {
1134  rval = 255; gval = 0; bval = 0;
1135  } else if (status == dqm::qstatus::WARNING ) {
1136  rval = 255; gval = 255; bval = 0;
1137  } else if (status == dqm::qstatus::OTHER) {
1138  rval = 0; gval = 0; bval = 255;
1139  } else if (status == dqm::qstatus::STATUS_OK) {
1140  rval = 0; gval = 255; bval = 0;
1141  } else {
1142  rval = 255; gval = 255; bval = 255;
1143  }
1144  }
1145  jsSnippet.str("") ;
1146  jsSnippet << " <DetInfo DetId='"
1147  << detId
1148  << "' red='"
1149  << rval
1150  << "' green='"
1151  << gval
1152  << "' blue='"
1153  << bval
1154  << "' entries='"
1155  << entries
1156  << "'/>" ;
1157  colorMap.push_back(jsSnippet.str()) ;
1158 // if( it == me_list.begin()) // The first should be equal to all others...
1159 // {
1160 // getNormalization((*it), norm, theMEType.latin1()) ;
1161 // }
1162  }
1163  }
1164 
1165 // delete random ;
1166 
1167 /* cout << ACYellow << ACBold
1168  << "[SiPixelInformationExtractor::sendTkUpdatedStatus()] "
1169  << ACPlain
1170  << "Color map consists of "
1171  << colorMap.size()
1172  << " snippets: start shipping back"
1173  << endl ;
1174 */
1175  out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
1176  *out << "<?xml version=\"1.0\" ?>" << endl;
1177  *out << "<TrackerMapUpdate>" << endl;
1178 
1179  for(vector<string>::iterator it=colorMap.begin(); it!=colorMap.end(); it++)
1180  {
1181  *out << *it << endl;
1182  }
1183 
1184  *out << " <theLimits id=\"normalizationLimits\" normLow=\""
1185  << norm.first
1186  << "\" normHigh=\""
1187  << norm.second
1188  << "\" />"
1189  << endl;
1190  *out << "</TrackerMapUpdate>"
1191  << endl;
1192 
1193 /* cout << ACYellow << ACBold
1194  << "[SiPixelInformationExtractor::sendTkUpdatedStatus()] "
1195  << ACPlain
1196  << "Color map updated within range "
1197  << norm.first
1198  << "-"
1199  << norm.second
1200  << endl ;
1201 */
1202 }
static const int OTHER
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void computeStatus(MonitorElement *mE, double &colorValue, std::pair< double, double > &norm)
(Documentation under construction).
static const int WARNING
const unsigned int maxEntries
static int getStatus(MonitorElement *me)
static void getStatusColor(int status, int &rval, int &gval, int &bval)
std::string getMEType(MonitorElement *mE)
void selectMEList(DQMStore *bei, std::string &name, std::vector< MonitorElement * > &mes)
(Documentation under construction).
tuple out
Definition: dbtoconf.py:99
unsigned long long int rval
Definition: vlib.h:23
static const int STATUS_OK
tuple status
Definition: ntuplemaker.py:245
static const int ERROR
void SiPixelInformationExtractor::setHTMLHeader ( xgi::Output out)
private

Definition at line 1595 of file SiPixelInformationExtractor.cc.

Referenced by getHistosFromPath(), and getSingleModuleHistos().

1595  {
1596  out->getHTTPResponseHeader().addHeader("Content-Type", "text/html");
1597  out->getHTTPResponseHeader().addHeader("Pragma", "no-cache");
1598  out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate,max-age=0");
1599  out->getHTTPResponseHeader().addHeader("Expires","Mon, 26 Jul 1997 05:00:00 GMT");
1600 }
tuple out
Definition: dbtoconf.py:99
void SiPixelInformationExtractor::setPlainHeader ( xgi::Output out)
private

Definition at line 1615 of file SiPixelInformationExtractor.cc.

1615  {
1616  out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
1617  out->getHTTPResponseHeader().addHeader("Pragma", "no-cache");
1618  out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate,max-age=0");
1619  out->getHTTPResponseHeader().addHeader("Expires","Mon, 26 Jul 1997 05:00:00 GMT");
1620 
1621 }
tuple out
Definition: dbtoconf.py:99
void SiPixelInformationExtractor::setXMLHeader ( xgi::Output out)
private

Definition at line 1604 of file SiPixelInformationExtractor.cc.

Referenced by getTrackerMapHistos(), and readStatusMessage().

1604  {
1605  out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
1606  out->getHTTPResponseHeader().addHeader("Pragma", "no-cache");
1607  out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate,max-age=0");
1608  out->getHTTPResponseHeader().addHeader("Expires","Mon, 26 Jul 1997 05:00:00 GMT");
1609  *out << "<?xml version=\"1.0\" ?>" << std::endl;
1610 
1611 }
tuple out
Definition: dbtoconf.py:99

Member Data Documentation

SiPixelActionExecutor* SiPixelInformationExtractor::actionExecutor_
private

Definition at line 159 of file SiPixelInformationExtractor.h.

int SiPixelInformationExtractor::alarmCounter_
private

Definition at line 155 of file SiPixelInformationExtractor.h.

Referenced by printAlarmList(), and readAlarmTree().

MonitorElement* SiPixelInformationExtractor::BarrelNdigisFREQProjection
private

Definition at line 190 of file SiPixelInformationExtractor.h.

SiPixelConfigParser* SiPixelInformationExtractor::configParser_
private

Definition at line 157 of file SiPixelInformationExtractor.h.

SiPixelConfigWriter* SiPixelInformationExtractor::configWriter_
private

Definition at line 158 of file SiPixelInformationExtractor.h.

int SiPixelInformationExtractor::count
private
MonitorElement* SiPixelInformationExtractor::EndcapNdigisFREQProjection
private

Definition at line 189 of file SiPixelInformationExtractor.h.

bool SiPixelInformationExtractor::endOfModules_
private

Definition at line 184 of file SiPixelInformationExtractor.h.

Referenced by findNoisyPixels().

int SiPixelInformationExtractor::errcount
private

Definition at line 178 of file SiPixelInformationExtractor.h.

MonitorElement* SiPixelInformationExtractor::EventRateBarrelPixels
private

Definition at line 186 of file SiPixelInformationExtractor.h.

Referenced by bookNoisyPixels(), and findNoisyPixels().

MonitorElement* SiPixelInformationExtractor::EventRateEndcapPixels
private

Definition at line 187 of file SiPixelInformationExtractor.h.

Referenced by bookNoisyPixels(), and findNoisyPixels().

bool SiPixelInformationExtractor::flagHotModule_
private

Definition at line 174 of file SiPixelInformationExtractor.h.

bool SiPixelInformationExtractor::gotDigis
private

Definition at line 179 of file SiPixelInformationExtractor.h.

SiPixelHistoPlotter* SiPixelInformationExtractor::histoPlotter_
private
std::map<std::string, std::vector< std::string> > SiPixelInformationExtractor::layoutMap
private

Definition at line 163 of file SiPixelInformationExtractor.h.

SiPixelLayoutParser* SiPixelInformationExtractor::layoutParser_
private

Definition at line 160 of file SiPixelInformationExtractor.h.

std::map<std::string, std::vector<std::string> > SiPixelInformationExtractor::meQTestsMap
private

Definition at line 168 of file SiPixelInformationExtractor.h.

ofstream SiPixelInformationExtractor::myfile_
private

Definition at line 181 of file SiPixelInformationExtractor.h.

Referenced by findNoisyPixels().

int SiPixelInformationExtractor::nevents_
private

Definition at line 182 of file SiPixelInformationExtractor.h.

Referenced by findNoisyPixels().

std::map< uint32_t , std::vector< std::pair< std::pair<int,int> , float > > > SiPixelInformationExtractor::noisyDetIds_
private

Definition at line 183 of file SiPixelInformationExtractor.h.

Referenced by findNoisyPixels().

bool SiPixelInformationExtractor::offlineXMLfile_
private

Definition at line 175 of file SiPixelInformationExtractor.h.

Referenced by getTrackerMapHistos().

std::map<std::string, std::map<std::string, std::string> > SiPixelInformationExtractor::qtestsMap
private

Definition at line 166 of file SiPixelInformationExtractor.h.

bool SiPixelInformationExtractor::readMeMap_
private

Definition at line 173 of file SiPixelInformationExtractor.h.

bool SiPixelInformationExtractor::readQTestMap_
private

Definition at line 172 of file SiPixelInformationExtractor.h.

bool SiPixelInformationExtractor::readReference_
private

Definition at line 171 of file SiPixelInformationExtractor.h.

Referenced by SiPixelInformationExtractor().

edm::ESHandle<SiPixelFedCablingMap> SiPixelInformationExtractor::theCablingMap
private

Definition at line 185 of file SiPixelInformationExtractor.h.

Referenced by findNoisyPixels().