CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SiPixelInformationExtractor Class Reference

#include <SiPixelInformationExtractor.h>

List of all members.

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).
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).
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)
std::string getMEType (MonitorElement *mE)
void getNormalization (MonitorElement *mE, std::pair< double, double > &norm, std::string theMEType)
 (Documentation under construction).
void getNormalization2D (MonitorElement *mE, std::pair< double, double > &normX, std::pair< double, double > &normY, std::string theMEType)
 (Documentation under construction).
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)
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 readConfiguration ()
 Read Configuration File.
void readModuleAndHistoList (DQMStore *bei, xgi::Output *out)
 (Documentation under construction).
void readModuleHistoTree (DQMStore *bei, std::string &str_name, xgi::Output *out)
 (Documentation under construction).
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)
void selectMEList (DQMStore *bei, std::string &name, std::vector< MonitorElement * > &mes)
 (Documentation under construction).
void sendTkUpdatedStatus (DQMStore *bei, xgi::Output *out, std::string &meName, std::string &theTKType)
 (Documentation under construction).
 SiPixelInformationExtractor (bool offlineXMLfile)
 Constructor of the SiPixelInformationExtractor class.
 ~SiPixelInformationExtractor ()
 Destructor of the SiPixelInformationExtractor class.

Private Member Functions

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

                                                                            : offlineXMLfile_(offlineXMLfile) {
  edm::LogInfo("SiPixelInformationExtractor") << 
    " Creating SiPixelInformationExtractor " << "\n" ;
  
  readReference_ = false;
  histoPlotter_=0;
  histoPlotter_ = new SiPixelHistoPlotter();
}
SiPixelInformationExtractor::~SiPixelInformationExtractor ( )

Destructor of the SiPixelInformationExtractor class.

Definition at line 81 of file SiPixelInformationExtractor.cc.

References histoPlotter_.

                                                          {
  edm::LogInfo("SiPixelInformationExtractor") << 
    " Deleting SiPixelInformationExtractor " << "\n" ;
  
  if (histoPlotter_) delete histoPlotter_;
}

Member Function Documentation

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

Definition at line 1333 of file SiPixelInformationExtractor.cc.

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

Referenced by SiPixelEDAClient::beginRun().

                                                                                                 {
//std::cout<<"BOOK NOISY PIXEL MEs!"<<std::endl;
  bei->cd();
  if(noiseRate_>=0.){
    bei->setCurrentFolder("Pixel/Barrel");
    EventRateBarrelPixels = bei->book1D("barrelEventRate","Digi event rate for all Barrel pixels",1000,0.,0.01);
    EventRateBarrelPixels->setAxisTitle("Event Rate",1);
    EventRateBarrelPixels->setAxisTitle("Number of Pixels",2);
    bei->cd();  
    bei->setCurrentFolder("Pixel/Endcap");
    EventRateEndcapPixels = bei->book1D("endcapEventRate","Digi event rate for all Endcap pixels",1000,0.,0.01);
    EventRateEndcapPixels->setAxisTitle("Event Rate",1);
    EventRateEndcapPixels->setAxisTitle("Number of Pixels",2);
  }
}
void SiPixelInformationExtractor::computeStatus ( MonitorElement mE,
double &  colorValue,
std::pair< double, double > &  norm 
)

(Documentation under construction).

Definition at line 901 of file SiPixelInformationExtractor.cc.

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

Referenced by sendTkUpdatedStatus().

