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 
20 
21 #include "boost/bind.hpp"
22 
23 
24 namespace edm {
25 
26  EDLooperBase::EDLooperBase() : iCounter_(0), act_table_(0), moduleChanger_(0) { }
28 
29  void
32  }
33 
36  edm::ModuleDescription modDesc("EDLooperBase", "");
37  Event event(eventPrincipal, modDesc);
38 
40  try {
41  status = duringLoop(event, es, ioController);
42  }
43  catch(cms::Exception& e) {
44  e.addContext("Calling the 'duringLoop' method of a looper");
46  if (action != actions::Rethrow) {
47  edm::printCmsExceptionWarning("SkipEvent", e);
48  }
49  else {
50  throw;
51  }
52  }
53  return status;
54  }
55 
58  return endOfLoop(es, iCounter_);
59  }
60 
61  void
63  ++iCounter_;
64 
65  std::set<edm::eventsetup::EventSetupRecordKey> const& keys = modifyingRecords();
66  for_all(keys,
68  esp, _1));
69  }
70 
73 
75 
77  edm::ModuleDescription modDesc("EDLooperBase", "");
78  Run run(iRP, modDesc);
79  beginRun(run,iES);
80  }
81 
83  edm::ModuleDescription modDesc("EDLooperBase", "");
84  Run run(iRP, modDesc);
85  endRun(run,iES);
86  }
88  edm::ModuleDescription modDesc("EDLooperBase", "");
89  LuminosityBlock luminosityBlock(iLB, modDesc);
90  beginLuminosityBlock(luminosityBlock,iES);
91  }
93  edm::ModuleDescription modDesc("EDLooperBase", "");
94  LuminosityBlock luminosityBlock(iLB, modDesc);
95  endLuminosityBlock(luminosityBlock,iES);
96  }
97 
98  void EDLooperBase::beginRun(Run const&, EventSetup const&){}
99  void EDLooperBase::endRun(Run const&, EventSetup const&){}
102 
104 
105 
106  std::set<eventsetup::EventSetupRecordKey>
108  {
109  return std::set<eventsetup::EventSetupRecordKey> ();
110  }
111 
112  void
114  scheduleInfo_ = std::auto_ptr<ScheduleInfo>(new ScheduleInfo(iInfo));
115  }
116  void
118  moduleChanger_ = iChanger;
119  }
120 
122  return moduleChanger_;
123  }
125  return scheduleInfo_.get();
126  }
127 
128 }
virtual Status endOfLoop(EventSetup const &, unsigned int iCounter)=0
std::auto_ptr< ScheduleInfo > scheduleInfo_
Definition: EDLooperBase.h:146
unsigned int iCounter_
Definition: EDLooperBase.h:143
std::string const & category() const
Definition: Exception.cc:183
void doBeginLuminosityBlock(LuminosityBlockPrincipal &, EventSetup const &)
Definition: EDLooperBase.cc:87
ActionTable const * act_table_
Definition: EDLooperBase.h:144
void resetRecordPlusDependentRecords(EventSetupRecordKey const &)
Used when we need to force a Record to reset all its proxies.
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:57
ModuleChanger const * moduleChanger() const
This only returns a non-zero value during the call to endOfLoop.
void doEndLuminosityBlock(LuminosityBlockPrincipal &, EventSetup const &)
Definition: EDLooperBase.cc:92
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e, edm::JobReport *jobRep=0, int rc=-1)
virtual void endOfJob()
Definition: EDLooperBase.cc:74
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:72
void setModuleChanger(ModuleChanger const *)
void addContext(std::string const &context)
Definition: Exception.cc:227
virtual void endRun(Run const &, EventSetup const &)
Called after all event modules have processed the end of a Run.
Definition: EDLooperBase.cc:99
void prepareForNextLoop(eventsetup::EventSetupProvider *esp)
Definition: EDLooperBase.cc:62
virtual void beginRun(Run const &, EventSetup const &)
Called after all event modules have processed the begin of a Run.
Definition: EDLooperBase.cc:98
virtual void startingNewLoop(unsigned int)=0
void doBeginRun(RunPrincipal &, EventSetup const &)
Definition: EDLooperBase.cc:76
Status doDuringLoop(EventPrincipal &eventPrincipal, EventSetup const &es, ProcessingController &)
Definition: EDLooperBase.cc:35
virtual ~EDLooperBase()
Definition: EDLooperBase.cc:27
actions::ActionCodes find(const std::string &category) const
Definition: Actions.cc:93
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:30
Definition: Run.h:33
void doEndRun(RunPrincipal &, EventSetup const &)
Definition: EDLooperBase.cc:82
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the end of a LuminosityBlock.