CMS 3D CMS Logo

EventFromSource.h
Go to the documentation of this file.
1 #ifndef FWCore_TestProcessor_EventFromSource_h
2 #define FWCore_TestProcessor_EventFromSource_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/TestProcessor
6 // Class : EventFromSource
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Mon, 30 Apr 2018 18:51:27 GMT
19 //
20 
21 // system include files
22 #include <string>
23 
24 // user include files
30 
31 // forward declarations
32 
33 namespace edm {
34  class EventFromSourcePrincipal;
35 
36  namespace test {
37 
39  public:
41  : principal_(&iPrincipal), token_(iToken) {}
42 
43  // ---------- const member functions ---------------------
44  template <typename T>
45  TestHandle<T> get(std::string const& iModule,
46  std::string const& iInstanceLabel,
47  std::string const& iProcess) const {
49 
50  auto h = principal_->getByLabel(
51  edm::PRODUCT_TYPE, edm::TypeID(typeid(T)), iModule, iInstanceLabel, iProcess, nullptr, nullptr, nullptr);
52  if (h.failedToGet()) {
53  return TestHandle<T>(std::move(h.whyFailedFactory()));
54  }
55  void const* basicWrapper = h.wrapper();
56  assert(basicWrapper);
57  Wrapper<T> const* wrapper = static_cast<Wrapper<T> const*>(basicWrapper);
58  return TestHandle<T>(wrapper->product());
59  }
60 
61  RunNumber_t run() const { return principal_->run(); }
63  EventNumber_t event() const { return principal_->aux().event(); }
64  EventAuxiliary const& aux() const { return principal_->aux(); }
65 
66  private:
67  // ---------- member data --------------------------------
70  };
71  } // namespace test
72 } // namespace edm
73 
74 #endif
EventNumber_t event() const
EventAuxiliary const & aux() const
RunNumber_t run() const
LuminosityBlockNumber_t luminosityBlock() const
edm::ServiceToken token_
unsigned long long EventNumber_t
assert(be >=bs)
unsigned int LuminosityBlockNumber_t
LuminosityBlockNumber_t luminosityBlock() const
EventAuxiliary const & aux() const
BasicHandle getByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:576
EventPrincipal const * principal_
RunNumber_t run() const
EventFromSource(EventPrincipal const &iPrincipal, edm::ServiceToken iToken)
EventNumber_t event() const
HLT enums.
unsigned int RunNumber_t
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
long double T
def move(src, dest)
Definition: eostools.py:511
static HepMC::HEPEVT_Wrapper wrapper