{
  double normalizationX = 1 ;
  double normalizationY = 1 ;
  double meanX          = 0 ;
  double meanY          = 0 ;
  
  colorValue = 0 ;

  pair<double,double> normX ;
  pair<double,double> normY ;

  string theMEType = getMEType(theME) ;

//   cout << ACRed << ACReverse
//        << "[SiPixelInformationExtractor::computeStatus()]"
//        << ACPlain
//        << " Computing average for "
//        << theME->getName()
//        << endl ;

  if( theMEType.find("TH1") != string::npos)
  {
   meanX = (double)theME->getMean();
   getNormalization(theME, normX, "TH1") ;
   normalizationX = fabs( normX.second - normX.first) ;
   if( normalizationX == 0 ) {normalizationX=1.E-20;}
   colorValue  = meanX / normalizationX ;
   norm.first  = normX.first ;
   norm.second = normX.second ;
  }
  
  if( theMEType.find("TH2") != string::npos)
  {
   meanX = (double)theME->getMean(1);
   meanY = (double)theME->getMean(2);
   getNormalization2D(theME, normX, normY, "TH2") ;
   normalizationX = fabs( normX.second - normX.first) ;
   normalizationY = fabs( normY.second - normY.first) ;
   if( normalizationX == 0 ) {normalizationX=1.E-20;}
   if( normalizationY == 0 ) {normalizationY=1.E-20;}
   double cVX = meanX / normalizationX ;
   double cVY = meanY / normalizationY ;
   colorValue = sqrt(cVX*cVX + cVY*cVY) ;
   if( normalizationX >= normalizationY )
   { 
    norm.first  = normX.first;
    norm.second = normX.second ;
   } else { 
    norm.first  = normY.first;
    norm.second = normY.second ;
   }
//   cout << ACBlue << ACBold << ACReverse
//        << "[SiPixelInformationExtractor::computeStatus()]"
//      << ACPlain << "    "
//      << theME->getName()
//      << " meanX:Y "
//      << meanX << ":" << meanY
//      << " normX:Y " 
//      << norm.first << ":" << norm.second
//      << endl ;
  } 
 
  return ;
}
void SiPixelInformationExtractor::createDummiesFromLayout ( ) [private]
void SiPixelInformationExtractor::createImages ( 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(), spr::find(), DQMStore::get(), DQMStore::getMEs(), MonitorElement::getRootObject(), DQMStore::getSubdirs(), DQMStore::goUp(), and DQMStore::pwd().

Referenced by readModuleAndHistoList().

                                                                                         {
//cout<<"entering SiPixelInformationExtractor::fillModuleAndHistoList"<<endl;
  string currDir = bei->pwd();
  //cout<<"currDir= "<<currDir<<endl;
  if(currDir.find("Module_") != string::npos){
    if(histos.size() == 0){
      vector<string> contents = bei->getMEs();
      for (vector<string>::const_iterator it = contents.begin(); it != contents.end(); it++) {
        string hname          = (*it).substr(0, (*it).find("_siPixel"));
        if(hname==" ") hname = (*it).substr(0, (*it).find("_generalTracks"));
        string fullpathname   = bei->pwd() + "/" + (*it); 
       // cout<<"fullpathname="<<fullpathname<<endl;
        MonitorElement * me   = bei->get(fullpathname);
        string htype          = "undefined" ;
        if(me) htype = me->getRootObject()->IsA()->GetName() ;
        //cout<<"hname="<<hname<<endl;
        //if(htype=="TH1F" || htype=="TH1D"){
        histos[hname] = htype ;
        string mId=" ";
        if(hname.find("ndigis")                !=string::npos) mId = (*it).substr((*it).find("ndigis_siPixelDigis_")+20, 9);
        if(mId==" " && hname.find("nclusters") !=string::npos) mId = (*it).substr((*it).find("nclusters_siPixelClusters_")+26, 9);
        if(mId==" " && hname.find("residualX") !=string::npos) mId = (*it).substr((*it).find("residualX_ctfWithMaterialTracks_")+32, 9);
        if(mId==" " && hname.find("NErrors") !=string::npos) mId = (*it).substr((*it).find("NErrors_siPixelDigis_")+21, 9);
        if(mId==" " && hname.find("ClustX") !=string::npos) mId = (*it).substr((*it).find("ClustX_siPixelRecHit_")+21, 9);
        if(mId==" " && hname.find("pixelAlive") !=string::npos) mId = (*it).substr((*it).find("pixelAlive_siPixelCalibDigis_")+29, 9);
        if(mId==" " && hname.find("Gain1d") !=string::npos) mId = (*it).substr((*it).find("Gain1d_siPixelCalibDigis_")+25, 9);
        if(mId!=" ") modules.push_back(mId);
        //cout<<"mId="<<mId<<endl;
        //}
      }    
    }
  } else {  
    vector<string> subdirs = bei->getSubdirs();
    for (vector<string>::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) {
      if((bei->pwd()).find("Barrel")==string::npos && (bei->pwd()).find("Endcap")==string::npos) bei->goUp();
      bei->cd(*it);
      fillModuleAndHistoList(bei, modules, histos);
      bei->goUp();
    }
  }
//  fillBarrelList(bei, modules, histos);
//cout<<"leaving SiPixelInformationExtractor::fillModuleAndHistoList"<<endl;
}
void SiPixelInformationExtractor::findNoisyPixels ( DQMStore bei,
bool  init,
float  noiseRate,
int  noiseRateDenominator,
edm::EventSetup const &  eSetup 
)

Definition at line 1352 of file SiPixelInformationExtractor.cc.

References DQMStore::cd(), sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, cond::rpcobgas::detid, 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, Association::map, myfile_, PixelEndcapName::name(), PixelBarrelName::name(), nevents_, noisyDetIds_, edm::ESHandle< T >::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().

{
//cout<<"Entering SiPixelInformationExtractor::findNoisyPixels with noiseRate set to "<<noiseRate_<<endl;

  
  if(init){
    endOfModules_=false;
    nevents_=noiseRateDenominator_;
    if(nevents_ == -1){
      bei->cd();
      bei->setCurrentFolder("Pixel/EventInfo");
      nevents_ = (bei->get("Pixel/EventInfo/processedEvents"))->getIntValue();
    }
    bei->cd();  
    myfile_.open ("NoisyPixelList.txt", ios::app);
    myfile_ << "Noise summary, ran over " << nevents_ << " events, threshold was set to " << noiseRate_ <<  std::endl;
  }
  string currDir = bei->pwd();
  string dname = currDir.substr(currDir.find_last_of("/")+1);


  if(dname.find("Module_")!=string::npos){
    vector<string> meVec = bei->getMEs();
    for (vector<string>::const_iterator it = meVec.begin(); it != meVec.end(); it++) {
      string full_path = currDir + "/" + (*it);
      if(full_path.find("hitmap_siPixelDigis")!=string::npos){
        //broken HV bond:
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_01/Panel_2/Module_2")!=string::npos) continue;
        //?noisy?
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_1/Module_4")!=string::npos) continue;
        //ROG with HV problem (short?):
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_10/Panel_1/Module_3")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_10/Panel_1/Module_4")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_10/Panel_2/Module_2")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_10/Panel_2/Module_3")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_11/Panel_1/Module_3")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_11/Panel_1/Module_4")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_11/Panel_2/Module_2")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_11/Panel_2/Module_3")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_1/Module_3")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_1/Module_4")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_2/Module_2")!=string::npos) continue;
        //if(currDir.find("HalfCylinder_mI/Disk_1/Blade_12/Panel_2/Module_3")!=string::npos) continue;
        MonitorElement * me = bei->get(full_path);
        if (!me) continue;
        int detid=getDetId(me); int pixcol=-1; int pixrow=-1; 

        //cout<<"detid= "<<detid<<endl;
        std::vector<std::pair<std::pair<int, int>, float> > noisyPixelsInModule;
        TH2F * hothisto = me->getTH2F();
        if(hothisto){
          for(int i=1; i!=hothisto->GetNbinsX()+1; i++){
            for(int j=1; j!=hothisto->GetNbinsY()+1; j++){
              float value = (hothisto->GetBinContent(i,j))/float(nevents_);
              if(me->getPathname().find("Barrel")!=string::npos){
                EventRateBarrelPixels = bei->get("Pixel/Barrel/barrelEventRate");
                if(EventRateBarrelPixels) EventRateBarrelPixels->Fill(value);
              }else if(me->getPathname().find("Endcap")!=string::npos){
                EventRateEndcapPixels = bei->get("Pixel/Endcap/endcapEventRate");
                if(EventRateEndcapPixels) EventRateEndcapPixels->Fill(value);
              }
              if(value > noiseRate_){
                pixcol = i-1;
                pixrow = j-1;
                //cout<<"pixcol= "<<pixcol<<" , pixrow= "<<pixrow<<" , value= "<<value<<endl;
 
                std::pair<int, int> address(pixcol, pixrow);
                std::pair<std::pair<int, int>, float>  PixelStats(address, value);
                noisyPixelsInModule.push_back(PixelStats);
              }
            }
          }
        }
        noisyDetIds_[detid] = noisyPixelsInModule;
        //if(noisyPixelsInModule.size()>=20) cout<<"This module has 20 or more hot pixels: "<<detid<<","<<bei->pwd()<<","<<noisyPixelsInModule.size()<<endl;
      }
    }
  }
  vector<string> subDirVec = bei->getSubdirs();  
  for (vector<string>::const_iterator ic = subDirVec.begin();
       ic != subDirVec.end(); ic++) {
    if((*ic).find("AdditionalPixelErrors")!=string::npos) continue;
    bei->cd(*ic);
    init=false;
    findNoisyPixels(bei,init,noiseRate_,noiseRateDenominator_,eSetup);
    bei->goUp();
  }

  if(bei->pwd().find("EventInfo")!=string::npos) endOfModules_ = true;
  
  if(!endOfModules_) return;
  // myfile_ <<"am in "<<bei->pwd()<<" now!"<<endl;
  if(currDir == "Pixel/EventInfo/reportSummaryContents"){
    eSetup.get<SiPixelFedCablingMapRcd>().get(theCablingMap);
    std::vector<std::pair<sipixelobjects::DetectorIndex,double> > pixelvec;
    std::map<uint32_t,int> myfedmap;
    std::map<uint32_t,std::string> mynamemap;
    int realfedID = -1;
    //int Nnoisies = noisyDetIds_.size();
    //cout<<"Number of noisy modules: "<<Nnoisies<<endl;
    int counter = 0;
    int n_noisyrocs_all = 0;
    int n_noisyrocs_barrel = 0;
    int n_noisyrocs_endcap = 0;
    int n_verynoisyrocs_all = 0;
    int n_verynoisyrocs_barrel = 0;
    int n_verynoisyrocs_endcap = 0;

    for(int fid = 0; fid < 40; fid++){
    for(std::map<uint32_t, std::vector< std::pair<std::pair<int, int>, float> > >::const_iterator it = noisyDetIds_.begin(); 
        it != noisyDetIds_.end(); it++){
      uint32_t detid = (*it).first;
      std::vector< std::pair<std::pair<int, int>, float> > noisyPixels = (*it).second;
      //cout<<noisyPixels.size()<<" noisy pixels in a module: "<<detid<<endl;
      // now convert into online conventions:
      for(int fedid=0; fedid<=40; ++fedid){
        SiPixelFrameConverter converter(theCablingMap.product(),fedid);
        uint32_t newDetId = detid;
        if(converter.hasDetUnit(newDetId)){
          realfedID=fedid;
          break;   
        }
      }
      if(fid == realfedID){
      //cout<<"FED ID is = "<<realfedID<<endl;
      if(realfedID==-1) continue; 
      DetId detId(detid);
      uint32_t detSubId = detId.subdetId();
      std::string outputname;
      bool HalfModule = false;
      if (detSubId == 2){   //FPIX
        PixelEndcapName nameworker(detid);
        outputname = nameworker.name();
      } else if(detSubId == 1){   //BPIX
        PixelBarrelName nameworker(detid);
        outputname = nameworker.name();
        HalfModule = nameworker.isHalfModule();

      } else{
        continue;
      } 
      std::map<int,int> myrocmap;
      myfedmap[detid]=realfedID;
      mynamemap[detid]=outputname;
      
      for(std::vector< std::pair< std::pair<int,int>, float> >::const_iterator pxl = noisyPixels.begin(); 
          pxl != noisyPixels.end(); pxl++){
        std::pair<int,int> offlineaddress = (*pxl).first;
        float Noise_frac = (*pxl).second;
        int offlineColumn = offlineaddress.first;
        int offlineRow = offlineaddress.second;
        counter++;
        //cout<<"noisy pixel counter: "<<counter<<endl;

        sipixelobjects::ElectronicIndex cabling; 
        SiPixelFrameConverter formatter(theCablingMap.product(),realfedID);
        sipixelobjects::DetectorIndex detector = {detid, offlineRow, offlineColumn};      
        formatter.toCabling(cabling,detector);
        // cabling should now contain cabling.roc and cabling.dcol  and cabling.pxid
        // however, the coordinates now need to be converted from dcl,pxid to the row,col coordinates used in the calibration info 
        sipixelobjects::LocalPixel::DcolPxid loc;
        loc.dcol = cabling.dcol;
        loc.pxid = cabling.pxid;
        
        
        // OLD version, not 31X compatible:
//        const sipixelobjects::PixelFEDCabling *theFed= theCablingMap.product()->fed(realfedID);
//      const sipixelobjects::PixelFEDLink * link = theFed->link(cabling.link);
//      const sipixelobjects::PixelROC *theRoc = link->roc(cabling.roc);
//      sipixelobjects::LocalPixel locpixel(loc);
        
        
        // FIX to adhere to new cabling map. To be replaced with CalibTracker/SiPixelTools detid - > hardware id classes ASAP.
        //        const sipixelobjects::PixelFEDCabling *theFed= theCablingMap.product()->fed(realfedID);
        //        const sipixelobjects::PixelFEDLink * link = theFed->link(cabling.link);
        //        const sipixelobjects::PixelROC *theRoc = link->roc(cabling.roc);
        sipixelobjects::LocalPixel locpixel(loc);
        sipixelobjects::CablingPathToDetUnit path = {realfedID, cabling.link, cabling.roc};  
        const sipixelobjects::PixelROC *theRoc = theCablingMap->findItem(path);
        // END of FIX
        
        int onlineColumn = locpixel.rocCol();
        int onlineRow= locpixel.rocRow();
        myrocmap[(theRoc->idInDetUnit())]++;

        // ROC numbers in the barrel go from 8 to 15 instead of 0 to 7 in half modules.  This is a 
        // fix to get the roc number, and add 8 to it if:
        // it's a Barrel module AND on the minus side AND a Half module

        int rocnumber = -1;

        if((detSubId == 1) && (outputname.find("mO")!=string::npos || outputname.find("mI")!=string::npos) && (HalfModule)){
          rocnumber = theRoc->idInDetUnit() + 8;
        }
        else{
          rocnumber = theRoc->idInDetUnit();
        }

        //cout<<counter<<" : \t detid= "<<detid<<" , OFF col,row= "<<offlineColumn<<","<<offlineRow<<" , ON roc,col,row= "<<theRoc->idInDetUnit()<<","<<onlineColumn<<","<<onlineRow<<endl;
        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;
      }
      for(std::map<int, int>::const_iterator nrc = myrocmap.begin(); nrc != myrocmap.end(); nrc++){
        if((*nrc).second > 0){
          n_noisyrocs_all++;
          if(detSubId == 2){
            n_noisyrocs_endcap++;
          } else if(detSubId == 1){
            n_noisyrocs_barrel++;}
        }
        if((*nrc).second > 40){
          n_verynoisyrocs_all++;
          if(detSubId == 2){
            n_verynoisyrocs_endcap++;
          } else if(detSubId == 1){
            n_verynoisyrocs_barrel++;}
        }
      }
      }

    }
    }
    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;
    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;

  }
  myfile_.close();
