CMS 3D CMS Logo

LuminosityBlockFromSource.h
Go to the documentation of this file.
1 #ifndef FWCore_TestProcessor_LuminosityBlockFromSource_h
2 #define FWCore_TestProcessor_LuminosityBlockFromSource_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/TestProcessor
6 // Class : LuminosityBlockFromSource
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 
35  namespace test {
36 
38  public:
39  LuminosityBlockFromSource(std::shared_ptr<LuminosityBlockPrincipal const> iPrincipal, edm::ServiceToken iToken)
40  : principal_(iPrincipal), token_(iToken) {}
41 
42  // ---------- const member functions ---------------------
43  template <typename T>
44  TestHandle<T> get(std::string const& iModule,
45  std::string const& iInstanceLabel,
46  std::string const& iProcess) const {
48 
49  auto h = principal_->getByLabel(
50  edm::PRODUCT_TYPE, edm::TypeID(typeid(T)), iModule, iInstanceLabel, iProcess, 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  RunNumber_t run() const { return principal_->run(); }
61  LuminosityBlockNumber_t luminosityBlock() const { return principal_->luminosityBlock(); }
62  LuminosityBlockAuxiliary const& aux() const { return principal_->aux(); }
63 
64  // ---------- static member functions --------------------
65 
66  // ---------- member functions ---------------------------
67 
68  private:
69  // ---------- member data --------------------------------
70  std::shared_ptr<LuminosityBlockPrincipal const> principal_;
72  };
73  } // namespace test
74 } // namespace edm
75 
76 #endif
LuminosityBlockAuxiliary const & aux() const
assert(be >=bs)
unsigned int LuminosityBlockNumber_t
LuminosityBlockNumber_t luminosityBlock() const
LuminosityBlockFromSource(std::shared_ptr< LuminosityBlockPrincipal const > iPrincipal, edm::ServiceToken iToken)
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
std::shared_ptr< LuminosityBlockPrincipal const > principal_
static HepMC::HEPEVT_Wrapper wrapper