CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/HLTrigger/HLTcore/interface/TriggerSummaryProducerAOD.h

Go to the documentation of this file.
00001 #ifndef HLTcore_TriggerSummaryProducerAOD_h
00002 #define HLTcore_TriggerSummaryProducerAOD_h
00003 
00016 #include "FWCore/Framework/interface/Event.h"
00017 #include "FWCore/Framework/interface/EDProducer.h"
00018 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00019 
00020 #include "FWCore/Framework/interface/Selector.h"
00021 #include "FWCore/ServiceRegistry/interface/Service.h"
00022 #include "FWCore/Framework/interface/TriggerNamesService.h"
00023 
00024 #include "DataFormats/Common/interface/Handle.h"
00025 
00026 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00027 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00028 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
00029 
00030 #include "DataFormats/L1Trigger/interface/L1HFRingsFwd.h"
00031 #include "DataFormats/L1Trigger/interface/L1EtMissParticleFwd.h"
00032 #include "DataFormats/METReco/interface/METFwd.h"
00033 #include "DataFormats/METReco/interface/CaloMETFwd.h"
00034 
00035 
00036 #include<string>
00037 #include<vector>
00038 
00039 //
00040 // class declaration
00041 //
00042 
00043 class TriggerSummaryProducerAOD : public edm::EDProducer {
00044   
00045  public:
00046   explicit TriggerSummaryProducerAOD(const edm::ParameterSet&);
00047   ~TriggerSummaryProducerAOD();
00048   virtual void produce(edm::Event&, const edm::EventSetup&);
00049   virtual void endJob();
00050 
00051   // additional
00052 
00053   template <typename C>
00054   void fillTriggerObjectCollections(const edm::Event& );
00055 
00056   template <typename T>
00057   void fillTriggerObject(const T& );
00058   void fillTriggerObject(const l1extra::L1HFRings& );
00059   void fillTriggerObject(const l1extra::L1EtMissParticle& );
00060   void fillTriggerObject(const reco::CaloMET& );
00061   void fillTriggerObject(const reco::MET& );
00062 
00063   template <typename C>
00064     void fillFilterObjectMembers(const edm::Event&, const edm::InputTag& tag, const trigger::Vids &, const std::vector<edm::Ref<C> >&);
00065 
00066   template <typename C>
00067   void fillFilterObjectMember(const int&, const int&, const edm::Ref<C>&);
00068   void fillFilterObjectMember(const int&, const int&, const edm::Ref<l1extra::L1HFRingsCollection>&);
00069   void fillFilterObjectMember(const int&, const int&, const edm::Ref<l1extra::L1EtMissParticleCollection>&);
00070   void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::CaloMETCollection>&);
00071   void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::METCollection>&);
00072 
00073  private:
00075   std::string pn_;
00076 
00078   edm::ProcessNameSelector selector_;
00079 
00081   edm::service::TriggerNamesService* tns_;
00082 
00084   struct OrderInputTag {
00085     bool ignoreProcess_;
00086     OrderInputTag(bool ignoreProcess): ignoreProcess_(ignoreProcess) { };
00087     inline bool operator()(const edm::InputTag& l, const edm::InputTag& r) const {
00088       int c = l.label().compare(r.label());
00089       if(0==c) {
00090         if(ignoreProcess_) {
00091           return l.instance()<r.instance();
00092         }
00093         c = l.instance().compare(r.instance());
00094         if(0==c) {
00095           return l.process()<r.process();
00096         }
00097       }
00098       return c < 0;
00099     };
00100   };
00101   typedef std::set<edm::InputTag,OrderInputTag> InputTagSet;
00102 
00104   InputTagSet filterTagsEvent_;
00105   InputTagSet filterTagsGlobal_;
00106 
00108   InputTagSet collectionTagsEvent_;
00109   InputTagSet collectionTagsGlobal_;
00110 
00112   trigger::TriggerObjectCollection toc_;
00113   std::vector<std::string> tags_;
00115   std::map<edm::ProductID,unsigned int> offset_;
00116 
00118   std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs_;
00120   trigger::Keys keys_;
00122   trigger::Vids ids_;
00123 
00125   std::vector<bool> maskFilters_;
00126 
00127 };
00128 #endif