FWCore
Modules
src
IterateNTimesLooper.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: Modules
4
// Class : IterateNTimesLooper
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
// Original Author: Chris Jones
10
// Created: Tue Jul 11 11:16:14 EDT 2006
11
//
12
13
// system include files
14
15
// user include files
16
#include "
FWCore/Framework/interface/EDLooper.h
"
17
#include "
FWCore/Framework/interface/LooperFactory.h
"
18
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
19
20
namespace
edm
{
21
22
class
IterateNTimesLooper
:
public
EDLooper
{
23
public
:
24
IterateNTimesLooper
(
ParameterSet
const
&);
25
IterateNTimesLooper
(
IterateNTimesLooper
const
&) =
delete
;
// stop default
26
IterateNTimesLooper
const
&
operator=
(
IterateNTimesLooper
const
&) =
delete
;
// stop default
27
~IterateNTimesLooper
()
override
;
28
29
// ---------- const member functions ---------------------
30
31
// ---------- static member functions --------------------
32
33
// ---------- member functions ---------------------------
34
void
startingNewLoop
(
unsigned
int
)
override
;
35
Status
duringLoop
(
Event
const
&,
EventSetup
const
&)
override
;
36
Status
endOfLoop
(
EventSetup
const
&,
unsigned
int
)
override
;
37
38
private
:
39
// ---------- member data --------------------------------
40
unsigned
int
max_
;
41
unsigned
int
times_
;
42
bool
shouldStop_
;
43
};
44
45
//
46
//
47
// constructors and destructor
48
//
49
IterateNTimesLooper::IterateNTimesLooper
(
ParameterSet
const
& iConfig)
50
: max_(iConfig.getParameter<unsigned
int
>(
"nTimes"
)), times_(0), shouldStop_(
false
) {}
51
52
// IterateNTimesLooper::IterateNTimesLooper(IterateNTimesLooper const& rhs) {
53
// // do actual copying here;
54
// }
55
56
IterateNTimesLooper::~IterateNTimesLooper
() {}
57
58
//
59
// assignment operators
60
//
61
// IterateNTimesLooper const& IterateNTimesLooper::operator=(IterateNTimesLooper const& rhs) {
62
// //An exception safe implementation is
63
// IterateNTimesLooper temp(rhs);
64
// swap(rhs);
65
//
66
// return *this;
67
// }
68
69
//
70
// member functions
71
//
72
void
IterateNTimesLooper::startingNewLoop
(
unsigned
int
iIteration) {
73
times_
= iIteration;
74
if
(iIteration >=
max_
) {
75
shouldStop_
=
true
;
76
}
77
}
78
79
EDLooper::Status
IterateNTimesLooper::duringLoop
(
Event
const
&,
EventSetup
const
&) {
80
return
shouldStop_
?
kStop
:
kContinue
;
81
}
82
83
EDLooper::Status
IterateNTimesLooper::endOfLoop
(
EventSetup
const
&,
unsigned
int
/*iCounter*/
) {
84
++
times_
;
85
return
(
times_
<
max_
) ?
kContinue
:
kStop
;
86
}
87
}
// namespace edm
88
89
using
edm::IterateNTimesLooper
;
90
DEFINE_FWK_LOOPER
(
IterateNTimesLooper
);
edm::IterateNTimesLooper::startingNewLoop
void startingNewLoop(unsigned int) override
Definition:
IterateNTimesLooper.cc:72
edm::EDLooperBase::Status
Status
Definition:
EDLooperBase.h:82
funct::false
false
Definition:
Factorize.h:29
edm::IterateNTimesLooper::IterateNTimesLooper
IterateNTimesLooper(ParameterSet const &)
Definition:
IterateNTimesLooper.cc:49
DEFINE_FWK_LOOPER
#define DEFINE_FWK_LOOPER(type)
Definition:
LooperFactory.h:108
edm::EDLooperBase::kContinue
Definition:
EDLooperBase.h:82
ParameterSet.h
LooperFactory.h
createfilelist.int
int
Definition:
createfilelist.py:10
edm::EDLooper
Definition:
EDLooper.h:27
edm::IterateNTimesLooper::duringLoop
Status duringLoop(Event const &, EventSetup const &) override
Definition:
IterateNTimesLooper.cc:79
edm::EventSetup
Definition:
EventSetup.h:59
edm::IterateNTimesLooper::endOfLoop
Status endOfLoop(EventSetup const &, unsigned int) override
Definition:
IterateNTimesLooper.cc:83
edm::IterateNTimesLooper::max_
unsigned int max_
Definition:
IterateNTimesLooper.cc:40
edm::IterateNTimesLooper
Definition:
IterateNTimesLooper.cc:22
edm::IterateNTimesLooper::times_
unsigned int times_
Definition:
IterateNTimesLooper.cc:41
edm::EDLooperBase::kStop
Definition:
EDLooperBase.h:82
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::IterateNTimesLooper::~IterateNTimesLooper
~IterateNTimesLooper() override
Definition:
IterateNTimesLooper.cc:56
edm::ParameterSet
Definition:
ParameterSet.h:47
EDLooper.h
edm::Event
Definition:
Event.h:73
edm::IterateNTimesLooper::shouldStop_
bool shouldStop_
Definition:
IterateNTimesLooper.cc:42
edm::IterateNTimesLooper::operator=
IterateNTimesLooper const & operator=(IterateNTimesLooper const &)=delete
Generated for CMSSW Reference Manual by
1.8.14