CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::EDLooperBase Class Referenceabstract

#include <EDLooperBase.h>

Inheritance diagram for edm::EDLooperBase:
edm::EDLooper edm::NavigateEventsLooper FWFFLooper EcalEleCalibLooper edm::ESProducerLooper edm::IterateNTimesLooper InvRingCalib MuScleFit __class__< T > AlignmentProducer PhysicsTools::MVATrainerLooper Pi0FixedMassWindowCalibration ZeeCalibration PhysicsTools::MVATrainerContainerLooperImpl< Record_t > PhysicsTools::MVATrainerLooperImpl< Record_t >

Public Types

enum  Status { kContinue, kStop }
 

Public Member Functions

virtual void attachTo (ActivityRegistry &)
 Override this method if you need to monitor the state of the processing. More...
 
void beginOfJob (EventSetupImpl const &)
 
virtual void beginOfJob (EventSetup const &)
 
virtual void beginOfJob ()
 
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)
 

Protected Member Functions

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...
 

Private Member Functions

virtual void beginLuminosityBlock (LuminosityBlock const &, EventSetup const &)
 Called after all event modules have processed the begin of a LuminosityBlock. More...
 
virtual void beginRun (Run const &, EventSetup const &)
 Called after all event modules have processed the begin of a Run. More...
 
virtual Status duringLoop (Event const &, EventSetup const &, ProcessingController &)=0
 
virtual void endLuminosityBlock (LuminosityBlock const &, EventSetup const &)
 Called after all event modules have processed the end of a LuminosityBlock. More...
 
virtual Status endOfLoop (EventSetup const &, unsigned int iCounter)=0
 
virtual void endRun (Run const &, EventSetup const &)
 Called after all event modules have processed the end of a Run. More...
 
virtual void startingNewLoop (unsigned int)=0
 

Private Attributes

ExceptionToActionTable const * act_table_
 
unsigned int iCounter_
 
ModuleCallingContext moduleCallingContext_
 
edm::propagate_const< ModuleChanger * > moduleChanger_
 
ModuleDescription moduleDescription_
 
edm::propagate_const< std::unique_ptr< ScheduleInfo > > scheduleInfo_
 

Detailed Description

Definition at line 77 of file EDLooperBase.h.

Member Enumeration Documentation

Enumerator
kContinue 
kStop 

Definition at line 79 of file EDLooperBase.h.

Constructor & Destructor Documentation

EDLooperBase::EDLooperBase ( )

Definition at line 32 of file EDLooperBase.cc.

33  : iCounter_(0),
34  act_table_(nullptr),
35  moduleChanger_(nullptr),
36  moduleDescription_("Looper", "looper"),
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:155
unsigned int iCounter_
Definition: EDLooperBase.h:148
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:154
ExceptionToActionTable const * act_table_
Definition: EDLooperBase.h:149
edm::propagate_const< ModuleChanger * > moduleChanger_
Definition: EDLooperBase.h:152
EDLooperBase::~EDLooperBase ( )
virtualnoexcept

Definition at line 38 of file EDLooperBase.cc.

38 {}
edm::EDLooperBase::EDLooperBase ( EDLooperBase const &  )
delete

Member Function Documentation

void EDLooperBase::attachTo ( ActivityRegistry )
virtual

Override this method if you need to monitor the state of the processing.

Reimplemented in FWFFLooper.

Definition at line 155 of file EDLooperBase.cc.

155 {}
void EDLooperBase::beginLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &   
)
privatevirtual

Called after all event modules have processed the begin of a LuminosityBlock.

Definition at line 152 of file EDLooperBase.cc.

Referenced by doBeginLuminosityBlock().

152 {}
void edm::EDLooperBase::beginOfJob ( EventSetupImpl const &  )
virtual void edm::EDLooperBase::beginOfJob ( EventSetup const &  )
virtual
void EDLooperBase::beginOfJob ( )
virtual

Reimplemented in ZeeCalibration, Pi0FixedMassWindowCalibration, __class__< T >, EcalEleCalibLooper, and InvRingCalib.

Definition at line 88 of file EDLooperBase.cc.

Referenced by prepareForNextLoop().

88 {}
void EDLooperBase::beginRun ( Run const &  ,
EventSetup const &   
)
privatevirtual

Called after all event modules have processed the begin of a Run.

Definition at line 150 of file EDLooperBase.cc.

