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
()
override
;
26
27
// ---------- const member functions ---------------------
28
29
// ---------- static member functions --------------------
30
31
// ---------- member functions ---------------------------
32
void
startingNewLoop
(
unsigned
int
)
override
;
33
Status
duringLoop
(
Event
const
&,
EventSetup
const
&)
override
;
34
Status
endOfLoop
(
EventSetup
const
&,
unsigned
int
)
override
;
35
36
private
:
37
IterateNTimesLooper
(
IterateNTimesLooper
const
&) =
delete
;
// stop default
38
39
IterateNTimesLooper
const
&
operator=
(
IterateNTimesLooper
const
&) =
delete
;
// stop default
40
41
// ---------- member data --------------------------------
42
unsigned
int
max_
;
43
unsigned
int
times_
;
44
bool
shouldStop_
;
45
};
46
47
//
48
//
49
// constructors and destructor
50
//
51
IterateNTimesLooper::IterateNTimesLooper
(
ParameterSet
const
& iConfig)
52
: max_(iConfig.getParameter<unsigned
int
>(
"nTimes"
)), times_(0), shouldStop_(
false
) {}
53
54
// IterateNTimesLooper::IterateNTimesLooper(IterateNTimesLooper const& rhs) {
55
// // do actual copying here;
56
// }
57
58
IterateNTimesLooper::~IterateNTimesLooper
() {}
59
60
//
61
// assignment operators
62
//
63
// IterateNTimesLooper const& IterateNTimesLooper::operator=(IterateNTimesLooper const& rhs) {
64
// //An exception safe implementation is
65
// IterateNTimesLooper temp(rhs);
66
// swap(rhs);
67
//
68
// return *this;
69
// }
70
71
//
72
// member functions
73
//
74
void
IterateNTimesLooper::startingNewLoop
(
unsigned
int
iIteration) {
75
times_
= iIteration;
76
if
(iIteration >=
max_
) {
77
shouldStop_
=
true
;
78
}
79
}
80
81
EDLooper::Status
IterateNTimesLooper::duringLoop
(
Event
const
&,
EventSetup
const
&) {
82
return
shouldStop_
?
kStop
:
kContinue
;
83
}
84
85
EDLooper::Status
IterateNTimesLooper::endOfLoop
(
EventSetup
const
&,
unsigned
int
/*iCounter*/
) {
86
++
times_
;
87
return
(
times_
<
max_
) ?
kContinue
:
kStop
;
88
}
89
}
// namespace edm
90
91
using
edm::IterateNTimesLooper
;
92
DEFINE_FWK_LOOPER
(
IterateNTimesLooper
);
edm::IterateNTimesLooper
Definition:
IterateNTimesLooper.cc:22
edm::EDLooperBase::Status
Status
Definition:
EDLooperBase.h:79
funct::false
false
Definition:
Factorize.h:34
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::IterateNTimesLooper::startingNewLoop
void startingNewLoop(unsigned int) override
Definition:
IterateNTimesLooper.cc:74
DEFINE_FWK_LOOPER
#define DEFINE_FWK_LOOPER(type)
Definition:
LooperFactory.h:107
edm::IterateNTimesLooper::IterateNTimesLooper
IterateNTimesLooper(ParameterSet const &)
Definition:
IterateNTimesLooper.cc:51
edm::EDLooper
Definition:
EDLooper.h:27
edm::EDLooperBase::kStop
Definition:
EDLooperBase.h:79
edm::IterateNTimesLooper::duringLoop
Status duringLoop(Event const &, EventSetup const &) override
Definition:
IterateNTimesLooper.cc:81
LooperFactory.h
edm::ParameterSet
Definition:
ParameterSet.h:36
createfilelist.int
int
Definition:
createfilelist.py:10
edm::EventSetup
Definition:
EventSetup.h:57
edm::EDLooperBase::kContinue
Definition:
EDLooperBase.h:79
edm::IterateNTimesLooper::endOfLoop
Status endOfLoop(EventSetup const &, unsigned int) override
Definition:
IterateNTimesLooper.cc:85
edm::IterateNTimesLooper::max_
unsigned int max_
Definition:
IterateNTimesLooper.cc:42
edm::IterateNTimesLooper::times_
unsigned int times_
Definition:
IterateNTimesLooper.cc:43
edm::IterateNTimesLooper::~IterateNTimesLooper
~IterateNTimesLooper() override
Definition:
IterateNTimesLooper.cc:58
edm::IterateNTimesLooper::shouldStop_
bool shouldStop_
Definition:
IterateNTimesLooper.cc:44
ParameterSet.h
EDLooper.h
edm::Event
Definition:
Event.h:73
edm::IterateNTimesLooper::operator=
IterateNTimesLooper const & operator=(IterateNTimesLooper const &)=delete
Generated for CMSSW Reference Manual by
1.8.16