//cout<<"...leaving SiPixelInformationExtractor::findNoisyPixels!"<<endl;
  return;
}
int SiPixelInformationExtractor::getDetId ( MonitorElement mE)

(Documentation under construction).

Given a pointer to ME returns the associated detId

Definition at line 1212 of file SiPixelInformationExtractor.cc.

References MonitorElement::getName().

Referenced by findNoisyPixels().

{
//cout<<"In SiPixelInformationExtractor::getDetId: for ME= "<<mE->getName()<<endl;
 string mEName = mE->getName();

 int detId = 0;
 
 if( mEName.find("_3") != string::npos )
 {
  string detIdString = mEName.substr((mEName.find_last_of("_"))+1,9);
  //cout<<"string: "<<detIdString<<endl;
  std::istringstream isst;
  isst.str(detIdString);
  isst>>detId;
// } else {
//  cout << ACYellow << ACBold
//       << "[SiPixelInformationExtractor::getDetId()] "
//       << ACPlain
//       << "Could not extract detId from "
//       << mEName
//       << endl ;
 }
  //cout<<"returning with: "<<detId<<endl;
  return detId ;
  
}
void SiPixelInformationExtractor::getHistosFromPath ( DQMStore bei,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 1302 of file SiPixelInformationExtractor.cc.

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

Referenced by SiPixelWebInterface::handleEDARequest().

                                                                    {
//cout<<"Entering SiPixelInformationExtractor::getHistosFromPath: "<<endl;
  string path = getItemValue(req_map,"Path");
//cout<<"Path is: "<<path<<endl;
  if (path.size() == 0) return;

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

  string opt =" ";

  setHTMLHeader(out);
  vector<MonitorElement*> all_mes = bei->getContents(path);
  *out << path << " " ;
  for(vector<MonitorElement*>::iterator it=all_mes.begin(); it!=all_mes.end(); it++){
    MonitorElement* me = (*it);
    //cout<<"I'm in the loop now..."<<endl;
    if (!me) continue;
    string name = me->getName();
    string full_path = path + "/" + name;
//cout<<"Calling HP::setNewPlot now for "<<full_path<<endl;
    histoPlotter_->setNewPlot(full_path, opt, width, height);
    *out << name << " ";
  }
//  cout<<"... leaving SiPixelInformationExtractor::getHistosFromPath!"<<endl;
}
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]
std::string SiPixelInformationExtractor::getItemValue ( std::multimap< std::string, std::string > &  req_map,
std::string  item_name 
) [private]

