Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
);
StopAfterNEvents::~StopAfterNEvents
~StopAfterNEvents() override
Definition:
StopAfterNEvents.cc:24
runTheMatrix.ret
tuple ret
prodAgent to be discontinued
Definition:
runTheMatrix.py:596
StopAfterNEvents::StopAfterNEvents
StopAfterNEvents(const edm::ParameterSet &)
Definition:
StopAfterNEvents.cc:21
funct::false
false
Definition:
Factorize.h:29
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
StopAfterNEvents::n_
int n_
Definition:
StopAfterNEvents.cc:12
MakerMacros.h
TrackValidation_cff.pset
tuple pset
Definition:
TrackValidation_cff.py:591
StopAfterNEvents::nMax_
const int nMax_
Definition:
StopAfterNEvents.cc:11
ParameterSet.h
EDFilter.h
StopAfterNEvents::filter
bool filter(edm::Event &, edm::EventSetup const &) override
Definition:
StopAfterNEvents.cc:26
edm::EventSetup
Definition:
EventSetup.h:59
edm::EDFilter
Definition:
EDFilter.h:39
StopAfterNEvents::verbose_
const bool verbose_
Definition:
StopAfterNEvents.cc:13
StopAfterNEvents
Definition:
StopAfterNEvents.cc:4
edm::ParameterSet
Definition:
ParameterSet.h:47
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:144
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.5