Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:17

0001 #ifndef _SiPixelInformationExtractor_h_
0002 #define _SiPixelInformationExtractor_h_
0003 
0004 #include "DQMServices/Core/interface/DQMStore.h"
0005 
0006 #include "DQM/SiPixelMonitorClient/interface/SiPixelActionExecutor.h"
0007 #include "DQM/SiPixelMonitorClient/interface/SiPixelConfigParser.h"
0008 #include "DQM/SiPixelMonitorClient/interface/SiPixelConfigWriter.h"
0009 #include "DQM/SiPixelMonitorClient/interface/SiPixelLayoutParser.h"
0010 
0011 #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h"
0012 #include "CondFormats/SiPixelObjects/interface/DetectorIndex.h"
0013 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"
0014 #include "CondFormats/SiPixelObjects/interface/SiPixelFrameConverter.h"
0015 #include "DataFormats/Common/interface/DetSetVector.h"
0016 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
0017 
0018 #include "TCanvas.h"
0019 #include "TF1.h"
0020 #include "TGaxis.h"
0021 #include "TH2F.h"
0022 #include "TPaveText.h"
0023 
0024 #include <fstream>
0025 #include <map>
0026 #include <sstream>
0027 #include <string>
0028 #include <vector>
0029 #include <cstdint>
0030 
0031 class SiPixelEDAClient;
0032 class SiPixelWebInterface;
0033 class SiPixelInformationExtractor {
0034 public:
0035   typedef dqm::legacy::MonitorElement MonitorElement;
0036   typedef dqm::legacy::DQMStore DQMStore;
0037 
0038   SiPixelInformationExtractor(bool offlineXMLfile);
0039   ~SiPixelInformationExtractor();
0040 
0041   void computeStatus(MonitorElement *mE, double &colorValue, std::pair<double, double> &norm);
0042   void getNormalization(MonitorElement *mE, std::pair<double, double> &norm, std::string theMEType);
0043   void getNormalization2D(MonitorElement *mE,
0044                           std::pair<double, double> &normX,
0045                           std::pair<double, double> &normY,
0046                           std::string theMEType);
0047   int getDetId(MonitorElement *mE);
0048   std::string getMEType(MonitorElement *mE);
0049 
0050   void readConfiguration();
0051   bool readConfiguration(std::map<std::string, std::vector<std::string>> &layoutMap,
0052                          std::map<std::string, std::map<std::string, std::string>> &qtestsMap,
0053                          std::map<std::string, std::vector<std::string>> &meQTestsMap);
0054 
0055   void bookNoisyPixels(DQMStore::IBooker &iBooker, float noiseRate, bool Tier0Flag);
0056 
0057   void findNoisyPixels(DQMStore::IBooker &iBooker,
0058                        DQMStore::IGetter &iGetter,
0059                        bool init,
0060                        float noiseRate,
0061                        int noiseRateDenominator,
0062                        const SiPixelFedCablingMap *theCablingMap);
0063 
0064 private:
0065   void getItemList(const std::multimap<std::string, std::string> &req_map,
0066                    std::string item_name,
0067                    std::vector<std::string> &items);
0068   bool hasItem(std::multimap<std::string, std::string> &req_map, std::string item_name);
0069   std::string getItemValue(const std::multimap<std::string, std::string> &req_map, std::string item_name);
0070   std::string getItemValue(std::multimap<std::string, std::string> &req_map, std::string item_name);
0071   void createDummiesFromLayout();
0072   void selectImage(std::string &name, int status);
0073   void selectImage(std::string &name, std::vector<QReport *> &reports);
0074   void selectColor(std::string &col, int status);
0075   void selectColor(std::string &col, std::vector<QReport *> &reports);
0076 
0077   int alarmCounter_;
0078 
0079   SiPixelConfigParser *configParser_;
0080   SiPixelConfigWriter *configWriter_;
0081   SiPixelActionExecutor *actionExecutor_;
0082   SiPixelLayoutParser *layoutParser_;
0083 
0084   std::map<std::string, std::vector<std::string>> layoutMap;
0085   std::map<std::string, std::map<std::string, std::string>> qtestsMap;
0086   std::map<std::string, std::vector<std::string>> meQTestsMap;
0087 
0088   bool readReference_;
0089   bool readQTestMap_;
0090   bool readMeMap_;
0091   bool flagHotModule_;
0092   bool offlineXMLfile_;
0093 
0094   int count;
0095   int errcount;
0096   bool gotDigis;
0097 
0098   std::ofstream myfile_;
0099   int nevents_;
0100   std::map<uint32_t, std::vector<std::pair<std::pair<int, int>, float>>> noisyDetIds_;
0101   bool endOfModules_;
0102 
0103   MonitorElement *EventRateBarrelPixels;
0104   MonitorElement *EventRateEndcapPixels;
0105 
0106   MonitorElement *EndcapNdigisFREQProjection;
0107   MonitorElement *BarrelNdigisFREQProjection;
0108 };
0109 #endif