CMS 3D CMS Logo

PixelVertexProducerAlpaka.cc
Go to the documentation of this file.
1 #include <alpaka/alpaka.hpp>
2 
16 
22 
23 #include "vertexFinder.h"
24 
26 
27  using namespace cms::alpakatools;
28 
29  template <typename TrackerTraits>
33 
34  public:
35  explicit PixelVertexProducerAlpaka(const edm::ParameterSet& iConfig);
36  ~PixelVertexProducerAlpaka() override = default;
37 
38  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
39 
40  private:
41  void produce(edm::StreamID streamID, device::Event& iEvent, const device::EventSetup& iSetup) const override;
42 
43  const Algo algo_;
44 
45  // Tracking cuts before sending tracks to vertex algo
46  const float ptMin_;
47  const float ptMax_;
48 
51  };
52 
53  template <typename TrackerTraits>
55  : algo_(conf.getParameter<bool>("oneKernel"),
56  conf.getParameter<bool>("useDensity"),
57  conf.getParameter<bool>("useDBSCAN"),
58  conf.getParameter<bool>("useIterative"),
59  conf.getParameter<bool>("doSplitting"),
60  conf.getParameter<int>("minT"),
61  conf.getParameter<double>("eps"),
62  conf.getParameter<double>("errmax"),
63  conf.getParameter<double>("chi2max")),
64  ptMin_(conf.getParameter<double>("PtMin")), // 0.5 GeV
65  ptMax_(conf.getParameter<double>("PtMax")), // 75. Onsumes
66  tokenDeviceTrack_(consumes(conf.getParameter<edm::InputTag>("pixelTrackSrc"))),
67  tokenDeviceVertex_(produces()) {}
68 
69  template <typename TrackerTraits>
72 
73  // Only one of these three algos can be used at once.
74  // Maybe this should become a Plugin Factory
75  desc.add<bool>("oneKernel", true);
76  desc.add<bool>("useDensity", true);
77  desc.add<bool>("useDBSCAN", false);
78  desc.add<bool>("useIterative", false);
79  desc.add<bool>("doSplitting", true);
80 
81  desc.add<int>("minT", 2); // min number of neighbours to be "core"
82  desc.add<double>("eps", 0.07); // max absolute distance to cluster
83  desc.add<double>("errmax", 0.01); // max error to be "seed"
84  desc.add<double>("chi2max", 9.); // max normalized distance to cluster
85 
86  desc.add<double>("PtMin", 0.5);
87  desc.add<double>("PtMax", 75.);
88  desc.add<edm::InputTag>("pixelTrackSrc", edm::InputTag("pixelTracksAlpaka"));
89 
90  descriptions.addWithDefaultLabel(desc);
91  }
92 
93  template <typename TrackerTraits>
96  const device::EventSetup& iSetup) const {
97  auto const& hTracks = iEvent.get(tokenDeviceTrack_);
98 
99  iEvent.emplace(tokenDeviceVertex_, algo_.makeAsync(iEvent.queue(), hTracks.view(), ptMin_, ptMax_));
100  }
101 
105 
106 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
107 
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
device::EDPutToken< ZVertexSoACollection > tokenDeviceVertex_
PixelVertexProducerAlpaka< pixelTopology::HIonPhase1 > PixelVertexProducerAlpakaHIonPhase1
PixelVertexProducerAlpaka< pixelTopology::Phase1 > PixelVertexProducerAlpakaPhase1
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iEvent
Definition: GenABIO.cc:224
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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
void produce(edm::StreamID streamID, device::Event &iEvent, const device::EventSetup &iSetup) const override
PixelVertexProducerAlpaka< pixelTopology::Phase2 > PixelVertexProducerAlpakaPhase2