Definition at line 723 of file SiPixelInformationExtractor.cc.

References pos, and relativeConstraints::value.

                                                                     {
//cout<<"entering SiPixelInformationExtractor::getItemValue for item: "<<item_name<<endl;
  std::multimap<std::string,std::string>::iterator pos = req_map.find(item_name);
  std::string value = " ";
  if (pos != req_map.end()) {
//  cout<<"item found!"<<endl;
    value = pos->second;
  }
//  cout<<"value = "<<value<<endl;
  return value;
//cout<<"leaving SiPixelInformationExtractor::getItemValue"<<endl;
}
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 711 of file SiPixelInformationExtractor.cc.

References pos, and relativeConstraints::value.

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

                                                                     {
//cout<<"entering SiPixelInformationExtractor::getItemValue for item: "<<item_name<<endl;
  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;
  }
//  cout<<"value = "<<value<<endl;
  return value;
//cout<<"leaving SiPixelInformationExtractor::getItemValue"<<endl;
}
void SiPixelInformationExtractor::getMEList ( DQMStore bei,
std::map< std::string, int > &  mEHash 
)
std::string SiPixelInformationExtractor::getMEType ( MonitorElement mE)

Definition at line 259 of file SiPixelInformationExtractor.cc.

References MonitorElement::getRootObject().

