CMS 3D CMS Logo

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