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:
42  LuminosityBlockProcessingStatus(unsigned int iNStreams) : nStreamsStillProcessingLumi_(iNStreams) {}
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 
74 
75  //These should only be called while in the InputSource's task queue
76  void updateLastTimestamp(edm::Timestamp const& iTime) {
77  if (iTime > endTime_) {
78  endTime_ = iTime;
79  }
80  }
81  edm::Timestamp const& lastTimestamp() const { return endTime_; }
82 
83  //Called once all events in Lumi have been processed
84  void setEndTime();
85 
89 
92 
95 
98 
99  private:
100  // ---------- member data --------------------------------
102  std::shared_ptr<LuminosityBlockPrincipal> lumiPrincipal_;
103  std::vector<std::shared_ptr<const EventSetupImpl>> eventSetupImpls_;
106  std::atomic<unsigned int> nStreamsStillProcessingLumi_{0}; //read/write as streams finish lumi so must be atomic
108  std::atomic<char> endTimeSetStatus_{0};
110  std::atomic<bool> startedNextLumiOrEndedRun_{false};
113  };
114 } // namespace edm
115 
116 #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_
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