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 
49 
58 
59 #include <map>
60 #include <set>
61 #include <string>
62 #include <vector>
63 
64 #include <functional>
65 #include "oneapi/tbb/concurrent_unordered_set.h"
66 #include <regex>
67 
68 namespace edm {
69  class EventSetup;
70 }
71 
72 namespace edm {
74 }
75 
76 //
77 // class declaration
78 //
79 
81 struct InputTagHash {
82  std::size_t operator()(const edm::InputTag& inputTag) const {
83  std::hash<std::string> Hash;
84  // bit-wise xor
85  return Hash(inputTag.label()) ^ Hash(inputTag.instance()) ^ Hash(inputTag.process());
86  }
87 };
89 public:
91  ~TriggerSummaryProducerAOD() override;
92  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
93  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
94  void endJob() override;
95 
96 private:
98  struct OrderInputTag {
100  OrderInputTag(bool ignoreProcess) : ignoreProcess_(ignoreProcess){};
101  inline bool operator()(const edm::InputTag& l, const edm::InputTag& r) const {
102  int c = l.label().compare(r.label());
103  if (0 == c) {
104  if (ignoreProcess_) {
105  return l.instance() < r.instance();
106  }
107  c = l.instance().compare(r.instance());
108  if (0 == c) {
109  return l.process() < r.process();
110  }
111  }
112  return c < 0;
113  };
114  };
115 
116  using ProductIDtoIndex = std::map<edm::ProductID, unsigned int>;
117  using InputTagSet = std::set<edm::InputTag, OrderInputTag>;
118  template <typename C>
121  std::vector<std::string>&,
122  trigger::Keys&,
123  const edm::Event&,
125  const InputTagSet&) const;
126 
127  template <typename T>
134 
135  template <typename C>
137  const edm::InputTag& tag,
138  const trigger::Vids&,
139  const std::vector<edm::Ref<C>>&,
140  const ProductIDtoIndex&,
142  trigger::Vids& oIds) const;
143 
144  template <typename C>
145  void fillFilterObjectMember(trigger::Keys& keys, trigger::Vids& ids, const int&, const int&, const edm::Ref<C>&) const;
147  trigger::Vids& ids,
148  const int&,
149  const int&,
152  trigger::Vids& ids,
153  const int&,
154  const int&,
157  trigger::Keys& keys, trigger::Vids& ids, const int&, const int&, const edm::Ref<reco::PFMETCollection>&) const;
159  trigger::Keys& keys, trigger::Vids& ids, const int&, const int&, const edm::Ref<reco::CaloMETCollection>&) const;
161  trigger::Keys& keys, trigger::Vids& ids, const int&, const int&, const edm::Ref<reco::METCollection>&) const;
162 
164  const bool throw_;
168  std::vector<std::regex> moduleLabelPatternsToMatch_;
169  std::vector<std::regex> moduleLabelPatternsToSkip_;
170 
172  mutable tbb::concurrent_unordered_set<edm::InputTag, InputTagHash> filterTagsGlobal_;
173 
175  mutable tbb::concurrent_unordered_set<edm::InputTag, InputTagHash> collectionTagsGlobal_;
176 
178  //trigger::TriggerObjectCollection toc_;
179  //std::vector<std::string> tags_;
181  //std::map<edm::ProductID, unsigned int> offset_;
182 
184  //trigger::Keys keys_;
186  //trigger::Vids ids_;
187 
189  //std::vector<bool> maskFilters_;
190 
222 };
223 #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_
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::TrackerMuonCollection > getL1TTkMuonCollection_
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_
edm::GetterOfProducts< l1t::P2GTCandidateCollection > getL1TP2GTCandCollection_
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_