CMS 3D CMS Logo

HcalRecoParamWithPulseShapeT.h
Go to the documentation of this file.
1 #ifndef CondFormats_HcalObjects_interface_HcalRecoParamWithPulseShapeHostT_h
2 #define CondFormats_HcalObjects_interface_HcalRecoParamWithPulseShapeHostT_h
3 
7 
8 namespace hcal {
9  template <typename TDev>
11  public:
14 
15  using PulseShapeConstElement = typename PulseShapeCollection::ConstView::const_element;
16 
17  class ConstView {
18  public:
19  using RecoParamConstView = typename RecoParamCollection::ConstView;
20  using PulseShapeConstView = typename PulseShapeCollection::ConstView;
22  : recoParamView_{recoView}, pulseShapeView_{psView} {};
23 
24  ALPAKA_FN_ACC PulseShapeConstElement getPulseShape(uint32_t const hashedId) const {
25  auto const recoPulseShapeId = recoParamView_.ids()[hashedId];
26  return pulseShapeView_[recoPulseShapeId];
27  }
28 
29  constexpr typename RecoParamCollection::ConstView recoParamView() { return recoParamView_; }
30 
31  private:
32  typename RecoParamCollection::ConstView recoParamView_;
33  typename PulseShapeCollection::ConstView pulseShapeView_;
34  };
35 
36  HcalRecoParamWithPulseShapeT(size_t recoSize, size_t pulseSize, TDev const& dev)
37  : recoParam_(recoSize, dev), pulseShape_(pulseSize, dev) {}
38  template <typename TQueue, typename = std::enable_if_t<alpaka::isQueue<TQueue>>>
39  HcalRecoParamWithPulseShapeT(size_t recoSize, size_t pulseSize, TQueue const& queue)
40  : recoParam_(recoSize, queue), pulseShape_(pulseSize, queue) {}
43 
44  const RecoParamCollection& recoParam() const { return recoParam_; }
45  const PulseShapeCollection& pulseShape() const { return pulseShape_; }
46 
47  typename RecoParamCollection::View recoParamView() { return recoParam_.view(); }
49 
50  ConstView const_view() const { return ConstView(recoParam_.view(), pulseShape_.view()); }
51 
52  private:
55  };
56 } // namespace hcal
57 #endif
typename PulseShapeCollection::ConstView PulseShapeConstView
PortableCollection< HcalPulseShapeSoA, TDev > PulseShapeCollection
const RecoParamCollection & recoParam() const
HcalRecoParamWithPulseShapeT(size_t recoSize, size_t pulseSize, TQueue const &queue)
ALPAKA_FN_ACC PulseShapeConstElement getPulseShape(uint32_t const hashedId) const
const PulseShapeCollection & pulseShape() const
HcalRecoParamWithPulseShapeT(RecoParamCollection reco, PulseShapeCollection pulse)
HcalRecoParamWithPulseShapeT(size_t recoSize, size_t pulseSize, TDev const &dev)
double pulse(double x, double y, double z, double t)
PortableCollection< HcalRecoParamSoA, TDev > RecoParamCollection
fixed size matrix
typename PulseShapeCollection::ConstView::const_element PulseShapeConstElement
typename traits::PortableCollectionTrait< T, TDev >::CollectionType PortableCollection
constexpr ConstView(RecoParamConstView recoView, PulseShapeConstView psView)
typename RecoParamCollection::ConstView RecoParamConstView
constexpr RecoParamCollection::ConstView recoParamView()
def move(src, dest)
Definition: eostools.py:511