Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:23

0001 #include <iostream>
0002 
0003 #include "FWCore/ServiceRegistry/interface/Service.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include "FWCore/Framework/interface/MakerMacros.h"
0006 #include "FWCore/Framework/interface/Frameworkfwd.h"
0007 
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 #include "FWCore/Framework/interface/EventSetup.h"
0010 
0011 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0012 
0013 #include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
0014 #include "CondFormats/RunInfo/interface/RunSummary.h"
0015 #include "CondFormats/RunInfo/interface/RunInfo.h"
0016 
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 
0019 #include "DQM/EcalPreshowerMonitorModule/interface/ESDataCertificationTask.h"
0020 
0021 using namespace cms;
0022 using namespace edm;
0023 using namespace std;
0024 
0025 ESDataCertificationTask::ESDataCertificationTask(const ParameterSet& ps) {
0026   usesResource("DQMStore");
0027   dqmStore_ = Service<DQMStore>().operator->();
0028 
0029   prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
0030 
0031   mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
0032 
0033   meESDataCertificationSummary_ = nullptr;
0034   meESDataCertificationSummaryMap_ = nullptr;
0035 }
0036 
0037 ESDataCertificationTask::~ESDataCertificationTask() {}
0038 
0039 void ESDataCertificationTask::beginJob(void) {
0040   char histo[200];
0041 
0042   if (dqmStore_) {
0043     dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
0044 
0045     sprintf(histo, "CertificationSummary");
0046     meESDataCertificationSummary_ = dqmStore_->bookFloat(histo);
0047     meESDataCertificationSummary_->Fill(0.0);
0048 
0049     sprintf(histo, "CertificationSummaryMap");
0050     meESDataCertificationSummaryMap_ = dqmStore_->book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
0051     meESDataCertificationSummaryMap_->setAxisTitle("X", 1);
0052     meESDataCertificationSummaryMap_->setAxisTitle("Y", 2);
0053   }
0054 }
0055 
0056 void ESDataCertificationTask::endJob(void) {}
0057 
0058 void ESDataCertificationTask::beginLuminosityBlock(const edm::LuminosityBlock& lumiBlock,
0059                                                    const edm::EventSetup& iSetup) {
0060   this->reset();
0061 }
0062 
0063 void ESDataCertificationTask::endLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) {}
0064 
0065 void ESDataCertificationTask::reset(void) {
0066   if (meESDataCertificationSummary_)
0067     meESDataCertificationSummary_->Reset();
0068 
0069   if (meESDataCertificationSummaryMap_)
0070     meESDataCertificationSummaryMap_->Reset();
0071 }
0072 
0073 void ESDataCertificationTask::analyze(const Event& e, const EventSetup& c) {}
0074 
0075 DEFINE_FWK_MODULE(ESDataCertificationTask);