Referenced by doBeginRun().

150 {}
void EDLooperBase::copyInfo ( ScheduleInfo const &  )

Definition at line 161 of file EDLooperBase.cc.

References scheduleInfo_.

161 { scheduleInfo_ = std::make_unique<ScheduleInfo>(iInfo); }
edm::propagate_const< std::unique_ptr< ScheduleInfo > > scheduleInfo_
Definition: EDLooperBase.h:151
void EDLooperBase::doBeginLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 119 of file EDLooperBase.cc.

References edm::BeginLuminosityBlock, beginLuminosityBlock(), edm::LuminosityBlockPrincipal::beginTime(), edm::LuminosityBlockPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), edm::GlobalContext::kBeginLuminosityBlock, moduleCallingContext_, moduleDescription_, and edm::LuminosityBlockPrincipal::runPrincipal().

121  {
122  GlobalContext globalContext(GlobalContext::Transition::kBeginLuminosityBlock,
123  iLB.id(),
124  iLB.runPrincipal().index(),
125  iLB.index(),
126  iLB.beginTime(),
127  processContext);
128  ParentContext parentContext(&globalContext);
129  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
130  LuminosityBlock luminosityBlock(iLB, moduleDescription_, &moduleCallingContext_, false);
131  const EventSetup es{iES, static_cast<unsigned int>(Transition::BeginLuminosityBlock), nullptr};
132  beginLuminosityBlock(luminosityBlock, es);
133  }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:155
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the begin of a LuminosityBlock.
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:154
void EDLooperBase::doBeginRun ( RunPrincipal iRP,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 92 of file EDLooperBase.cc.

References edm::BeginRun, beginRun(), edm::RunPrincipal::beginTime(), edm::RunPrincipal::index(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kBeginRun, moduleCallingContext_, moduleDescription_, writedatasetfile::run, and edm::RunPrincipal::run().

92  {
93  GlobalContext globalContext(GlobalContext::Transition::kBeginRun,
94  LuminosityBlockID(iRP.run(), 0),
95  iRP.index(),
97  iRP.beginTime(),
98  processContext);
99  ParentContext parentContext(&globalContext);
100  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
102  const EventSetup es{iES, static_cast<unsigned int>(Transition::BeginRun), nullptr};
103  beginRun(run, es);
104  }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:155
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:154
static LuminosityBlockIndex invalidLuminosityBlockIndex()
virtual void beginRun(Run const &, EventSetup const &)
Called after all event modules have processed the begin of a Run.
EDLooperBase::Status EDLooperBase::doDuringLoop ( EventPrincipal eventPrincipal,
EventSetupImpl const &  es,
ProcessingController ,
StreamContext  
)

Definition at line 42 of file EDLooperBase.cc.

References act_table_, writedatasetfile::action, cms::Exception::addContext(), cms::Exception::category(), duringLoop(), MillePedeFileConverter_cfg::e, edm::Event, event(), edm::ExceptionToActionTable::find(), edm::EventPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), kContinue, edm::StreamContext::kEvent, edm::EventPrincipal::luminosityBlockPrincipal(), moduleCallingContext_, moduleDescription_, edm::printCmsExceptionWarning(), edm::exception_actions::Rethrow, edm::LuminosityBlockPrincipal::runPrincipal(), edm::StreamContext::setEventID(), edm::StreamContext::setLuminosityBlockIndex(), edm::StreamContext::setRunIndex(), edm::StreamContext::setTimestamp(), edm::StreamContext::setTransition(), mps_update::status, and edm::EventPrincipal::time().

45  {
46  streamContext->setTransition(StreamContext::Transition::kEvent);
47  streamContext->setEventID(eventPrincipal.id());
48  streamContext->setRunIndex(eventPrincipal.luminosityBlockPrincipal().runPrincipal().index());
49  streamContext->setLuminosityBlockIndex(eventPrincipal.luminosityBlockPrincipal().index());
50  streamContext->setTimestamp(eventPrincipal.time());
51  ParentContext parentContext(streamContext);
52  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
54 
56  try {
57  const EventSetup es{esi, static_cast<unsigned int>(Transition::Event), nullptr};
58  status = duringLoop(event, es, ioController);
59  } catch (cms::Exception& e) {
60  e.addContext("Calling the 'duringLoop' method of a looper");
62  if (action != exception_actions::Rethrow) {
63  edm::printCmsExceptionWarning("SkipEvent", e);
64  } else {
65  throw;
66  }
67  }
68  return status;
69  }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:155
std::string const & category() const
Definition: Exception.cc:143
exception_actions::ActionCodes find(const std::string &category) const
virtual Status duringLoop(Event const &, EventSetup const &, ProcessingController &)=0
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:154
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
ExceptionToActionTable const * act_table_
Definition: EDLooperBase.h:149
void addContext(std::string const &context)
Definition: Exception.cc:165
Definition: event.py:1
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
void EDLooperBase::doEndLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 134 of file EDLooperBase.cc.

References edm::LuminosityBlockPrincipal::beginTime(), edm::EndLuminosityBlock, endLuminosityBlock(), edm::LuminosityBlockPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), edm::GlobalContext::kEndLuminosityBlock, moduleCallingContext_, moduleDescription_, and edm::LuminosityBlockPrincipal::runPrincipal().

