CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::IterateNTimesLooper Class Reference
Inheritance diagram for edm::IterateNTimesLooper:
edm::EDLooper edm::EDLooperBase

Public Member Functions

Status duringLoop (Event const &, EventSetup const &) override
 
Status endOfLoop (EventSetup const &, unsigned int) override
 
 IterateNTimesLooper (ParameterSet const &)
 
void startingNewLoop (unsigned int) override
 
 ~IterateNTimesLooper () override
 
- Public Member Functions inherited from edm::EDLooper
 EDLooper ()
 
 EDLooper (EDLooper const &)=delete
 
EDLooperoperator= (EDLooper const &)=delete
 
 ~EDLooper () override
 
- Public Member Functions inherited from edm::EDLooperBase
virtual void attachTo (ActivityRegistry &)
 Override this method if you need to monitor the state of the processing. More...
 
virtual void beginOfJob ()
 
virtual void beginOfJob (EventSetup const &)
 
void beginOfJob (EventSetupImpl const &)
 
void copyInfo (ScheduleInfo const &)
 
void doBeginLuminosityBlock (LuminosityBlockPrincipal &, EventSetupImpl const &, ProcessContext *)
 
void doBeginRun (RunPrincipal &, EventSetupImpl const &, ProcessContext *)
 
Status doDuringLoop (EventPrincipal &eventPrincipal, EventSetupImpl const &es, ProcessingController &, StreamContext *)
 
void doEndLuminosityBlock (LuminosityBlockPrincipal &, EventSetupImpl const &, ProcessContext *)
 
Status doEndOfLoop (EventSetupImpl const &es)
 
void doEndRun (RunPrincipal &, EventSetupImpl const &, ProcessContext *)
 
void doStartingNewLoop ()
 
 EDLooperBase ()
 
 EDLooperBase (EDLooperBase const &)=delete
 
virtual void endOfJob ()
 
virtual std::set< eventsetup::EventSetupRecordKeymodifyingRecords () const
 
EDLooperBaseoperator= (EDLooperBase const &)=delete
 
void prepareForNextLoop (eventsetup::EventSetupProvider *esp)
 
void setActionTable (ExceptionToActionTable const *actionTable)
 
void setModuleChanger (ModuleChanger *)
 
virtual ~EDLooperBase () noexcept(false)
 

Private Member Functions

 IterateNTimesLooper (IterateNTimesLooper const &)=delete
 
IterateNTimesLooper const & operator= (IterateNTimesLooper const &)=delete
 

Private Attributes

unsigned int max_
 
bool shouldStop_
 
unsigned int times_
 

Additional Inherited Members

- Public Types inherited from edm::EDLooperBase
enum  Status { kContinue, kStop }
 
- Protected Member Functions inherited from edm::EDLooperBase
ModuleChangermoduleChanger ()
 This only returns a non-zero value during the call to endOfLoop. More...
 
ScheduleInfo const * scheduleInfo () const
 This returns a non-zero value after the constructor has been called. More...
 

Detailed Description

Definition at line 22 of file IterateNTimesLooper.cc.

Constructor & Destructor Documentation

◆ IterateNTimesLooper() [1/2]

edm::IterateNTimesLooper::IterateNTimesLooper ( ParameterSet const &  iConfig)

Definition at line 51 of file IterateNTimesLooper.cc.

52  : max_(iConfig.getParameter<unsigned int>("nTimes")), times_(0), shouldStop_(false) {}

◆ ~IterateNTimesLooper()

edm::IterateNTimesLooper::~IterateNTimesLooper ( )
override

Definition at line 58 of file IterateNTimesLooper.cc.

58 {}

◆ IterateNTimesLooper() [2/2]

edm::IterateNTimesLooper::IterateNTimesLooper ( IterateNTimesLooper const &  )
privatedelete

Member Function Documentation

◆ duringLoop()

EDLooper::Status edm::IterateNTimesLooper::duringLoop ( Event const &  ,
EventSetup const &   
)
overridevirtual

Called after all event modules have had a chance to process the edm::Event.

Implements edm::EDLooper.

Definition at line 81 of file IterateNTimesLooper.cc.

81  {
82  return shouldStop_ ? kStop : kContinue;
83  }

References edm::EDLooperBase::kContinue, edm::EDLooperBase::kStop, and shouldStop_.

◆ endOfLoop()

EDLooper::Status edm::IterateNTimesLooper::endOfLoop ( EventSetup const &  ,
unsigned int  iCounter 
)
overridevirtual

Called after the system has finished one loop over the events. Thar argument is a count of how many loops have been processed before this loo. For the first time through the events the argument will be 0.

Implements edm::EDLooperBase.

Definition at line 85 of file IterateNTimesLooper.cc.

85  {
86  ++times_;
87  return (times_ < max_) ? kContinue : kStop;
88  }

References edm::EDLooperBase::kContinue, edm::EDLooperBase::kStop, max_, and times_.

◆ operator=()

IterateNTimesLooper const& edm::IterateNTimesLooper::operator= ( IterateNTimesLooper const &  )
privatedelete

◆ startingNewLoop()

void edm::IterateNTimesLooper::startingNewLoop ( unsigned int  )
overridevirtual

Called before system starts to loop over the events. The argument is a count of how many loops have been processed. For the first time through the events the argument will be 0.

Implements edm::EDLooperBase.

Definition at line 74 of file IterateNTimesLooper.cc.

74  {
75  times_ = iIteration;
76  if (iIteration >= max_) {
77  shouldStop_ = true;
78  }
79  }

References max_, shouldStop_, and times_.

Member Data Documentation

◆ max_

unsigned int edm::IterateNTimesLooper::max_
private

Definition at line 42 of file IterateNTimesLooper.cc.

Referenced by endOfLoop(), and startingNewLoop().

◆ shouldStop_

bool edm::IterateNTimesLooper::shouldStop_
private

Definition at line 44 of file IterateNTimesLooper.cc.

Referenced by duringLoop(), and startingNewLoop().

◆ times_

unsigned int edm::IterateNTimesLooper::times_
private

Definition at line 43 of file IterateNTimesLooper.cc.

Referenced by endOfLoop(), and startingNewLoop().

edm::EDLooperBase::kStop
Definition: EDLooperBase.h:79
edm::EDLooperBase::kContinue
Definition: EDLooperBase.h:79
edm::IterateNTimesLooper::max_
unsigned int max_
Definition: IterateNTimesLooper.cc:42
edm::IterateNTimesLooper::times_
unsigned int times_
Definition: IterateNTimesLooper.cc:43
edm::IterateNTimesLooper::shouldStop_
bool shouldStop_
Definition: IterateNTimesLooper.cc:44