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  // Workaround until the ProductID problem in issue https://github.com/cms-sw/cmssw/issues/44643 is fixed
63 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
64  if constexpr (std::is_same_v<TrackerTraits, pixelTopology::Phase1>) {
65  producesTemporarily("edm::DeviceProduct<alpaka_cuda_async::pixelTrack::TracksSoACollectionPhase1>");
66  }
67 #endif
68  }
69 
70  template <typename TrackerTraits>
73 
74  desc.add<edm::InputTag>("pixelRecHitSrc", edm::InputTag("siPixelRecHitsPreSplittingAlpaka"));
75 
76  std::string cpe = "PixelCPEFastParams";
77  cpe += TrackerTraits::nameModifier;
78  desc.add<std::string>("CPE", cpe);
79 
81  descriptions.addWithDefaultLabel(desc);
82  }
83 
84  template <typename TrackerTraits>
86  auto bf = 1. / es.getData(tokenField_).inverseBzAtOriginInGeV();
87 
88  auto& fcpe = es.getData(cpeToken_);
89 
90  auto const& hits = iEvent.get(tokenHit_);
91 
92  iEvent.emplace(tokenTrack_, deviceAlgo_.makeTuplesAsync(hits, fcpe.const_buffer().data(), bf, iEvent.queue()));
93  }
94 
97 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
98 
100 
const device::EDGetToken< HitsOnDevice > tokenHit_
Definition: CAHitNtuplet.cc:49
void produce(device::Event &iEvent, const device::EventSetup &es) override
Definition: CAHitNtuplet.cc:85
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:71
TracksSoACollection< TrackerTraits > TkSoADevice
Definition: CAHitNtuplet.cc:36
int iEvent
Definition: GenABIO.cc:224
TrackingRecHitsSoACollection< TrackerTraits > HitsOnDevice
Definition: CAHitNtuplet.cc:32
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:96
CAHitNtupletAlpaka< pixelTopology::Phase1 > CAHitNtupletAlpakaPhase1
Definition: CAHitNtuplet.cc:95