00001 #ifndef _SiPixelInformationExtractor_h_ 00002 #define _SiPixelInformationExtractor_h_ 00003 00004 #include "DQMServices/Core/interface/MonitorElement.h" 00005 00006 #include "DQM/SiPixelMonitorClient/interface/SiPixelConfigParser.h" 00007 #include "DQM/SiPixelMonitorClient/interface/SiPixelConfigWriter.h" 00008 #include "DQM/SiPixelMonitorClient/interface/SiPixelActionExecutor.h" 00009 #include "DQM/SiPixelMonitorClient/interface/SiPixelLayoutParser.h" 00010 00011 #include "FWCore/Framework/interface/Event.h" 00012 #include "FWCore/Framework/interface/EventSetup.h" 00013 #include "FWCore/Framework/interface/ESHandle.h" 00014 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00015 00016 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h" 00017 #include "DataFormats/Common/interface/DetSetVector.h" 00018 #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h" 00019 #include "CondFormats/SiPixelObjects/interface/DetectorIndex.h" 00020 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h" 00021 #include "CondFormats/SiPixelObjects/interface/SiPixelFrameConverter.h" 00022 00023 #include "xgi/Utils.h" 00024 #include "xgi/Method.h" 00025 00026 #include "TCanvas.h" 00027 #include "TPaveText.h" 00028 #include "TF1.h" 00029 #include "TH2F.h" 00030 #include "TGaxis.h" 00031 00032 #include <fstream> 00033 #include <sstream> 00034 #include <map> 00035 #include <vector> 00036 #include <string> 00037 #include <map> 00038 #include <boost/cstdint.hpp> 00039 00040 class DQMStore; 00041 class SiPixelEDAClient; 00042 class SiPixelWebInterface; 00043 class SiPixelHistoPlotter; 00044 class SiPixelInformationExtractor { 00045 00046 public: 00047 00048 SiPixelInformationExtractor( bool offlineXMLfile); 00049 ~SiPixelInformationExtractor(); 00050 00051 void getSingleModuleHistos( DQMStore * bei, 00052 const std::multimap<std::string, std::string>& req_map, 00053 xgi::Output * out); 00054 void getHistosFromPath( DQMStore * bei, 00055 const std::multimap<std::string, std::string>& req_map, 00056 xgi::Output * out); 00057 void getTrackerMapHistos( DQMStore * bei, 00058 const std::multimap<std::string, std::string>& req_map, 00059 xgi::Output * out); 00060 00061 00062 void readModuleAndHistoList( DQMStore * bei, 00063 xgi::Output * out); 00064 void readModuleHistoTree( DQMStore * bei, 00065 std::string & str_name, 00066 xgi::Output * out); 00067 void readSummaryHistoTree( DQMStore * bei, 00068 std::string & str_name, 00069 xgi::Output * out); 00070 void readAlarmTree( DQMStore * bei, 00071 std::string & str_name, 00072 xgi::Output * out); 00073 void readStatusMessage( DQMStore * bei, 00074 std::multimap<std::string, std::string>& req_map, 00075 xgi::Output * out); 00076 void computeStatus( MonitorElement * mE, 00077 double & colorValue, 00078 std::pair<double,double> & norm) ; 00079 void getNormalization( MonitorElement * mE, 00080 std::pair<double,double> & norm, 00081 std::string theMEType) ; 00082 void getNormalization2D( MonitorElement * mE, 00083 std::pair<double,double> & normX, 00084 std::pair<double,double> & normY, 00085 std::string theMEType) ; 00086 void sendTkUpdatedStatus( DQMStore * bei, 00087 xgi::Output * out, 00088 std::string & meName, 00089 std::string & theTKType) ; 00090 void selectMEList( DQMStore * bei, 00091 std::string & name, 00092 std::vector<MonitorElement*> & mes); 00093 void getMEList( DQMStore * bei, 00094 std::map<std::string, int> & mEHash); 00095 int getDetId( MonitorElement * mE) ; 00096 void getIMGCImage( const std::multimap<std::string, std::string>& req_map, 00097 xgi::Output * out); 00098 void getIMGCImage( std::multimap<std::string, std::string>& req_map, 00099 xgi::Output * out); 00100 std::string getMEType( MonitorElement * mE) ; 00101 00102 void readConfiguration(); 00103 bool readConfiguration( std::map<std::string,std::vector< std::string> > & layoutMap, 00104 std::map<std::string,std::map<std::string,std::string> > & qtestsMap, 00105 std::map<std::string,std::vector<std::string> > & meQTestsMap); 00106 00107 void bookNoisyPixels( DQMStore * bei, 00108 float noiseRate, 00109 bool Tier0Flag); 00110 00111 void findNoisyPixels ( DQMStore * bei, 00112 bool init, 00113 float noiseRate, 00114 int noiseRateDenominator, 00115 edm::EventSetup const & eSetup); 00116 00117 void createImages (DQMStore * bei); 00118 00119 private: 00120 00121 void fillModuleAndHistoList( DQMStore * bei, 00122 std::vector<std::string> & modules, 00123 std::map<std::string,std::string> & histos); 00124 void getItemList( const std::multimap<std::string, std::string> & req_map, 00125 std::string item_name, 00126 std::vector<std::string> & items); 00127 void printModuleHistoList( DQMStore * bei, 00128 std::ostringstream & str_val); 00129 void printSummaryHistoList( DQMStore * bei, 00130 std::ostringstream & str_val); 00131 void printAlarmList( DQMStore * bei, 00132 std::ostringstream & str_val); 00133 bool goToDir( DQMStore * bei, 00134 std::string & sname); 00135 bool hasItem( std::multimap<std::string, std::string> & req_map, 00136 std::string item_name); 00137 std::string getItemValue( const std::multimap<std::string, std::string> & req_map, 00138 std::string item_name); 00139 std::string getItemValue( std::multimap<std::string, std::string> & req_map, 00140 std::string item_name); 00141 void createDummiesFromLayout(); 00142 void selectImage( std::string & name, 00143 int status); 00144 void selectImage( std::string & name, 00145 std::vector<QReport*> & reports); 00146 void selectColor( std::string & col, 00147 int status); 00148 void selectColor( std::string & col, 00149 std::vector<QReport*> & reports); 00150 00151 void setHTMLHeader( xgi::Output * out); 00152 void setXMLHeader( xgi::Output * out); 00153 void setPlainHeader( xgi::Output * out); 00154 00155 int alarmCounter_; 00156 00157 SiPixelConfigParser * configParser_ ; 00158 SiPixelConfigWriter * configWriter_ ; 00159 SiPixelActionExecutor * actionExecutor_; 00160 SiPixelLayoutParser * layoutParser_ ; 00161 00162 std::map<std::string, 00163 std::vector< std::string> > layoutMap; 00164 std::map<std::string, 00165 std::map<std::string, 00166 std::string> > qtestsMap; 00167 std::map<std::string, 00168 std::vector<std::string> > meQTestsMap; 00169 00170 00171 bool readReference_; 00172 bool readQTestMap_; 00173 bool readMeMap_; 00174 bool flagHotModule_; 00175 bool offlineXMLfile_; 00176 00177 int count; 00178 int errcount; 00179 bool gotDigis; 00180 00181 ofstream myfile_; 00182 int nevents_; 00183 std::map< uint32_t , std::vector< std::pair< std::pair<int,int> , float > > > noisyDetIds_; 00184 bool endOfModules_; 00185 edm::ESHandle<SiPixelFedCablingMap> theCablingMap; 00186 MonitorElement * EventRateBarrelPixels; 00187 MonitorElement * EventRateEndcapPixels; 00188 00189 MonitorElement * EndcapNdigisFREQProjection; 00190 MonitorElement * BarrelNdigisFREQProjection; 00191 00192 00193 SiPixelHistoPlotter* histoPlotter_; 00194 }; 00195 #endif