CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQMOffline/Trigger/src/HLTTauDQMOfflineSource.cc

Go to the documentation of this file.
00001 #include "DQMOffline/Trigger/interface/HLTTauDQMOfflineSource.h"
00002 
00003 using namespace std;
00004 using namespace edm;
00005 using namespace reco;
00006 using namespace l1extra;
00007 using namespace trigger;
00008 
00009 //
00010 // constructors and destructor
00011 //
00012 HLTTauDQMOfflineSource::HLTTauDQMOfflineSource( const edm::ParameterSet& ps ) :counterEvt_(0)
00013 {
00014 
00015   //Get General Monitoring Parameters
00016   config_                 = ps.getParameter<std::vector<edm::ParameterSet> >("MonitorSetup");
00017   configType_             = ps.getParameter<std::vector<std::string> >("ConfigType");
00018   doRefAnalysis_          = ps.getParameter<bool>("doMatching");
00019   NPtBins_                = ps.getUntrackedParameter<int>("PtHistoBins",20);
00020   NEtaBins_               = ps.getUntrackedParameter<int>("EtaHistoBins",25);
00021   NPhiBins_               = ps.getUntrackedParameter<int>("PhiHistoBins",32);
00022   EtMax_                  = ps.getUntrackedParameter<double>("EtHistoMax",100);
00023   L1MatchDr_              = ps.getUntrackedParameter<double>("L1MatchDeltaR",0.5);
00024   HLTMatchDr_             = ps.getUntrackedParameter<double>("HLTMatchDeltaR",0.3);
00025 
00026 
00027   refObjects_              = ps.getUntrackedParameter<std::vector<edm::InputTag> >("refObjects");
00028 
00029   prescaleEvt_            = ps.getUntrackedParameter<int>("prescaleEvt", -1);
00030 
00031 
00032 
00033   //Read The Configuration
00034   for(unsigned int i=0;i<config_.size();++i)
00035     {
00036 
00037       if(configType_[i] == "L1")
00038         {
00039           HLTTauDQML1Plotter tmp(config_[i],NPtBins_,NEtaBins_,NPhiBins_,EtMax_,doRefAnalysis_,L1MatchDr_);
00040           l1Plotters.push_back(tmp);
00041         }
00042 
00043       if(configType_[i] == "Calo")
00044         {
00045           HLTTauDQMCaloPlotter tmp(config_[i],NPtBins_,NEtaBins_,NPhiBins_,EtMax_,doRefAnalysis_,HLTMatchDr_);
00046           caloPlotters.push_back(tmp);
00047         }
00048 
00049       else if(configType_[i] == "Track")
00050         {
00051           HLTTauDQMTrkPlotter tmp(config_[i],NPtBins_,NEtaBins_,NPhiBins_,EtMax_,doRefAnalysis_,HLTMatchDr_);
00052           trackPlotters.push_back(tmp);
00053         }
00054 
00055       else if(configType_[i] == "Path")
00056         {
00057           HLTTauDQMPathPlotter tmp(config_[i],doRefAnalysis_);
00058           pathPlotters.push_back(tmp);
00059         }
00060 
00061       else if(configType_[i] == "LitePath")
00062         {
00063           HLTTauDQMLitePathPlotter tmp(config_[i],NPtBins_,NEtaBins_,NPhiBins_,EtMax_,doRefAnalysis_,HLTMatchDr_);
00064           litePathPlotters.push_back(tmp);
00065         }
00066     }
00067 }
00068 
00069 HLTTauDQMOfflineSource::~HLTTauDQMOfflineSource()
00070 {
00071    
00072   // do anything here that needs to be done at desctruction time
00073   // (e.g. close files, deallocate resources etc.)
00074   
00075 }
00076 
00077 
00078 //--------------------------------------------------------
00079 void 
00080 HLTTauDQMOfflineSource::beginJob(){
00081 
00082 }
00083 
00084 //--------------------------------------------------------
00085 void HLTTauDQMOfflineSource::beginRun(const edm::Run& r, const EventSetup& context) {
00086 
00087 }
00088 
00089 //--------------------------------------------------------
00090 void HLTTauDQMOfflineSource::beginLuminosityBlock(const LuminosityBlock& lumiSeg, 
00091                                       const EventSetup& context) {
00092   
00093 }
00094 
00095 // ----------------------------------------------------------
00096 void 
00097 HLTTauDQMOfflineSource::analyze(const Event& iEvent, const EventSetup& iSetup )
00098 {  
00099   //Apply the prescaler
00100   if(counterEvt_ > prescaleEvt_)
00101     {
00102       //Do Analysis here
00103       
00104       //Create dummy Match Collections
00105       std::vector<LVColl> refC;
00106 
00107       if(doRefAnalysis_)
00108         {
00109             for(unsigned int i=0;i<refObjects_.size();++i)
00110             {
00111               Handle<LVColl> collHandle;
00112               if(iEvent.getByLabel(refObjects_[i],collHandle))
00113                 {
00114                   refC.push_back(*collHandle);
00115                 }
00116             }
00117         }
00118 
00119 
00120 
00121       //fill the empty slots with empty collections
00122       LVColl dummy;
00123       for(int k=refC.size();k<3;k++)
00124         {
00125           refC.push_back(dummy);
00126         }
00127 
00128      
00129       
00130       //Path Plotters
00131       for(unsigned int i=0;i<pathPlotters.size();++i)
00132         pathPlotters[i].analyze(iEvent,iSetup,refC);
00133 
00134       //Lite Path Plotters
00135       for(unsigned int i=0;i<litePathPlotters.size();++i)
00136         litePathPlotters[i].analyze(iEvent,iSetup,refC);
00137 
00138       //L1  Plotters
00139       for(unsigned int i=0;i<l1Plotters.size();++i)
00140         l1Plotters[i].analyze(iEvent,iSetup,refC);
00141 
00142       //Calo Plotters
00143       for(unsigned int i=0;i<caloPlotters.size();++i)
00144         caloPlotters[i].analyze(iEvent,iSetup,refC[0]);
00145 
00146       //Track Plotters
00147       for(unsigned int i=0;i<trackPlotters.size();++i)
00148         trackPlotters[i].analyze(iEvent,iSetup,refC[0]);
00149     }
00150   else
00151       counterEvt_++;
00152 
00153 }
00154 
00155 
00156 
00157 
00158 //--------------------------------------------------------
00159 void HLTTauDQMOfflineSource::endLuminosityBlock(const LuminosityBlock& lumiSeg, 
00160                                     const EventSetup& context) {
00161 }
00162 //--------------------------------------------------------
00163 void HLTTauDQMOfflineSource::endRun(const Run& r, const EventSetup& context){
00164 }
00165 //--------------------------------------------------------
00166 void HLTTauDQMOfflineSource::endJob(){
00167   return;
00168 }
00169 
00170 
00171