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 const *)
 
virtual ~EDLooperBase ()
 

Protected Member Functions

ModuleChanger const * moduleChanger () const
 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_
 
ModuleChanger const * moduleChanger_
 
ModuleDescription moduleDescription_
 
std::auto_ptr< ScheduleInfoscheduleInfo_
 

Detailed Description

Definition at line 76 of file EDLooperBase.h.

Member Enumeration Documentation

Enumerator
kContinue 
kStop 

Definition at line 78 of file EDLooperBase.h.

Constructor & Destructor Documentation

EDLooperBase::EDLooperBase ( )

Definition at line 34 of file EDLooperBase.cc.

34  : iCounter_(0), act_table_(nullptr), moduleChanger_(nullptr),
35  moduleDescription_("Looper", "looper"),
37  { }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:154
unsigned int iCounter_
Definition: EDLooperBase.h:147
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:153
ModuleChanger const * moduleChanger_
Definition: EDLooperBase.h:151
ExceptionToActionTable const * act_table_
Definition: EDLooperBase.h:148
EDLooperBase::~EDLooperBase ( )
virtual

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

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

Referenced by doBeginLuminosityBlock().

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

Reimplemented in AlignmentProducer.

Definition at line 90 of file EDLooperBase.cc.

References beginOfJob().

90 { beginOfJob();}
virtual void beginOfJob()
Definition: EDLooperBase.cc:91
void EDLooperBase::beginOfJob ( )
virtual

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

Definition at line 91 of file EDLooperBase.cc.

Referenced by beginOfJob().

91 { }
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 145 of file EDLooperBase.cc.

Referenced by doBeginRun().

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

Definition at line 160 of file EDLooperBase.cc.

References scheduleInfo_.

160  {
161  scheduleInfo_ = std::auto_ptr<ScheduleInfo>(new ScheduleInfo(iInfo));
162  }
std::auto_ptr< ScheduleInfo > scheduleInfo_
Definition: EDLooperBase.h:150
void EDLooperBase::doBeginLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetup const &  iES,
ProcessContext processContext 
)

Definition at line 120 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().

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

Definition at line 95 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.

95  {
96  GlobalContext globalContext(GlobalContext::Transition::kBeginRun,
97  LuminosityBlockID(iRP.run(), 0),
98  iRP.index(),
100  iRP.beginTime(),
101  processContext);
102  ParentContext parentContext(&globalContext);
103  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
105  beginRun(run,iES);
106  }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:154
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:153
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 46 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().

47  {
48 
49  streamContext->setTransition(StreamContext::Transition::kEvent);
50  streamContext->setEventID(eventPrincipal.id());
51  streamContext->setRunIndex(eventPrincipal.luminosityBlockPrincipal().runPrincipal().index());
52  streamContext->setLuminosityBlockIndex(eventPrincipal.luminosityBlockPrincipal().index());
53  streamContext->setTimestamp(eventPrincipal.time());
54  ParentContext parentContext(streamContext);
55  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
57 
59  try {
60  status = duringLoop(event, es, ioController);
61  }
62  catch(cms::Exception& e) {
63  e.addContext("Calling the 'duringLoop' method of a looper");
65  if (action != exception_actions::Rethrow) {
66  edm::printCmsExceptionWarning("SkipEvent", e);
67  }
68  else {
69  throw;
70  }
71  }
72  return status;
73  }
RunPrincipal const & runPrincipal() const
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:154
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
Timestamp const & time() const
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:153
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e, edm::JobReport *jobRep=0, int rc=-1)
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:148
void addContext(std::string const &context)
Definition: Exception.cc:227
RunIndex index() const
Definition: RunPrincipal.h:53
tuple status
Definition: ntuplemaker.py:245
void EDLooperBase::doEndLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetup const &  iES,
ProcessContext processContext 
)

Definition at line 132 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().

132  {
133  GlobalContext globalContext(GlobalContext::Transition::kEndLuminosityBlock,
134  iLB.id(),
135  iLB.runPrincipal().index(),
136  iLB.index(),
137  iLB.beginTime(),
138  processContext);
139  ParentContext parentContext(&globalContext);
140  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
142  endLuminosityBlock(luminosityBlock,iES);
143  }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:154
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:153
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 76 of file EDLooperBase.cc.

References endOfLoop(), and iCounter_.

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

Definition at line 108 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.

108  {
109  GlobalContext globalContext(GlobalContext::Transition::kEndRun,
110  LuminosityBlockID(iRP.run(), 0),
111  iRP.index(),
113  iRP.endTime(),
114  processContext);
115  ParentContext parentContext(&globalContext);
116  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
118  endRun(run,iES);
119  }
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:154
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:153
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 41 of file EDLooperBase.cc.

References iCounter_, and startingNewLoop().

41  {
43  }
unsigned int iCounter_
Definition: EDLooperBase.h:147
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 148 of file EDLooperBase.cc.

Referenced by doEndLuminosityBlock().

148 {}
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 146 of file EDLooperBase.cc.

Referenced by doEndRun().

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

Reimplemented in edm::ESProducerLooper.

Definition at line 154 of file EDLooperBase.cc.

Referenced by prepareForNextLoop().

155  {
156  return std::set<eventsetup::EventSetupRecordKey> ();
157  }
const ModuleChanger * EDLooperBase::moduleChanger ( ) const
protected

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

Definition at line 168 of file EDLooperBase.cc.

References moduleChanger_.

Referenced by FWFFLooper::endOfLoop().

168  {
169  return moduleChanger_;
170  }
ModuleChanger const * moduleChanger_
Definition: EDLooperBase.h:151
EDLooperBase& edm::EDLooperBase::operator= ( EDLooperBase const &  )
delete
void EDLooperBase::prepareForNextLoop ( eventsetup::EventSetupProvider esp)

Definition at line 81 of file EDLooperBase.cc.

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

81  {
82  ++iCounter_;
83 
84  std::set<edm::eventsetup::EventSetupRecordKey> const& keys = modifyingRecords();
85  for_all(keys,
87  esp, _1));
88  }
unsigned int iCounter_
Definition: EDLooperBase.h:147
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 171 of file EDLooperBase.cc.

References scheduleInfo_.

Referenced by FWFFLooper::startingNewLoop().

171  {
172  return scheduleInfo_.get();
173  }
std::auto_ptr< ScheduleInfo > scheduleInfo_
Definition: EDLooperBase.h:150
void edm::EDLooperBase::setActionTable ( ExceptionToActionTable const *  actionTable)
inline

Definition at line 104 of file EDLooperBase.h.

References act_table_.

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

Definition at line 164 of file EDLooperBase.cc.

References moduleChanger_.

164  {
165  moduleChanger_ = iChanger;
166  }
ModuleChanger const * moduleChanger_
Definition: EDLooperBase.h:151
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 148 of file EDLooperBase.h.

Referenced by doDuringLoop(), and setActionTable().

unsigned int edm::EDLooperBase::iCounter_
private

Definition at line 147 of file EDLooperBase.h.

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

ModuleCallingContext edm::EDLooperBase::moduleCallingContext_
private
ModuleChanger const* edm::EDLooperBase::moduleChanger_
private

Definition at line 151 of file EDLooperBase.h.

Referenced by moduleChanger(), and setModuleChanger().

ModuleDescription edm::EDLooperBase::moduleDescription_
private
std::auto_ptr<ScheduleInfo> edm::EDLooperBase::scheduleInfo_
private

Definition at line 150 of file EDLooperBase.h.

Referenced by copyInfo(), and scheduleInfo().