CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

edm::IterateNTimesLooper Class Reference

Inheritance diagram for edm::IterateNTimesLooper:
edm::EDLooper edm::EDLooperBase

List of all members.

Public Member Functions

virtual Status duringLoop (Event const &, EventSetup const &)
virtual Status endOfLoop (EventSetup const &, unsigned int)
 IterateNTimesLooper (ParameterSet const &)
virtual void startingNewLoop (unsigned int)
virtual ~IterateNTimesLooper ()

Private Member Functions

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

Private Attributes

unsigned int max_
bool shouldStop_
unsigned int times_

Detailed Description

Definition at line 22 of file IterateNTimesLooper.cc.


Constructor & Destructor Documentation

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

Definition at line 52 of file IterateNTimesLooper.cc.

                                                                      :
    max_(iConfig.getParameter<unsigned int>("nTimes")),
    times_(0),
    shouldStop_(false) {
  }
edm::IterateNTimesLooper::~IterateNTimesLooper ( ) [virtual]

Definition at line 62 of file IterateNTimesLooper.cc.

                                            {
  }
edm::IterateNTimesLooper::IterateNTimesLooper ( IterateNTimesLooper const &  ) [private]

Member Function Documentation

EDLooper::Status edm::IterateNTimesLooper::duringLoop ( Event const &  ,
EventSetup const &   
) [virtual]

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

Implements edm::EDLooper.

Definition at line 88 of file IterateNTimesLooper.cc.

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

                                                                 {
    return shouldStop_ ? kStop : kContinue;
  }
EDLooper::Status edm::IterateNTimesLooper::endOfLoop ( EventSetup const &  ,
unsigned  iCounter 
) [virtual]

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 93 of file IterateNTimesLooper.cc.

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

                                                                  {
    ++times_;
    return (times_ < max_) ? kContinue : kStop;
  }
IterateNTimesLooper const& edm::IterateNTimesLooper::operator= ( IterateNTimesLooper const &  ) [private]
void edm::IterateNTimesLooper::startingNewLoop ( unsigned  int) [virtual]

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 80 of file IterateNTimesLooper.cc.

References max_, shouldStop_, and times_.

                                                              {
    times_ = iIteration;
    if(iIteration >= max_) {
      shouldStop_ = true;
    }
  }

Member Data Documentation

unsigned int edm::IterateNTimesLooper::max_ [private]

Definition at line 43 of file IterateNTimesLooper.cc.

Referenced by endOfLoop(), and startingNewLoop().

Definition at line 45 of file IterateNTimesLooper.cc.

Referenced by duringLoop(), and startingNewLoop().

unsigned int edm::IterateNTimesLooper::times_ [private]

Definition at line 44 of file IterateNTimesLooper.cc.

Referenced by endOfLoop(), and startingNewLoop().