Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef _SiPixelActionExecutor_h_
0002 #define _SiPixelActionExecutor_h_
0003 
0004 #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h"
0005 #include "CondFormats/SiPixelObjects/interface/DetectorIndex.h"
0006 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"
0007 #include "CondFormats/SiPixelObjects/interface/SiPixelFrameConverter.h"
0008 #include "DQM/SiPixelMonitorClient/interface/SiPixelConfigParser.h"
0009 #include "DQM/SiPixelMonitorClient/interface/SiPixelConfigWriter.h"
0010 #include "DQMServices/Core/interface/DQMStore.h"
0011 #include <fstream>
0012 #include <map>
0013 #include <string>
0014 #include <vector>
0015 
0016 // For Tracker Map
0017 enum funcType { EachBinContent, Entries, Mean, Sum, WeightedSum };
0018 #define PI_12 0.261799
0019 #define PI 3.141592
0020 #define PI_2 1.570796
0021 
0022 // Number of HalfCylinders in Endcap or number of Shells in Barrel, which is bigger
0023 #define NLev1 4
0024 // Number of Disks in Endcap or number of Layers in Barrel, which is bigger
0025 #define NLev2 3
0026 // Number of Blades in Endcap or number of Ladders in Barrel, which is bigger
0027 #define NLev3 22
0028 // Number of Modules - different for Endcap and Barrel, which is bigger
0029 #define NLev4 7
0030 
0031 #define NCyl 4
0032 #define NDisk 2
0033 #define NBlade 12
0034 #define NModuleE 7
0035 
0036 #define NShell 4
0037 #define NLayer 3
0038 #define NModuleB 4
0039 
0040 #define NPoints 5
0041 
0042 // End for Tracker Map
0043 
0044 class SiPixelActionExecutor {
0045 public:
0046   typedef dqm::legacy::DQMStore DQMStore;
0047   typedef dqm::legacy::MonitorElement MonitorElement;
0048 
0049   SiPixelActionExecutor(bool offlineXMLfile, bool Tier0Flag);
0050   ~SiPixelActionExecutor();
0051 
0052   void createSummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade);
0053   void bookDeviations(DQMStore::IBooker &iBooker, bool isUpgrade);
0054   void bookEfficiency(DQMStore::IBooker &iBooker, bool isUpgrade);
0055   void createEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isUpgrade);
0056   void fillEfficiency(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isbarrel, bool isUpgrade);
0057   void fillEfficiencySummary(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter);
0058   void bookOccupancyPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool hiRes, bool isbarrel);
0059   void bookOccupancyPlots(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool hiRes);
0060   void createOccupancy(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter);
0061   void normaliseAvDigiOcc(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter);
0062   void normaliseAvDigiOccVsLumi(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, int lumisec);
0063   bool readConfiguration(int &tkmap_freq,
0064                          int &sum_barrel_freq,
0065                          int &sum_endcap_freq,
0066                          int &sum_grandbarrel_freq,
0067                          int &sum_grandendcap_freq,
0068                          int &message_limit,
0069                          int &source_type,
0070                          int &calib_type);
0071   bool readConfiguration(int &tkmap_freq, int &summary_freq);
0072   void readConfiguration();
0073   int getLadder(const std::string &dname);
0074   int getBlade(const std::string &dname);
0075 
0076 private:
0077   MonitorElement *getSummaryME(DQMStore::IBooker &iBooker,
0078                                DQMStore::IGetter &iGetter,
0079                                std::string me_name,
0080                                bool isUpgrade);
0081   MonitorElement *getFEDSummaryME(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, std::string me_name);
0082   void GetBladeSubdirs(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, std::vector<std::string> &blade_subdirs);
0083   void fillSummary(DQMStore::IBooker &iBooker,
0084                    DQMStore::IGetter &iGetter,
0085                    std::string dir_name,
0086                    std::vector<std::string> &me_names,
0087                    bool isbarrel,
0088                    bool isUpgrade);
0089   void fillFEDErrorSummary(DQMStore::IBooker &iBooker,
0090                            DQMStore::IGetter &iGetter,
0091                            std::string dir_name,
0092                            std::vector<std::string> &me_names);
0093   void fillGrandBarrelSummaryHistos(DQMStore::IBooker &iBooker,
0094                                     DQMStore::IGetter &iGetter,
0095                                     std::vector<std::string> &me_names,
0096                                     bool isUpgrade);
0097   void fillGrandEndcapSummaryHistos(DQMStore::IBooker &iBooker,
0098                                     DQMStore::IGetter &iGetter,
0099                                     std::vector<std::string> &me_names,
0100                                     bool isUpgrade);
0101   void getGrandSummaryME(DQMStore::IBooker &iBooker,
0102                          DQMStore::IGetter &iGetter,
0103                          int nbin,
0104                          std::string &me_name,
0105                          std::vector<MonitorElement *> &mes);
0106 
0107   void fillOccupancy(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, bool isbarrel);
0108 
0109   SiPixelConfigParser *configParser_;
0110   SiPixelConfigWriter *configWriter_;
0111 
0112   std::vector<std::string> summaryMENames;
0113   std::vector<std::string> tkMapMENames;
0114 
0115   int message_limit_;
0116   int source_type_;
0117   int calib_type_;
0118   int ndet_;
0119   bool offlineXMLfile_;
0120   bool Tier0Flag_;
0121 
0122   MonitorElement *OccupancyMap;
0123   MonitorElement *PixelOccupancyMap;
0124   MonitorElement *HitEfficiency_L1;
0125   MonitorElement *HitEfficiency_L2;
0126   MonitorElement *HitEfficiency_L3;
0127   MonitorElement *HitEfficiency_L4;
0128   MonitorElement *HitEfficiency_Dp1;
0129   MonitorElement *HitEfficiency_Dp2;
0130   MonitorElement *HitEfficiency_Dp3;
0131   MonitorElement *HitEfficiency_Dm1;
0132   MonitorElement *HitEfficiency_Dm2;
0133   MonitorElement *HitEfficiency_Dm3;
0134   MonitorElement *HitEfficiencySummary;
0135   MonitorElement *DEV_adc_Barrel;
0136   MonitorElement *DEV_ndigis_Barrel;
0137   MonitorElement *DEV_charge_Barrel;
0138   MonitorElement *DEV_nclusters_Barrel;
0139   MonitorElement *DEV_size_Barrel;
0140   MonitorElement *DEV_adc_Endcap;
0141   MonitorElement *DEV_ndigis_Endcap;
0142   MonitorElement *DEV_charge_Endcap;
0143   MonitorElement *DEV_nclusters_Endcap;
0144   MonitorElement *DEV_size_Endcap;
0145 
0146   TH2F *temp_H;
0147   TH2F *temp_1x2;
0148   TH2F *temp_1x5;
0149   TH2F *temp_2x3;
0150   TH2F *temp_2x4;
0151   TH2F *temp_2x5;
0152 };
0153 #endif