Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DQM/EcalPreshowerMonitorClient/interface/EcalPreshowerMonitorClient.h"
0002 
0003 #include "DQM/EcalPreshowerMonitorClient/interface/ESClient.h"
0004 #include "DQM/EcalPreshowerMonitorClient/interface/ESIntegrityClient.h"
0005 #include "DQM/EcalPreshowerMonitorClient/interface/ESPedestalClient.h"
0006 #include "DQM/EcalPreshowerMonitorClient/interface/ESSummaryClient.h"
0007 
0008 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0011 
0012 #include "FWCore/Framework/interface/MakerMacros.h"
0013 
0014 #include <iostream>
0015 #include <memory>
0016 #include <string>
0017 #include <vector>
0018 
0019 EcalPreshowerMonitorClient::EcalPreshowerMonitorClient(const edm::ParameterSet &ps)
0020     : debug_(ps.getUntrackedParameter<bool>("debug")), verbose_(ps.getUntrackedParameter<bool>("verbose")), clients_() {
0021   std::vector<std::string> enabledClients(ps.getUntrackedParameter<std::vector<std::string>>("enabledClients"));
0022 
0023   if (verbose_) {
0024     std::cout << " Enabled Clients:";
0025     for (unsigned int i = 0; i < enabledClients.size(); i++) {
0026       std::cout << " " << enabledClients[i];
0027     }
0028     std::cout << std::endl;
0029   }
0030 
0031   // Setup Clients
0032   if (find(enabledClients.begin(), enabledClients.end(), "Integrity") != enabledClients.end()) {
0033     clients_.push_back(new ESIntegrityClient(ps));
0034   }
0035 
0036   if (find(enabledClients.begin(), enabledClients.end(), "Pedestal") != enabledClients.end()) {
0037     clients_.push_back(new ESPedestalClient(ps));
0038   }
0039 
0040   if (find(enabledClients.begin(), enabledClients.end(), "Summary") != enabledClients.end()) {
0041     clients_.push_back(new ESSummaryClient(ps));
0042   }
0043 }
0044 
0045 EcalPreshowerMonitorClient::~EcalPreshowerMonitorClient() {
0046   if (verbose_)
0047     std::cout << "Finish EcalPreshowerMonitorClient" << std::endl;
0048 
0049   for (unsigned int i = 0; i < clients_.size(); i++) {
0050     delete clients_[i];
0051   }
0052 }
0053 
0054 /*static*/
0055 void EcalPreshowerMonitorClient::fillDescriptions(edm::ConfigurationDescriptions &_descs) {
0056   edm::ParameterSetDescription desc;
0057 
0058   std::vector<std::string> clientsDefault;
0059   clientsDefault.push_back("Integrity");
0060   clientsDefault.push_back("Pedestal");
0061   clientsDefault.push_back("Summary");
0062   desc.addUntracked<std::vector<std::string>>("enabledClients", clientsDefault);
0063   desc.addUntracked<edm::FileInPath>("LookupTable");
0064   desc.addUntracked<std::string>("prefixME", "EcalPreshower");
0065   desc.addUntracked<bool>("fitPedestal", true);
0066   desc.addUntracked<bool>("cloneME", true);
0067   desc.addUntracked<bool>("verbose", false);
0068   desc.addUntracked<bool>("debug", false);
0069 
0070   _descs.addDefault(desc);
0071 }
0072 
0073 void EcalPreshowerMonitorClient::dqmEndJob(DQMStore::IBooker &_ibooker, DQMStore::IGetter &_igetter) {
0074   if (debug_) {
0075     std::cout << "EcalPreshowerMonitorClient: endJob" << std::endl;
0076   }
0077 
0078   for (unsigned int i = 0; i < clients_.size(); i++) {
0079     clients_[i]->setup(_ibooker);
0080     clients_[i]->endJobAnalyze(_igetter);
0081   }
0082 }
0083 
0084 void EcalPreshowerMonitorClient::dqmEndLuminosityBlock(DQMStore::IBooker &_ibooker,
0085                                                        DQMStore::IGetter &_igetter,
0086                                                        const edm::LuminosityBlock &,
0087                                                        const edm::EventSetup &) {
0088   for (unsigned int i = 0; i < clients_.size(); i++) {
0089     clients_[i]->setup(_ibooker);
0090     clients_[i]->endLumiAnalyze(_igetter);
0091   }
0092 }
0093 
0094 // define this as a plug-in
0095 DEFINE_FWK_MODULE(EcalPreshowerMonitorClient);