CMS 3D CMS Logo

LuminosityBlockProcessingStatus.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_LuminosityBlockProcessingStatus_h
2 #define FWCore_Framework_LuminosityBlockProcessingStatus_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : LuminosityBlockProcessingStatus
7 //
16 //
17 // Original Author: root
18 // Created: Tue, 19 Dec 2017 14:24:57 GMT
19 //
20 
21 // system include files
22 #include <memory>
23 #include <atomic>
24 #include <vector>
25 
26 // user include files
32 
33 // forward declarations
34 namespace edm {
35 #if !defined(TEST_NO_FWD_DECL)
36  class LuminosityBlockPrincipal;
37  class LuminosityBlockProcessingStatus;
38 #endif
39 
41  public:
43 
46 
48 
51  //free lumi for next usage
52  lumiPrincipal_.reset();
54  }
55 
56  void resetResources();
57 
58  std::shared_ptr<LuminosityBlockPrincipal>& lumiPrincipal() { return lumiPrincipal_; }
59  void setLumiPrincipal(std::shared_ptr<LuminosityBlockPrincipal> val) { lumiPrincipal_ = std::move(val); }
60 
61  EventSetupImpl const& eventSetupImpl(unsigned subProcessIndex) const {
62  return *eventSetupImpls_.at(subProcessIndex);
63  }
64 
65  std::vector<std::shared_ptr<const EventSetupImpl>>& eventSetupImpls() { return eventSetupImpls_; }
66  std::vector<std::shared_ptr<const EventSetupImpl>> const& eventSetupImpls() const { return eventSetupImpls_; }
67 
69 
72 
73  bool shouldStreamStartLumi();
74  void noMoreEventsInLumi();
76 
77  //These should only be called while in the InputSource's task queue
78  void updateLastTimestamp(edm::Timestamp const& iTime) {
79  if (iTime > endTime_) {
80  endTime_ = iTime;
81  }
82  }
83  edm::Timestamp const& lastTimestamp() const { return endTime_; }
84 
85  //Called once all events in Lumi have been processed
86  void setEndTime();
87 
91 
94 
97 
100 
101  private:
102  // ---------- member data --------------------------------
104  std::shared_ptr<LuminosityBlockPrincipal> lumiPrincipal_;
105  std::vector<std::shared_ptr<const EventSetupImpl>> eventSetupImpls_;
110  std::atomic<unsigned int> nStreamsStillProcessingLumi_{0};
112  std::atomic<State> state_{State::kRunning};
114  std::atomic<char> endTimeSetStatus_{0};
115  std::atomic<bool> startedNextLumiOrEndedRun_{false};
118  };
119 } // namespace edm
120 
121 #endif
EventSetupImpl const & eventSetupImpl(unsigned subProcessIndex) const
std::vector< std::shared_ptr< const EventSetupImpl > > & eventSetupImpls()
void setResumer(LimitedTaskQueue::Resumer iResumer)
std::shared_ptr< LuminosityBlockPrincipal > & lumiPrincipal()
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
void doneWaiting(std::exception_ptr iExcept)
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
#define CMS_THREAD_GUARD(_var_)
void setLumiPrincipal(std::shared_ptr< LuminosityBlockPrincipal > val)
std::vector< std::shared_ptr< const EventSetupImpl > > const & eventSetupImpls() const
Definition: value.py:1
void updateLastTimestamp(edm::Timestamp const &iTime)
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_
LuminosityBlockProcessingStatus const & operator=(LuminosityBlockProcessingStatus const &)=delete
HLT enums.
void setEventProcessingState(EventProcessingState val)
def move(src, dest)
Definition: eostools.py:511