CMS 3D CMS Logo

PFClusterSoAProducer.cc
Go to the documentation of this file.
1 #include <Eigen/Core>
2 #include <Eigen/Dense>
3 
17 
20  public:
22  : pfClusParamsToken(esConsumes(config.getParameter<edm::ESInputTag>("pfClusterParams"))),
23  topologyToken_(esConsumes(config.getParameter<edm::ESInputTag>("topology"))),
24  inputPFRecHitSoA_Token_{consumes(config.getParameter<edm::InputTag>("pfRecHits"))},
27  synchronise_(config.getParameter<bool>("synchronise")),
28  pfRecHitFractionAllocation_(config.getParameter<int>("pfRecHitFractionAllocation")) {}
29 
34  int nRH = 0;
35  if (pfRecHits->metadata().size() != 0)
36  nRH = pfRecHits->size();
37 
38  reco::PFClusteringVarsDeviceCollection pfClusteringVars{nRH, event.queue()};
39  reco::PFClusteringEdgeVarsDeviceCollection pfClusteringEdgeVars{(nRH * 8), event.queue()};
40  reco::PFClusterDeviceCollection pfClusters{nRH, event.queue()};
41  reco::PFRecHitFractionDeviceCollection pfrhFractions{nRH * pfRecHitFractionAllocation_, event.queue()};
42 
43  if (nRH != 0) {
44  PFClusterProducerKernel kernel(event.queue(), pfRecHits);
45  kernel.execute(event.queue(),
46  params,
47  topology,
48  pfClusteringVars,
49  pfClusteringEdgeVars,
50  pfRecHits,
51  pfClusters,
52  pfrhFractions);
53  }
54 
55  if (synchronise_)
56  alpaka::wait(event.queue());
57 
58  event.emplace(outputPFClusterSoA_Token_, std::move(pfClusters));
59  event.emplace(outputPFRHFractionSoA_Token_, std::move(pfrhFractions));
60  }
61 
62  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
64  desc.add<edm::InputTag>("pfRecHits", edm::InputTag(""));
65  desc.add<edm::ESInputTag>("pfClusterParams", edm::ESInputTag(""));
66  desc.add<edm::ESInputTag>("topology", edm::ESInputTag(""));
67  desc.add<bool>("synchronise", false);
68  desc.add<int>("pfRecHitFractionAllocation", 120);
69  descriptions.addWithDefaultLabel(desc);
70  }
71 
72  private:
78  const bool synchronise_;
80  };
81 
82 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
83 
85 DEFINE_FWK_ALPAKA_MODULE(PFClusterSoAProducer);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const device::ESGetToken< reco::PFRecHitHCALTopologyDeviceCollection, PFRecHitHCALTopologyRecord > topologyToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< reco::PFRecHitHostCollection > inputPFRecHitSoA_Token_
Definition: config.py:1
void execute(Queue &queue, const reco::PFClusterParamsDeviceCollection &params, const reco::PFRecHitHCALTopologyDeviceCollection &topology, reco::PFClusteringVarsDeviceCollection &pfClusteringVars, reco::PFClusteringEdgeVarsDeviceCollection &pfClusteringEdgeVars, const reco::PFRecHitHostCollection &pfRecHits, reco::PFClusterDeviceCollection &pfClusters, reco::PFRecHitFractionDeviceCollection &pfrhFractions)
const device::EDPutToken< reco::PFRecHitFractionDeviceCollection > outputPFRHFractionSoA_Token_
PortableCollection<::reco::PFClusterSoA > PFClusterDeviceCollection
PortableCollection<::reco::PFClusteringVarsSoA > PFClusteringVarsDeviceCollection
void produce(device::Event &event, device::EventSetup const &setup) override
PortableCollection<::reco::PFRecHitHCALTopologySoA > PFRecHitHCALTopologyDeviceCollection
PortableCollection<::reco::PFRecHitFractionSoA > PFRecHitFractionDeviceCollection
PortableCollection<::reco::PFClusterParamsSoA > PFClusterParamsDeviceCollection
const device::EDPutToken< reco::PFClusterDeviceCollection > outputPFClusterSoA_Token_
const device::ESGetToken< reco::PFClusterParamsDeviceCollection, JobConfigurationGPURecord > pfClusParamsToken
PortableCollection<::reco::PFClusteringEdgeVarsSoA > PFClusteringEdgeVarsDeviceCollection
HLT enums.
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:16
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1