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 Pi0FixedMassWindowCalibration ZeeCalibration

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

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

◆ Status

Enumerator
kContinue 
kStop 

Definition at line 79 of file EDLooperBase.h.

79 { kContinue, kStop };

Constructor & Destructor Documentation

◆ EDLooperBase() [1/2]

EDLooperBase::EDLooperBase ( )

Definition at line 32 of file EDLooperBase.cc.

33  : iCounter_(0),
34  act_table_(nullptr),
35  moduleChanger_(nullptr),
36  moduleDescription_("Looper", "looper"),

◆ ~EDLooperBase()

EDLooperBase::~EDLooperBase ( )
virtualnoexcept

Definition at line 38 of file EDLooperBase.cc.

38 {}

◆ EDLooperBase() [2/2]

edm::EDLooperBase::EDLooperBase ( EDLooperBase const &  )
delete

Member Function Documentation

◆ attachTo()

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 {}

◆ beginLuminosityBlock()

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

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

Reimplemented in AlignmentProducer.

Definition at line 152 of file EDLooperBase.cc.

152 {}

Referenced by doBeginLuminosityBlock().

◆ beginOfJob() [1/3]

void EDLooperBase::beginOfJob ( )
virtual

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

Definition at line 88 of file EDLooperBase.cc.

88 {}

Referenced by beginOfJob().

◆ beginOfJob() [2/3]

void EDLooperBase::beginOfJob ( EventSetup const &  )
virtual

Reimplemented in AlignmentProducer.

Definition at line 87 of file EDLooperBase.cc.

87 { beginOfJob(); }

References beginOfJob().

◆ beginOfJob() [3/3]

void EDLooperBase::beginOfJob ( EventSetupImpl const &  iImpl)

Definition at line 84 of file EDLooperBase.cc.

84  {
85  beginOfJob(EventSetup{iImpl, static_cast<unsigned int>(Transition::BeginRun), nullptr, false});
86  }

References beginOfJob(), and edm::BeginRun.

◆ beginRun()

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

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

Reimplemented in FWFFLooper, and AlignmentProducer.

Definition at line 150 of file EDLooperBase.cc.

150 {}

Referenced by doBeginRun().

◆ copyInfo()

void EDLooperBase::copyInfo ( ScheduleInfo const &  iInfo)

Definition at line 161 of file EDLooperBase.cc.

161 { scheduleInfo_ = std::make_unique<ScheduleInfo>(iInfo); }

References scheduleInfo_.

◆ doBeginLuminosityBlock()

void EDLooperBase::doBeginLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 119 of file EDLooperBase.cc.

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, false};
132  beginLuminosityBlock(luminosityBlock, es);
133  }

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

◆ doBeginRun()

void EDLooperBase::doBeginRun ( RunPrincipal iRP,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 92 of file EDLooperBase.cc.

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, false};
103  beginRun(run, es);
104  }

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

◆ doDuringLoop()

EDLooperBase::Status EDLooperBase::doDuringLoop ( edm::EventPrincipal eventPrincipal,
EventSetupImpl const &  es,
edm::ProcessingController ioController,
StreamContext streamContext 
)

Definition at line 42 of file EDLooperBase.cc.

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, false};
58  status = duringLoop(event, es, ioController);
59  } catch (cms::Exception& e) {
60  e.addContext("Calling the 'duringLoop' method of a looper");
63  edm::printCmsExceptionWarning("SkipEvent", e);
64  } else {
65  throw;
66  }
67  }
68  return status;
69  }

References act_table_, writedatasetfile::action, duringLoop(), MillePedeFileConverter_cfg::e, edm::Event, edmPickEvents::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().

◆ doEndLuminosityBlock()

void EDLooperBase::doEndLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 134 of file EDLooperBase.cc.

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, false};
147  endLuminosityBlock(luminosityBlock, es);
148  }

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

◆ doEndOfLoop()

EDLooperBase::Status EDLooperBase::doEndOfLoop ( EventSetupImpl const &  es)

Definition at line 71 of file EDLooperBase.cc.

71  {
72  const EventSetup es{esi, static_cast<unsigned int>(Transition::EndRun), nullptr, false};
73  return endOfLoop(es, iCounter_);
74  }

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

