CMS 3D CMS Logo

Event.h
Go to the documentation of this file.
1 #ifndef FWCore_TestProcessor_Event_h
2 #define FWCore_TestProcessor_Event_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/TestProcessor
6 // Class : Event
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
28 
29 // forward declarations
30 
31 namespace edm {
32  class EventPrincipal;
33 
34  namespace test {
35 
36  class Event {
37  public:
38  Event(EventPrincipal const& iPrincipal, std::string iModuleLabel, std::string iProcessName, bool modulePassed);
39 
40  // ---------- const member functions ---------------------
41  template <typename T>
42  TestHandle<T> get() const {
43  static const std::string s_null;
44  return get<T>(s_null);
45  }
46 
47  template <typename T>
48  TestHandle<T> get(std::string const& iInstanceLabel) const {
49  auto h = principal_->getByLabel(
50  edm::PRODUCT_TYPE, edm::TypeID(typeid(T)), label_, iInstanceLabel, processName_, nullptr, nullptr, nullptr);
51  if (h.failedToGet()) {
52  return TestHandle<T>(std::move(h.whyFailedFactory()));
53  }
54  void const* basicWrapper = h.wrapper();
55  assert(basicWrapper);
56  Wrapper<T> const* wrapper = static_cast<Wrapper<T> const*>(basicWrapper);
57  return TestHandle<T>(wrapper->product());
58  }
59 
60  bool modulePassed() const { return modulePassed_; }
61  // ---------- static member functions --------------------
62 
63  // ---------- member functions ---------------------------
64 
65  private:
66  // ---------- member data --------------------------------
71  };
72  } // namespace test
73 } // namespace edm
74 
75 #endif
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Event(EventPrincipal const &iPrincipal, std::string iModuleLabel, std::string iProcessName, bool modulePassed)
Definition: Event.cc:32
BasicHandle getByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:540
EventPrincipal const * principal_
Definition: Event.h:67
T const * product() const
Definition: Wrapper.h:35
std::string label_
Definition: Event.h:68
HLT enums.
bool modulePassed() const
Definition: Event.h:60
long double T
std::string processName_
Definition: Event.h:69
def move(src, dest)
Definition: eostools.py:511
bool modulePassed_
Definition: Event.h:70
static HepMC::HEPEVT_Wrapper wrapper