CMS 3D CMS Logo

HLTDynamicPrescaler.cc
Go to the documentation of this file.
7 
9 public:
11  ~HLTDynamicPrescaler() override;
12  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
13  bool filter(edm::StreamID, edm::Event& event, edm::EventSetup const& setup) const override;
14 
15 private:
16  mutable std::atomic<unsigned int> m_count; // event counter
17 };
18 
20 
22 
25  desc.add<bool>("saveTags", false);
26  descriptions.add("hltDynamicPrescaler", desc);
27 }
28 
30  auto count = ++m_count;
31 
32  unsigned int dynamicScale = 1;
33  while (count > dynamicScale * 10) {
34  dynamicScale *= 10;
35  }
36 
37  return (0 == count % dynamicScale);
38 }
39 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::atomic< unsigned int > m_count
~HLTDynamicPrescaler() override
bool filter(edm::StreamID, edm::Event &event, edm::EventSetup const &setup) const override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLTDynamicPrescaler(edm::ParameterSet const &configuration)
Definition: event.py:1