Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-18 22:46:53

0001 #include "DQMOffline/Trigger/interface/HLTTauCertifier.h"
0002 
0003 using namespace std;
0004 using namespace edm;
0005 
0006 //
0007 // constructors and destructor
0008 //
0009 HLTTauCertifier::HLTTauCertifier(const edm::ParameterSet &ps) {
0010   targetFolder_ = ps.getParameter<string>("targetDir");
0011   targetME_ = ps.getParameter<string>("targetME");
0012   inputMEs_ = ps.getParameter<vector<string> >("inputMEs");
0013   setBadRunOnWarnings_ = ps.getParameter<bool>("setBadRunOnWarnings");
0014   setBadRunOnErrors_ = ps.getParameter<bool>("setBadRunOnErrors");
0015 }
0016 
0017 HLTTauCertifier::~HLTTauCertifier() = default;
0018 
0019 //--------------------------------------------------------
0020 void HLTTauCertifier::dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) {
0021   int warnings = 0;
0022   int errors = 0;
0023   double response = 1.0;
0024 
0025   for (auto const &inputME : inputMEs_) {
0026     MonitorElement *monElement = iGetter.get(inputME);
0027     if (monElement) {
0028       warnings += monElement->getQWarnings().size();
0029       errors += monElement->getQErrors().size();
0030     }
0031   }
0032   if (setBadRunOnWarnings_ && warnings > 0)
0033     response = 0.0;
0034 
0035   if (setBadRunOnErrors_ && errors > 0)
0036     response = 0.0;
0037 
0038   //OK SAVE THE FINAL RESULT
0039   iBooker.setCurrentFolder(targetFolder_);
0040   MonitorElement *certME = iBooker.bookFloat(targetME_);
0041   certME->Fill(response);
0042 }
0043 
0044 #include "FWCore/Framework/interface/MakerMacros.h"
0045 DEFINE_FWK_MODULE(HLTTauCertifier);