Referenced by computeStatus(), and sendTkUpdatedStatus().

{
  string qtype = theMe->getRootObject()->IsA()->GetName() ;
  if(         qtype.find("TH1") != string::npos )
  {
    return "TH1" ;
  } else if ( qtype.find("TH2") != string::npos  ) {
    return "TH2" ;
  } else if ( qtype.find("TH3") != string::npos ) {
    return "TH3" ;
  }
  return "TH1" ;
}
void SiPixelInformationExtractor::getNormalization ( MonitorElement mE,
std::pair< double, double > &  norm,
std::string  theMEType 
)

(Documentation under construction).

Definition at line 973 of file SiPixelInformationExtractor.cc.

References MonitorElement::getNbinsX().

Referenced by computeStatus().

{
  double normLow  = 0 ;
  double normHigh = 0 ;

  if( theMEType.find("TH1") != string::npos)
  {
   normHigh    = (double)theME->getNbinsX() ;
   norm.first  = normLow  ;
   norm.second = normHigh ;
  }
}
void SiPixelInformationExtractor::getNormalization2D ( MonitorElement mE,
std::pair< double, double > &  normX,
std::pair< double, double > &  normY,
std::string  theMEType 
)

(Documentation under construction).

Definition at line 992 of file SiPixelInformationExtractor.cc.

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

Referenced by computeStatus().

{
  double normLow  = 0 ;
  double normHigh = 0 ;

  if( theMEType.find("TH2") != string::npos )
  {
   normHigh    = (double)theME->getNbinsX() ;
   normX.first  = normLow  ;
   normX.second = normHigh ;
   normHigh    = (double)theME->getNbinsY() ;
   normY.first  = normLow  ;
   normY.second = normHigh ;
//   cout << ACCyan << ACBold << ACReverse
//        << "[SiPixelInformationExtractor::getNormalization2D()]"
//      << ACPlain << " "
//      << theME->getName()
//      << " normX: " 
//      << normX.first << ":" << normX.second
//      << " normY: " 
//      << normY.first << ":" << normY.second
//      << endl ;
  }
}
void SiPixelInformationExtractor::getSingleModuleHistos ( DQMStore bei,
const std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)
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_, getHLTPrescaleColumns::path, DQMStore::pwd(), SiPixelHistoPlotter::setNewPlot(), setXMLHeader(), and tablePrinter::width.

Referenced by SiPixelWebInterface::handleEDARequest().

                                                                       {

//  cout << __LINE__ << ACYellow << ACBold 
//       << "[SiPixelInformationExtractor::getTrackerMapHistos] " << ACPlain << endl ;
//  cout<<"I am in this dir: "<<bei->pwd()<<endl;
  vector<string> hlist;
  string tkmap_name;
  SiPixelConfigParser config_parser;
  string localPath;
  if(offlineXMLfile_) localPath = string("DQM/SiPixelMonitorClient/test/sipixel_tier0_config.xml");
  else localPath = string("DQM/SiPixelMonitorClient/test/sipixel_monitorelement_config.xml");
  config_parser.getDocument(edm::FileInPath(localPath).fullPath());
//  if (!config_parser.getMENamesForTrackerMap(tkmap_name, hlist)) return;
//  if (hlist.size() == 0) return;
  if (!config_parser.getMENamesForTrackerMap(tkmap_name, hlist)) 
  {
   cout << __LINE__ << ACYellow << ACBold 
        << "[SiPixelInformationExtractor::getTrackerMapHistos] " 
        << ACPlain << ACRed << ACPlain 
        << "getMENamesForTrackerMap return false " 
        << ACPlain << endl ; assert(0) ;
   return;
  }
  if (hlist.size() == 0) 
  {
   cout << __LINE__ << ACYellow << ACBold 
        << "[SiPixelInformationExtractor::getTrackerMapHistos] " 
        << ACPlain << ACRed << ACPlain 
        << "hlist.size() == 0 " 
        << ACPlain << endl ;  assert(0) ;
   return;
  }


  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);
  string currDir = bei->pwd();   
//  cout<<"detId= "<<detId<<" , path= "<<path<<" , and now I am in "<<currDir<<endl;
  
/*
  if((bei->pwd()).find("Module_") == string::npos &&
     (bei->pwd()).find("FED_") == string::npos){
    cout<<"This is not a pixel module or FED!"<<endl;
   cout << __LINE__ << ACYellow << ACBold 
        << "[SiPixelInformationExtractor::getTrackerMapHistos] " 
        << ACPlain << ACRed << ACPlain 
        << "This is not a pixel module or FED!" 
        << ACPlain << endl ; assert(0) ;
    return;
  }
*/ 
  vector<MonitorElement*> all_mes = bei->getContents(path);
  setXMLHeader(out);

