CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
virtual void beginOfJob (EventSetup const &)
 
virtual void beginOfJob ()
 
void copyInfo (ScheduleInfo const &)
 
void doBeginLuminosityBlock (LuminosityBlockPrincipal &, EventSetup const &, ProcessContext *)
 
void doBeginRun (RunPrincipal &, EventSetup const &, ProcessContext *)
 
Status doDuringLoop (EventPrincipal &eventPrincipal, EventSetup const &es, ProcessingController &, StreamContext *)
 
void doEndLuminosityBlock (LuminosityBlockPrincipal &, EventSetup const &, ProcessContext *)
 
Status doEndOfLoop (EventSetup const &es)
 
void doEndRun (RunPrincipal &, EventSetup const &, ProcessContext *)
 
void doStartingNewLoop ()
 
 EDLooperBase ()
 
 EDLooperBase (EDLooperBase const &)=delete
 
virtual void endOfJob ()
 
virtual std::set
< eventsetup::EventSetupRecordKey
modifyingRecords () const
 
EDLooperBaseoperator= (EDLooperBase const &)=delete
 
void prepareForNextLoop (eventsetup::EventSetupProvider *esp)
 
void setActionTable (ExceptionToActionTable const *actionTable)
 
void setModuleChanger (ModuleChanger *)
 
virtual ~EDLooperBase ()
 

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 31 of file EDLooperBase.cc.

31  : iCounter_(0), act_table_(nullptr), moduleChanger_(nullptr),
32  moduleDescription_("Looper", "looper"),
34  { }
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 ( )
virtual

Definition at line 35 of file EDLooperBase.cc.

35 { }
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 147 of file EDLooperBase.cc.

147 {}
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 144 of file EDLooperBase.cc.

Referenced by doBeginLuminosityBlock().

144 {}
void EDLooperBase::beginOfJob ( EventSetup const &  )
virtual

Reimplemented in AlignmentProducer.

Definition at line 87 of file EDLooperBase.cc.

References beginOfJob().

87 { beginOfJob();}
virtual void beginOfJob()
Definition: EDLooperBase.cc:88
void EDLooperBase::beginOfJob ( )
virtual

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

Definition at line 88 of file EDLooperBase.cc.

Referenced by beginOfJob().

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

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

Reimplemented in AlignmentProducer, and FWFFLooper.

Definition at line 142 of file EDLooperBase.cc.

Referenced by doBeginRun().

142 {}
void EDLooperBase::copyInfo ( ScheduleInfo const &  iInfo)

Definition at line 157 of file EDLooperBase.cc.

References scheduleInfo_.

157  {
158  scheduleInfo_ = std::auto_ptr<ScheduleInfo>(new ScheduleInfo(iInfo));
159  }
edm::propagate_const< std::unique_ptr< ScheduleInfo > > scheduleInfo_
Definition: EDLooperBase.h:151
void EDLooperBase::doBeginLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetup const &  iES,
ProcessContext processContext 
)

Definition at line 117 of file EDLooperBase.cc.

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

117  {
118  GlobalContext globalContext(GlobalContext::Transition::kBeginLuminosityBlock,
119  iLB.id(),
120  iLB.runPrincipal().index(),
121  iLB.index(),
122  iLB.beginTime(),
123  processContext);
124  ParentContext parentContext(&globalContext);
125  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
127  beginLuminosityBlock(luminosityBlock,iES);
128  }
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,
EventSetup const &  iES,
ProcessContext processContext 
)

Definition at line 92 of file EDLooperBase.cc.

References beginRun(), edm::RunPrincipal::beginTime(), edm::RunPrincipal::index(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kBeginRun, moduleCallingContext_, moduleDescription_, edm::RunPrincipal::run(), and DTTTrigCorrFirst::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  beginRun(run,iES);
103  }
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 ( edm::EventPrincipal eventPrincipal,
EventSetup const &  es,
edm::ProcessingController ioController,
StreamContext streamContext 
)

Definition at line 43 of file EDLooperBase.cc.

References act_table_, alignCSCRings::action, cms::Exception::addContext(), cms::Exception::category(), duringLoop(), alignCSCRings::e, event(), edm::ExceptionToActionTable::find(), edm::EventPrincipal::id(), edm::RunPrincipal::index(), edm::LuminosityBlockPrincipal::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(), ntuplemaker::status, and edm::EventPrincipal::time().

