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 MonitorElement* ProfileDistr;
00080 MonitorElement* CumulDistr;
00081 MonitorElement* SummaryOfProfileDistr;
00082 MonitorElement* SummaryOfCumulDistr;
00083 MonitorElement* SummaryDistr;
00084 };
00085
00086
00087 void getModMEs(ModMEs& CondObj_ME, const uint32_t& detId_);
00088 void getSummaryMEs(ModMEs& CondObj_ME, const uint32_t& detId_);
00089 std::pair<std::string,uint32_t> getLayerNameAndId(const uint32_t& detId_);
00090 std::pair<std::string,uint32_t> getStringNameAndId(const uint32_t& detId_);
00091 std::vector<uint32_t> GetSameLayerDetId(std::vector<uint32_t> activeDetIds, uint32_t selDetId);
00092
00093
00094 virtual void fillModMEs(const std::vector<uint32_t> & selectedDetIds);
00095 virtual void fillSummaryMEs(const std::vector<uint32_t> & selectedDetIds);
00096 virtual void fillMEsForDet(ModMEs selModME_,uint32_t selDetId_)=0;
00097 virtual void fillMEsForLayer( std::map<uint32_t, ModMEs> selModMEsMap_, uint32_t selDetId_)=0;
00098
00099
00100 void fillTkMap(const uint32_t& detid, const float& value);
00101
00102 SiStripDetInfoFileReader* reader;
00103
00104 const edm::EventSetup& eSetup_;
00105 edm::ParameterSet hPSet_;
00106 edm::ParameterSet fPSet_;
00107
00108 bool Mod_On_;
00109 bool HistoMaps_On_;
00110 bool SummaryOnLayerLevel_On_;
00111 bool SummaryOnStringLevel_On_;
00112 bool GrandSummary_On_;
00113 double minValue, maxValue;
00114 std::vector<int> tkMapScaler;
00115
00116
00117
00118 std::string CondObj_fillId_;
00119 std::string CondObj_name_;
00120
00121 std::map<uint32_t, ModMEs> ModMEsMap_;
00122 std::map<uint32_t, ModMEs> SummaryMEsMap_;
00123 std::vector<uint32_t> activeDetIds;
00124 std::vector<uint32_t> all_DetIds;
00125
00126 unsigned long long cacheID_memory;
00127 unsigned long long cacheID_current;
00128
00129 TkHistoMap* Tk_HM_;
00130 TkHistoMap* Tk_HM_H;
00131 TkHistoMap* Tk_HM_L;
00132 TrackerMap * tkMap;
00133
00134 private:
00135
00136 void bookProfileMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00137 void bookCumulMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00138 void bookSummaryProfileMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00139 void bookSummaryCumulMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00140 void bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs& CondObj_ME, const uint32_t& detId_);
00141 void bookTkMap(const std::string& TkMapname);
00142
00143 void saveTkMap(const std::string& TkMapname, double minValue, double maxValue);
00144
00145 std::vector<uint32_t> ModulesToBeExcluded_;
00146 std::vector<uint32_t> ModulesToBeIncluded_;
00147 std::vector<std::string> SubDetectorsToBeExcluded_;
00148
00149 edm::ESHandle<SiStripDetCabling> detCablingHandle_;
00150
00151 std::string condDataMonitoringMode_;
00152
00153 SiStripHistoId hidmanager;
00154 SiStripFolderOrganizer folder_organizer;
00155 DQMStore* dqmStore_;
00156
00157 };
00158
00159
00160 #endif