CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DQM/HcalMonitorClient/src/HcalDCSInfo.cc

Go to the documentation of this file.
00001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00002 #include "FWCore/ServiceRegistry/interface/Service.h"
00003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00004 
00005 #include "DQMServices/Core/interface/DQMStore.h"
00006 #include "DQMServices/Core/interface/MonitorElement.h"
00007 
00008 #include "DQM/HcalMonitorClient/interface/HcalDCSInfo.h"
00009 
00010 #include <iostream>
00011 #include <iomanip>
00012 #include <stdio.h>
00013 #include <string>
00014 #include <sstream>
00015 #include <math.h>
00016 
00017 //
00018 // -- Constructor
00019 //
00020 HcalDCSInfo::HcalDCSInfo(const edm::ParameterSet& pSet) {
00021 
00022   debug_ = pSet.getUntrackedParameter<int>("debug",0);
00023   rootFolder_ = pSet.getUntrackedParameter<std::string>("subSystemFolder","Hcal");
00024   // Create MessageSender
00025   edm::LogInfo( "HcalDCSInfo") << "HcalDCSInfo::Creating HcalDCSInfo ";
00026 
00027   // get back-end interface
00028   dqmStore_ = edm::Service<DQMStore>().operator->();
00029 }
00030 
00031 HcalDCSInfo::~HcalDCSInfo() 
00032 {
00033   edm::LogInfo("HcalDCSInfo") << "HcalDCSInfo::Deleting HcalDCSInfo ";
00034   
00035 } // destructor
00036 
00037 //
00038 // -- Begin Job
00039 //
00040 void HcalDCSInfo::beginJob() {
00041  
00042 
00043   dqmStore_->setCurrentFolder(rootFolder_+"/EventInfo/");
00044 
00045   // Book MEs for Hcal DCS fractions
00046 
00047   DCSFraction_= dqmStore_->bookFloat("DCSSummary"); 
00048 
00049   DCSSummaryMap_ = dqmStore_->book2D("DCSSummaryMap","HcalDCSSummaryMap",7,0.,7.,1,0.,1.);
00050   DCSSummaryMap_->setAxisRange(-1,1,3);
00051   DCSSummaryMap_->setBinLabel(1,"HB");
00052   DCSSummaryMap_->setBinLabel(2,"HE");
00053   DCSSummaryMap_->setBinLabel(3,"HO");
00054   DCSSummaryMap_->setBinLabel(4,"HF");
00055   DCSSummaryMap_->setBinLabel(5,"H00");
00056   DCSSummaryMap_->setBinLabel(6,"H012");
00057   DCSSummaryMap_->setBinLabel(7,"HFlumi");
00058   DCSSummaryMap_->setBinLabel(1,"Status",2);
00059 
00060   dqmStore_->setCurrentFolder(rootFolder_+"/EventInfo/DCSContents");
00061   DCSFractionHB_= dqmStore_->bookFloat("Hcal_HB");  
00062   DCSFractionHE_= dqmStore_->bookFloat("Hcal_HE");  
00063   DCSFractionHO_= dqmStore_->bookFloat("Hcal_HO");  
00064   DCSFractionHF_= dqmStore_->bookFloat("Hcal_HF");  
00065   DCSFractionHO0_= dqmStore_->bookFloat("Hcal_HO0");
00066   DCSFractionHO12_= dqmStore_->bookFloat("Hcal_HO12");
00067   DCSFractionHFlumi_= dqmStore_->bookFloat("Hcal_HFlumi");
00068 
00069 } 
00070 
00071 //
00072 // -- Begin Run
00073 //
00074 void HcalDCSInfo::beginRun(edm::Run const& run, edm::EventSetup const& eSetup) 
00075 {
00076   edm::LogInfo ("HcalDCSInfo") <<"HcalDCSInfo:: Begining of Run";
00077   return;
00078 }
00079 
00080 //
00081 // -- Analyze
00082 //
00083 void HcalDCSInfo::analyze(edm::Event const& event, edm::EventSetup const& eSetup) 
00084 {
00085 }
00086 
00087 //
00088 // -- Begin Luminosity Block
00089 //
00090 void HcalDCSInfo::beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& eSetup)
00091 {
00092   edm::LogInfo ("HcalDCSInfo") <<"HcalDCSInfo:: Luminosity Block";
00093 }
00094 
00095 void HcalDCSInfo::endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& eSetup)
00096 {
00097   edm::LogInfo ("HcalDCSInfo") <<"HcalDCSInfo:: Luminosity Block";
00098 
00099   // Fill them with -1 to start with
00100 
00101   for (int ii=0;ii<7;ii++) DCSSummaryMap_->setBinContent(ii+1,1,-1.0);
00102   DCSFraction_->Fill(-1.0);
00103   DCSFractionHB_->Fill(-1.0);
00104   DCSFractionHE_->Fill(-1.0);
00105   DCSFractionHO_->Fill(-1.0);
00106   DCSFractionHF_->Fill(-1.0);
00107   DCSFractionHO0_->Fill(-1.0);
00108   DCSFractionHO12_->Fill(-1.0);
00109   DCSFractionHFlumi_->Fill(-1.0);
00110 
00111   // Fill them with 1
00112 
00113   for (int ii=0;ii<7;ii++) DCSSummaryMap_->setBinContent(ii+1,1,1.0);
00114   DCSFraction_->Fill(1.0);
00115   DCSFractionHB_->Fill(1.0);
00116   DCSFractionHE_->Fill(1.0);
00117   DCSFractionHO_->Fill(1.0);
00118   DCSFractionHF_->Fill(1.0);
00119   DCSFractionHO0_->Fill(1.0);
00120   DCSFractionHO12_->Fill(1.0);
00121   DCSFractionHFlumi_->Fill(1.0);
00122 }
00123 
00124 #include "FWCore/Framework/interface/MakerMacros.h"
00125 DEFINE_FWK_MODULE(HcalDCSInfo);