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 
30 
46 
47 #include <map>
48 #include <set>
49 #include <string>
50 #include <vector>
51 
52 #include <functional>
53 #include "tbb/concurrent_unordered_set.h"
54 
55 namespace edm {
56  class EventSetup;
57 }
58 
59 namespace edm {
61 }
62 
63 //
64 // class declaration
65 //
66 
68 struct InputTagHash {
69  std::size_t operator()(const edm::InputTag& inputTag) const {
70  std::hash<std::string> Hash;
71  // bit-wise xor
72  return Hash(inputTag.label()) ^ Hash(inputTag.instance()) ^ Hash(inputTag.process());
73  }
74 };
77  mutable tbb::concurrent_unordered_set<edm::InputTag,InputTagHash> filterTagsGlobal_;
78  mutable tbb::concurrent_unordered_set<edm::InputTag,InputTagHash> collectionTagsGlobal_;
79 };
80 
81 class TriggerSummaryProducerAOD : public edm::stream::EDProducer<edm::GlobalCache<GlobalInputTags>> {
82 
83  public:
86  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
87  virtual void produce(edm::Event&, const edm::EventSetup&) override;
88  virtual void endStream() override;
89  static void globalEndJob(const GlobalInputTags *);
90 
91  // additional
92  static std::unique_ptr<GlobalInputTags> initializeGlobalCache(edm::ParameterSet const&) {
93  return std::unique_ptr<GlobalInputTags> (new GlobalInputTags());
94  };
95 
96  template <typename C>
98 
99  template <typename T>
100  void fillTriggerObject(const T& );
103  void fillTriggerObject(const reco::CaloMET& );
104  void fillTriggerObject(const reco::MET& );
105 
106  template <typename C>
107  void fillFilterObjectMembers(const edm::Event&, const edm::InputTag& tag, const trigger::Vids &, const std::vector<edm::Ref<C> >&);
108 
109  template <typename C>
110  void fillFilterObjectMember(const int&, const int&, const edm::Ref<C>&);
111  void fillFilterObjectMember(const int&, const int&, const edm::Ref<l1extra::L1HFRingsCollection>&);
112  void fillFilterObjectMember(const int&, const int&, const edm::Ref<l1extra::L1EtMissParticleCollection>&);
113  void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::CaloMETCollection>&);
114  void fillFilterObjectMember(const int&, const int&, const edm::Ref<reco::METCollection>&);
115 
116  private:
119 
121  struct OrderInputTag {
123  OrderInputTag(bool ignoreProcess): ignoreProcess_(ignoreProcess) { };
124  inline bool operator()(const edm::InputTag& l, const edm::InputTag& r) const {
125  int c = l.label().compare(r.label());
126  if(0==c) {
127  if(ignoreProcess_) {
128  return l.instance()<r.instance();
129  }
130  c = l.instance().compare(r.instance());
131  if(0==c) {
132  return l.process()<r.process();
133  }
134  }
135  return c < 0;
136  };
137  };
138  typedef std::set<edm::InputTag,OrderInputTag> InputTagSet;
139 
143 
147 
150  std::vector<std::string> tags_;
152  std::map<edm::ProductID,unsigned int> offset_;
153 
158 
160  std::vector<bool> maskFilters_;
161 
178 };
179 #endif
virtual void produce(edm::Event &, const edm::EventSetup &) override
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_
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:43
void fillFilterObjectMembers(const edm::Event &, const edm::InputTag &tag, const trigger::Vids &, const std::vector< edm::Ref< C > > &)
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:42
std::string const & process() const
Definition: InputTag.h:46
edm::GetterOfProducts< reco::ElectronCollection > getElectronCollection_
InputTagSet collectionTagsEvent_
list of L3 collection tags
edm::GetterOfProducts< reco::CompositeCandidateCollection > getCompositeCandidateCollection_
edm::GetterOfProducts< trigger::TriggerFilterObjectWithRefs > getTriggerFilterObjectWithRefs_
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:43
std::vector< int > Vids
edm::GetterOfProducts< l1extra::L1EmParticleCollection > getL1EmParticleCollection_