CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DQMOffline/Trigger/src/HLTTauCertifier.cc

Go to the documentation of this file.
00001 #include "DQMOffline/Trigger/interface/HLTTauCertifier.h"
00002 
00003 using namespace std;
00004 using namespace edm;
00005 
00006 //
00007 // constructors and destructor
00008 //
00009 HLTTauCertifier::HLTTauCertifier( const edm::ParameterSet& ps )
00010 {
00011   targetFolder_       = ps.getParameter<string>("targetDir");
00012   targetME_           = ps.getParameter<string>("targetME");
00013   inputMEs_           = ps.getParameter<vector<string> >("inputMEs");
00014   setBadRunOnWarnings_ = ps.getParameter<bool>("setBadRunOnWarnings");
00015   setBadRunOnErrors_   = ps.getParameter<bool>("setBadRunOnErrors");
00016 
00017    dbe_ = &*edm::Service<DQMStore>();
00018 
00019 }
00020 
00021 HLTTauCertifier::~HLTTauCertifier()
00022 {
00023    
00024   // do anything here that needs to be done at desctruction time
00025   // (e.g. close files, deallocate resources etc.)
00026   
00027 }
00028 
00029 
00030 //--------------------------------------------------------
00031 void 
00032 HLTTauCertifier::beginJob(){
00033 
00034 }
00035 
00036 //--------------------------------------------------------
00037 void HLTTauCertifier::beginRun(const edm::Run& r, const EventSetup& context) {
00038 
00039 }
00040 
00041 //--------------------------------------------------------
00042 void HLTTauCertifier::beginLuminosityBlock(const LuminosityBlock& lumiSeg, 
00043                                       const EventSetup& context) {
00044   
00045 }
00046 
00047 // ----------------------------------------------------------
00048 void 
00049 HLTTauCertifier::analyze(const Event& iEvent, const EventSetup& iSetup )
00050 {  
00051 
00052 }
00053 
00054 
00055 
00056 
00057 //--------------------------------------------------------
00058 void HLTTauCertifier::endLuminosityBlock(const LuminosityBlock& lumiSeg, 
00059                                     const EventSetup& context) {
00060 }
00061 //--------------------------------------------------------
00062 void HLTTauCertifier::endRun(const Run& r, const EventSetup& context){
00063   if(dbe_) {
00064     int warnings=0;
00065     int errors=0;
00066     double response=1.0;
00067     
00068     for(unsigned int i=0;i<inputMEs_.size();++i)
00069       {
00070         MonitorElement *monElement = dbe_->get(inputMEs_.at(i));
00071         if(monElement)
00072           {
00073             warnings+=monElement->getQWarnings().size();
00074             errors+=monElement->getQErrors().size();
00075           }
00076       }
00077     if(setBadRunOnWarnings_ && warnings>0) 
00078       response=0.0;
00079 
00080     if(setBadRunOnErrors_ && errors>0) 
00081       response=0.0;
00082 
00083     //OK SAVE THE FINAL RESULT  
00084     dbe_->setCurrentFolder(targetFolder_);
00085     MonitorElement *certME = dbe_->bookFloat(targetME_);
00086     certME->Fill(response);
00087   }
00088 
00089 }
00090 //--------------------------------------------------------
00091 void HLTTauCertifier::endJob(){
00092   return;
00093 }
00094 
00095 
00096