CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/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/Framework/interface/GetterOfProducts.h"
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020 #include "FWCore/Utilities/interface/InputTag.h"
00021 #include "DataFormats/Common/interface/Ref.h"
00022 #include "DataFormats/Provenance/interface/ProductID.h"
00023 
00024 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00025 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00026 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
00027 
00028 #include "DataFormats/L1Trigger/interface/L1HFRingsFwd.h"
00029 #include "DataFormats/L1Trigger/interface/L1EtMissParticleFwd.h"
00030 #include "DataFormats/METReco/interface/METFwd.h"
00031 #include "DataFormats/METReco/interface/CaloMETFwd.h"
00032 
00033 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h"
00034 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
00035 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
00036 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00037 #include "DataFormats/Candidate/interface/CompositeCandidateFwd.h"
00038 #include "DataFormats/METReco/interface/METCollection.h"
00039 #include "DataFormats/METReco/interface/CaloMETCollection.h"
00040 #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h"
00041 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
00042 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
00043 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
00044 #include "DataFormats/L1Trigger/interface/L1EtMissParticleFwd.h"
00045 #include "DataFormats/L1Trigger/interface/L1HFRingsFwd.h"
00046 #include "DataFormats/JetReco/interface/PFJetCollection.h"
00047 #include "DataFormats/TauReco/interface/PFTauFwd.h"
00048 
00049 #include <map>
00050 #include <set>
00051 #include <string>
00052 #include <vector>
00053 
00054 namespace edm {
00055   class EventSetup;
00056 }
00057 
00058 //
00059 // class declaration
00060 //
00061 
00062 class TriggerSummaryProducerAOD : public edm::EDProducer {
00063   
00064  public:
00065   explicit TriggerSummaryProducerAOD(const edm::ParameterSet&);
00066   ~TriggerSummaryProducerAOD();
00067   virtual void produce(edm::Event&, const edm::EventSetup&);
00068   virtual void endJob();
00069 
00070   // additional
00071 
00072   template <typename C>
00073   void fillTriggerObjectCollections(const edm::Event&, edm::GetterOfProducts<C>& );
00074 
00075   template <typename T>
00076   void fillTriggerObject(const T& );
00077   void fillTriggerObject(const l1extra::L1HFRings& );
00078   void fillTriggerObject(const l1extra::L1EtMissParticle& );
00079   void fillTriggerObject(const reco::CaloMET& );
00080   void fillTriggerObject(const reco::MET& );
00081 
00082   template <typename C>
00083     void fillFilterObjectMembers(const edm::Event&, const edm::InputTag& tag, const trigger::Vids &, const std::vector<edm::Ref<C> >&);
00084 
00085   template <typename C>
00086   void fillFilterObjectMember(const int&, const int&, const edm::Ref<C>&);
00087   void fillFilterObjectMember(const int&, const int&, const edm::Ref<l1extra::L1HFRingsCollection>&);
00088   void fillFilterObjectMember(const int&, const int&, const edm::Ref<l1extra::L1EtMissParticleCollection>&);
00089   void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::CaloMETCollection>&);
00090   void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::METCollection>&);
00091 
00092  private:
00094   std::string pn_;
00095 
00097   struct OrderInputTag {
00098     bool ignoreProcess_;
00099     OrderInputTag(bool ignoreProcess): ignoreProcess_(ignoreProcess) { };
00100     inline bool operator()(const edm::InputTag& l, const edm::InputTag& r) const {
00101       int c = l.label().compare(r.label());
00102       if(0==c) {
00103         if(ignoreProcess_) {
00104           return l.instance()<r.instance();
00105         }
00106         c = l.instance().compare(r.instance());
00107         if(0==c) {
00108           return l.process()<r.process();
00109         }
00110       }
00111       return c < 0;
00112     };
00113   };
00114   typedef std::set<edm::InputTag,OrderInputTag> InputTagSet;
00115 
00117   InputTagSet filterTagsEvent_;
00118   InputTagSet filterTagsGlobal_;
00119 
00121   InputTagSet collectionTagsEvent_;
00122   InputTagSet collectionTagsGlobal_;
00123 
00125   trigger::TriggerObjectCollection toc_;
00126   std::vector<std::string> tags_;
00128   std::map<edm::ProductID,unsigned int> offset_;
00129 
00131   trigger::Keys keys_;
00133   trigger::Vids ids_;
00134 
00136   std::vector<bool> maskFilters_;
00137 
00138   edm::GetterOfProducts<trigger::TriggerFilterObjectWithRefs> getTriggerFilterObjectWithRefs_;
00139   edm::GetterOfProducts<reco::RecoEcalCandidateCollection> getRecoEcalCandidateCollection_;
00140   edm::GetterOfProducts<reco::ElectronCollection> getElectronCollection_;
00141   edm::GetterOfProducts<reco::RecoChargedCandidateCollection> getRecoChargedCandidateCollection_;
00142   edm::GetterOfProducts<reco::CaloJetCollection> getCaloJetCollection_;
00143   edm::GetterOfProducts<reco::CompositeCandidateCollection> getCompositeCandidateCollection_;
00144   edm::GetterOfProducts<reco::METCollection> getMETCollection_;
00145   edm::GetterOfProducts<reco::CaloMETCollection> getCaloMETCollection_;
00146   edm::GetterOfProducts<reco::IsolatedPixelTrackCandidateCollection> getIsolatedPixelTrackCandidateCollection_;
00147   edm::GetterOfProducts<l1extra::L1EmParticleCollection> getL1EmParticleCollection_;
00148   edm::GetterOfProducts<l1extra::L1MuonParticleCollection> getL1MuonParticleCollection_;
00149   edm::GetterOfProducts<l1extra::L1JetParticleCollection> getL1JetParticleCollection_;
00150   edm::GetterOfProducts<l1extra::L1EtMissParticleCollection> getL1EtMissParticleCollection_;
00151   edm::GetterOfProducts<l1extra::L1HFRingsCollection> getL1HFRingsCollection_;
00152   edm::GetterOfProducts<reco::PFJetCollection> getPFJetCollection_;
00153   edm::GetterOfProducts<reco::PFTauCollection> getPFTauCollection_;
00154 };
00155 #endif