Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-13 23:27:04

0001 #ifndef FWCore_Framework_TransitionInfoTypes_h
0002 #define FWCore_Framework_TransitionInfoTypes_h
0003 //
0004 // Package:     FWCore/Framework
0005 //
0006 /**
0007 
0008  Description: The types here are used to pass information
0009  down to the Worker class from the EventProcessor.
0010 
0011 */
0012 //
0013 // Original Author:  W. David Dagenhart
0014 //         Created:  26 June 2020
0015 
0016 #include <memory>
0017 #include <vector>
0018 
0019 namespace edm {
0020   class EventPrincipal;
0021   class EventSetupImpl;
0022   class LuminosityBlockPrincipal;
0023   class ProcessBlockPrincipal;
0024   class RunPrincipal;
0025 
0026   class EventTransitionInfo {
0027   public:
0028     EventTransitionInfo() {}
0029 
0030     EventTransitionInfo(EventPrincipal& iPrincipal, EventSetupImpl const& iEventSetupImpl)
0031         : eventPrincipal_(&iPrincipal), eventSetupImpl_(&iEventSetupImpl) {}
0032 
0033     EventPrincipal& principal() { return *eventPrincipal_; }
0034     EventPrincipal const& principal() const { return *eventPrincipal_; }
0035     EventSetupImpl const& eventSetupImpl() const { return *eventSetupImpl_; }
0036 
0037   private:
0038     EventPrincipal* eventPrincipal_ = nullptr;
0039     EventSetupImpl const* eventSetupImpl_ = nullptr;
0040   };
0041 
0042   class LumiTransitionInfo {
0043   public:
0044     LumiTransitionInfo() {}
0045 
0046     LumiTransitionInfo(LuminosityBlockPrincipal& iPrincipal,
0047                        EventSetupImpl const& iEventSetupImpl,
0048                        std::vector<std::shared_ptr<const EventSetupImpl>> const* iEventSetupImpls = nullptr)
0049         : luminosityBlockPrincipal_(&iPrincipal),
0050           eventSetupImpl_(&iEventSetupImpl),
0051           eventSetupImpls_(iEventSetupImpls) {}
0052 
0053     LuminosityBlockPrincipal& principal() { return *luminosityBlockPrincipal_; }
0054     LuminosityBlockPrincipal const& principal() const { return *luminosityBlockPrincipal_; }
0055     EventSetupImpl const& eventSetupImpl() const { return *eventSetupImpl_; }
0056     std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls() const { return eventSetupImpls_; }
0057 
0058   private:
0059     LuminosityBlockPrincipal* luminosityBlockPrincipal_ = nullptr;
0060     EventSetupImpl const* eventSetupImpl_ = nullptr;
0061     std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls_ = nullptr;
0062   };
0063 
0064   class RunTransitionInfo {
0065   public:
0066     RunTransitionInfo() {}
0067 
0068     RunTransitionInfo(RunPrincipal& iPrincipal, EventSetupImpl const& iEventSetupImpl)
0069         : runPrincipal_(&iPrincipal), eventSetupImpl_(&iEventSetupImpl) {}
0070 
0071     RunPrincipal& principal() { return *runPrincipal_; }
0072     RunPrincipal const& principal() const { return *runPrincipal_; }
0073     EventSetupImpl const& eventSetupImpl() const { return *eventSetupImpl_; }
0074 
0075   private:
0076     RunPrincipal* runPrincipal_ = nullptr;
0077     EventSetupImpl const* eventSetupImpl_ = nullptr;
0078   };
0079 
0080   class ProcessBlockTransitionInfo {
0081   public:
0082     ProcessBlockTransitionInfo() {}
0083 
0084     ProcessBlockTransitionInfo(ProcessBlockPrincipal& iPrincipal) : processBlockPrincipal_(&iPrincipal) {}
0085 
0086     ProcessBlockPrincipal& principal() { return *processBlockPrincipal_; }
0087     ProcessBlockPrincipal const& principal() const { return *processBlockPrincipal_; }
0088 
0089   private:
0090     ProcessBlockPrincipal* processBlockPrincipal_ = nullptr;
0091   };
0092 
0093 };  // namespace edm
0094 
0095 #endif