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 
23 
26  desc.add<bool>("saveTags", false);
27  descriptions.add("hltDynamicPrescaler", desc);
28 }
29 
31  ++m_count;
32 
33  if (m_count % m_scale)
34  return false;
35 
36  if (m_count == m_scale * 10)
37  m_scale = m_count;
38 
39  return true;
40 }
41 
ConfigurationDescriptions.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EDFilter.h
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTDynamicPrescaler::HLTDynamicPrescaler
HLTDynamicPrescaler(edm::ParameterSet const &configuration)
Definition: HLTDynamicPrescaler.cc:20
HLTDynamicPrescaler::m_count
unsigned int m_count
Definition: HLTDynamicPrescaler.cc:16
HLTDynamicPrescaler
Definition: HLTDynamicPrescaler.cc:8
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
HLTDynamicPrescaler::m_scale
unsigned int m_scale
Definition: HLTDynamicPrescaler.cc:17
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ctppsRawToDigi_cff.configuration
configuration
Definition: ctppsRawToDigi_cff.py:11
edm::EDFilter
Definition: EDFilter.h:38
edm::EventSetup
Definition: EventSetup.h:58
HLTDynamicPrescaler::filter
bool filter(edm::Event &event, edm::EventSetup const &setup) override
Definition: HLTDynamicPrescaler.cc:30
HLTDynamicPrescaler::~HLTDynamicPrescaler
~HLTDynamicPrescaler() override
HLTDynamicPrescaler::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HLTDynamicPrescaler.cc:24
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
Frameworkfwd.h
EventSetup.h
ParameterSet.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73