44  {
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  status = duringLoop(event, es, ioController);
58  }
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  }
65  else {
66  throw;
67  }
68  }
69  return status;
70  }
RunPrincipal const & runPrincipal() const
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:155
EventID const & id() const
std::string const & category() const
Definition: Exception.cc:183
exception_actions::ActionCodes find(const std::string &category) const
LuminosityBlockIndex index() const
virtual Status duringLoop(Event const &, EventSetup const &, ProcessingController &)=0
Definition: Event.h:16
Timestamp const & time() const
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:154
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
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:227
RunIndex index() const
Definition: RunPrincipal.h:53
tuple status
Definition: ntuplemaker.py:245
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
void EDLooperBase::doEndLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetup const &  iES,
ProcessContext processContext 
)

Definition at line 129 of file EDLooperBase.cc.

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

129  {
130  GlobalContext globalContext(GlobalContext::Transition::kEndLuminosityBlock,
131  iLB.id(),
132  iLB.runPrincipal().index(),
133  iLB.index(),
134  iLB.beginTime(),
135  processContext);
136  ParentContext parentContext(&globalContext);
137  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
139  endLuminosityBlock(luminosityBlock,iES);
140  }
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 ( EventSetup const &  es)

Definition at line 73 of file EDLooperBase.cc.

References endOfLoop(), and iCounter_.

73  {
74  return endOfLoop(es, iCounter_);
75  }
virtual Status endOfLoop(EventSetup const &, unsigned int iCounter)=0
unsigned int iCounter_
Definition: EDLooperBase.h:148
void EDLooperBase::doEndRun ( RunPrincipal iRP,
EventSetup const &  iES,
ProcessContext processContext 
)

Definition at line 105 of file EDLooperBase.cc.

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

105  {
106  GlobalContext globalContext(GlobalContext::Transition::kEndRun,
107  LuminosityBlockID(iRP.run(), 0),
108  iRP.index(),
110  iRP.endTime(),
111  processContext);
112  ParentContext parentContext(&globalContext);
113  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
115  endRun(run,iES);
116  }
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 38 of file EDLooperBase.cc.

References iCounter_, and startingNewLoop().

38  {
40  }
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 FWFFLooper, edm::EDLooper, and 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.

Reimplemented in AlignmentProducer.

Definition at line 145 of file EDLooperBase.cc.

Referenced by doEndLuminosityBlock().

145 {}
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 MuScleFit, ZeeCalibration, AlignmentProducer, Pi0FixedMassWindowCalibration, FWFFLooper, EcalEleCalibLooper, InvRingCalib, edm::NavigateEventsLooper, edm::IterateNTimesLooper, and PhysicsTools::MVATrainerLooper.

Referenced by doEndOfLoop().

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 143 of file EDLooperBase.cc.

Referenced by doEndRun().

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

Reimplemented in edm::ESProducerLooper.

Definition at line 151 of file EDLooperBase.cc.

Referenced by prepareForNextLoop().

152  {
153  return std::set<eventsetup::EventSetupRecordKey> ();
154  }
ModuleChanger * EDLooperBase::moduleChanger ( )
protected

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

Definition at line 165 of file EDLooperBase.cc.

References moduleChanger_.

Referenced by FWFFLooper::endOfLoop().

165  {
166  return moduleChanger_;
167  }
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 78 of file EDLooperBase.cc.

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

78  {
79  ++iCounter_;
80 
81  std::set<edm::eventsetup::EventSetupRecordKey> const& keys = modifyingRecords();
82  for_all(keys,
84  esp, std::placeholders::_1));
85  }
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:16
const ScheduleInfo * EDLooperBase::scheduleInfo ( ) const
protected

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

Definition at line 168 of file EDLooperBase.cc.

References scheduleInfo_.

Referenced by FWFFLooper::startingNewLoop().

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

Definition at line 105 of file EDLooperBase.h.

References act_table_.

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

Definition at line 161 of file EDLooperBase.cc.

References moduleChanger_.

161  {
162  moduleChanger_ = iChanger;
163  }
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, AlignmentProducer, Pi0FixedMassWindowCalibration, FWFFLooper, __class__< T >, EcalEleCalibLooper, 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(), and setActionTable().

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