◆ doEndRun()

void EDLooperBase::doEndRun ( RunPrincipal iRP,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 106 of file EDLooperBase.cc.

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, false};
117  endRun(run, es);
118  }

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

◆ doStartingNewLoop()

void EDLooperBase::doStartingNewLoop ( )

Definition at line 40 of file EDLooperBase.cc.

References iCounter_, and startingNewLoop().

◆ duringLoop()

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, edm::EDLooper, and FWFFLooper.

Referenced by doDuringLoop().

◆ endLuminosityBlock()

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

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

Reimplemented in AlignmentProducer.

Definition at line 153 of file EDLooperBase.cc.

153 {}

Referenced by doEndLuminosityBlock().

◆ endOfJob()

void EDLooperBase::endOfJob ( )
virtual

◆ endOfLoop()

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, edm::IterateNTimesLooper, MuScleFit, FWFFLooper, ZeeCalibration, Pi0FixedMassWindowCalibration, AlignmentProducer, EcalEleCalibLooper, and InvRingCalib.

Referenced by doEndOfLoop().

◆ endRun()

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

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

Reimplemented in AlignmentProducer.

Definition at line 151 of file EDLooperBase.cc.

151 {}

Referenced by doEndRun().

◆ modifyingRecords()

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

Reimplemented in edm::ESProducerLooper.

Definition at line 157 of file EDLooperBase.cc.

157  {
158  return std::set<eventsetup::EventSetupRecordKey>();
159  }

Referenced by prepareForNextLoop().

◆ moduleChanger()

ModuleChanger * EDLooperBase::moduleChanger ( )
protected

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

Definition at line 164 of file EDLooperBase.cc.

164 { return moduleChanger_; }

References moduleChanger_.

Referenced by FWFFLooper::endOfLoop().

◆ operator=()

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

◆ prepareForNextLoop()

void EDLooperBase::prepareForNextLoop ( eventsetup::EventSetupProvider esp)

Definition at line 76 of file EDLooperBase.cc.

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  }

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

◆ scheduleInfo()

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.

165 { return scheduleInfo_.get(); }

References scheduleInfo_.

Referenced by FWFFLooper::startingNewLoop().

◆ setActionTable()

void edm::EDLooperBase::setActionTable ( ExceptionToActionTable const *  actionTable)
inline

Definition at line 106 of file EDLooperBase.h.

106 { act_table_ = actionTable; }

References act_table_.

◆ setModuleChanger()

void EDLooperBase::setModuleChanger ( ModuleChanger iChanger)

Definition at line 162 of file EDLooperBase.cc.

162 { moduleChanger_ = iChanger; }

References moduleChanger_.

◆ startingNewLoop()

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 FWFFLooper, __class__< T >, EcalEleCalibLooper, InvRingCalib, edm::IterateNTimesLooper, MuScleFit, ZeeCalibration, Pi0FixedMassWindowCalibration, AlignmentProducer, and edm::NavigateEventsLooper.

Referenced by doStartingNewLoop().

Member Data Documentation

◆ act_table_

ExceptionToActionTable const* edm::EDLooperBase::act_table_
private

Definition at line 149 of file EDLooperBase.h.

Referenced by doDuringLoop(), and setActionTable().

◆ iCounter_

unsigned int edm::EDLooperBase::iCounter_
private

Definition at line 148 of file EDLooperBase.h.

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

◆ moduleCallingContext_

ModuleCallingContext edm::EDLooperBase::moduleCallingContext_
private

◆ moduleChanger_

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

Definition at line 152 of file EDLooperBase.h.

Referenced by moduleChanger(), and setModuleChanger().

◆ moduleDescription_

ModuleDescription edm::EDLooperBase::moduleDescription_
private

◆ scheduleInfo_

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

Definition at line 151 of file EDLooperBase.h.

Referenced by copyInfo(), and scheduleInfo().

