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  monitorPedestals_ = iConfig.getParameter<bool>("MonitorSiStripPedestal");
55  monitorNoises_ = iConfig.getParameter<bool>("MonitorSiStripNoise");
56  monitorQuality_ = iConfig.getParameter<bool>("MonitorSiStripQuality");
57  monitorApvGains_ = iConfig.getParameter<bool>("MonitorSiStripApvGain");
58  monitorLorentzAngle_ = iConfig.getParameter<bool>("MonitorSiStripLorentzAngle");
59  monitorBackPlaneCorrection_ = iConfig.getParameter<bool>("MonitorSiStripBackPlaneCorrection");
60  monitorLowThreshold_ = iConfig.getParameter<bool>("MonitorSiStripLowThreshold");
61  monitorHighThreshold_ = iConfig.getParameter<bool>("MonitorSiStripHighThreshold");
62  monitorCabling_ = iConfig.getParameter<bool>("MonitorSiStripCabling");
65  if (monitorPedestals_) {
67  }
68  if (monitorNoises_) {
69  noiseToken_ = iC.esConsumes();
70  const auto& hPSet = iConfig.getParameter<edm::ParameterSet>("SiStripNoisesDQM_PSet");
71  if (hPSet.getParameter<bool>("SimGainRenormalisation")) {
73  } else if (hPSet.getParameter<bool>("GainRenormalisation")) {
75  }
76  }
77  if (monitorQuality_) {
78  const auto& fPSet = conf_.getParameter<edm::ParameterSet>("FillConditions_PSet");
79  const auto& qualityLabel = fPSet.getParameter<std::string>("StripQualityLabel");
81  }
82  if (monitorApvGains_) {
83  gainToken_ = iC.esConsumes();
84  }
87  }
90  }
93  }
94  if (monitorCabling_) {
96  }
97 }
98 
100 
102  const auto tTopo = &eSetup.getData(tTopoToken_);
103  const auto& fPSet = conf_.getParameter<edm::ParameterSet>("FillConditions_PSet");
104  const TkDetMap* tkDetMap{nullptr};
105  if (fPSet.getParameter<bool>("HistoMaps_On")) {
106  tkDetMap = &eSetup.getData(tkDetMapToken_);
107  }
108  if (monitorPedestals_) {
109  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripPedestalsDQM_PSet");
110  pedestalsDQM_ = std::make_unique<SiStripPedestalsDQM>(pedestalsToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
111  }
112 
113  if (monitorNoises_) {
114  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripNoisesDQM_PSet");
115  const SiStripApvGain* gain = nullptr;
116  if (hPSet.getParameter<bool>("SimGainRenormalisation")) {
117  gain = &eSetup.getData(simGainToken_);
118  } else if (hPSet.getParameter<bool>("GainRenormalisation")) {
119  gain = &eSetup.getData(gainTokenForNoise_);
120  }
121  noisesDQM_ = std::make_unique<SiStripNoisesDQM>(noiseToken_, iRun, hPSet, fPSet, tTopo, tkDetMap, gain);
122  }
123 
124  if (monitorQuality_) {
125  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripQualityDQM_PSet");
126  qualityDQM_ = std::make_unique<SiStripQualityDQM>(qualityToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
127  }
128 
129  if (monitorApvGains_) {
130  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripApvGainsDQM_PSet");
131  apvgainsDQM_ = std::make_unique<SiStripApvGainsDQM>(gainToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
132  }
133 
134  if (monitorLorentzAngle_) {
135  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripLorentzAngleDQM_PSet");
137  std::make_unique<SiStripLorentzAngleDQM>(lorentzAngleToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
138  }
139 
141  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripBackPlaneCorrectionDQM_PSet");
143  std::make_unique<SiStripBackPlaneCorrectionDQM>(backplaneCorrectionToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
144  }
145 
146  if (monitorLowThreshold_) {
147  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripLowThresholdDQM_PSet");
148  lowthresholdDQM_ = std::make_unique<SiStripThresholdDQM>(thresholdToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
149  }
150 
151  if (monitorHighThreshold_) {
152  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripHighThresholdDQM_PSet");
153  highthresholdDQM_ = std::make_unique<SiStripThresholdDQM>(thresholdToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
154  }
155 
156  if (monitorCabling_) {
157  const auto& hPSet = conf_.getParameter<edm::ParameterSet>("SiStripCablingDQM_PSet");
158  cablingDQM_ = std::make_unique<SiStripCablingDQM>(detCablingToken_, iRun, hPSet, fPSet, tTopo, tkDetMap);
159  }
160 }
161 
162 void SiStripClassToMonitorCondData::getModMEsOnDemand(edm::EventSetup const& eSetup, uint32_t requestedDetId) {
163  if (monitorPedestals_) {
164  pedestalsDQM_->analysisOnDemand(eSetup, requestedDetId);
165  }
166  if (monitorNoises_) {
167  noisesDQM_->analysisOnDemand(eSetup, requestedDetId);
168  }
169  if (monitorQuality_) {
170  qualityDQM_->analysisOnDemand(eSetup, requestedDetId);
171  qualityDQM_->fillGrandSummaryMEs();
172  } // fillGrand. for SiStripquality
173  if (monitorApvGains_) {
174  apvgainsDQM_->analysisOnDemand(eSetup, requestedDetId);
175  }
176  if (monitorLorentzAngle_) {
177  lorentzangleDQM_->analysisOnDemand(eSetup, requestedDetId);
178  }
180  bpcorrectionDQM_->analysisOnDemand(eSetup, requestedDetId);
181  }
182  if (monitorCabling_) {
183  cablingDQM_->analysisOnDemand(eSetup, requestedDetId);
184  }
185  if (monitorLowThreshold_) {
186  lowthresholdDQM_->analysisOnDemand(eSetup, requestedDetId);
187  }
188  if (monitorHighThreshold_) {
189  highthresholdDQM_->analysisOnDemand(eSetup, requestedDetId);
190  }
191 }
192 // -----
193 
194 //
195 // ----- getlayerMEsOnDemand
196 //
198  std::string requestedSubDetector,
199  uint32_t requestedSide,
200  uint32_t requestedLayer) {
201  if (monitorPedestals_) {
202  pedestalsDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
203  }
204  if (monitorNoises_) {
205  noisesDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
206  }
207  if (monitorQuality_) {
208  qualityDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
209  qualityDQM_->fillGrandSummaryMEs();
210  }
211  if (monitorApvGains_) {
212  apvgainsDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
213  }
214  if (monitorLorentzAngle_) {
215  lorentzangleDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
216  }
218  bpcorrectionDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
219  }
220  if (monitorCabling_) {
221  cablingDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
222  }
223  if (monitorLowThreshold_) {
224  lowthresholdDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
225  }
226  if (monitorHighThreshold_) {
227  highthresholdDQM_->analysisOnDemand(eSetup, requestedSubDetector, requestedSide, requestedLayer);
228  }
229 }
230 
231 //
232 // ----- Analyze
233 //
235  if (monitorPedestals_) {
236  pedestalsDQM_->analysis(eSetup);
237  }
238  if (monitorNoises_) {
239  noisesDQM_->analysis(eSetup);
240  }
241  if (monitorQuality_) {
242  qualityDQM_->analysis(eSetup);
243  qualityDQM_->fillGrandSummaryMEs();
244  } // fillGrand. for SiStripquality
245  if (monitorApvGains_) {
246  apvgainsDQM_->analysis(eSetup);
247  }
248  if (monitorLorentzAngle_) {
249  lorentzangleDQM_->analysis(eSetup);
250  }
252  bpcorrectionDQM_->analysis(eSetup);
253  }
254  if (monitorCabling_) {
255  cablingDQM_->analysis(eSetup);
256  }
257  if (monitorLowThreshold_) {
258  lowthresholdDQM_->analysis(eSetup);
259  }
260  if (monitorHighThreshold_) {
261  highthresholdDQM_->analysis(eSetup);
262  }
263 
264 } // analyze
265 // -----
266 
268  if (monitorPedestals_) {
269  pedestalsDQM_->end();
270  }
271  if (monitorNoises_) {
272  noisesDQM_->end();
273  }
274  if (monitorLowThreshold_) {
275  lowthresholdDQM_->end();
276  }
277  if (monitorHighThreshold_) {
278  highthresholdDQM_->end();
279  }
280  if (monitorApvGains_) {
281  apvgainsDQM_->end();
282  }
283  if (monitorLorentzAngle_) {
284  lorentzangleDQM_->end();
285  }
287  bpcorrectionDQM_->end();
288  }
289  if (monitorQuality_) {
290  qualityDQM_->end();
291  }
292  if (monitorCabling_) {
293  cablingDQM_->end();
294  }
295 }
296 
298  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
300 
301  DQMStore* dqmStore_ = edm::Service<DQMStore>().operator->();
302 
303  if (outputMEsInRootFile) {
304  dqmStore_->save(outputFileName);
305  }
306 }
SiStripClassToMonitorCondData::pedestalsToken_
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedestalsToken_
Definition: SiStripClassToMonitorCondData.h:99
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
SiStripClassToMonitorCondData::cablingDQM_
std::unique_ptr< SiStripCablingDQM > cablingDQM_
Definition: SiStripClassToMonitorCondData.h:92
Handle.h
SiStripClassToMonitorCondData::beginRun
void beginRun(edm::RunNumber_t iRun, edm::EventSetup const &eSetup)
Definition: SiStripClassToMonitorCondData.cc:101
edm::ESInputTag
Definition: ESInputTag.h:87
MessageLogger.h
SiStripFolderOrganizer.h
SiStripHistoId.h
ESHandle.h
bysipixelclustmulteventfilter_cfi.qualityLabel
qualityLabel
Definition: bysipixelclustmulteventfilter_cfi.py:8
SiStripClassToMonitorCondData::monitorPedestals_
bool monitorPedestals_
Definition: SiStripClassToMonitorCondData.h:76
SiStripCablingDQM.h
DQMStore.h
ExtractTObject.h
SiStripApvGainRcd.h
SiStripQualityDQM.h
SiStripNoises.h
SiStripClassToMonitorCondData::simGainToken_
edm::ESGetToken< SiStripApvGain, SiStripApvGainSimRcd > simGainToken_
Definition: SiStripClassToMonitorCondData.h:101
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
SiStripClassToMonitorCondData::detCablingToken_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
Definition: SiStripClassToMonitorCondData.h:108
SiStripClassToMonitorCondData::qualityDQM_
std::unique_ptr< SiStripQualityDQM > qualityDQM_
Definition: SiStripClassToMonitorCondData.h:88
dqm::legacy::DQMStore
Definition: DQMStore.h:727
Service.h
SiStripClassToMonitorCondData::noisesDQM_
std::unique_ptr< SiStripNoisesDQM > noisesDQM_
Definition: SiStripClassToMonitorCondData.h:87
SiStripLorentzAngleDQM.h
SiStripClassToMonitorCondData::SiStripClassToMonitorCondData
SiStripClassToMonitorCondData(edm::ParameterSet const &iConfig, edm::ConsumesCollector iC)
Definition: SiStripClassToMonitorCondData.cc:51
SiStripPedestalsRcd.h
SiStripBackPlaneCorrectionDQM.h
TkDetMap
Definition: TkDetMap.h:175
SiStripClassToMonitorCondData::lowthresholdDQM_
std::unique_ptr< SiStripThresholdDQM > lowthresholdDQM_
Definition: SiStripClassToMonitorCondData.h:93
SiStripClassToMonitorCondData::tkDetMapToken_
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
Definition: SiStripClassToMonitorCondData.h:96
reco_skim_cfg_mod.outputFileName
outputFileName
Definition: reco_skim_cfg_mod.py:15
SiStripClassToMonitorCondData::backplaneCorrectionToken_
edm::ESGetToken< SiStripBackPlaneCorrection, SiStripBackPlaneCorrectionRcd > backplaneCorrectionToken_
Definition: SiStripClassToMonitorCondData.h:106
SiStripClassToMonitorCondData::getLayerMEsOnDemand
void getLayerMEsOnDemand(edm::EventSetup const &eSetup, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer)
Definition: SiStripClassToMonitorCondData.cc:197
SiStripClassToMonitorCondData::conf_
edm::ParameterSet conf_
Definition: SiStripClassToMonitorCondData.h:74
SiStripApvGain.h
SiStripClassToMonitorCondData::monitorBackPlaneCorrection_
bool monitorBackPlaneCorrection_
Definition: SiStripClassToMonitorCondData.h:81
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripClassToMonitorCondData::save
void save()
Definition: SiStripClassToMonitorCondData.cc:297
SiStripThresholdDQM.h
SiStripClassToMonitorCondData::highthresholdDQM_
std::unique_ptr< SiStripThresholdDQM > highthresholdDQM_
Definition: SiStripClassToMonitorCondData.h:94
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SiStripClassToMonitorCondData::monitorNoises_
bool monitorNoises_
Definition: SiStripClassToMonitorCondData.h:77
SiStripBackPlaneCorrection.h
SiStripClassToMonitorCondData::pedestalsDQM_
std::unique_ptr< SiStripPedestalsDQM > pedestalsDQM_
Definition: SiStripClassToMonitorCondData.h:86
SiStripPedestalsDQM.h
edm::Service
Definition: Service.h:30
SiStripClassToMonitorCondData::end
void end()
Definition: SiStripClassToMonitorCondData.cc:267
SiStripClassToMonitorCondData::bpcorrectionDQM_
std::unique_ptr< SiStripBackPlaneCorrectionDQM > bpcorrectionDQM_
Definition: SiStripClassToMonitorCondData.h:91
SiStripClassToMonitorCondData::gainTokenForNoise_
edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd > gainTokenForNoise_
Definition: SiStripClassToMonitorCondData.h:102
SiStripClassToMonitorCondData::noiseToken_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
Definition: SiStripClassToMonitorCondData.h:100
edm::EventSetup
Definition: EventSetup.h:58
SiStripClassToMonitorCondData::apvgainsDQM_
std::unique_ptr< SiStripApvGainsDQM > apvgainsDQM_
Definition: SiStripClassToMonitorCondData.h:89
SiStripClassToMonitorCondData::monitorLorentzAngle_
bool monitorLorentzAngle_
Definition: SiStripClassToMonitorCondData.h:80
SiStripClassToMonitorCondData::getModMEsOnDemand
void getModMEsOnDemand(edm::EventSetup const &eSetup, uint32_t requestedDetId)
Definition: SiStripClassToMonitorCondData.cc:162
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
SiStripClassToMonitorCondData::qualityToken_
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken_
Definition: SiStripClassToMonitorCondData.h:104
SiStripClassToMonitorCondData::gainToken_
edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd > gainToken_
Definition: SiStripClassToMonitorCondData.h:103
SiStripClassToMonitorCondData::monitorCabling_
bool monitorCabling_
Definition: SiStripClassToMonitorCondData.h:84
SiStripApvGainsDQM.h
edm::Transition::BeginRun
SiStripQuality.h
SiStripClassToMonitorCondData::analyseCondData
void analyseCondData(const edm::EventSetup &)
Definition: SiStripClassToMonitorCondData.cc:234
SiStripClassToMonitorCondData::monitorQuality_
bool monitorQuality_
Definition: SiStripClassToMonitorCondData.h:78
SiStripQualityRcd.h
SiStripPedestals.h
SiStripClassToMonitorCondData::monitorLowThreshold_
bool monitorLowThreshold_
Definition: SiStripClassToMonitorCondData.h:82
SiStripClassToMonitorCondData.h
EventSetup.h
SiStripNoisesDQM.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripClassToMonitorCondData::lorentzangleDQM_
std::unique_ptr< SiStripLorentzAngleDQM > lorentzangleDQM_
Definition: SiStripClassToMonitorCondData.h:90
SiStripClassToMonitorCondData::monitorApvGains_
bool monitorApvGains_
Definition: SiStripClassToMonitorCondData.h:79
SiStripClassToMonitorCondData::thresholdToken_
edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd > thresholdToken_
Definition: SiStripClassToMonitorCondData.h:107
SiStripNoisesRcd.h
ParameterSet.h
SiStripClassToMonitorCondData::~SiStripClassToMonitorCondData
~SiStripClassToMonitorCondData()
Definition: SiStripClassToMonitorCondData.cc:99
SiStripLorentzAngle.h
SiStripApvGain
Definition: SiStripApvGain.h:25
SiStripClassToMonitorCondData::monitorHighThreshold_
bool monitorHighThreshold_
Definition: SiStripClassToMonitorCondData.h:83
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
SiStripClassToMonitorCondData::tTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: SiStripClassToMonitorCondData.h:97
SiStripClassToMonitorCondData::lorentzAngleToken_
edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleRcd > lorentzAngleToken_
Definition: SiStripClassToMonitorCondData.h:105