CMS 3D CMS Logo

PFClusterSoAProducer.cc
Go to the documentation of this file.
1 #include <Eigen/Core>
2 #include <Eigen/Dense>
15 
18  public:
20  : pfClusParamsToken(esConsumes(config.getParameter<edm::ESInputTag>("pfClusterParams"))),
21  topologyToken_(esConsumes(config.getParameter<edm::ESInputTag>("topology"))),
22  inputPFRecHitSoA_Token_{consumes(config.getParameter<edm::InputTag>("pfRecHits"))},
25  synchronise_(config.getParameter<bool>("synchronise")),
26  pfRecHitFractionAllocation_(config.getParameter<int>("pfRecHitFractionAllocation")) {}
27 
32  const int nRH = pfRecHits->size();
33 
34  reco::PFClusteringVarsDeviceCollection pfClusteringVars{nRH, event.queue()};
35  reco::PFClusteringEdgeVarsDeviceCollection pfClusteringEdgeVars{(nRH * 8), event.queue()};
36  reco::PFClusterDeviceCollection pfClusters{nRH, event.queue()};
37  reco::PFRecHitFractionDeviceCollection pfrhFractions{nRH * pfRecHitFractionAllocation_, event.queue()};
38 
39  PFClusterProducerKernel kernel(event.queue(), pfRecHits);
40  kernel.execute(
41  event.queue(), params, topology, pfClusteringVars, pfClusteringEdgeVars, pfRecHits, pfClusters, pfrhFractions);
42 
43  if (synchronise_)
44  alpaka::wait(event.queue());
45 
46  event.emplace(outputPFClusterSoA_Token_, std::move(pfClusters));
47  event.emplace(outputPFRHFractionSoA_Token_, std::move(pfrhFractions));
48  }
49 
50  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
52  desc.add<edm::InputTag>("pfRecHits");
53  desc.add<edm::ESInputTag>("pfClusterParams");
54  desc.add<edm::ESInputTag>("topology");
55  desc.add<bool>("synchronise");
56  desc.add<int>("pfRecHitFractionAllocation", 120);
57  descriptions.addWithDefaultLabel(desc);
58  }
59 
60  private:
66  const bool synchronise_;
68  };
69 
70 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
71 
73 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