CMS 3D CMS Logo

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

Public Member Functions

Status duringLoop (Event const &, EventSetup const &) override
 
Status endOfLoop (EventSetup const &, unsigned int) override
 
 IterateNTimesLooper (IterateNTimesLooper const &)=delete
 
 IterateNTimesLooper (ParameterSet const &)
 
IterateNTimesLooper const & operator= (IterateNTimesLooper const &)=delete
 
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 ()
 
void esPrefetchAsync (WaitingTaskHolder iTask, EventSetupImpl const &iImpl, Transition iTrans, ServiceToken const &iToken) const
 
virtual std::set< eventsetup::EventSetupRecordKeymodifyingRecords () const
 
EDLooperBaseoperator= (EDLooperBase const &)=delete
 
void prefetchAsync (WaitingTaskHolder iTask, ServiceToken const &token, Transition iTrans, Principal const &iPrincipal, EventSetupImpl const &iImpl) const
 
void prepareForNextLoop (eventsetup::EventSetupProvider *esp)
 
void setActionTable (ExceptionToActionTable const *actionTable)
 
void setModuleChanger (ModuleChanger *)
 
 ~EDLooperBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

unsigned int max_
 
bool shouldStop_
 
unsigned int times_
 

Additional Inherited Members

- Public Types inherited from edm::EDLooperBase
enum  Status { kContinue, kStop }
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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...
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

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

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

◆ IterateNTimesLooper() [2/2]

edm::IterateNTimesLooper::IterateNTimesLooper ( IterateNTimesLooper const &  )
delete

◆ ~IterateNTimesLooper()

edm::IterateNTimesLooper::~IterateNTimesLooper ( )
override

Definition at line 56 of file IterateNTimesLooper.cc.

56 {}

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

79  {
80  return shouldStop_ ? kStop : kContinue;
81  }

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

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

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

◆ operator=()

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

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

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

References max_, shouldStop_, and times_.

Member Data Documentation

◆ max_

unsigned int edm::IterateNTimesLooper::max_
private

Definition at line 40 of file IterateNTimesLooper.cc.

Referenced by endOfLoop(), and startingNewLoop().

◆ shouldStop_

bool edm::IterateNTimesLooper::shouldStop_
private

Definition at line 42 of file IterateNTimesLooper.cc.

Referenced by duringLoop(), and startingNewLoop().

◆ times_

unsigned int edm::IterateNTimesLooper::times_
private

Definition at line 41 of file IterateNTimesLooper.cc.

Referenced by endOfLoop(), and startingNewLoop().

edm::EDLooperBase::kStop
Definition: EDLooperBase.h:82
edm::EDLooperBase::kContinue
Definition: EDLooperBase.h:82
edm::IterateNTimesLooper::max_
unsigned int max_
Definition: IterateNTimesLooper.cc:40
edm::IterateNTimesLooper::times_
unsigned int times_
Definition: IterateNTimesLooper.cc:41
edm::IterateNTimesLooper::shouldStop_
bool shouldStop_
Definition: IterateNTimesLooper.cc:42