CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDLooperBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: <package>
4 // Module: EDLooperBase
5 //
6 // Author: Valentin Kuznetsov
7 // Created: Wed Jul 5 11:44:26 EDT 2006
8 // $Id: EDLooperBase.cc,v 1.1 2010/08/09 21:04:56 chrjones Exp $
9 
21 
22 #include "boost/bind.hpp"
23 
24 
25 namespace edm {
26 
27  EDLooperBase::EDLooperBase() : iCounter_(0), act_table_(0), moduleChanger_(0) { }
29 
30  void
33  }
34 
37  edm::ModuleDescription modDesc("EDLooperBase", "");
38  Event event(eventPrincipal, modDesc);
39 
41  try {
42  status = duringLoop(event, es, ioController);
43  }
44  catch(cms::Exception& e) {
46  if (action != actions::Rethrow) {
47  LogWarning(e.category())
48  << "An exception occurred in the looper, continuing with the next event\n"
49  << e.what();
50  }
51  else {
52  throw;
53  }
54  }
55  return status;
56  }
57 
60  return endOfLoop(es, iCounter_);
61  }
62 
63  void
65  ++iCounter_;
66 
67  const std::set<edm::eventsetup::EventSetupRecordKey>& keys = modifyingRecords();
68  for_all(keys,
70  esp, _1));
71  }
72 
75 
77 
79  edm::ModuleDescription modDesc("EDLooperBase", "");
80  Run run(iRP, modDesc);
81  beginRun(run,iES);
82  }
83 
85  edm::ModuleDescription modDesc("EDLooperBase", "");
86  Run run(iRP, modDesc);
87  endRun(run,iES);
88  }
90  edm::ModuleDescription modDesc("EDLooperBase", "");
91  LuminosityBlock luminosityBlock(iLB, modDesc);
92  beginLuminosityBlock(luminosityBlock,iES);
93  }
95  edm::ModuleDescription modDesc("EDLooperBase", "");
96  LuminosityBlock luminosityBlock(iLB, modDesc);
97  endLuminosityBlock(luminosityBlock,iES);
98  }
99 
100  void EDLooperBase::beginRun(Run const&, EventSetup const&){}
101  void EDLooperBase::endRun(Run const&, EventSetup const&){}
104 
106 
107 
108  std::set<eventsetup::EventSetupRecordKey>
110  {
111  return std::set<eventsetup::EventSetupRecordKey> ();
112  }
113 
114  void
116  scheduleInfo_ = std::auto_ptr<ScheduleInfo>(new ScheduleInfo(iInfo));
117  }
118  void
120  moduleChanger_ = iChanger;
121  }
122 
124  return moduleChanger_;
125  }
127  return scheduleInfo_.get();
128  }
129 
130 }
virtual char const * what() const
Definition: Exception.cc:97
virtual Status endOfLoop(EventSetup const &, unsigned int iCounter)=0
void resetRecordPlusDependentRecords(const EventSetupRecordKey &)
Used when we need to force a Record to reset all its proxies.
std::string rootCause() const
Definition: Exception.cc:78
std::auto_ptr< ScheduleInfo > scheduleInfo_
Definition: EDLooperBase.h:146
unsigned int iCounter_
Definition: EDLooperBase.h:143
void doBeginLuminosityBlock(LuminosityBlockPrincipal &, EventSetup const &)
Definition: EDLooperBase.cc:89
ActionTable const * act_table_
Definition: EDLooperBase.h:144
virtual Status duringLoop(Event const &, EventSetup const &, ProcessingController &)=0
virtual std::set< eventsetup::EventSetupRecordKey > modifyingRecords() const
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the begin of a LuminosityBlock.
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
Status doEndOfLoop(EventSetup const &es)
Definition: EDLooperBase.cc:59
ModuleChanger const * moduleChanger() const
This only returns a non-zero value during the call to endOfLoop.
void doEndLuminosityBlock(LuminosityBlockPrincipal &, EventSetup const &)
Definition: EDLooperBase.cc:94
virtual void endOfJob()
Definition: EDLooperBase.cc:76
ModuleChanger const * moduleChanger_
Definition: EDLooperBase.h:147
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
ScheduleInfo const * scheduleInfo() const
This returns a non-zero value after the constructor has been called.
void copyInfo(ScheduleInfo const &)
virtual void beginOfJob()
Definition: EDLooperBase.cc:74
void setModuleChanger(ModuleChanger const *)
virtual void endRun(Run const &, EventSetup const &)
Called after all event modules have processed the end of a Run.
void prepareForNextLoop(eventsetup::EventSetupProvider *esp)
Definition: EDLooperBase.cc:64
virtual void beginRun(Run const &, EventSetup const &)
Called after all event modules have processed the begin of a Run.
virtual void startingNewLoop(unsigned int)=0
void doBeginRun(RunPrincipal &, EventSetup const &)
Definition: EDLooperBase.cc:78
Status doDuringLoop(EventPrincipal &eventPrincipal, EventSetup const &es, ProcessingController &)
Definition: EDLooperBase.cc:36
virtual ~EDLooperBase()
Definition: EDLooperBase.cc:28
actions::ActionCodes find(const std::string &category) const
Definition: Actions.cc:95
tuple status
Definition: ntuplemaker.py:245
virtual void attachTo(ActivityRegistry &)
Override this method if you need to monitor the state of the processing.
void doStartingNewLoop()
Definition: EDLooperBase.cc:31
Definition: Run.h:31
void doEndRun(RunPrincipal &, EventSetup const &)
Definition: EDLooperBase.cc:84
std::string category() const
Definition: Exception.cc:74
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the end of a LuminosityBlock.