test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerSummaryProducerAOD.h
Go to the documentation of this file.
1 #ifndef HLTcore_TriggerSummaryProducerAOD_h
2 #define HLTcore_TriggerSummaryProducerAOD_h
3 
21 
25 
31 
48 
49 #include <map>
50 #include <set>
51 #include <string>
52 #include <vector>
53 
54 #include <functional>
55 #include "tbb/concurrent_unordered_set.h"
56 
57 namespace edm {
58  class EventSetup;
59 }
60 
61 namespace edm {
63 }
64 
65 //
66 // class declaration
67 //
68 
70 struct InputTagHash {
71  std::size_t operator()(const edm::InputTag& inputTag) const {
72  std::hash<std::string> Hash;
73  // bit-wise xor
74  return Hash(inputTag.label()) ^ Hash(inputTag.instance()) ^ Hash(inputTag.process());
75  }
76 };
79  mutable tbb::concurrent_unordered_set<edm::InputTag,InputTagHash> filterTagsGlobal_;
80  mutable tbb::concurrent_unordered_set<edm::InputTag,InputTagHash> collectionTagsGlobal_;
81 };
82 
83 class TriggerSummaryProducerAOD : public edm::stream::EDProducer<edm::GlobalCache<GlobalInputTags>> {
84 
85  public:
88  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
89  virtual void produce(edm::Event&, const edm::EventSetup&) override;
90  virtual void endStream() override;
91  static void globalEndJob(const GlobalInputTags *);
92 
93  // additional
94  static std::unique_ptr<GlobalInputTags> initializeGlobalCache(edm::ParameterSet const&) {
95  return std::unique_ptr<GlobalInputTags> (new GlobalInputTags());
96  };
97 
98  template <typename C>
100 
101  template <typename T>
102  void fillTriggerObject(const T& );
105  void fillTriggerObject(const reco::PFMET& );
106  void fillTriggerObject(const reco::CaloMET& );
107  void fillTriggerObject(const reco::MET& );
108 
109  template <typename C>
110  void fillFilterObjectMembers(const edm::Event&, const edm::InputTag& tag, const trigger::Vids &, const std::vector<edm::Ref<C> >&);
111 
112  template <typename C>
113  void fillFilterObjectMember(const int&, const int&, const edm::Ref<C>&);
114  void fillFilterObjectMember(const int&, const int&, const edm::Ref<l1extra::L1HFRingsCollection>&);
115  void fillFilterObjectMember(const int&, const int&, const edm::Ref<l1extra::L1EtMissParticleCollection>&);
116  void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::PFMETCollection>&);
117  void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::CaloMETCollection>&);
118  void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::METCollection>&);
119 
120  private:
123 
125  struct OrderInputTag {
127  OrderInputTag(bool ignoreProcess): ignoreProcess_(ignoreProcess) { };
128  inline bool operator()(const edm::InputTag& l, const edm::InputTag& r) const {
129  int c = l.label().compare(r.label());
130  if(0==c) {
131  if(ignoreProcess_) {
132  return l.instance()<r.instance();
133  }
134  c = l.instance().compare(r.instance());
135  if(0==c) {
136  return l.process()<r.process();
137  }
138  }
139  return c < 0;
140  };
141  };
142  typedef std::set<edm::InputTag,OrderInputTag> InputTagSet;
143 
147 
151 
154  std::vector<std::string> tags_;
156  std::map<edm::ProductID,unsigned int> offset_;
157 
162 
164  std::vector<bool> maskFilters_;
165 
188 };
189 #endif
virtual void produce(edm::Event &, const edm::EventSetup &) override
edm::GetterOfProducts< l1t::TauBxCollection > getL1TTauParticleCollection_
edm::GetterOfProducts< l1extra::L1JetParticleCollection > getL1JetParticleCollection_
edm::GetterOfProducts< reco::IsolatedPixelTrackCandidateCollection > getIsolatedPixelTrackCandidateCollection_
edm::GetterOfProducts< reco::RecoEcalCandidateCollection > getRecoEcalCandidateCollection_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::GetterOfProducts< l1extra::L1MuonParticleCollection > getL1MuonParticleCollection_
trigger::TriggerObjectCollection toc_
trigger object collection
edm::GetterOfProducts< reco::PFTauCollection > getPFTauCollection_
std::vector< bool > maskFilters_
packing decision
edm::GetterOfProducts< reco::METCollection > getMETCollection_
edm::GetterOfProducts< l1t::JetBxCollection > getL1TJetParticleCollection_
std::set< edm::InputTag, OrderInputTag > InputTagSet
edm::GetterOfProducts< reco::CaloJetCollection > getCaloJetCollection_
void fillFilterObjectMember(const int &, const int &, const edm::Ref< C > &)
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > getL1EtMissParticleCollection_
std::vector< std::string > tags_
edm::GetterOfProducts< reco::PFJetCollection > getPFJetCollection_
edm::GetterOfProducts< reco::RecoChargedCandidateCollection > getRecoChargedCandidateCollection_
Definition: MET.h:42
edm::GetterOfProducts< l1extra::L1HFRingsCollection > getL1HFRingsCollection_
bool operator()(const edm::InputTag &l, const edm::InputTag &r) const
std::map< edm::ProductID, unsigned int > offset_
global map for indices into toc_: offset per input L3 collection
std::string Hash
Definition: Types.h:45
void fillFilterObjectMembers(const edm::Event &, const edm::InputTag &tag, const trigger::Vids &, const std::vector< edm::Ref< C > > &)
edm::GetterOfProducts< l1t::MuonBxCollection > getL1TMuonParticleCollection_
std::size_t operator()(const edm::InputTag &inputTag) const
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
tbb::concurrent_unordered_set< edm::InputTag, InputTagHash > filterTagsGlobal_
std::vector< size_type > Keys
edm::GetterOfProducts< reco::CaloMETCollection > getCaloMETCollection_
std::string const & label() const
Definition: InputTag.h:36
std::string const & process() const
Definition: InputTag.h:40
edm::GetterOfProducts< reco::ElectronCollection > getElectronCollection_
InputTagSet collectionTagsEvent_
list of L3 collection tags
edm::GetterOfProducts< reco::CompositeCandidateCollection > getCompositeCandidateCollection_
edm::GetterOfProducts< trigger::TriggerFilterObjectWithRefs > getTriggerFilterObjectWithRefs_
edm::GetterOfProducts< reco::PFMETCollection > getPFMETCollection_
static std::unique_ptr< GlobalInputTags > initializeGlobalCache(edm::ParameterSet const &)
void fillTriggerObjectCollections(const edm::Event &, edm::GetterOfProducts< C > &)
InputTagSet filterTagsEvent_
list of L3 filter tags
TriggerSummaryProducerAOD(const edm::ParameterSet &, const GlobalInputTags *)
static void globalEndJob(const GlobalInputTags *)
long double T
tbb::concurrent_unordered_set< edm::InputTag, InputTagHash > collectionTagsGlobal_
std::string const & instance() const
Definition: InputTag.h:37
edm::GetterOfProducts< l1t::EtSumBxCollection > getL1TEtSumParticleCollection_
std::vector< int > Vids
edm::GetterOfProducts< l1extra::L1EmParticleCollection > getL1EmParticleCollection_
edm::GetterOfProducts< l1t::EGammaBxCollection > getL1TEGammaParticleCollection_