CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/DQMOffline/Trigger/src/HLTTauPostProcessor.cc

Go to the documentation of this file.
00001 #include "DQMOffline/Trigger/interface/HLTTauPostProcessor.h"
00002 
00003 using namespace std;
00004 using namespace edm;
00005 
00006 HLTTauPostProcessor::HLTTauPostProcessor( const edm::ParameterSet& ps ) 
00007 {
00008     sourceModule_   = ps.getUntrackedParameter<std::string>("SourceModule");
00009     dqmBaseFolder_  = ps.getUntrackedParameter<std::string>("DQMBaseFolder");
00010     hltProcessName_ = ps.getUntrackedParameter<std::string>("HLTProcessName","HLT");
00011     L1MatchDr_      = ps.getUntrackedParameter<double>("L1MatchDeltaR",0.5);
00012     HLTMatchDr_     = ps.getUntrackedParameter<double>("HLTMatchDeltaR",0.2);
00013     runAtEndJob_    = ps.getUntrackedParameter<bool>("runAtEndJob",false);
00014     runAtEndRun_    = ps.getUntrackedParameter<bool>("runAtEndRun",true);
00015     hltMenuChanged_ = true;
00016     automation_     = HLTTauDQMAutomation(hltProcessName_, L1MatchDr_, HLTMatchDr_); 
00017     ps_             = ps;
00018 }
00019 
00020 HLTTauPostProcessor::~HLTTauPostProcessor()
00021 {
00022 }
00023 
00024 void HLTTauPostProcessor::beginJob()
00025 {
00026 }
00027 
00028 void HLTTauPostProcessor::beginRun( const edm::Run& iRun, const edm::EventSetup& iSetup )
00029 {
00030     //Evaluate configuration for every new trigger menu
00031     if ( HLTCP_.init(iRun, iSetup, hltProcessName_, hltMenuChanged_) ) {
00032         if ( hltMenuChanged_ ) {
00033             processPSet(ps_);
00034         }
00035     } else {
00036         edm::LogWarning("HLTTauPostProcessor") << "HLT config extraction failure with process name '" << hltProcessName_ << "'";
00037     }
00038 }
00039 
00040 void HLTTauPostProcessor::beginLuminosityBlock( const LuminosityBlock& lumiSeg, const EventSetup& context )
00041 {
00042 }
00043 
00044 void HLTTauPostProcessor::analyze( const Event& iEvent, const EventSetup& iSetup )
00045 {
00046 }
00047 
00048 void HLTTauPostProcessor::endLuminosityBlock( const LuminosityBlock& lumiSeg, const EventSetup& context )
00049 {
00050 }
00051 
00052 void HLTTauPostProcessor::endRun( const Run& r, const EventSetup& context )
00053 {
00054     if (runAtEndRun_) harvest();
00055 }
00056 
00057 void HLTTauPostProcessor::endJob()
00058 {
00059     if (runAtEndJob_) harvest();
00060 }
00061 
00062 void HLTTauPostProcessor::harvest()
00063 {    
00064     //Clear the plotter collection first
00065     while (!summaryPlotters_.empty()) delete summaryPlotters_.back(), summaryPlotters_.pop_back();
00066     
00067     //Read the configuration
00068     for ( unsigned int i = 0; i < setup_.size(); ++i ) {
00069         summaryPlotters_.push_back(new HLTTauDQMSummaryPlotter(setup_[i],dqmBaseFolder_));
00070     }
00071     
00072     for ( unsigned int i = 0; i < summaryPlotters_.size(); ++i ) {
00073         if (summaryPlotters_[i]->isValid()) summaryPlotters_[i]->plot();
00074     }
00075 }
00076 
00077 void HLTTauPostProcessor::processPSet( const edm::ParameterSet& pset ) {
00078     //Get parameters
00079     setup_ = pset.getParameter<std::vector<edm::ParameterSet> >("Setup");
00080     
00081     //Automatic Configuration
00082     automation_.AutoCompleteConfig( setup_, HLTCP_ );
00083 }