From 865b9651d14fc7b991798d66bffeddd4bbe5c7d6 Mon Sep 17 00:00:00 2001 From: William Tanenbaum Date: Sat, 22 Aug 2009 03:40:12 +0000 Subject: [PATCH] --- yaml --- r: 72175 b: "refs/heads/CMSSW_7_1_X" c: f399d7f23147be120efa03dc8ef2bd3ab059e796 h: "refs/heads/CMSSW_7_1_X" i: 72173: 8514e5e875cbcbe3f0931973dabcc07bc420e062 72171: ca617d5d19c1375bd8cdaf1bfa2300ec276bbcf2 72167: 306af32cd414f224cdfef87f3e4f10fae311eadc 72159: 40b2df39e1758a89bbc8b92fec9d7222bcfa7f50 v: v3 --- [refs] | 2 +- .../FWCore/Framework/interface/InputSource.h | 12 ++++++++++- .../Framework/src/ConfigurableInputSource.cc | 8 -------- trunk/FWCore/Framework/src/EventProcessor.cc | 2 ++ trunk/FWCore/Framework/src/InputSource.cc | 20 +++++++++++++++++++ 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 7bbc300d3973b..fbcc0f3b94d45 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": 4cf1e716939500c0e3372b7663ad98e38f266581 +"refs/heads/CMSSW_7_1_X": f399d7f23147be120efa03dc8ef2bd3ab059e796 diff --git a/trunk/FWCore/Framework/interface/InputSource.h b/trunk/FWCore/Framework/interface/InputSource.h index 0dc5bbc052c00..344fbec296464 100644 --- a/trunk/FWCore/Framework/interface/InputSource.h +++ b/trunk/FWCore/Framework/interface/InputSource.h @@ -178,8 +178,16 @@ namespace edm { /// Called by framework at end of job void doEndJob(); - /// Called by framework when events are exhausted. + /// Called by framework at beginning of lumi block + void doBeginLumi(LuminosityBlockPrincipal& lbp); + + /// Called by framework at end of lumi block void doEndLumi(LuminosityBlockPrincipal& lbp); + + /// Called by framework at beginning of run + void doBeginRun(RunPrincipal& rp); + + /// Called by framework at end of run void doEndRun(RunPrincipal& rp); /// Called by the framework before forking the process @@ -284,7 +292,9 @@ namespace edm { virtual void wakeUp_(); void preRead(); void postRead(Event& event); + virtual void beginLuminosityBlock(LuminosityBlock&); virtual void endLuminosityBlock(LuminosityBlock&); + virtual void beginRun(Run&); virtual void endRun(Run&); virtual void beginJob(EventSetup const&); virtual void endJob(); diff --git a/trunk/FWCore/Framework/src/ConfigurableInputSource.cc b/trunk/FWCore/Framework/src/ConfigurableInputSource.cc index 857db3d0c6059..bc5d67d6c72c9 100644 --- a/trunk/FWCore/Framework/src/ConfigurableInputSource.cc +++ b/trunk/FWCore/Framework/src/ConfigurableInputSource.cc @@ -59,11 +59,6 @@ namespace edm { RunAuxiliary runAux(eventID_.run(), ts, Timestamp::invalidTimestamp()); boost::shared_ptr runPrincipal( new RunPrincipal(runAux, productRegistry(), processConfiguration())); - RunPrincipal& rp = - const_cast(*runPrincipal); - Run run(rp, moduleDescription()); - beginRun(run); - run.commit_(); newRun_ = false; return runPrincipal; } @@ -76,9 +71,6 @@ namespace edm { boost::shared_ptr lumiPrincipal( new LuminosityBlockPrincipal( lumiAux, productRegistry(), processConfiguration())); - LuminosityBlock lb(*lumiPrincipal, moduleDescription()); - beginLuminosityBlock(lb); - lb.commit_(); newLumi_ = false; return lumiPrincipal; } diff --git a/trunk/FWCore/Framework/src/EventProcessor.cc b/trunk/FWCore/Framework/src/EventProcessor.cc index 69ec09906f710..59369434d14a4 100644 --- a/trunk/FWCore/Framework/src/EventProcessor.cc +++ b/trunk/FWCore/Framework/src/EventProcessor.cc @@ -1683,6 +1683,7 @@ namespace edm { void EventProcessor::beginRun(int run) { RunPrincipal& runPrincipal = principalCache_.runPrincipal(run); + input_->doBeginRun(runPrincipal); IOVSyncValue ts(EventID(runPrincipal.run(), 0), 0, runPrincipal.beginTime()); @@ -1710,6 +1711,7 @@ namespace edm { void EventProcessor::beginLumi(int run, int lumi) { LuminosityBlockPrincipal& lumiPrincipal = principalCache_.lumiPrincipal(run, lumi); + input_->doBeginLumi(lumiPrincipal); // NOTE: Using 0 as the event number for the begin of a lumi block is a bad idea // lumi blocks know their start and end times why not also start and end events? IOVSyncValue ts(EventID(lumiPrincipal.run(), 0), lumiPrincipal.luminosityBlock(), lumiPrincipal.beginTime()); diff --git a/trunk/FWCore/Framework/src/InputSource.cc b/trunk/FWCore/Framework/src/InputSource.cc index 56a45e63635b0..27853e661619f 100644 --- a/trunk/FWCore/Framework/src/InputSource.cc +++ b/trunk/FWCore/Framework/src/InputSource.cc @@ -368,6 +368,13 @@ namespace edm { } } + void + InputSource::doBeginRun(RunPrincipal& rp) { + Run run(rp, moduleDescription()); + beginRun(run); + run.commit_(); + } + void InputSource::doEndRun(RunPrincipal& rp) { rp.setEndTime(time_); @@ -376,6 +383,13 @@ namespace edm { run.commit_(); } + void + InputSource::doBeginLumi(LuminosityBlockPrincipal& lbp) { + LuminosityBlock lb(lbp, moduleDescription()); + beginLuminosityBlock(lb); + lb.commit_(); + } + void InputSource::doEndLumi(LuminosityBlockPrincipal& lbp) { lbp.setEndTime(time_); @@ -415,9 +429,15 @@ namespace edm { void InputSource::wakeUp_() {} + void + InputSource::beginLuminosityBlock(LuminosityBlock&) {} + void InputSource::endLuminosityBlock(LuminosityBlock&) {} + void + InputSource::beginRun(Run&) {} + void InputSource::endRun(Run&) {}