Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:11

0001 #ifndef _SiPixelDataQuality_h_
0002 #define _SiPixelDataQuality_h_
0003 
0004 #include "DQM/SiPixelMonitorClient/interface/SiPixelActionExecutor.h"
0005 #include "DQM/SiPixelMonitorClient/interface/SiPixelConfigParser.h"
0006 #include "DQM/SiPixelMonitorClient/interface/SiPixelConfigWriter.h"
0007 #include "DQM/SiPixelMonitorClient/interface/SiPixelLayoutParser.h"
0008 #include "DQMServices/Core/interface/DQMStore.h"
0009 
0010 #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h"
0011 #include "CondFormats/SiPixelObjects/interface/DetectorIndex.h"
0012 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"
0013 #include "CondFormats/SiPixelObjects/interface/SiPixelFrameConverter.h"
0014 #include "DataFormats/Common/interface/DetSetVector.h"
0015 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
0016 
0017 #include "TCanvas.h"
0018 #include "TF1.h"
0019 #include "TGaxis.h"
0020 #include "TH2F.h"
0021 #include "TPaveText.h"
0022 
0023 #include <fstream>
0024 #include <map>
0025 #include <sstream>
0026 #include <string>
0027 #include <vector>
0028 
0029 class SiPixelEDAClient;
0030 class SiPixelDataQuality {
0031 public:
0032   typedef dqm::legacy::MonitorElement MonitorElement;
0033   typedef dqm::legacy::DQMStore DQMStore;
0034 
0035   SiPixelDataQuality(bool offlineXMLfile);
0036   ~SiPixelDataQuality();
0037 
0038   int getDetId(MonitorElement *mE);
0039 
0040   void bookGlobalQualityFlag(DQMStore::IBooker &iBooker, bool Tier0Flag, int nFEDs);
0041 
0042   void computeGlobalQualityFlag(
0043       DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool init, int nFEDs, bool Tier0Flag);
0044 
0045   void computeGlobalQualityFlagByLumi(DQMStore::IGetter &iGetter,
0046                                       bool init,
0047                                       int nFEDs,
0048                                       bool Tier0Flag,
0049                                       int nEvents_lastLS_,
0050                                       int nErrorsBarrel_lastLS_,
0051                                       int nErrorsEndcap_lastLS_);
0052 
0053   void fillGlobalQualityPlot(DQMStore::IBooker &iBooker,
0054                              DQMStore::IGetter &iGetter,
0055                              bool init,
0056                              const SiPixelFedCablingMap *theCablingMap,
0057                              int nFEDs,
0058                              bool Tier0Flag,
0059                              int lumisec);
0060 
0061 private:
0062   bool offlineXMLfile_;
0063 
0064   TH2F *allmodsMap;
0065   TH2F *errmodsMap;
0066   TH2F *goodmodsMap;
0067   TH1D *allmodsVec;
0068   TH1D *errmodsVec;
0069   TH1D *goodmodsVec;
0070   int count;
0071   int errcount;
0072   bool gotDigis;
0073 
0074   int objectCount_;
0075   bool DONE_;
0076 
0077   std::ofstream myfile_;
0078   int nevents_;
0079   bool endOfModules_;
0080 
0081   // Final combined Data Quality Flags:
0082   MonitorElement *SummaryReportMap;
0083   MonitorElement *SummaryPixel;
0084   MonitorElement *SummaryBarrel;
0085   MonitorElement *SummaryEndcap;
0086   MonitorElement *ClusterModAll;
0087   MonitorElement *ClusterMod1;
0088   MonitorElement *ClusterMod2;
0089   MonitorElement *ClusterMod3;
0090   MonitorElement *ClusterMod4;
0091 
0092   float qflag_;
0093   int allMods_, errorMods_, barrelMods_, endcapMods_;
0094 
0095   // FEDErrors Cuts:
0096   MonitorElement *FEDErrReportMap;
0097   MonitorElement *NErrorsBarrel;
0098   MonitorElement *NErrorsEndcap;
0099   MonitorElement *NErrorsFEDs;
0100   int n_errors_barrel_, n_errors_endcap_, n_errors_pixel_;
0101   float barrel_error_flag_, endcap_error_flag_, pixel_error_flag_;
0102 
0103   bool digiStatsBarrel, clusterStatsBarrel, trackStatsBarrel;
0104   int digiCounterBarrel, clusterCounterBarrel, trackCounterBarrel;
0105   bool digiStatsEndcap, clusterStatsEndcap, trackStatsEndcap;
0106   int digiCounterEndcap, clusterCounterEndcap, trackCounterEndcap;
0107 
0108   // Digis Cuts:
0109   MonitorElement *NDigisBarrel;
0110   MonitorElement *NDigisEndcap;
0111   MonitorElement *DigiChargeBarrel;
0112   MonitorElement *DigiChargeEndcap;
0113 
0114   // Cluster Cuts:
0115   MonitorElement *ClusterSizeBarrel;
0116   MonitorElement *ClusterSizeEndcap;
0117   MonitorElement *ClusterChargeBarrel;
0118   MonitorElement *ClusterChargeEndcap;
0119   MonitorElement *NClustersBarrel;
0120   MonitorElement *NClustersEndcap;
0121 
0122   // Track Cuts:
0123   MonitorElement *NPixelTracks;
0124 
0125   int count1;
0126   int count2;
0127   int count3;
0128   int count4;
0129   int count5;
0130   int count6;
0131 
0132   int timeoutCounter_;
0133   int modCounter_;
0134   int lastLS_;
0135   float lasterrmods_[40];
0136   float lastallmods_[40];
0137 };
0138 #endif