/*  cout << __LINE__ << ACCyan << ACBold 
       << " [SiPixelInformationExtractor::getTrackerMapHistos()] path "
       << ACPlain << path << endl ; 
  cout << __LINE__ << ACCyan << ACBold 
       << " [SiPixelInformationExtractor::getTrackerMapHistos()] all_mes.size() "
       << ACPlain << all_mes.size() << endl ; 
*/
  string theME ;
  *out << "<pathList>" << endl ;
  for (vector<string>::iterator ih = hlist.begin();
       ih != hlist.end(); ih++) {
       //cout<<"ih iterator (hlist): "<<(*ih)<<endl;
    for (vector<MonitorElement *>::const_iterator it = all_mes.begin();
         it!= all_mes.end(); it++) {
      MonitorElement * me = (*it);
      if (!me) 
      { 
       cout << __LINE__ << ACCyan << ACBold 
            << " [SiPixelInformationExtractor::getTrackerMapHistos()] skipping "
                       << ACPlain << *ih << endl ; 
       continue;
      }
      theME = me->getName();
      //cout<<"ME iterator (all_mes): "<<theME<<endl; 
      string temp_s ; 
      if(theME.find("siPixel")!=string::npos || theME.find("ctfWithMaterialTracks")!=string::npos) { temp_s = theME.substr(0,theME.find_first_of("_")); }
      //cout << __LINE__ << ACCyan << ACBold 
      //     << " [SiPixelInformationExtractor::getTrackerMapHistos()] temp_s "
      //     << ACPlain << temp_s << " <--> " << *ih << " |" << theME << "|" << endl ; 
      if (temp_s == (*ih)) {
        string full_path = path + "/" + me->getName();
        histoPlotter_->setNewPlot(full_path, opt, width, height);
//cout << __LINE__ << ACRed << ACBold 
//     << " [SiPixelInformationExtractor::getTrackerMapHistos()] fullPath: "
//     << ACPlain << full_path << endl ; 
        *out << " <pathElement path='" << full_path << "' />" << endl ;
      }      
    }
  }   
  *out << "</pathList>" << endl ;
//cout << __LINE__ << " [SiPixelInformationExtractor::getTrackerMapHistos()] endlist: " << endl ;
}
bool SiPixelInformationExtractor::goToDir ( DQMStore bei,
std::string &  sname 
) [private]
bool SiPixelInformationExtractor::hasItem ( std::multimap< std::string, std::string > &  req_map,
std::string  item_name 
) [private]
void SiPixelInformationExtractor::printAlarmList ( DQMStore bei,
std::ostringstream &  str_val 
) [private]
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(), DQMStore::getMEs(), DQMStore::getSubdirs(), DQMStore::goUp(), and DQMStore::pwd().

Referenced by readModuleHistoTree().

                                                                              {
//cout<<"entering SiPixelInformationExtractor::printModuleHistoList"<<endl;
  static string indent_str = "";
  string currDir = bei->pwd();
  string dname = currDir.substr(currDir.find_last_of("/")+1);
  str_val << " <li>\n"
          << "  <a href=\"#\" id=\"" << currDir << "\">\n   " 
          <<     dname << "\n"
          << "  </a>\n"
          << endl << 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("_siPixel")!=string::npos || 
        (*it).find("_ctfWithMaterialTracks")!=string::npos) {
      string qit = (*it) ;
      string temp_s;
      if(qit.find("siPixel")!=string::npos || qit.find("ctfWithMaterialTracks")!=string::npos) { temp_s = qit.substr(0,qit.find_first_of("_")); }
      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       " 
//            <<        temp_s << "\n"
              <<        (*it) << "\n"
              << "     </a>\n"
              << "    </li>" 
              << endl;
    }
  }
  for (vector<string>::const_iterator ic  = subDirVec.begin();
                                      ic != subDirVec.end(); ic++) {
    bei->cd(*ic);
    printModuleHistoList(bei, str_val);
    bei->goUp();
  }
  str_val << "   </ul>" << endl;  
  str_val << "  </li>"  << endl;  
//cout<<"leaving SiPixelInformationExtractor::printModuleHistoList"<<endl;
}
void SiPixelInformationExtractor::printSummaryHistoList ( DQMStore bei,
std::ostringstream &  str_val 
) [private]
void SiPixelInformationExtractor::readAlarmTree ( DQMStore bei,
std::string &  str_name,
xgi::Output *  out 
)
void SiPixelInformationExtractor::readConfiguration ( )

Read Configuration File.

Definition at line 92 of file SiPixelInformationExtractor.cc.

