CMS 3D CMS Logo

SiStripClassToMonitorCondData.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripMonitorSummary
4 // Class : SiStripClassToMonitorCondData
5 //
6 // Original Author: Evelyne Delmeire
7 //
8 
15 
17 
22 
24 
33 
39 
43 
46 
47 // std
48 #include <cstdlib>
49 #include <algorithm>
50 
53  : conf_(iConfig) {
54  const auto& mPSet = iConfig.getParameter<edm::ParameterSet>("MonitorSiStrip_PSet");
55  monitorPedestals_ = mPSet.getParameter<bool>("MonitorSiStripPedestal");
56  monitorNoises_ = mPSet.getParameter<bool>("MonitorSiStripNoise");
57  monitorQuality_ = mPSet.getParameter<bool>("MonitorSiStripQuality");
58  monitorApvGains_ = mPSet.getParameter<bool>("MonitorSiStripApvGain");
59  monitorLorentzAngle_ = mPSet.getParameter<bool>("MonitorSiStripLorentzAngle");
60  monitorBackPlaneCorrection_ = mPSet.getParameter<bool>("MonitorSiStripBackPlaneCorrection");
61  monitorLowThreshold_ = mPSet.getParameter<bool>("MonitorSiStripLowThreshold");
62  monitorHighThreshold_ = mPSet.getParameter<bool>("MonitorSiStripHighThreshold");
63  monitorCabling_ = mPSet.getParameter<bool>("MonitorSiStripCabling");
64 
67  if (monitorPedestals_) {
69  }
70  if (monitorNoises_) {
71  noiseToken_ = iC.esConsumes();
72  const auto& hPSet = iConfig.getParameter<edm::ParameterSet>("SiStripNoisesDQM_PSet");
73  if (hPSet.getParameter<bool>("SimGainRenormalisation")) {
75  } else if (hPSet.getParameter<bool>("GainRenormalisation")) {
77  }
78  }
79  if (monitorQuality_) {
80  const auto& fPSet = conf_.getParameter<edm::ParameterSet>("FillConditions_PSet");
81  const auto& qualityLabel = fPSet.getParameter<std::string>("StripQualityLabel");
83  }
84  if (monitorApvGains_) {
85  gainToken_ = iC.esConsumes();
86  }
89  }
92  }
95  }
96  if (monitorCabling_) {
98  }
99 }
100 
102 
104  const auto tTopo = &eSetup.getData(tTopoToken_);
105  const auto& fPSet = conf_.getParameter<edm::ParameterSet>("FillConditions_PSet");
106  const TkDetMap* tkDetMap{nullptr};
107  if (fPSet.getParameter<bool>("HistoMaps_On")) {
108  tkDetMap = &eSetup.getData(tkDetMapToken_);
109  }
110  if (monitorPedestals_) {
111  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripPedestalsDQM_PSet");
112  pedestalsDQM_ = std::make_unique<SiStripPedestalsDQM>(pedestalsToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
113  }
114 
115  if (monitorNoises_) {
116  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripNoisesDQM_PSet");
117  const SiStripApvGain* gain = nullptr;
118  if (hPSet.getParameter<bool>("SimGainRenormalisation")) {
119  gain = &eSetup.getData(simGainToken_);
120  } else if (hPSet.getParameter<bool>("GainRenormalisation")) {
121  gain = &eSetup.getData(gainTokenForNoise_);
122  }
123  noisesDQM_ = std::make_unique<SiStripNoisesDQM>(noiseToken_, iRun, hPSet, fPSet, tTopo, tkDetMap, gain);
124  }
125 
126  if (monitorQuality_) {
127  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripQualityDQM_PSet");
128  qualityDQM_ = std::make_unique<SiStripQualityDQM>(qualityToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
129  }
130 
131  if (monitorApvGains_) {
132  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripApvGainsDQM_PSet");
133  apvgainsDQM_ = std::make_unique<SiStripApvGainsDQM>(gainToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
134  }
135 
136  if (monitorLorentzAngle_) {
137  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripLorentzAngleDQM_PSet");
139  std::make_unique<SiStripLorentzAngleDQM>(lorentzAngleToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
140  }
141 
143  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripBackPlaneCorrectionDQM_PSet");
145  std::make_unique<SiStripBackPlaneCorrectionDQM>(backplaneCorrectionToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
146  }
147 
148  if (monitorLowThreshold_) {
149  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripLowThresholdDQM_PSet");
150  lowthresholdDQM_ = std::make_unique<SiStripThresholdDQM>(thresholdToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
151  }
152 
153  if (monitorHighThreshold_) {
154  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripHighThresholdDQM_PSet");
155  highthresholdDQM_ = std::make_unique<SiStripThresholdDQM>(thresholdToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
156  }
157 
158  if (monitorCabling_) {
159  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripCablingDQM_PSet");
160  cablingDQM_ = std::make_unique<SiStripCablingDQM>(detCablingToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
161  }
162 }
163 
164 void SiStripClassToMonitorCondData::getModMEsOnDemand(edm::EventSetup const& eSetup, uint32_t requestedDetId) {
165  if (monitorPedestals_) {
166  pedestalsDQM_->analysisOnDemand(eSetup, requestedDetId);
167  }
168  if (monitorNoises_) {
169  noisesDQM_->analysisOnDemand(eSetup, requestedDetId);
170  }
171  if (monitorQuality_) {
172  qualityDQM_->analysisOnDemand(eSetup, requestedDetId);
173  qualityDQM_->fillGrandSummaryMEs();
174  } // fillGrand. for SiStripquality
175  if (monitorApvGains_) {
176  apvgainsDQM_->analysisOnDemand(eSetup, requestedDetId);
177  }
178  if (monitorLorentzAngle_) {
179  lorentzangleDQM_->analysisOnDemand(eSetup, requestedDetId);
180  }
182  bpcorrectionDQM_->analysisOnDemand(eSetup, requestedDetId);
183  }
184  if (monitorCabling_) {
185  cablingDQM_->analysisOnDemand(eSetup, requestedDetId);
186  }
187  if (monitorLowThreshold_) {
188  lowthresholdDQM_->analysisOnDemand(eSetup, requestedDetId);
189  }
190  if (monitorHighThreshold_) {
191  highthresholdDQM_->analysisOnDemand(eSetup, requestedDetId);
192  }
193 }
194 // -----
195 
196 //
197 // ----- getlayerMEsOnDemand
198 //
200  std::string requestedSubDetector,
201  uint32_t requestedSide,
202  uint32_t requestedLayer) {
203  if (monitorPedestals_) {
204  pedestalsDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
205  }
206  if (monitorNoises_) {
207  noisesDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
208  }
209  if (monitorQuality_) {
210  qualityDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
211  qualityDQM_->fillGrandSummaryMEs();
212  }
213  if (monitorApvGains_) {
214  apvgainsDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
215  }
216  if (monitorLorentzAngle_) {
217  lorentzangleDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
218  }
220  bpcorrectionDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
221  }
222  if (monitorCabling_) {
223  cablingDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
224  }
225  if (monitorLowThreshold_) {
226  lowthresholdDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
227  }
228  if (monitorHighThreshold_) {
229  highthresholdDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
230  }
231 }
232 
233 //
234 // ----- Analyze
235 //
237  if (monitorPedestals_) {
238  pedestalsDQM_->analysis(eSetup);
239  }
240  if (monitorNoises_) {
241  noisesDQM_->analysis(eSetup);
242  }
243  if (monitorQuality_) {
244  qualityDQM_->analysis(eSetup);
245  qualityDQM_->fillGrandSummaryMEs();
246  } // fillGrand. for SiStripquality
247  if (monitorApvGains_) {
248  apvgainsDQM_->analysis(eSetup);
249  }
250  if (monitorLorentzAngle_) {
251  lorentzangleDQM_->analysis(eSetup);
252  }
254  bpcorrectionDQM_->analysis(eSetup);
255  }
256  if (monitorCabling_) {
257  cablingDQM_->analysis(eSetup);
258  }
259  if (monitorLowThreshold_) {
260  lowthresholdDQM_->analysis(eSetup);
261  }
262  if (monitorHighThreshold_) {
263  highthresholdDQM_->analysis(eSetup);
264  }
265 
266 } // analyze
267 // -----
268 
270  if (monitorPedestals_) {
271  pedestalsDQM_->end();
272  }
273  if (monitorNoises_) {
274  noisesDQM_->end();
275  }
276  if (monitorLowThreshold_) {
277  lowthresholdDQM_->end();
278  }
279  if (monitorHighThreshold_) {
280  highthresholdDQM_->end();
281  }
282  if (monitorApvGains_) {
283  apvgainsDQM_->end();
284  }
285  if (monitorLorentzAngle_) {
286  lorentzangleDQM_->end();
287  }
289  bpcorrectionDQM_->end();
290  }
291  if (monitorQuality_) {
292  qualityDQM_->end();
293  }
294  if (monitorCabling_) {
295  cablingDQM_->end();
296  }
297 }
298 
300  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
302 
303  DQMStore* dqmStore_ = edm::Service<DQMStore>().operator->();
304 
305  if (outputMEsInRootFile) {
306  dqmStore_->save(outputFileName);
307  }
308 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void beginRun(edm::RunNumber_t iRun, edm::EventSetup const &eSetup)
edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleRcd > lorentzAngleToken_
std::unique_ptr< SiStripCablingDQM > cablingDQM_
edm::ESGetToken< SiStripApvGain, SiStripApvGainSimRcd > simGainToken_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
std::unique_ptr< SiStripQualityDQM > qualityDQM_
std::unique_ptr< SiStripThresholdDQM > lowthresholdDQM_
edm::ESGetToken< SiStripBackPlaneCorrection, SiStripBackPlaneCorrectionRcd > backplaneCorrectionToken_
std::unique_ptr< SiStripThresholdDQM > highthresholdDQM_
SiStripClassToMonitorCondData(edm::ParameterSet const &iConfig, edm::ConsumesCollector iC)
void getLayerMEsOnDemand(edm::EventSetup const &eSetup, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer)
std::unique_ptr< SiStripPedestalsDQM > pedestalsDQM_
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
std::unique_ptr< SiStripNoisesDQM > noisesDQM_
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken_
void getModMEsOnDemand(edm::EventSetup const &eSetup, uint32_t requestedDetId)
std::unique_ptr< SiStripBackPlaneCorrectionDQM > bpcorrectionDQM_
edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd > thresholdToken_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
std::unique_ptr< SiStripLorentzAngleDQM > lorentzangleDQM_
edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd > gainTokenForNoise_
edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd > gainToken_
std::unique_ptr< SiStripApvGainsDQM > apvgainsDQM_
void analyseCondData(const edm::EventSetup &)
unsigned int RunNumber_t
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedestalsToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_