Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef _SiStripQualityChecker_h_
0002 #define _SiStripQualityChecker_h_
0003 
0004 #include "DQMServices/Core/interface/DQMStore.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 
0007 #include <iostream>
0008 #include <fstream>
0009 #include <sstream>
0010 #include <map>
0011 #include <vector>
0012 #include <string>
0013 
0014 class TkDetMap;
0015 class TrackerTopology;
0016 class SiStripDetCabling;
0017 
0018 class SiStripQualityChecker {
0019 public:
0020   typedef dqm::harvesting::MonitorElement MonitorElement;
0021   typedef dqm::harvesting::DQMStore DQMStore;
0022 
0023   SiStripQualityChecker(edm::ParameterSet const& ps);
0024   ~SiStripQualityChecker();
0025 
0026   void bookStatus(DQMStore& dqm_store);
0027   void resetStatus();
0028   void fillDummyStatus();
0029   void fillStatus(DQMStore& dqm_store,
0030                   const SiStripDetCabling* cabling,
0031                   const TkDetMap* tkDetMap,
0032                   const TrackerTopology* tTopo);
0033   void fillStatusAtLumi(DQMStore& dqm_store);
0034   void printStatusReport();
0035   void fillFaultyModuleStatus(DQMStore& dqm_store, const TrackerTopology* tTopo);
0036 
0037 private:
0038   struct SubDetMEs {
0039     MonitorElement* DetFraction;
0040     MonitorElement* SToNFlag;
0041     MonitorElement* SummaryFlag;
0042     std::string detectorTag;
0043   };
0044 
0045   void fillDetectorStatus(DQMStore& dqm_store, const SiStripDetCabling* cabling);
0046   void fillSubDetStatus(
0047       DQMStore& dqm_store, const SiStripDetCabling* cabling, SubDetMEs& mes, unsigned int xbin, float& gflag);
0048   void getModuleStatus(DQMStore& dqm_store,
0049                        std::vector<MonitorElement*>& layer_mes,
0050                        int& errdet,
0051                        int& errdet_hasBadChan,
0052                        int& errdet_hasTooManyDigis,
0053                        int& errdet_hasTooManyClu,
0054                        int& errdet_hasExclFed,
0055                        int& errdet_hasDcsErr);
0056 
0057   void fillStatusHistogram(MonitorElement const*, int xbin, int ybin, float val);
0058   void initialiseBadModuleList();
0059 
0060   void fillDetectorStatusAtLumi(DQMStore& dqm_store);
0061 
0062   std::map<std::string, SubDetMEs> SubDetMEsMap;
0063   std::map<std::string, std::string> SubDetFolderMap;
0064 
0065   MonitorElement* DetFractionReportMap{nullptr};
0066   MonitorElement* DetFractionReportMap_hasBadChan{nullptr};
0067   MonitorElement* DetFractionReportMap_hasTooManyDigis{nullptr};
0068   MonitorElement* DetFractionReportMap_hasTooManyClu{nullptr};
0069   MonitorElement* DetFractionReportMap_hasExclFed{nullptr};
0070   MonitorElement* DetFractionReportMap_hasDcsErr{nullptr};
0071   MonitorElement* SToNReportMap{nullptr};
0072   MonitorElement* SummaryReportMap{nullptr};
0073   MonitorElement* SummaryReportGlobal{nullptr};
0074   MonitorElement* TrackSummaryReportMap{nullptr};
0075   MonitorElement* TrackSummaryReportGlobal{nullptr};
0076 
0077   std::map<uint32_t, uint16_t> badModuleList;
0078 
0079   edm::ParameterSet const pSet_;
0080 
0081   bool bookedStripStatus_{false};
0082 
0083   const TkDetMap* tkDetMap_;
0084 };
0085 #endif