CMS 3D CMS Logo

TrackingRecHit2DReduced.h
Go to the documentation of this file.
1 #ifndef CUDADataFormats_TrackingRecHit_interface_TrackingRecHit2DReduced_h
2 #define CUDADataFormats_TrackingRecHit_interface_TrackingRecHit2DReduced_h
3 
6 
7 // a reduced (in content and therefore in size) version to be used on CPU for Legacy reconstruction
9 public:
12 
13  template <typename UP32, typename UP16>
14  TrackingRecHit2DReduced(UP32&& istore32, UP16&& istore16, int nhits)
15  : m_store32(std::move(istore32)), m_store16(std::move(istore16)), m_nHits(nhits) {
16  auto get32 = [&](int i) { return const_cast<float*>(m_store32.get()) + i * nhits; };
17 
18  // copy all the pointers (better be in sync with the producer store)
19 
20  m_view.m_xl = get32(0);
21  m_view.m_yl = get32(1);
22  m_view.m_xerr = get32(2);
23  m_view.m_yerr = get32(3);
24  m_view.m_chargeAndStatus = reinterpret_cast<uint32_t*>(get32(4));
25  m_view.m_detInd = const_cast<uint16_t*>(m_store16.get());
26  }
27 
28  // view only!
30 
31  TrackingRecHit2DReduced() = default;
32  ~TrackingRecHit2DReduced() = default;
33 
38 
40  TrackingRecHit2DSOAView const& view() const { return m_view; }
41 
42  auto nHits() const { return m_nHits; }
43 
44 private:
46 
49 
50  int m_nHits;
51 };
52 
53 #endif
auto const * get() const
Definition: HostProduct.h:18
TrackingRecHit2DSOAView & view()
TrackingRecHit2DReduced(UP32 &&istore32, UP16 &&istore16, int nhits)
TrackingRecHit2DSOAView m_view
TrackingRecHit2DReduced()=default
TrackingRecHit2DReduced & operator=(const TrackingRecHit2DReduced &)=delete
TrackingRecHit2DSOAView const & view() const
~TrackingRecHit2DReduced()=default
def move(src, dest)
Definition: eostools.py:511
TrackingRecHit2DReduced(TrackingRecHit2DSOAView const &iview, int nhits)