CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalDataCertification Class Reference

#include <DQM/HcalMonitorClient/src/HcalDataCertification.cc>

Inheritance diagram for HcalDataCertification:
edm::EDAnalyzer

Public Member Functions

 HcalDataCertification (const edm::ParameterSet &)
 
 ~HcalDataCertification ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
void CertifyHcal ()
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 

Private Attributes

MonitorElementCertificationSummary
 
MonitorElementCertificationSummaryMap
 
edm::ParameterSet conf_
 
DQMStoredbe_
 
int debug_
 
MonitorElementHcal_HB
 
MonitorElementHcal_HE
 
MonitorElementHcal_HF
 
MonitorElementHcal_HFlumi
 
MonitorElementHcal_HO
 
MonitorElementHcal_HO0
 
MonitorElementHcal_HO12
 
std::string rootFolder_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 47 of file HcalDataCertification.cc.

Constructor & Destructor Documentation

HcalDataCertification::HcalDataCertification ( const edm::ParameterSet iConfig)
explicit

Definition at line 90 of file HcalDataCertification.cc.

References dbe_, debug_, edm::ParameterSet::getUntrackedParameter(), cmsCodeRules.cppFunctionSkipper::operator, and rootFolder_.

91 {
92  // now do what ever initialization is needed
93  debug_ = iConfig.getUntrackedParameter<int>("debug",0);
94  rootFolder_ = iConfig.getUntrackedParameter<std::string>("subSystemFolder","Hcal");
96 }
T getUntrackedParameter(std::string const &, T const &) const
HcalDataCertification::~HcalDataCertification ( )

Definition at line 98 of file HcalDataCertification.cc.

99 {
100  // do anything here that needs to be done at desctruction time
101  // (e.g. close files, deallocate resources etc.)
102 }

Member Function Documentation

void HcalDataCertification::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 110 of file HcalDataCertification.cc.