edm::EDLooperBase::Status
Status
Definition: EDLooperBase.h:79
edm::LuminosityBlockPrincipal::runPrincipal
RunPrincipal const & runPrincipal() const
Definition: LuminosityBlockPrincipal.h:45
edm::EventPrincipal::luminosityBlockPrincipal
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
Definition: EventPrincipal.h:81
edm::exception_actions::Rethrow
Definition: ExceptionActions.h:11
mps_update.status
status
Definition: mps_update.py:69
edm::Transition::Event
edm::printCmsExceptionWarning
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
Definition: ExceptionMessages.cc:25
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
edm::EventPrincipal::id
EventID const & id() const
Definition: EventPrincipal.h:92
edm::GlobalContext::Transition::kEndRun
edm::eventsetup::EventSetupProvider::resetRecordPlusDependentRecords
void resetRecordPlusDependentRecords(EventSetupRecordKey const &)
Used when we need to force a Record to reset all its proxies.
Definition: EventSetupProvider.cc:367
edm::for_all
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
edm::EDLooperBase::act_table_
ExceptionToActionTable const * act_table_
Definition: EDLooperBase.h:149
edm::EDLooperBase::iCounter_
unsigned int iCounter_
Definition: EDLooperBase.h:148
edm::EventPrincipal::time
Timestamp const & time() const
Definition: EventPrincipal.h:94
edm::EDLooperBase::moduleChanger_
edm::propagate_const< ModuleChanger * > moduleChanger_
Definition: EDLooperBase.h:152
edm::EDLooperBase::kStop
Definition: EDLooperBase.h:79
edm::EDLooperBase::endRun
virtual void endRun(Run const &, EventSetup const &)
Called after all event modules have processed the end of a Run.
Definition: EDLooperBase.cc:151
edm::EDLooperBase::beginRun
virtual void beginRun(Run const &, EventSetup const &)
Called after all event modules have processed the begin of a Run.
Definition: EDLooperBase.cc:150
edm::EDLooperBase::startingNewLoop
virtual void startingNewLoop(unsigned int)=0
LuminosityBlock
Event
edm::GlobalContext::Transition::kEndLuminosityBlock
edm::Transition::BeginLuminosityBlock
edm::RunPrincipal::index
RunIndex index() const
Definition: RunPrincipal.h:57
edm::EDLooperBase::endLuminosityBlock
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the end of a LuminosityBlock.
Definition: EDLooperBase.cc:153
edm::EDLooperBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:154
edm::LuminosityBlockIndex::invalidLuminosityBlockIndex
static LuminosityBlockIndex invalidLuminosityBlockIndex()
Definition: LuminosityBlockIndex.cc:9
edm::EDLooperBase::endOfLoop
virtual Status endOfLoop(EventSetup const &, unsigned int iCounter)=0
edm::EDLooperBase::moduleCallingContext_
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:155
edmPickEvents.event
event
Definition: edmPickEvents.py:273
edm::GlobalContext::Transition::kBeginLuminosityBlock
writedatasetfile.action
action
Definition: writedatasetfile.py:8
edm::StreamContext::Transition::kEvent
edm::EDLooperBase::kContinue
Definition: EDLooperBase.h:79
edm::Transition::EndLuminosityBlock
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::Transition::BeginRun
edm::EDLooperBase::duringLoop
virtual Status duringLoop(Event const &, EventSetup const &, ProcessingController &)=0
edm::ExceptionToActionTable::find
exception_actions::ActionCodes find(const std::string &category) const
Definition: ExceptionActions.cc:85
edm::EDLooperBase::modifyingRecords
virtual std::set< eventsetup::EventSetupRecordKey > modifyingRecords() const
Definition: EDLooperBase.cc:157
cms::Exception
Definition: Exception.h:70
EventSetup
edm::LuminosityBlockPrincipal::index
LuminosityBlockIndex index() const
Definition: LuminosityBlockPrincipal.h:51
event
Definition: event.py:1
edm::Transition::EndRun
edm::EDLooperBase::scheduleInfo_
edm::propagate_const< std::unique_ptr< ScheduleInfo > > scheduleInfo_
Definition: EDLooperBase.h:151
edm::GlobalContext::Transition::kBeginRun
edm::exception_actions::ActionCodes
ActionCodes
Definition: ExceptionActions.h:11
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::EDLooperBase::beginOfJob
virtual void beginOfJob()
Definition: EDLooperBase.cc:88
edm::EDLooperBase::beginLuminosityBlock
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the begin of a LuminosityBlock.
Definition: EDLooperBase.cc:152
Run