Go to the documentation of this file.00001 #ifndef SiStripMonitorSummary_SiStripBaseCondObjDQM_h
00002 #define SiStripMonitorSummary_SiStripBaseCondObjDQM_h
00003
00004 #include "FWCore/Framework/interface/EventSetup.h"
00005 #include "FWCore/Framework/interface/ESHandle.h"
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007 #include "FWCore/ServiceRegistry/interface/Service.h"
00008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00009
00010
00011
00012 #include "DataFormats/DetId/interface/DetId.h"
00013 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00014 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00015 #include "DataFormats/SiStripDetId/interface/TIDDetId.h"
00016 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00017
00018 #include "DataFormats/SiStripDetId/interface/SiStripDetId.h"
00019 #include "DataFormats/SiStripDetId/interface/SiStripSubStructure.h"
00020
00021 #include "DQM/SiStripCommon/interface/SiStripFolderOrganizer.h"
00022 #include "DQM/SiStripCommon/interface/SiStripHistoId.h"
00023
00024 #include "DQMServices/Core/interface/DQMStore.h"
00025 #include "DQMServices/Core/interface/MonitorElement.h"
00026
00027 #include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h"
00028
00029 #include "CalibTracker/Records/interface/SiStripDetCablingRcd.h"
00030 #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h"
00031
00032 #include "DQM/SiStripCommon/interface/TkHistoMap.h"
00033 #include "CommonTools/TrackerMap/interface/TrackerMap.h"
00034
00035 #include <vector>
00036 #include <map>
00037 #include <string>
00038 #include <sstream>
00039
00040
00041 class SiStripBaseCondObjDQM {
00042
00043
00044
00045 public:
00046
00047
00048
00049 SiStripBaseCondObjDQM(const edm::EventSetup & eSetup,
00050 edm::ParameterSet const& hPSet,
00051 edm::ParameterSet const& fPSet );
00052
00053 virtual ~SiStripBaseCondObjDQM(){};
00054
00055 virtual void getActiveDetIds(const edm::EventSetup & eSetup)=0;
00056
00057 void analysis(const edm::EventSetup & eSetup_);
00058 void analysisOnDemand(const edm::EventSetup & eSetup_, uint32_t detIdOnDemand);
00059 void analysisOnDemand(const edm::EventSetup & eSetup_, std::vector<uint32_t> detIdsOnDemand);
00060 void analysisOnDemand(const edm::EventSetup & eSetup_,
00061 std::string requestedSubDetector,
00062 uint32_t requestedSide,
00063 uint32_t requestedLayer);
00064
00065
00066 std::vector<uint32_t> getCabledModules();
00067 void selectModules(std::vector<uint32_t> & detIds_);
00068
00069
00070
00071 virtual unsigned long long getCache(const edm::EventSetup & eSetup_)=0;
00072 virtual void getConditionObject(const edm::EventSetup & eSetup_)=0;
00073
00074 virtual void end();
00075
00076 protected:
00077
00078 struct ModMEs{
00079 ModMEs():ProfileDistr(0),
00080 CumulDistr(0),
00081 SummaryOfProfileDistr(0),
00082 SummaryOfCumulDistr(0),
00083 SummaryDistr(0){;}
00084 MonitorElement* ProfileDistr;
00085 MonitorElement* CumulDistr;
00086 MonitorElement* SummaryOfProfileDistr;
00087 MonitorElement* SummaryOfCumulDistr;
00088 MonitorElement* SummaryDistr;
00089 };
00090
00091
00092 void getModMEs(ModMEs& CondObj_ME, const uint32_t& detId_);
00093 void getSummaryMEs(ModMEs& CondObj_ME, const uint32_t& detId_);
00094 std::pair<std::string,uint32_t> getLayerNameAndId(const uint32_t& detId_);
00095 std::pair<std::string,uint32_t> getStringNameAndId(const uint32_t& detId_);
00096 std::vector<uint32_t> GetSameLayerDetId(std::vector<uint32_t> activeDetIds, uint32_t selDetId);
00097
00098
00099 virtual void fillModMEs(const std::vector<uint32_t> & selectedDetIds);
00100 virtual void fillSummaryMEs(const std::vector<uint32_t> & selectedDetIds);
00101 virtual void fillMEsForDet(ModMEs selModME_,uint32_t selDetId_)=0;
00102 virtual void fillMEsForLayer( uint32_t selDetId_)=0;
00103
00104
00105 void fillTkMap(const uint32_t& detid, const float& value);
00106
00107 SiStripDetInfoFileReader* reader;
00108
00109 const edm::EventSetup& eSetup_;
00110 edm::ParameterSet hPSet_;
00111 edm::ParameterSet fPSet_;
00112
00113 bool Mod_On_;
00114 bool HistoMaps_On_;
00115 bool SummaryOnLayerLevel_On_;
00116 bool SummaryOnStringLevel_On_;
00117 bool GrandSummary_On_;
00118 double minValue, maxValue;
00119 std::vector<int> tkMapScaler;
00120
00121
00122
00123 std::string CondObj_fillId_;
00124 std::string CondObj_name_;
00125
00126 std::map<uint32_t, ModMEs> ModMEsMap_;
00127 std::map<uint32_t, ModMEs> SummaryMEsMap_;
00128 std::vector<uint32_t> activeDetIds;
00129 std::vector<uint32_t> all_DetIds;
00130
00131 unsigned long long cacheID_memory;
00132 unsigned long long cacheID_current;
00133
00134 TkHistoMap* Tk_HM_;
00135 TkHistoMap* Tk_HM_H;
00136 TkHistoMap* Tk_HM_L;
00137 TrackerMap * tkMap;
00138
00139 private:
00140
00141 void bookProfileMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00142 void bookCumulMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00143 void bookSummaryProfileMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00144 void bookSummaryCumulMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00145 void bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00146 void bookTkMap(const std::string& TkMapname);
00147
00148 void saveTkMap(const std::string& TkMapname, double minValue, double maxValue);
00149
00150 std::vector<uint32_t> ModulesToBeExcluded_;
00151 std::vector<uint32_t> ModulesToBeIncluded_;
00152 std::vector<std::string> SubDetectorsToBeExcluded_;
00153
00154 edm::ESHandle<SiStripDetCabling> detCablingHandle_;
00155
00156 std::string condDataMonitoringMode_;
00157
00158 SiStripHistoId hidmanager;
00159 SiStripFolderOrganizer folder_organizer;
00160 DQMStore* dqmStore_;
00161
00162 };
00163
00164
00165 #endif