{ }
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().

                                                                          {
//cout<<"entering SiPixelInformationExtractor::readModuleAndHistoList"<<endl;
   bei->cd("Pixel");
   std::map<std::string,std::string> hnames;
   std::vector<std::string> mod_names;
   fillModuleAndHistoList(bei, mod_names, hnames);
   out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
  *out << "<?xml version=\"1.0\" ?>" << std::endl;
  *out << "<ModuleAndHistoList>" << endl;
  *out << "<ModuleList>" << endl;
   for (std::vector<std::string>::iterator im = mod_names.begin();
        im != mod_names.end(); im++) {
     *out << "<ModuleNum>" << *im << "</ModuleNum>" << endl;     
   }
   *out << "</ModuleList>" << endl;
   *out << "<HistoList>" << endl;

   for (std::map<std::string,std::string>::iterator ih = hnames.begin();
        ih != hnames.end(); ih++) {
     *out << "<Histo type=\"" 
          << ih->second
          << "\">" 
          << ih->first 
          << "</Histo>" 
          << endl;     
   }
   *out << "</HistoList>" << endl;
   *out << "</ModuleAndHistoList>" << endl;
//cout<<"leaving SiPixelInformationExtractor::readModuleAndHistoList"<<endl;
}
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().

                                                                       {
//cout<<"entering  SiPixelInformationExtractor::readModuleHistoTree"<<endl;
  ostringstream modtree;
  if (goToDir(bei, str_name)) {
    modtree << "<form name=\"IMGCanvasItemsSelection\" "
            << "action=\"javascript:void%200\">" 
            << endl ;
    modtree << "<ul id=\"dhtmlgoodies_tree\" class=\"dhtmlgoodies_tree\">" << endl;
    printModuleHistoList(bei,modtree);
    modtree <<"</ul>" << endl;   
    modtree <<"</form>" << endl;   
  } else {
    modtree << "Desired Directory does not exist";
  }
  cout << ACYellow << ACBold
       << "[SiPixelInformationExtractor::readModuleHistoTree()]"
       << ACPlain << endl ;
  //     << "html string follows: " << endl ;
  //cout << modtree.str() << endl ;
  //cout << ACYellow << ACBold
  //     << "[SiPixelInformationExtractor::readModuleHistoTree()]"
  //     << ACPlain
  //     << "String complete " << endl ;
  out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
  *out << modtree.str();
   bei->cd();
//cout<<"leaving  SiPixelInformationExtractor::readModuleHistoTree"<<endl;
}
void SiPixelInformationExtractor::readStatusMessage ( DQMStore bei,
std::multimap< std::string, std::string > &  req_map,
xgi::Output *  out 
)

Definition at line 836 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().

                                                                    {

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

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

  string opt =" ";

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

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

      if (q_reports.size() != 0) {
        test_status << " QTest Status for " << name << " : " << endl;
        test_status << " ======================================================== " << endl; 
        for (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 << ") ";
          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) << endl;
          test_status << "&lt;br/&gt;";
          test_status <<  " QTest Detail  : " << mess_str.substr(mess_str.find(")")+2) << endl;
        } 
        test_status << " ======================================================== " << endl;
      }
      *out << "<HPath>" << name << "</HPath>" << endl;         
    }    
  }
  *out << "</PathList>" << endl;
  *out << "<StatusList>" << endl;
  *out << "<Status>" << test_status.str() << "</Status>" << endl;      
  *out << "</StatusList>" << endl;
  *out << "</StatusAndPath>" << endl;
}
void SiPixelInformationExtractor::readSummaryHistoTree ( DQMStore bei,
std::string &  str_name,
xgi::Output *  out 
)
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,
std::vector< QReport * > &  reports 
) [private]
void SiPixelInformationExtractor::selectImage ( std::string &  name,
int  status 
) [private]
void SiPixelInformationExtractor::selectMEList ( DQMStore bei,
std::string &  name,
std::vector< MonitorElement * > &  mes 
)

(Documentation under construction).

Definition at line 1025 of file SiPixelInformationExtractor.cc.

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

Referenced by sendTkUpdatedStatus().

{  
//  cout<<"In SiPixelInformationExtractor::selectMEList: "<<endl;
  string currDir = bei->pwd();
   
  string theME ;
   
  // Get ME from Collector/FU0/Tracker/PixelEndcap/HalfCylinder_pX/Disk_X/Blade_XX/Panel_XX/Module_XX
  if (currDir.find("Module_") != string::npos ||
      currDir.find("FED_") != string::npos)  
  {
    vector<string> contents = bei->getMEs(); 
       
    for (vector<string>::const_iterator it = contents.begin(); it != contents.end(); it++) 
    {
      theME = (*it) ;
      if(theME.find("siPixel")==string::npos && theME.find("ctfWithMaterialTracks")==string::npos) {continue ;} // If the ME is not a siPixel or ctfWithMaterialTrack one, skip
      string temp_s = theME.substr(0,theME.find_first_of("_"));
      //cout<<"should be the variable name: temp_s= "<<temp_s<<endl;
      if (temp_s == theMEName)  
      {
        string full_path = currDir + "/" + (*it);

        MonitorElement * me = bei->get(full_path.c_str());
        
        if (me) {mes.push_back(me);}
      }
    }
    return;
  } else {  // If not yet reached the desired level in the directory tree, recursively go down one level more
    vector<string> subdirs = bei->getSubdirs();
    for (vector<string>::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) 
    {
      bei->cd(*it);
      selectMEList(bei, theMEName, mes);
      bei->goUp();
    }
  }
}
void SiPixelInformationExtractor::sendTkUpdatedStatus ( DQMStore bei,
xgi::Output *  out,
std::string &  theMEName,
std::string &  theTKType 
)

(Documentation under construction).

Definition at line 1071 of file SiPixelInformationExtractor.cc.

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

Referenced by SiPixelWebInterface::periodicTkMapUpdate().

