Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:18:54

0001 // -*- C++ -*-
0002 //
0003 // Package:     HLTHiggsValidator
0004 // Class:       HLTHiggsValidator
0005 //
0006 
0007 //
0008 // Jordi Duarte Campderros (based on the Jason Slaunwhite
0009 // and Jeff Klukas coded from the HLTriggerOffline/Muon package
0010 //
0011 //
0012 //
0013 
0014 // system include files
0015 //#include<memory>
0016 
0017 //#include "FWCore/Framework/interface/MakerMacros.h"
0018 
0019 #include "HLTHiggsValidator.h"
0020 #include "EVTColContainer.h"
0021 
0022 //////// Class Methods ///////////////////////////////////////////////////////
0023 // Constructor
0024 HLTHiggsValidator::HLTHiggsValidator(const edm::ParameterSet& pset)
0025     : _pset(pset), _analysisnames(pset.getParameter<std::vector<std::string> >("analyses")), _collections(nullptr) {
0026   _collections = new EVTColContainer;
0027 
0028   //pass consumes list to the helper classes
0029   for (size_t i = 0; i < _analysisnames.size(); ++i) {
0030     HLTHiggsSubAnalysis analyzer(_pset, _analysisnames.at(i), consumesCollector());
0031     _analyzers.push_back(analyzer);
0032   }
0033 }
0034 
0035 HLTHiggsValidator::~HLTHiggsValidator() {
0036   if (_collections != nullptr) {
0037     delete _collections;
0038     _collections = nullptr;
0039   }
0040 }
0041 
0042 void HLTHiggsValidator::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
0043   // Call the Plotter beginRun (which stores the triggers paths..:)
0044   for (std::vector<HLTHiggsSubAnalysis>::iterator iter = _analyzers.begin(); iter != _analyzers.end(); ++iter) {
0045     iter->beginRun(iRun, iSetup);
0046   }
0047 }
0048 
0049 void HLTHiggsValidator::bookHistograms(DQMStore::IBooker& ibooker,
0050                                        const edm::Run& iRun,
0051                                        const edm::EventSetup& iSetup) {
0052   // Call the Plotter bookHistograms (which stores the triggers paths..:)
0053   for (std::vector<HLTHiggsSubAnalysis>::iterator iter = _analyzers.begin(); iter != _analyzers.end(); ++iter) {
0054     iter->bookHistograms(ibooker);
0055   }
0056 }
0057 
0058 void HLTHiggsValidator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0059   // Initialize the event collections
0060   this->_collections->reset();
0061 
0062   for (std::vector<HLTHiggsSubAnalysis>::iterator iter = _analyzers.begin(); iter != _analyzers.end(); ++iter) {
0063     iter->analyze(iEvent, iSetup, this->_collections);
0064   }
0065 }
0066 
0067 //define this as a plug-in
0068 //DEFINE_FWK_MODULE(HLTHiggsValidator);