CommonTools
UtilAlgos
plugins
StopAfterNEvents.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/EDFilter.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
3
4
class
StopAfterNEvents
:
public
edm::EDFilter
{
5
public
:
6
StopAfterNEvents
(
const
edm::ParameterSet
&);
7
~StopAfterNEvents
()
override
;
8
9
private
:
10
bool
filter
(
edm::Event
&,
edm::EventSetup
const
&)
override
;
11
const
int
nMax_
;
12
int
n_
;
13
const
bool
verbose_
;
14
};
15
16
#include <iostream>
17
18
using namespace
std
;
19
using namespace
edm
;
20
21
StopAfterNEvents::StopAfterNEvents
(
const
ParameterSet
&
pset
)
22
: nMax_(
pset
.getParameter<
int
>(
"maxEvents"
)), n_(0), verbose_(
pset
.getUntrackedParameter<
bool
>(
"verbose"
,
false
)) {}
23
24
StopAfterNEvents::~StopAfterNEvents
() {}
25
26
bool
StopAfterNEvents::filter
(
Event
&,
EventSetup
const
&) {
27
if
(
n_
< 0)
28
return
true
;
29
n_
++;
30
bool
ret
=
n_
<=
nMax_
;
31
if
(
verbose_
)
32
cout
<<
">>> filtering event"
<<
n_
<<
"/"
<<
nMax_
<<
"("
<< (
ret
?
"true"
:
"false"
) <<
")"
<< endl;
33
return
ret
;
34
}
35
36
#include "
FWCore/Framework/interface/MakerMacros.h
"
37
38
DEFINE_FWK_MODULE
(
StopAfterNEvents
);
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition:
runTheMatrix.py:542
StopAfterNEvents::StopAfterNEvents
StopAfterNEvents(const edm::ParameterSet &)
Definition:
StopAfterNEvents.cc:21
electrons_cff.bool
bool
Definition:
electrons_cff.py:366
funct::false
false
Definition:
Factorize.h:29
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
EDFilter.h
StopAfterNEvents::n_
int n_
Definition:
StopAfterNEvents.cc:12
StopAfterNEvents::nMax_
const int nMax_
Definition:
StopAfterNEvents.cc:11
StopAfterNEvents
Definition:
StopAfterNEvents.cc:4
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
StopAfterNEvents::verbose_
const bool verbose_
Definition:
StopAfterNEvents.cc:13
edm::ParameterSet
Definition:
ParameterSet.h:47
createfilelist.int
int
Definition:
createfilelist.py:10
edm::EDFilter
Definition:
EDFilter.h:38
edm::EventSetup
Definition:
EventSetup.h:58
std
Definition:
JetResolutionObject.h:76
StopAfterNEvents::filter
bool filter(edm::Event &, edm::EventSetup const &) override
Definition:
StopAfterNEvents.cc:26
ParameterSet.h
edm::Event
Definition:
Event.h:73
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
StopAfterNEvents::~StopAfterNEvents
~StopAfterNEvents() override
Definition:
StopAfterNEvents.cc:24
Generated for CMSSW Reference Manual by
1.8.16