Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
FWCore
Modules
src
Prescaler.cc
Go to the documentation of this file.
1
2
#include "
FWCore/Framework/interface/EDFilter.h
"
3
#include "
FWCore/Framework/interface/MakerMacros.h
"
4
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
7
8
namespace
edm {
9
class
Prescaler
:
public
EDFilter
{
10
public
:
11
explicit
Prescaler
(
ParameterSet
const
&);
12
virtual
~Prescaler
();
13
14
static
void
fillDescriptions
(
ConfigurationDescriptions
& descriptions);
15
virtual
bool
filter
(
Event
&
e
,
EventSetup
const
&
c
);
16
void
endJob
();
17
18
private
:
19
int
count_
;
20
int
n_
;
// accept one in n
21
int
offset_
;
// with offset, ie. sequence of events does not have to start at first event
22
};
23
24
Prescaler::Prescaler
(
ParameterSet
const
& ps) :
25
count_(),
26
n_(ps.getParameter<int>(
"prescaleFactor"
)),
27
offset_(ps.getParameter<int>(
"prescaleOffset"
)) {
28
}
29
30
Prescaler::~Prescaler
() {
31
}
32
33
bool
Prescaler::filter
(
Event
&,
EventSetup
const
&) {
34
++
count_
;
35
return
count_
%
n_
==
offset_
?
true
:
false
;
36
}
37
38
void
Prescaler::endJob
() {
39
}
40
41
void
42
Prescaler::fillDescriptions
(
ConfigurationDescriptions
& descriptions) {
43
ParameterSetDescription
desc;
44
desc.
add
<
int
>(
"prescaleFactor"
);
45
desc.
add
<
int
>(
"prescaleOffset"
);
46
descriptions.
add
(
"preScaler"
, desc);
47
}
48
}
49
50
using
edm::Prescaler
;
51
DEFINE_FWK_MODULE
(
Prescaler
);
edm::Prescaler::Prescaler
Prescaler(ParameterSet const &)
Definition:
Prescaler.cc:24
edm::Prescaler::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition:
Prescaler.cc:42
edm::Prescaler::n_
int n_
Definition:
Prescaler.cc:20
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
edm::Prescaler::~Prescaler
virtual ~Prescaler()
Definition:
Prescaler.cc:30
MakerMacros.h
edm::Prescaler::endJob
void endJob()
Definition:
Prescaler.cc:38
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:50
ParameterSet.h
edm::Prescaler
Definition:
Prescaler.cc:9
edm::Prescaler::filter
virtual bool filter(Event &e, EventSetup const &c)
Definition:
Prescaler.cc:33
ParameterSetDescription.h
EDFilter.h
edm::Prescaler::offset_
int offset_
Definition:
Prescaler.cc:21
edm::EventSetup
Definition:
EventSetup.h:44
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition:
ParameterSetDescription.h:89
edm::EDFilter
Definition:
EDFilter.h:24
edm::Prescaler::count_
int count_
Definition:
Prescaler.cc:19
trackerHits.c
tuple c
Definition:
trackerHits.py:26
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:65
alignCSCRings.e
list e
Definition:
alignCSCRings.py:90
edm::ParameterSet
Definition:
ParameterSet.h:35
ConfigurationDescriptions.h
edm::Event
Definition:
Event.h:50
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:27
Generated for CMSSW Reference Manual by
1.8.5