CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DQM/EcalPreshowerMonitorModule/src/ESDataCertificationTask.cc

Go to the documentation of this file.
00001 #include <iostream>
00002 
00003 #include "FWCore/ServiceRegistry/interface/Service.h"
00004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00005 #include "FWCore/Framework/interface/MakerMacros.h"
00006 #include "FWCore/Framework/interface/Frameworkfwd.h"
00007 
00008 #include "FWCore/Framework/interface/ESHandle.h"
00009 #include "FWCore/Framework/interface/EventSetup.h"
00010 
00011 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00012 
00013 #include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
00014 #include "CondFormats/RunInfo/interface/RunSummary.h"
00015 #include "CondFormats/RunInfo/interface/RunInfo.h"
00016 
00017 #include "DQMServices/Core/interface/MonitorElement.h"
00018 #include "DQMServices/Core/interface/DQMStore.h"
00019 
00020 #include "DQM/EcalPreshowerMonitorModule/interface/ESDataCertificationTask.h"
00021 
00022 using namespace cms;
00023 using namespace edm;
00024 using namespace std;
00025 
00026 ESDataCertificationTask::ESDataCertificationTask(const ParameterSet& ps) {
00027 
00028   dqmStore_ = Service<DQMStore>().operator->();
00029 
00030   prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
00031 
00032   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00033 
00034   mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
00035 
00036   meESDataCertificationSummary_ = 0;
00037   meESDataCertificationSummaryMap_ = 0;
00038 
00039 }
00040 
00041 ESDataCertificationTask::~ESDataCertificationTask() {
00042 
00043 }
00044 
00045 void ESDataCertificationTask::beginJob(void) {
00046 
00047   char histo[200];
00048   
00049   if ( dqmStore_ ) {
00050 
00051     dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
00052     
00053     sprintf(histo, "CertificationSummary");
00054     meESDataCertificationSummary_ = dqmStore_->bookFloat(histo);
00055     meESDataCertificationSummary_->Fill(0.0);
00056 
00057     sprintf(histo, "CertificationSummaryMap");
00058     meESDataCertificationSummaryMap_ = dqmStore_->book2D(histo,histo, 40, 0., 40., 40, 0., 40.);
00059     meESDataCertificationSummaryMap_->setAxisTitle("X", 1);
00060     meESDataCertificationSummaryMap_->setAxisTitle("Y", 2);
00061     
00062   }
00063 
00064 }
00065 
00066 void ESDataCertificationTask::endJob(void) {
00067 
00068   if ( enableCleanup_ ) this->cleanup();
00069 
00070 }
00071 
00072 void ESDataCertificationTask::beginLuminosityBlock(const edm::LuminosityBlock& lumiBlock, const  edm::EventSetup& iSetup){
00073 
00074   this->reset();
00075 
00076 }
00077 
00078 void ESDataCertificationTask::endLuminosityBlock(const edm::LuminosityBlock&  lumiBlock, const  edm::EventSetup& iSetup) {
00079 
00080 }
00081 
00082 void ESDataCertificationTask::reset(void) {
00083 
00084   if ( meESDataCertificationSummary_ ) meESDataCertificationSummary_->Reset();
00085 
00086   if ( meESDataCertificationSummaryMap_ ) meESDataCertificationSummaryMap_->Reset();
00087   
00088 }
00089 
00090 
00091 void ESDataCertificationTask::cleanup(void){
00092   
00093   if ( dqmStore_ ) {
00094 
00095     dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
00096     
00097     if ( meESDataCertificationSummary_ ) dqmStore_->removeElement( meESDataCertificationSummary_->getName() );
00098 
00099     if ( meESDataCertificationSummaryMap_ ) dqmStore_->removeElement( meESDataCertificationSummaryMap_->getName() );
00100 
00101   }
00102 
00103 }
00104 
00105 void ESDataCertificationTask::analyze(const Event& e, const EventSetup& c){ 
00106 
00107 }
00108 
00109 DEFINE_FWK_MODULE(ESDataCertificationTask);