CMS 3D CMS Logo

SiStripMonitorCondData.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripMonitorSummary
4 // Class : SiStripMonitorCondData
5 //
6 // Original Author: Evelyne Delmeire
7 //
8 
16 
18 
24 
26 
35 
36 #include "TH1F.h"
37 #include "TH2F.h"
38 #include "TProfile.h"
39 
40 // std
41 #include <algorithm>
42 #include <cmath>
43 #include <cstdlib>
44 #include <numeric>
45 #include <string>
46 
47 //
48 // ----- Constructor
49 //
51  monitorPedestals_ = iConfig.getParameter<bool>("MonitorSiStripPedestal");
52  monitorNoises_ = iConfig.getParameter<bool>("MonitorSiStripNoise");
53  monitorLowThreshold_ = iConfig.getParameter<bool>("MonitorSiStripLowThreshold");
54  monitorHighThreshold_ = iConfig.getParameter<bool>("MonitorSiStripHighThreshold");
55  monitorQuality_ = iConfig.getParameter<bool>("MonitorSiStripQuality");
56  monitorApvGains_ = iConfig.getParameter<bool>("MonitorSiStripApvGain");
57  monitorLorentzAngle_ = iConfig.getParameter<bool>("MonitorSiStripLorentzAngle");
58  monitorBackPlaneCorrection_ = iConfig.getParameter<bool>("MonitorSiStripBackPlaneCorrection");
59  monitorCabling_ = iConfig.getParameter<bool>("MonitorSiStripCabling");
60 }
61 // -----
62 
63 //
64 // ----- Destructor
65 //
67 // -----
68 
69 //
70 // ----- beginRun
71 //
73  if (monitorPedestals_) {
75  std::make_unique<SiStripPedestalsDQM>(eSetup,
76  run.run(),
77  conf_.getParameter<edm::ParameterSet>("SiStripPedestalsDQM_PSet"),
78  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
79  }
80 
81  if (monitorNoises_) {
82  noisesDQM_ = std::make_unique<SiStripNoisesDQM>(eSetup,
83  run.run(),
84  conf_.getParameter<edm::ParameterSet>("SiStripNoisesDQM_PSet"),
85  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
86  }
87 
90  std::make_unique<SiStripThresholdDQM>(eSetup,
91  run.run(),
92  conf_.getParameter<edm::ParameterSet>("SiStripLowThresholdDQM_PSet"),
93  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
94  }
95 
98  std::make_unique<SiStripThresholdDQM>(eSetup,
99  run.run(),
100  conf_.getParameter<edm::ParameterSet>("SiStripHighThresholdDQM_PSet"),
101  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
102  }
103 
104  if (monitorQuality_) {
105  qualityDQM_ = std::make_unique<SiStripQualityDQM>(eSetup,
106  run.run(),
107  conf_.getParameter<edm::ParameterSet>("SiStripQualityDQM_PSet"),
108  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
109  }
110 
111  if (monitorApvGains_) {
112  apvgainsDQM_ =
113  std::make_unique<SiStripApvGainsDQM>(eSetup,
114  run.run(),
115  conf_.getParameter<edm::ParameterSet>("SiStripApvGainsDQM_PSet"),
116  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
117  }
118 
119  if (monitorLorentzAngle_) {
121  std::make_unique<SiStripLorentzAngleDQM>(eSetup,
122  run.run(),
123  conf_.getParameter<edm::ParameterSet>("SiStripLorentzAngleDQM_PSet"),
124  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
125  }
126 
128  bpcorrectionDQM_ = std::make_unique<SiStripBackPlaneCorrectionDQM>(
129  eSetup,
130  run.run(),
131  conf_.getParameter<edm::ParameterSet>("SiStripBackPlaneCorrectionDQM_PSet"),
132  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
133  }
134  if (monitorCabling_) {
135  cablingDQM_ = std::make_unique<SiStripCablingDQM>(eSetup,
136  run.run(),
137  conf_.getParameter<edm::ParameterSet>("SiStripCablingDQM_PSet"),
138  conf_.getParameter<edm::ParameterSet>("FillConditions_PSet"));
139  }
140 } // beginRun
141 // -----
142 
143 //
144 // ----- beginJob
145 //
146 void SiStripMonitorCondData::beginJob(void) {} // beginJob
147 // -----
148 
149 //
150 // ----- Analyze
151 //
153  if (monitorPedestals_) {
154  pedestalsDQM_->analysis(eSetup);
155  }
156  if (monitorNoises_) {
157  noisesDQM_->analysis(eSetup);
158  }
159  if (monitorLowThreshold_) {
160  lowthresholdDQM_->analysis(eSetup);
161  }
162  if (monitorHighThreshold_) {
163  highthresholdDQM_->analysis(eSetup);
164  }
165  if (monitorApvGains_) {
166  apvgainsDQM_->analysis(eSetup);
167  }
168  if (monitorLorentzAngle_) {
169  lorentzangleDQM_->analysis(eSetup);
170  }
172  bpcorrectionDQM_->analysis(eSetup);
173  }
174  if (monitorQuality_) {
175  qualityDQM_->analysis(eSetup);
176  qualityDQM_->fillGrandSummaryMEs(eSetup);
177  } // fillGrand. for SiStripquality
178  if (monitorCabling_) {
179  cablingDQM_->analysis(eSetup);
180  }
181 } // analyze
182 // -----
183 
184 //
185 // ----- endRun
186 //
188  if (monitorPedestals_) {
189  pedestalsDQM_->end();
190  }
191  if (monitorNoises_) {
192  noisesDQM_->end();
193  }
194  if (monitorLowThreshold_) {
195  lowthresholdDQM_->end();
196  }
197  if (monitorHighThreshold_) {
198  highthresholdDQM_->end();
199  }
200  if (monitorApvGains_) {
201  apvgainsDQM_->end();
202  }
203  if (monitorLorentzAngle_) {
204  lorentzangleDQM_->end();
205  }
207  bpcorrectionDQM_->end();
208  }
209  if (monitorQuality_) {
210  qualityDQM_->end();
211  }
212  if (monitorCabling_) {
213  cablingDQM_->end();
214  }
215 
216  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
218 
219  DQMStore *dqmStore_ = edm::Service<DQMStore>().operator->();
220 
221  if (outputMEsInRootFile) {
222  dqmStore_->showDirStructure();
223  dqmStore_->save(outputFileName);
224  }
225 
226 } // endRun
227 // -----
228 
229 //
230 // ----- endJob
231 //
233 // endJob
234 // -----
235 
std::unique_ptr< SiStripNoisesDQM > noisesDQM_
T getParameter(std::string const &) const
std::unique_ptr< SiStripCablingDQM > cablingDQM_
RunNumber_t run() const
Definition: RunBase.h:40
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
std::unique_ptr< SiStripThresholdDQM > highthresholdDQM_
void analyze(const edm::Event &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::unique_ptr< SiStripApvGainsDQM > apvgainsDQM_
std::unique_ptr< SiStripQualityDQM > qualityDQM_
std::unique_ptr< SiStripThresholdDQM > lowthresholdDQM_
std::unique_ptr< SiStripPedestalsDQM > pedestalsDQM_
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
std::unique_ptr< SiStripBackPlaneCorrectionDQM > bpcorrectionDQM_
std::unique_ptr< SiStripLorentzAngleDQM > lorentzangleDQM_
SiStripMonitorCondData(const edm::ParameterSet &)
Definition: Run.h:45