110 {}
void HcalDataCertification::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 114 of file HcalDataCertification.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), CertificationSummary, CertificationSummaryMap, gather_cfg::cout, dbe_, debug_, DQMStore::getAllContents(), Hcal_HB, Hcal_HE, Hcal_HF, Hcal_HFlumi, Hcal_HO, Hcal_HO0, Hcal_HO12, DQMStore::pwd(), rootFolder_, MonitorElement::setAxisRange(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

115 {
116  if (debug_>0) std::cout<<"<HcalDataCertification> beginJob"<< std::endl;
117 
119  std::string currDir = dbe_->pwd();
120  if (debug_>0) std::cout << "--- Current Directory " << currDir << std::endl;
121  std::vector<MonitorElement*> mes = dbe_->getAllContents("");
122  if (debug_>0) std::cout << "found " << mes.size() << " monitoring elements:" << std::endl;
123 
124  dbe_->setCurrentFolder(rootFolder_+"/EventInfo/");
125 
126  CertificationSummary = dbe_->bookFloat("CertificationSummary");
127 
128  CertificationSummaryMap = dbe_->book2D("CertificationSummaryMap","HcalCertificationSummaryMap",7,0.,7.,1,0.,1.);
137  CertificationSummaryMap->setBinLabel(1,"Status",2);
138 
139  dbe_->setCurrentFolder(rootFolder_+"/EventInfo/CertificationContents/");
140  Hcal_HB = dbe_->bookFloat("Hcal_HB");
141  Hcal_HE = dbe_->bookFloat("Hcal_HE");
142  Hcal_HF = dbe_->bookFloat("Hcal_HF");
143  Hcal_HO = dbe_->bookFloat("Hcal_HO");
144  Hcal_HFlumi = dbe_->bookFloat("Hcal_HFlumi");
145  Hcal_HO0 = dbe_->bookFloat("Hcal_HO0");
146  Hcal_HO12 = dbe_->bookFloat("Hcal_HO12");
147 
148 }
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
MonitorElement * CertificationSummary
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:456
std::vector< MonitorElement * > getAllContents(const std::string &path) const
Definition: DQMStore.cc:1474
MonitorElement * CertificationSummaryMap
tuple cout
Definition: gather_cfg.py:41
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:647
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
const std::string & pwd(void) const
Definition: DQMStore.cc:209
void HcalDataCertification::beginLuminosityBlock ( const edm::LuminosityBlock run,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 159 of file HcalDataCertification.cc.

References gather_cfg::cout, and debug_.

160 {
161  if (debug_>0) std::cout<<"<HcalDataCertification> beginLuminosityBlock"<<std::endl;
162 }
tuple cout
Definition: gather_cfg.py:41
void HcalDataCertification::CertifyHcal ( )
private

Definition at line 176 of file HcalDataCertification.cc.

References CertificationSummary, CertificationSummaryMap, gather_cfg::cout, dbe_, debug_, MonitorElement::Fill(), DQMStore::get(), DQMStore::getAllContents(), Hcal_HB, Hcal_HE, Hcal_HF, Hcal_HFlumi, Hcal_HO, Hcal_HO0, Hcal_HO12, siStripFEDMonitor_P5_cff::Min, DQMStore::pwd(), rootFolder_, MonitorElement::setBinContent(), and DQMStore::setCurrentFolder().

Referenced by endLuminosityBlock(), and endRun().

177 {
178 
179  float hcalFrac,reportFrac,dcsFrac,daqFrac;
180  float fracHCAL[7][3];
181  float certHcal[7];
182 
183  if (debug_>0) {
185  std::string currDir = dbe_->pwd();
186  std::cout << "<HcalDataCertification::endLuminosityBlock> --- Current Directory " << currDir << std::endl;
187  std::vector<MonitorElement*> mes = dbe_->getAllContents("");
188  std::cout << "found " << mes.size() << " monitoring elements:" << std::endl;
189  }
190 
191  if (dbe_->get(rootFolder_+"/EventInfo/DCSSummary")) {
192  dcsFrac = (dbe_->get(rootFolder_+"/EventInfo/DCSSummary"))->getFloatValue();
193  }
194  else dcsFrac = -1;
195 
196  if (dbe_->get(rootFolder_+"/EventInfo/DAQSummary")) {
197  daqFrac = (dbe_->get(rootFolder_+"/EventInfo/DAQSummary"))->getFloatValue();
198  }
199  else daqFrac = -1;
200 
201  if (dbe_->get(rootFolder_+"/EventInfo/reportSummary")) {
202  reportFrac = (dbe_->get(rootFolder_+"/EventInfo/reportSummary"))->getFloatValue();
203  }
204  else reportFrac = -1;
205 
206  hcalFrac = 99.;
207  hcalFrac = TMath::Min(hcalFrac,reportFrac);
208  hcalFrac = TMath::Min(hcalFrac,daqFrac);
209  hcalFrac = TMath::Min(hcalFrac,dcsFrac);
210  if (debug_>0) {
211  std::cout<<"dcsFrac= "<<dcsFrac<<std::endl;
212  std::cout<<"daqFrac= "<<daqFrac<<std::endl;
213  std::cout<<"reportFrac= "<<reportFrac<<std::endl;
214  std::cout<<"CertificationSummary= "<<hcalFrac<<std::endl;
215  }
216 
217  // reportSummary
218 
219  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HB")) {
220  fracHCAL[0][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HB"))->getFloatValue();
221  }
222  else fracHCAL[0][0] = -1;
223 
224  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HE")) {
225  fracHCAL[1][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HE"))->getFloatValue();
226  }
227  else fracHCAL[1][0] = -1;
228 
229  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO")) {
230  fracHCAL[2][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO"))->getFloatValue();
231  }
232  else fracHCAL[2][0] = -1;
233 
234  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HF")) {
235  fracHCAL[3][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HF"))->getFloatValue();
236  }
237  else fracHCAL[3][0] = -1;
238 
239  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO0")) {
240  fracHCAL[4][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO0"))->getFloatValue();
241  }
242  else fracHCAL[4][0] = -1;
243 
244  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO12")) {
245  fracHCAL[5][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HO12"))->getFloatValue();
246  }
247  else fracHCAL[5][0] = -1;
248 
249 
250  if (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HFlumi")) {
251  fracHCAL[6][0] = (dbe_->get(rootFolder_+"/EventInfo/reportSummaryContents/Hcal_HFlumi"))->getFloatValue();
252  }
253  else fracHCAL[6][0] = -1;
254 
255  // DAQ
256 
257  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HB")) {
258  fracHCAL[0][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HB"))->getFloatValue();
259  }
260  else fracHCAL[0][1] = -1;
261 
262  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HE")) {
263  fracHCAL[1][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HE"))->getFloatValue();
264  }
265  else fracHCAL[1][1] = -1;
266 
267  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO")) {
268  fracHCAL[2][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO"))->getFloatValue();
269  }
270  else fracHCAL[2][1] = -1;
271 
272  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HF")) {
273  fracHCAL[3][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HF"))->getFloatValue();
274  }
275  else fracHCAL[3][1] = -1;
276 
277  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO0")) {
278  fracHCAL[4][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO0"))->getFloatValue();
279  }
280  else fracHCAL[4][1] = -1;
281 
282  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO12")) {
283  fracHCAL[5][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HO12"))->getFloatValue();
284  }
285  else fracHCAL[5][1] = -1;
286 
287  if (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HFlumi")) {
288  fracHCAL[6][1] = (dbe_->get(rootFolder_+"/EventInfo/DAQContents/Hcal_HFlumi"))->getFloatValue();
289  }
290  else fracHCAL[6][1] = -1;
291 
292  // DCS
293 
294  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HB")) {
295  fracHCAL[0][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HB"))->getFloatValue();
296  }
297  else fracHCAL[0][2] = -1;
298 
299  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HE")) {
300  fracHCAL[1][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HE"))->getFloatValue();
301  }
302  else fracHCAL[1][2] = -1;
303 
304  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO")) {
305  fracHCAL[2][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO"))->getFloatValue();
306  }
307  else fracHCAL[2][2] = -1;
308 
309  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HF")) {
310  fracHCAL[3][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HF"))->getFloatValue();
311  }
312  else fracHCAL[3][2] = -1;
313 
314  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO0")) {
315  fracHCAL[4][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO0"))->getFloatValue();
316  }
317  else fracHCAL[4][2] = -1;
318 
319  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO12")) {
320  fracHCAL[5][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HO12"))->getFloatValue();
321  }
322  else fracHCAL[5][2] = -1;
323 
324 
325  if (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HFlumi")) {
326  fracHCAL[6][2] = (dbe_->get(rootFolder_+"/EventInfo/DCSContents/Hcal_HFlumi"))->getFloatValue();
327  }
328  else fracHCAL[6][2] = -1;
329 
330  for (int ii=0;ii<7;ii++) {
331  certHcal[ii] = 99.0;
332  for (int jj=0; jj<2;jj++) certHcal[ii] = TMath::Min(certHcal[ii],fracHCAL[ii][jj]);
333  CertificationSummaryMap->setBinContent(ii+1,1,certHcal[ii]);
334  if (debug_>0) std::cout<<"certFrac["<<ii<<"]= "<<certHcal[ii]<<std::endl;
335  }
336 
337  CertificationSummary->Fill(hcalFrac);
338  Hcal_HB->Fill(certHcal[0]);
339  Hcal_HE->Fill(certHcal[1]);
340  Hcal_HO->Fill(certHcal[2]);
341  Hcal_HF->Fill(certHcal[3]);
342  Hcal_HO0->Fill(certHcal[4]);
343  Hcal_HO12->Fill(certHcal[5]);
344  Hcal_HFlumi->Fill(certHcal[6]);
345 
346 // ---------------------- end of certification
347  if (debug_>0) std::cout << "<HcalDataCertification::MEfilled= " << std::endl;
348 
349 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * CertificationSummary
std::vector< MonitorElement * > getAllContents(const std::string &path) const
Definition: DQMStore.cc:1474
void Fill(long long x)
MonitorElement * CertificationSummaryMap
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
tuple cout
Definition: gather_cfg.py:41
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
const std::string & pwd(void) const
Definition: DQMStore.cc:209
void HcalDataCertification::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 152 of file HcalDataCertification.cc.

References gather_cfg::cout, and debug_.

153 {
154  if (debug_>0) std::cout << "<HcalDataCertification> endJob " << std::endl;
155 }
tuple cout
Definition: gather_cfg.py:41
void HcalDataCertification::endLuminosityBlock ( const edm::LuminosityBlock run,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 166 of file HcalDataCertification.cc.

References CertifyHcal().

167 {
168  CertifyHcal();
169 }
void HcalDataCertification::endRun ( const edm::Run r,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 171 of file HcalDataCertification.cc.

References CertifyHcal().

172 {
173  CertifyHcal();
174 }

Member Data Documentation

MonitorElement* HcalDataCertification::CertificationSummary
private

Definition at line 65 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::CertificationSummaryMap
private

Definition at line 66 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

edm::ParameterSet HcalDataCertification::conf_
private

Definition at line 63 of file HcalDataCertification.cc.

DQMStore* HcalDataCertification::dbe_
private

Definition at line 64 of file HcalDataCertification.cc.

Referenced by beginJob(), CertifyHcal(), and HcalDataCertification().

int HcalDataCertification::debug_
private
MonitorElement* HcalDataCertification::Hcal_HB
private

Definition at line 67 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HE
private

Definition at line 68 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HF
private

Definition at line 69 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HFlumi
private

Definition at line 71 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO
private

Definition at line 70 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO0
private

Definition at line 72 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

MonitorElement* HcalDataCertification::Hcal_HO12
private

Definition at line 73 of file HcalDataCertification.cc.

Referenced by beginJob(), and CertifyHcal().

std::string HcalDataCertification::rootFolder_
private

Definition at line 75 of file HcalDataCertification.cc.

Referenced by beginJob(), CertifyHcal(), and HcalDataCertification().