CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/PhysicsTools/PatAlgos/plugins/PATTriggerProducer.h

Go to the documentation of this file.
00001 #ifndef PhysicsTools_PatAlgos_PATTriggerProducer_h
00002 #define PhysicsTools_PatAlgos_PATTriggerProducer_h
00003 
00004 
00005 // -*- C++ -*-
00006 //
00007 // Package:    PatAlgos
00008 // Class:      pat::PATTriggerProducer
00009 //
00010 // $Id: PATTriggerProducer.h,v 1.17.4.2 2012/09/11 22:21:47 vadler Exp $
00011 //
00040 #include "FWCore/Framework/interface/Frameworkfwd.h"
00041 #include "FWCore/Framework/interface/EDProducer.h"
00042 
00043 #include <string>
00044 
00045 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00046 #include "FWCore/Utilities/interface/InputTag.h"
00047 
00048 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h"
00049 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00050 
00051 namespace pat {
00052 
00053   class PATTriggerProducer : public edm::EDProducer {
00054 
00055     public:
00056 
00057       explicit PATTriggerProducer( const edm::ParameterSet & iConfig );
00058       ~PATTriggerProducer() {};
00059 
00060     private:
00061 
00062       virtual void beginRun( edm::Run & iRun, const edm::EventSetup & iSetup );
00063       virtual void beginLuminosityBlock( edm::LuminosityBlock & iLuminosityBlock, const edm::EventSetup & iSetup );
00064       virtual void produce( edm::Event & iEvent, const edm::EventSetup & iSetup );
00065 
00066       std::string nameProcess_;     // configuration
00067       bool        autoProcessName_;
00068       bool        onlyStandAlone_;  // configuration
00069       bool        firstInRun_;
00070       // L1
00071       L1GtUtils           l1GtUtils_;
00072       edm::ParameterSet * l1PSet_;
00073       bool                addL1Algos_;                    // configuration (optional with default)
00074       edm::InputTag       tagL1GlobalTriggerObjectMaps_;  // configuration (optional with default)
00075       edm::InputTag       tagL1ExtraMu_;                  // configuration (optional)
00076       edm::InputTag       tagL1ExtraNoIsoEG_;             // configuration (optional)
00077       edm::InputTag       tagL1ExtraIsoEG_;               // configuration (optional)
00078       edm::InputTag       tagL1ExtraCenJet_;              // configuration (optional)
00079       edm::InputTag       tagL1ExtraForJet_;              // configuration (optional)
00080       edm::InputTag       tagL1ExtraTauJet_;              // configuration (optional)
00081       edm::InputTag       tagL1ExtraETM_;                 // configuration (optional)
00082       edm::InputTag       tagL1ExtraHTM_;                 // configuration (optional)
00083       bool                autoProcessNameL1ExtraMu_;
00084       bool                autoProcessNameL1ExtraNoIsoEG_;
00085       bool                autoProcessNameL1ExtraIsoEG_;
00086       bool                autoProcessNameL1ExtraCenJet_;
00087       bool                autoProcessNameL1ExtraForJet_;
00088       bool                autoProcessNameL1ExtraTauJet_;
00089       bool                autoProcessNameL1ExtraETM_;
00090       bool                autoProcessNameL1ExtraHTM_;
00091       bool                mainBxOnly_;                    // configuration (optional with default)
00092       bool                saveL1Refs_;                    // configuration (optional with default)
00093       // HLT
00094       HLTConfigProvider         hltConfig_;
00095       bool                      hltConfigInit_;
00096       edm::InputTag             tagTriggerResults_;     // configuration (optional with default)
00097       edm::InputTag             tagTriggerEvent_;       // configuration (optional with default)
00098       std::string               hltPrescaleLabel_;      // configuration (optional)
00099       std::string               labelHltPrescaleTable_; // configuration (optional)
00100       trigger::HLTPrescaleTable hltPrescaleTableRun_;
00101       trigger::HLTPrescaleTable hltPrescaleTableLumi_;
00102       bool                       addPathModuleLabels_;  // configuration (optional with default)
00103       std::vector< std::string > exludeCollections_;    // configuration (optional)
00104 
00105       class ModuleLabelToPathAndFlags {
00106           public:
00107               struct PathAndFlags {
00108                 PathAndFlags(const std::string &name, unsigned int index, bool last, bool l3) : pathName(name), pathIndex(index), lastFilter(last), l3Filter(l3) {}
00109                 PathAndFlags() {}
00110                 std::string pathName;
00111                 unsigned int pathIndex;
00112                 bool lastFilter;
00113                 bool l3Filter;
00114               };
00115               void init(const HLTConfigProvider &conf) ;
00116               void clear() { map_.clear(); }
00117               const std::vector<PathAndFlags> & operator[](const std::string & filter) const {
00118                   std::map<std::string,std::vector<PathAndFlags> >::const_iterator it = map_.find(filter);
00119                   return (it == map_.end() ? empty_ : it->second);
00120               }
00121           private:
00122               void insert(const std::string & filter, const std::string &path, unsigned int pathIndex, bool lastFilter, bool l3Filter) {
00123                   map_[filter].push_back(PathAndFlags(path, pathIndex, lastFilter, l3Filter));
00124               }
00125               std::map<std::string,std::vector<PathAndFlags> > map_;
00126               const std::vector<PathAndFlags> empty_;
00127       };
00128       ModuleLabelToPathAndFlags moduleLabelToPathAndFlags_;
00129 
00130   };
00131 }
00132 
00133 
00134 #endif