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::Event & event, edm::EventSetup const & setup) override;
14 
15 private:
16  unsigned int m_count; // event counter
17  unsigned int m_scale; // accept one event every m_scale, which will change dynamically
18 };
19 
21  m_count(0),
22  m_scale(1) {
23 }
24 
26 
27 void
30  desc.add<bool>("saveTags",false);
31  descriptions.add("hltDynamicPrescaler",desc);
32 }
33 
35  ++m_count;
36 
37  if (m_count % m_scale)
38  return false;
39 
40  if (m_count == m_scale * 10)
41  m_scale = m_count;
42 
43  return true;
44 }
45 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
~HLTDynamicPrescaler() override
bool filter(edm::Event &event, edm::EventSetup const &setup) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLTDynamicPrescaler(edm::ParameterSet const &configuration)
Definition: event.py:1