CMS 3D CMS Logo

SiStripBaseCondObjDQM.h
Go to the documentation of this file.
1 #ifndef SiStripMonitorSummary_SiStripBaseCondObjDQM_h
2 #define SiStripMonitorSummary_SiStripBaseCondObjDQM_h
3 
9 
13 
16 
18 
20 
23 
25 
26 #include <map>
27 #include <sstream>
28 #include <string>
29 #include <vector>
30 
31 class TrackerTopology;
33 public:
36 
38  edm::ParameterSet const &hPSet,
39  edm::ParameterSet const &fPSet,
40  const TrackerTopology *tTopo);
41 
43 
44  virtual void getActiveDetIds(const edm::EventSetup &eSetup) = 0;
45 
46  void analysis(const edm::EventSetup &eSetup_);
47  void analysisOnDemand(const edm::EventSetup &eSetup_, uint32_t detIdOnDemand);
48  void analysisOnDemand(const edm::EventSetup &eSetup_, const std::vector<uint32_t> &detIdsOnDemand);
49  void analysisOnDemand(const edm::EventSetup &eSetup_,
50  std::string requestedSubDetector,
51  uint32_t requestedSide,
52  uint32_t requestedLayer);
53 
54  void selectModules(std::vector<uint32_t> &detIds_);
55 
56  // virtual void fillTopSummaryMEs()=0;
57 
58  virtual void getConditionObject(const edm::EventSetup &eSetup_) = 0;
59  virtual bool checkChanged(const edm::EventSetup &eSetup) = 0;
60 
61  virtual void end();
62 
63 protected:
64  struct ModMEs {
66  : ProfileDistr(nullptr),
67  CumulDistr(nullptr),
68  SummaryOfProfileDistr(nullptr),
69  SummaryOfCumulDistr(nullptr),
70  SummaryDistr(nullptr) {
71  ;
72  }
78  };
79 
80  void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_);
81  void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_);
82  std::pair<std::string, uint32_t> getLayerNameAndId(const uint32_t &detId_);
83  std::pair<std::string, uint32_t> getStringNameAndId(const uint32_t &detId_);
84  std::vector<uint32_t> GetSameLayerDetId(const std::vector<uint32_t> &activeDetIds, uint32_t selDetId);
85 
86  virtual void fillModMEs(const std::vector<uint32_t> &selectedDetIds);
87  virtual void fillSummaryMEs(const std::vector<uint32_t> &selectedDetIds);
88  virtual void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_) = 0;
89  virtual void fillMEsForLayer(
90  /*std::map<uint32_t, ModMEs> selModMEsMap_, */ uint32_t selDetId_) = 0;
91 
92  void fillTkMap(const uint32_t &detid, const float &value);
93 
95 
98 
99  bool Mod_On_;
105  std::vector<int> tkMapScaler;
106 
107  // bool ActiveDetIds_On_;
108 
111 
112  std::map<uint32_t, ModMEs> ModMEsMap_;
113  std::map<uint32_t, ModMEs> SummaryMEsMap_;
114  std::vector<uint32_t> activeDetIds;
115  std::vector<uint32_t> all_DetIds;
116 
117  std::unique_ptr<TkHistoMap> Tk_HM_;
118  std::unique_ptr<TkHistoMap> Tk_HM_H;
119  std::unique_ptr<TkHistoMap> Tk_HM_L;
121 
123 
124 private:
125  void bookProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_);
126  void bookCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_);
127  void bookSummaryProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_);
128  void bookSummaryCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_);
129  void bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_);
130 
131  void bookTkMap(const std::string &TkMapname);
132 
133  void saveTkMap(const std::string &TkMapname, double minValue, double maxValue);
134 
135  std::vector<uint32_t> ModulesToBeExcluded_;
136  std::vector<uint32_t> ModulesToBeIncluded_;
137  std::vector<std::string> SubDetectorsToBeExcluded_;
138 
140 
145 };
146 
147 template <typename CondObj, typename Record>
149 public:
152  edm::RunNumber_t iRun,
153  edm::ParameterSet const &hPSet,
154  edm::ParameterSet const &fPSet,
155  const TrackerTopology *tTopo)
156  : SiStripBaseCondObjDQM{iRun, hPSet, fPSet, tTopo}, token_{token} {}
158 
159  void getConditionObject(const edm::EventSetup &eSetup) override { condObj_ = &eSetup.getData(token_); }
160  bool checkChanged(const edm::EventSetup &eSetup) override { return watcher_.check(eSetup); }
161 
162 protected:
163  const CondObj *condObj_;
164 
165 private:
168 };
169 
170 #endif
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
std::map< uint32_t, ModMEs > ModMEsMap_
std::unique_ptr< TkHistoMap > Tk_HM_L
typename edm::ESGetToken< SiStripBackPlaneCorrection, SiStripBackPlaneCorrectionRcd > tokentype
std::vector< uint32_t > ModulesToBeExcluded_
edm::ESWatcher< Record > watcher_
void selectModules(std::vector< uint32_t > &detIds_)
const TrackerTopology * tTopo_
virtual void fillSummaryMEs(const std::vector< uint32_t > &selectedDetIds)
void bookTkMap(const std::string &TkMapname)
std::unique_ptr< TkHistoMap > Tk_HM_H
SiStripFolderOrganizer folder_organizer
std::vector< int > tkMapScaler
void saveTkMap(const std::string &TkMapname, double minValue, double maxValue)
void fillTkMap(const uint32_t &detid, const float &value)
std::map< uint32_t, ModMEs > SummaryMEsMap_
dqm::legacy::MonitorElement MonitorElement
void bookCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
bool checkChanged(const edm::EventSetup &eSetup) override
void analysisOnDemand(const edm::EventSetup &eSetup_, uint32_t detIdOnDemand)
virtual void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_)=0
virtual void fillMEsForLayer(uint32_t selDetId_)=0
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Definition: value.py:1
virtual void getConditionObject(const edm::EventSetup &eSetup_)=0
virtual void getActiveDetIds(const edm::EventSetup &eSetup)=0
void analysis(const edm::EventSetup &eSetup_)
std::vector< uint32_t > ModulesToBeIncluded_
SiStripBaseCondObjDQM(edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
std::pair< std::string, uint32_t > getStringNameAndId(const uint32_t &detId_)
void getConditionObject(const edm::EventSetup &eSetup) override
std::vector< uint32_t > all_DetIds
dqm::legacy::DQMStore DQMStore
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId)
virtual void fillModMEs(const std::vector< uint32_t > &selectedDetIds)
std::vector< uint32_t > activeDetIds
void bookSummaryCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
unsigned int RunNumber_t
SiStripBaseCondObjDQMGet(tokentype token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
virtual bool checkChanged(const edm::EventSetup &eSetup)=0
void bookSummaryProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
std::vector< std::string > SubDetectorsToBeExcluded_
std::unique_ptr< TkHistoMap > Tk_HM_
void bookProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
void bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)