Event.h
Go to the documentation of this file.
1 #ifndef art_Framework_Principal_Event_h
2 #define art_Framework_Principal_Event_h
3 // vim: set sw=2 expandtab :
4 
5 // =============================================================
6 // This is the primary interface for accessing products from a
7 // triggered event and inserting new derived products.
8 //
9 // For its usage, see "art/Framework/Principal/DataViewImpl.h"
10 // =============================================================
11 
17 
18 #include <memory>
19 
20 namespace art {
21 
22  class Event final : private DataViewImpl {
23  public:
24  template <typename T>
25  using HandleT = Handle<T>;
26 
27  ~Event();
28 
29  explicit Event(EventPrincipal const& ep, ModuleContext const& mc);
30 
31  Event(Event const&) = delete;
32  Event(Event&&) = delete;
33  Event& operator=(Event const&) = delete;
34  Event& operator=(Event&&) = delete;
35 
36  EventID id() const;
37  using DataViewImpl::event;
40  using DataViewImpl::run;
42  using DataViewImpl::time;
43 
44  SubRun const& getSubRun() const;
45  Run const& getRun() const;
46 
49 
50  using DataViewImpl::put;
51 
59 
62 
67 
68  // Obsolete interface (will be deprecated)
69  using DataViewImpl::get;
74 
76 
77  private:
78  std::unique_ptr<SubRun const> const subRun_;
79  };
80 
81 } // namespace art
82 
83 #endif /* art_Framework_Principal_Event_h */
84 
85 // Local Variables:
86 // mode: c++
87 // End:
Event(EventPrincipal const &ep, ModuleContext const &mc)
Definition: Event.cc:27
EventNumber_t event() const
Definition: DataViewImpl.cc:85
PROD const * getPointerByLabel(InputTag const &tag) const
Definition: DataViewImpl.h:651
ProductID getProductID(std::string const &instance_name="") const
Definition: DataViewImpl.h:338
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
ProcessHistory const & processHistory() const
bool get(SelectorBase const &, Handle< PROD > &result) const
Definition: DataViewImpl.h:606
bool getProcessParameterSet(std::string const &process, fhicl::ParameterSet &) const
void movePutProductsToPrincipal(Principal &principal)
Definition: Run.h:17
EventAuxiliary::ExperimentType experimentType() const
std::vector< InputTag > getInputTags(SelectorBase const &selector=MatchAllSelector{}) const
Definition: DataViewImpl.h:457
std::vector< ProductToken< PROD > > getProductTokens(SelectorBase const &selector=MatchAllSelector{}) const
Definition: DataViewImpl.h:466
bool isRealData() const
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
Timestamp time() const
History const & history() const
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
Definition: DataViewImpl.h:479
EDProductGetter const * productGetter(ProductID const pid) const
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition: DataViewImpl.h:677
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
cet::exempt_ptr< BranchDescription const > getProductDescription(ProductID) const
RunNumber_t run() const
Definition: DataViewImpl.cc:71
Run const & getRun() const
Definition: Event.cc:50
bool removeCachedProduct(Handle< PROD > &) const
Definition: DataViewImpl.h:927
std::unique_ptr< SubRun const > const subRun_
Definition: Event.h:78
ProcessHistoryID const & processHistoryID() const
Event & operator=(Event const &)=delete
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
bool getByToken(ProductToken< PROD > const &token, Handle< PROD > &result) const
Definition: DataViewImpl.h:660
PROD const & getProduct(InputTag const &tag) const
Definition: DataViewImpl.h:367
SubRun const & getSubRun() const
Definition: Event.cc:40
EventID id() const
Definition: Event.cc:34