CMS 3D CMS Logo

CAHitNtuplet.cc
Go to the documentation of this file.
1 #include <alpaka/alpaka.hpp>
2 
25 
26 #include "CAHitNtupletGenerator.h"
27 
29  template <typename TrackerTraits>
34 
37 
39 
40  public:
41  explicit CAHitNtupletAlpaka(const edm::ParameterSet& iConfig);
42  ~CAHitNtupletAlpaka() override = default;
43  void produce(device::Event& iEvent, const device::EventSetup& es) override;
44  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
45 
46  private:
51 
53  };
54 
55  template <typename TrackerTraits>
57  : tokenField_(esConsumes()),
58  cpeToken_(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("CPE")))),
59  tokenHit_(consumes(iConfig.getParameter<edm::InputTag>("pixelRecHitSrc"))),
60  tokenTrack_(produces()),
61  deviceAlgo_(iConfig) {}
62 
63  template <typename TrackerTraits>
66 
67  desc.add<edm::InputTag>("pixelRecHitSrc", edm::InputTag("siPixelRecHitsPreSplittingAlpaka"));
68 
69  std::string cpe = "PixelCPEFastParams";
70  cpe += TrackerTraits::nameModifier;
71  desc.add<std::string>("CPE", cpe);
72 
74  descriptions.addWithDefaultLabel(desc);
75  }
76 
77  template <typename TrackerTraits>
79  auto bf = 1. / es.getData(tokenField_).inverseBzAtOriginInGeV();
80 
81  auto& fcpe = es.getData(cpeToken_);
82 
83  auto const& hits = iEvent.get(tokenHit_);
84 
85  iEvent.emplace(tokenTrack_, deviceAlgo_.makeTuplesAsync(hits, fcpe.const_buffer().data(), bf, iEvent.queue()));
86  }
87 
91 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
92 
94 
const device::EDGetToken< HitsOnDevice > tokenHit_
Definition: CAHitNtuplet.cc:49
void produce(device::Event &iEvent, const device::EventSetup &es) override
Definition: CAHitNtuplet.cc:78
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const device::EDPutToken< TkSoADevice > tokenTrack_
Definition: CAHitNtuplet.cc:50
CAHitNtupletAlpaka(const edm::ParameterSet &iConfig)
Definition: CAHitNtuplet.cc:56
const device::ESGetToken< PixelCPEFastParams< TrackerTraits >, PixelCPEFastParamsRecord > cpeToken_
Definition: CAHitNtuplet.cc:48
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tokenField_
Definition: CAHitNtuplet.cc:47
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: CAHitNtuplet.cc:64
TracksSoACollection< TrackerTraits > TkSoADevice
Definition: CAHitNtuplet.cc:36
int iEvent
Definition: GenABIO.cc:224
TrackingRecHitsSoACollection< TrackerTraits > HitsOnDevice
Definition: CAHitNtuplet.cc:32
CAHitNtupletAlpaka< pixelTopology::HIonPhase1 > CAHitNtupletAlpakaHIonPhase1
Definition: CAHitNtuplet.cc:89
TrackingRecHitSoAConstView< TrackerTraits > HitsConstView
Definition: CAHitNtuplet.cc:31
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, TrackingRecHitHost< TrackerTraits >, TrackingRecHitDevice< TrackerTraits, Device > > TrackingRecHitsSoACollection
T const & getData(edm::ESGetToken< T, R > const &iToken) const
Definition: EventSetup.h:32
void fillPSetDescription(edm::ParameterSetDescription &desc)
typename TrackingRecHitSoA< TrackerTraits >::template TrackingRecHitSoALayout<>::ConstView TrackingRecHitSoAConstView
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, TracksHost< TrackerTraits >, TracksDevice< TrackerTraits, Device > > TracksSoACollection
HLT enums.
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:16
CAHitNtupletAlpaka< pixelTopology::Phase2 > CAHitNtupletAlpakaPhase2
Definition: CAHitNtuplet.cc:90
CAHitNtupletAlpaka< pixelTopology::Phase1 > CAHitNtupletAlpakaPhase1
Definition: CAHitNtuplet.cc:88