CMS 3D CMS Logo

TriggerSummaryProducerAOD.h
Go to the documentation of this file.
1 #ifndef HLTcore_TriggerSummaryProducerAOD_h
2 #define HLTcore_TriggerSummaryProducerAOD_h
3 
21 
25 
31 
48 
57 
58 #include <map>
59 #include <set>
60 #include <string>
61 #include <vector>
62 
63 #include <functional>
64 #include "oneapi/tbb/concurrent_unordered_set.h"
65 #include <regex>
66 
67 namespace edm {
68  class EventSetup;
69 }
70 
71 namespace edm {
73 }
74 
75 //
76 // class declaration
77 //
78 
80 struct InputTagHash {
81  std::size_t operator()(const edm::InputTag& inputTag) const {
82  std::hash<std::string> Hash;
83  // bit-wise xor
84  return Hash(inputTag.label()) ^ Hash(inputTag.instance()) ^ Hash(inputTag.process());
85  }
86 };
88 public:
90  ~TriggerSummaryProducerAOD() override;
91  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
92  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
93  void endJob() override;
94 
95 private:
97  struct OrderInputTag {
99  OrderInputTag(bool ignoreProcess) : ignoreProcess_(ignoreProcess){};
100  inline bool operator()(const edm::InputTag& l, const edm::InputTag& r) const {
101  int c = l.label().compare(r.label());
102  if (0 == c) {
103  if (ignoreProcess_) {
104  return l.instance() < r.instance();
105  }
106  c = l.instance().compare(r.instance());
107  if (0 == c) {
108  return l.process() < r.process();
109  }
110  }
111  return c < 0;
112  };
113  };
114 
115  using ProductIDtoIndex = std::map<edm::ProductID, unsigned int>;
116  using InputTagSet = std::set<edm::InputTag, OrderInputTag>;
117  template <typename C>
120  std::vector<std::string>&,
121  trigger::Keys&,
122  const edm::Event&,
124  const InputTagSet&) const;
125 
126  template <typename T>
133 
134  template <typename C>
136  const edm::InputTag& tag,
137  const trigger::Vids&,
138  const std::vector<edm::Ref<C>>&,
139  const ProductIDtoIndex&,
141  trigger::Vids& oIds) const;
142 
143  template <typename C>
144  void fillFilterObjectMember(trigger::Keys& keys, trigger::Vids& ids, const int&, const int&, const edm::Ref<C>&) const;
146  trigger::Vids& ids,
147  const int&,
148  const int&,
151  trigger::Vids& ids,
152  const int&,
153  const int&,
156  trigger::Keys& keys, trigger::Vids& ids, const int&, const int&, const edm::Ref<reco::PFMETCollection>&) const;
158  trigger::Keys& keys, trigger::Vids& ids, const int&, const int&, const edm::Ref<reco::CaloMETCollection>&) const;
160  trigger::Keys& keys, trigger::Vids& ids, const int&, const int&, const edm::Ref<reco::METCollection>&) const;
161 
163  const bool throw_;
167  std::vector<std::regex> moduleLabelPatternsToMatch_;
168  std::vector<std::regex> moduleLabelPatternsToSkip_;
169 
171  mutable tbb::concurrent_unordered_set<edm::InputTag, InputTagHash> filterTagsGlobal_;
172 
174  mutable tbb::concurrent_unordered_set<edm::InputTag, InputTagHash> collectionTagsGlobal_;
175 
177  //trigger::TriggerObjectCollection toc_;
178  //std::vector<std::string> tags_;
180  //std::map<edm::ProductID, unsigned int> offset_;
181 
183  //trigger::Keys keys_;
185  //trigger::Vids ids_;
186 
188  //std::vector<bool> maskFilters_;
189 
220 };
221 #endif
~TriggerSummaryProducerAOD() override
edm::GetterOfProducts< l1t::TauBxCollection > getL1TTauParticleCollection_
std::vector< std::regex > moduleLabelPatternsToSkip_
edm::GetterOfProducts< l1extra::L1JetParticleCollection > getL1JetParticleCollection_
edm::GetterOfProducts< reco::IsolatedPixelTrackCandidateCollection > getIsolatedPixelTrackCandidateCollection_
std::size_t operator()(const edm::InputTag &inputTag) const
edm::GetterOfProducts< reco::RecoEcalCandidateCollection > getRecoEcalCandidateCollection_
edm::GetterOfProducts< l1t::PFTrackCollection > getL1TPFTrackCollection_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::GetterOfProducts< l1extra::L1MuonParticleCollection > getL1MuonParticleCollection_
edm::GetterOfProducts< reco::PFTauCollection > getPFTauCollection_
edm::GetterOfProducts< reco::METCollection > getMETCollection_
edm::GetterOfProducts< l1t::JetBxCollection > getL1TJetParticleCollection_
edm::GetterOfProducts< l1t::TkElectronCollection > getL1TTkElectronCollection_
tbb::concurrent_unordered_set< edm::InputTag, InputTagHash > filterTagsGlobal_
list of L3 filter tags
tbb::concurrent_unordered_set< edm::InputTag, InputTagHash > collectionTagsGlobal_
list of L3 collection tags
edm::GetterOfProducts< reco::CaloJetCollection > getCaloJetCollection_
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > getL1EtMissParticleCollection_
void fillTriggerObject(trigger::TriggerObjectCollection &, const T &) const
edm::GetterOfProducts< reco::PFJetCollection > getPFJetCollection_
const bool throw_
throw on error
void fillTriggerObjectCollections(trigger::TriggerObjectCollection &, ProductIDtoIndex &, std::vector< std::string > &, trigger::Keys &, const edm::Event &, const edm::GetterOfProducts< C > &, const InputTagSet &) const
void fillFilterObjectMember(trigger::Keys &keys, trigger::Vids &ids, const int &, const int &, const edm::Ref< C > &) const
std::set< edm::InputTag, OrderInputTag > InputTagSet
edm::GetterOfProducts< l1t::TkEmCollection > getL1TTkEmCollection_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::GetterOfProducts< reco::RecoChargedCandidateCollection > getRecoChargedCandidateCollection_
TriggerSummaryProducerAOD(const edm::ParameterSet &)
Definition: MET.h:41
edm::GetterOfProducts< l1extra::L1HFRingsCollection > getL1HFRingsCollection_
edm::GetterOfProducts< l1t::TkMuonCollection > getL1TTkMuonCollection_
void fillFilterObjectMembers(const edm::Event &, const edm::InputTag &tag, const trigger::Vids &, const std::vector< edm::Ref< C >> &, const ProductIDtoIndex &, trigger::Keys &keys, trigger::Vids &oIds) const
std::vector< std::regex > moduleLabelPatternsToMatch_
module labels which should be avoided
edm::GetterOfProducts< l1t::PFTauCollection > getL1TPFTauCollection_
std::string Hash
Definition: Types.h:43
edm::GetterOfProducts< l1t::MuonBxCollection > getL1TMuonParticleCollection_
edm::GetterOfProducts< l1t::HPSPFTauCollection > getL1THPSPFTauCollection_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
std::vector< size_type > Keys
edm::GetterOfProducts< l1t::MuonShowerBxCollection > getL1TMuonShowerParticleCollection_
edm::GetterOfProducts< reco::CaloMETCollection > getCaloMETCollection_
edm::GetterOfProducts< reco::ElectronCollection > getElectronCollection_
HLT enums.
std::map< edm::ProductID, unsigned int > ProductIDtoIndex
edm::GetterOfProducts< reco::CompositeCandidateCollection > getCompositeCandidateCollection_
edm::GetterOfProducts< trigger::TriggerFilterObjectWithRefs > getTriggerFilterObjectWithRefs_
trigger object collection
edm::GetterOfProducts< reco::PFMETCollection > getPFMETCollection_
edm::GetterOfProducts< l1t::PFJetCollection > getL1TPFJetCollection_
long double T
bool operator()(const edm::InputTag &l, const edm::InputTag &r) const
edm::GetterOfProducts< l1t::EtSumBxCollection > getL1TEtSumParticleCollection_
std::vector< int > Vids
edm::GetterOfProducts< l1extra::L1EmParticleCollection > getL1EmParticleCollection_
edm::GetterOfProducts< l1t::EGammaBxCollection > getL1TEGammaParticleCollection_