CMS 3D CMS Logo

LuminosityBlock.h
Go to the documentation of this file.
1 #ifndef FWCore_TestProcessor_LuminosityBlock_h
2 #define FWCore_TestProcessor_LuminosityBlock_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/TestProcessor
6 // Class : LuminosityBlock
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 
36  public:
37  LuminosityBlock(std::shared_ptr<LuminosityBlockPrincipal const> iPrincipal,
38  std::string iModuleLabel,
39  std::string iProcessName);
40 
41  // ---------- const member functions ---------------------
42  template <typename T>
43  TestHandle<T> get() const {
44  static const std::string s_null;
45  return get<T>(s_null);
46  }
47 
48  template <typename T>
49  TestHandle<T> get(std::string const& iInstanceLabel) const {
50  auto h = principal_->getByLabel(
51  edm::PRODUCT_TYPE, edm::TypeID(typeid(T)), label_, iInstanceLabel, processName_, 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  // ---------- static member functions --------------------
61 
62  // ---------- member functions ---------------------------
63 
64  private:
65  // ---------- member data --------------------------------
66  std::shared_ptr<LuminosityBlockPrincipal const> principal_;
69  };
70  } // namespace test
71 } // namespace edm
72 
73 #endif
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
LuminosityBlock(std::shared_ptr< LuminosityBlockPrincipal const > iPrincipal, std::string iModuleLabel, std::string iProcessName)
std::shared_ptr< LuminosityBlockPrincipal const > principal_
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