136  {
137  GlobalContext globalContext(GlobalContext::Transition::kEndLuminosityBlock,
138  iLB.id(),
139  iLB.runPrincipal().index(),
140  iLB.index(),
141  iLB.beginTime(),
142  processContext);
143  ParentContext parentContext(&globalContext);
144  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
145  LuminosityBlock luminosityBlock(iLB, moduleDescription_, &moduleCallingContext_, true);
146  const EventSetup es{iES, static_cast<unsigned int>(Transition::EndLuminosityBlock), nullptr};
147  endLuminosityBlock(luminosityBlock, es);
148  }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:155
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:154
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the end of a LuminosityBlock.
EDLooperBase::Status EDLooperBase::doEndOfLoop ( EventSetupImpl const &  es)

Definition at line 71 of file EDLooperBase.cc.

References endOfLoop(), edm::EndRun, and iCounter_.

71  {
72  const EventSetup es{esi, static_cast<unsigned int>(Transition::EndRun), nullptr};
73  return endOfLoop(es, iCounter_);
74  }
virtual Status endOfLoop(EventSetup const &, unsigned int iCounter)=0
unsigned int iCounter_
Definition: EDLooperBase.h:148
void EDLooperBase::doEndRun ( RunPrincipal iRP,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 106 of file EDLooperBase.cc.

References edm::EndRun, endRun(), edm::RunPrincipal::endTime(), edm::RunPrincipal::index(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kEndRun, moduleCallingContext_, moduleDescription_, writedatasetfile::run, and edm::RunPrincipal::run().

106  {
107  GlobalContext globalContext(GlobalContext::Transition::kEndRun,
108  LuminosityBlockID(iRP.run(), 0),
109  iRP.index(),
111  iRP.endTime(),
112  processContext);
113  ParentContext parentContext(&globalContext);
114  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
116  const EventSetup es{iES, static_cast<unsigned int>(Transition::EndRun), nullptr};
117  endRun(run, es);
118  }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:155
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:154
static LuminosityBlockIndex invalidLuminosityBlockIndex()
virtual void endRun(Run const &, EventSetup const &)
Called after all event modules have processed the end of a Run.
void EDLooperBase::doStartingNewLoop ( )

Definition at line 40 of file EDLooperBase.cc.

References iCounter_, and startingNewLoop().

unsigned int iCounter_
Definition: EDLooperBase.h:148
virtual void startingNewLoop(unsigned int)=0
virtual Status edm::EDLooperBase::duringLoop ( Event const &  ,
EventSetup const &  ,
ProcessingController  
)
privatepure virtual

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

Implemented in edm::NavigateEventsLooper.

Referenced by doDuringLoop().

void EDLooperBase::endLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &   
)
privatevirtual

Called after all event modules have processed the end of a LuminosityBlock.

Definition at line 153 of file EDLooperBase.cc.

Referenced by doEndLuminosityBlock().

153 {}
void EDLooperBase::endOfJob ( )
virtual
virtual Status edm::EDLooperBase::endOfLoop ( EventSetup const &  ,
unsigned int  iCounter 
)
privatepure 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.

Implemented in edm::NavigateEventsLooper, and edm::IterateNTimesLooper.

Referenced by doEndOfLoop().

void EDLooperBase::endRun ( Run const &  ,
EventSetup const &   
)
privatevirtual

Called after all event modules have processed the end of a Run.

Definition at line 151 of file EDLooperBase.cc.

Referenced by doEndRun().

151 {}
std::set< eventsetup::EventSetupRecordKey > EDLooperBase::modifyingRecords ( ) const
virtual

Reimplemented in edm::ESProducerLooper.

Definition at line 157 of file EDLooperBase.cc.

Referenced by prepareForNextLoop().

157  {
158  return std::set<eventsetup::EventSetupRecordKey>();
159  }
ModuleChanger * EDLooperBase::moduleChanger ( )
protected

This only returns a non-zero value during the call to endOfLoop.

Definition at line 164 of file EDLooperBase.cc.

References moduleChanger_.

164 { return moduleChanger_; }
edm::propagate_const< ModuleChanger * > moduleChanger_
Definition: EDLooperBase.h:152
EDLooperBase& edm::EDLooperBase::operator= ( EDLooperBase const &  )
delete
void EDLooperBase::prepareForNextLoop ( eventsetup::EventSetupProvider esp)

Definition at line 76 of file EDLooperBase.cc.

References beginOfJob(), edm::BeginRun, edm::for_all(), iCounter_, relativeConstraints::keys, modifyingRecords(), and edm::eventsetup::EventSetupProvider::resetRecordPlusDependentRecords().

76  {
77  ++iCounter_;
78 
79  std::set<edm::eventsetup::EventSetupRecordKey> const& keys = modifyingRecords();
80  for_all(keys,
81  std::bind(&eventsetup::EventSetupProvider::resetRecordPlusDependentRecords, esp, std::placeholders::_1));
82  }
unsigned int iCounter_
Definition: EDLooperBase.h:148
void resetRecordPlusDependentRecords(EventSetupRecordKey const &)
Used when we need to force a Record to reset all its proxies.
virtual std::set< eventsetup::EventSetupRecordKey > modifyingRecords() const
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
const ScheduleInfo * EDLooperBase::scheduleInfo ( ) const
protected

This returns a non-zero value after the constructor has been called.

Definition at line 165 of file EDLooperBase.cc.

References scheduleInfo_.

165 { return scheduleInfo_.get(); }
edm::propagate_const< std::unique_ptr< ScheduleInfo > > scheduleInfo_
Definition: EDLooperBase.h:151
void edm::EDLooperBase::setActionTable ( ExceptionToActionTable const *  actionTable)
inline

Definition at line 106 of file EDLooperBase.h.

References Ecal2004TBTDCRanges_v1_cff::endRun.

106 { act_table_ = actionTable; }
ExceptionToActionTable const * act_table_
Definition: EDLooperBase.h:149
void EDLooperBase::setModuleChanger ( ModuleChanger iChanger)

Definition at line 162 of file EDLooperBase.cc.

References moduleChanger_.

162 { moduleChanger_ = iChanger; }
edm::propagate_const< ModuleChanger * > moduleChanger_
Definition: EDLooperBase.h:152
virtual void edm::EDLooperBase::startingNewLoop ( unsigned  int)
privatepure 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.

Implemented in MuScleFit, ZeeCalibration, Pi0FixedMassWindowCalibration, FWFFLooper, __class__< T >, EcalEleCalibLooper, AlignmentProducer, InvRingCalib, edm::NavigateEventsLooper, edm::IterateNTimesLooper, and PhysicsTools::MVATrainerLooper.

Referenced by doStartingNewLoop().

Member Data Documentation

ExceptionToActionTable const* edm::EDLooperBase::act_table_
private

Definition at line 149 of file EDLooperBase.h.

Referenced by doDuringLoop().

unsigned int edm::EDLooperBase::iCounter_
private

Definition at line 148 of file EDLooperBase.h.

Referenced by doEndOfLoop(), doStartingNewLoop(), and prepareForNextLoop().

ModuleCallingContext edm::EDLooperBase::moduleCallingContext_
private
edm::propagate_const<ModuleChanger*> edm::EDLooperBase::moduleChanger_
private

Definition at line 152 of file EDLooperBase.h.

Referenced by moduleChanger(), and setModuleChanger().

ModuleDescription edm::EDLooperBase::moduleDescription_
private
edm::propagate_const<std::unique_ptr<ScheduleInfo> > edm::EDLooperBase::scheduleInfo_
private

Definition at line 151 of file EDLooperBase.h.

Referenced by copyInfo(), and scheduleInfo().