{
//  cout<<"In SiPixelInformationExtractor::sendTkUpdatedStatus: "<<endl;
  int rval, gval, bval;
  vector<string>          colorMap ;
  vector<MonitorElement*> me_list;
  pair<double,double>     norm ;
  double sts ;
    
  bei->cd();
  selectMEList(bei, theMEName, me_list) ;
  bei->cd();

  string detId = "undefined";

/*   cout << ACYellow << ACBold
        << "[SiPixelInformationExtractor::sendTkUpdatedStatus()] "
        << ACPlain
        << "Preparing color map update for " 
        << theMEName
        << " type "
        << theTKType
        << " - List size: "
        << me_list.size() 
        << endl ;
*/  
  int maxEntries = 0 ;
  if( theTKType == "Entries") // In this case find the ME with the highest number of entries
  {                           // first and use that as a vertical scale normalization
   for(vector<MonitorElement*>::iterator it=me_list.begin(); it!=me_list.end(); it++)
   {
    int entries = (int)(*it)->getEntries() ;
    if( entries > maxEntries ) maxEntries = entries ;
   }
  }
  
  int entries = 0 ;
  stringstream jsSnippet ;
  for(vector<MonitorElement*>::iterator it=me_list.begin(); it!=me_list.end(); it++)
  {
    string meName    = (*it)->getName();
    string theMEType = getMEType(*it);
    if( meName.find("_3") != string::npos ) 
    {
     string detIdString = meName.substr(meName.find_last_of("_")+1,9);
     std::istringstream isst;
     isst.str(detIdString);
     isst>>detId;
     entries = (int)(*it)->getEntries() ;
     if( theTKType == "Averages") 
     {
      computeStatus(*it, sts, norm) ;
      SiPixelUtility::getStatusColor(sts, rval, gval, bval);
     } else if( theTKType == "Entries") {
      sts = (double)entries / (double)maxEntries ;
      SiPixelUtility::getStatusColor(sts, rval, gval, bval);
      if( entries > maxEntries ) maxEntries = entries ;
      norm.first  = 0 ;
      norm.second = maxEntries ;
     } else {
      int status  =  SiPixelUtility::getStatus((*it));
      if(        status == dqm::qstatus::ERROR ) 
      {
       rval = 255; gval =   0; bval =   0;
      } else if (status == dqm::qstatus::WARNING )  {
       rval = 255; gval = 255; bval =   0; 
      } else if (status == dqm::qstatus::OTHER)     {
       rval =   0; gval =   0; bval = 255;
      } else if (status == dqm::qstatus::STATUS_OK) {
       rval =   0; gval = 255; bval =   0;
      } else {  
       rval = 255; gval = 255; bval = 255;
      }
     }
     jsSnippet.str("") ;
     jsSnippet << " <DetInfo DetId='"
               << detId
               << "' red='"
               << rval
               << "' green='"
               << gval
               << "' blue='"
               << bval
               << "' entries='"
               << entries
               << "'/>" ;
     colorMap.push_back(jsSnippet.str()) ;
//      if( it == me_list.begin()) // The first should be equal to all others...
//      {
//       getNormalization((*it), norm, theMEType.latin1()) ;
//      }
    }
  }

//  delete random ;
  
/*   cout << ACYellow << ACBold
        << "[SiPixelInformationExtractor::sendTkUpdatedStatus()] "
        << ACPlain
        << "Color map consists of "
        << colorMap.size()
        << " snippets: start shipping back"
        << endl ;
*/
  out->getHTTPResponseHeader().addHeader("Content-Type", "text/xml");
  *out << "<?xml version=\"1.0\" ?>" << endl;
  *out << "<TrackerMapUpdate>"       << endl;

  for(vector<string>::iterator it=colorMap.begin(); it!=colorMap.end(); it++)
  {
   *out << *it << endl;
  }
 
  *out << " <theLimits id=\"normalizationLimits\" normLow=\"" 
       << norm.first 
       << "\" normHigh=\""
       << norm.second 
       << "\" />"
       << endl;
  *out << "</TrackerMapUpdate>"              
       << endl;

/*   cout << ACYellow << ACBold
        << "[SiPixelInformationExtractor::sendTkUpdatedStatus()] "
        << ACPlain
        << "Color map updated within range " 
        << norm.first
        << "-"
        << norm.second
        << endl ;
*/
}
void SiPixelInformationExtractor::setHTMLHeader ( xgi::Output *  out) [private]

Definition at line 1593 of file SiPixelInformationExtractor.cc.

Referenced by getHistosFromPath(), and SiStripInformationExtractor::getSingleModuleHistos().

                                                               {
  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 SiPixelInformationExtractor::setPlainHeader ( xgi::Output *  out) [private]

Definition at line 1613 of file SiPixelInformationExtractor.cc.

                                                                {
  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 SiPixelInformationExtractor::setXMLHeader ( xgi::Output *  out) [private]

Definition at line 1602 of file SiPixelInformationExtractor.cc.

Referenced by getTrackerMapHistos(), 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

Definition at line 159 of file SiPixelInformationExtractor.h.

Definition at line 190 of file SiPixelInformationExtractor.h.

Definition at line 157 of file SiPixelInformationExtractor.h.

Definition at line 158 of file SiPixelInformationExtractor.h.

Definition at line 177 of file SiPixelInformationExtractor.h.

Definition at line 189 of file SiPixelInformationExtractor.h.

Definition at line 184 of file SiPixelInformationExtractor.h.

Referenced by findNoisyPixels().

Definition at line 178 of file SiPixelInformationExtractor.h.

Definition at line 186 of file SiPixelInformationExtractor.h.

Referenced by bookNoisyPixels(), and findNoisyPixels().

Definition at line 187 of file SiPixelInformationExtractor.h.

Referenced by bookNoisyPixels(), and findNoisyPixels().

Definition at line 174 of file SiPixelInformationExtractor.h.

Definition at line 179 of file SiPixelInformationExtractor.h.

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

Definition at line 163 of file SiPixelInformationExtractor.h.

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.

Definition at line 181 of file SiPixelInformationExtractor.h.

Referenced by findNoisyPixels().

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().

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.

Definition at line 173 of file SiPixelInformationExtractor.h.

Definition at line 172 of file SiPixelInformationExtractor.h.

Definition at line 171 of file SiPixelInformationExtractor.h.

Referenced by SiPixelInformationExtractor().

Definition at line 185 of file SiPixelInformationExtractor.h.

Referenced by findNoisyPixels().