Main Page
Namespaces
Classes
Package Documentation
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
private
:
9
bool
filter
(
edm::Event
&,
edm::EventSetup
const
& )
override
;
10
const
int
nMax_
;
11
int
n_
;
12
const
bool
verbose_
;
13
};
14
15
#include <iostream>
16
17
using namespace
std
;
18
using namespace
edm
;
19
20
StopAfterNEvents::StopAfterNEvents
(
const
ParameterSet
&
pset
) :
21
nMax_
( pset.getParameter<
int
>(
"maxEvents"
) ),
n_
( 0 ),
22
verbose_
( pset.getUntrackedParameter<
bool
>(
"verbose"
,
false
) ) {
23
}
24
25
StopAfterNEvents::~StopAfterNEvents
() {
26
}
27
28
bool
StopAfterNEvents::filter
(
Event
&,
EventSetup
const
&) {
29
if
(
n_
< 0 )
return
true
;
30
n_
++ ;
31
bool
ret =
n_
<=
nMax_
;
32
if
(
verbose_
)
33
cout
<<
">>> filtering event"
<<
n_
<<
"/"
<<
nMax_
34
<<
"("
<< ( ret ?
"true"
:
"false"
) <<
")"
<< endl;
35
return
ret;
36
}
37
38
#include "
FWCore/Framework/interface/MakerMacros.h
"
39
40
DEFINE_FWK_MODULE
(
StopAfterNEvents
);
StopAfterNEvents::~StopAfterNEvents
~StopAfterNEvents() override
Definition:
StopAfterNEvents.cc:25
StopAfterNEvents::StopAfterNEvents
StopAfterNEvents(const edm::ParameterSet &)
Definition:
StopAfterNEvents.cc:20
funct::false
false
Definition:
Factorize.h:36
StopAfterNEvents::n_
int n_
Definition:
StopAfterNEvents.cc:11
MakerMacros.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
std
Definition:
JetResolutionObject.h:80
StopAfterNEvents::nMax_
const int nMax_
Definition:
StopAfterNEvents.cc:10
ParameterSet.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
createfilelist.int
int
Definition:
createfilelist.py:10
EDFilter.h
StopAfterNEvents::filter
bool filter(edm::Event &, edm::EventSetup const &) override
Definition:
StopAfterNEvents.cc:28
edm::EventSetup
Definition:
EventSetup.h:57
edm::EDFilter
Definition:
EDFilter.h:39
electrons_cff.bool
bool
Definition:
electrons_cff.py:372
StopAfterNEvents::verbose_
const bool verbose_
Definition:
StopAfterNEvents.cc:12
StopAfterNEvents
Definition:
StopAfterNEvents.cc:4
edm
HLT enums.
Definition:
AlignableModifier.h:17
edm::ParameterSet
Definition:
ParameterSet.h:36
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
edm::Event
Definition:
Event.h:71
Generated for CMSSW Reference Manual by
1.8.11