CMS 3D CMS Logo

List of all members | Public Member Functions
ALPAKA_ACCELERATOR_NAMESPACE::HGCalLayerClustersSoAAlgoKernelPositionByHits3 Class Reference

Public Member Functions

template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
ALPAKA_FN_ACC void operator() (TAcc const &acc, const unsigned int numer_of_clusters, float thresholdW0, float positionDeltaRho2, const HGCalSoARecHitsDeviceCollection::ConstView input_rechits_soa, const HGCalSoARecHitsExtraDeviceCollection::ConstView input_clusters_soa, HGCalSoAClustersDeviceCollection::View outputs, HGCalSoAClustersExtraDeviceCollection::View outputs_service) const
 

Detailed Description

Definition at line 122 of file HGCalLayerClustersSoAAlgoWrapper.dev.cc.

Member Function Documentation

◆ operator()()

template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
ALPAKA_FN_ACC void ALPAKA_ACCELERATOR_NAMESPACE::HGCalLayerClustersSoAAlgoKernelPositionByHits3::operator() ( TAcc const &  acc,
const unsigned int  numer_of_clusters,
float  thresholdW0,
float  positionDeltaRho2,
const HGCalSoARecHitsDeviceCollection::ConstView  input_rechits_soa,
const HGCalSoARecHitsExtraDeviceCollection::ConstView  input_clusters_soa,
HGCalSoAClustersDeviceCollection::View  outputs,
HGCalSoAClustersExtraDeviceCollection::View  outputs_service 
) const
inline

Definition at line 125 of file HGCalLayerClustersSoAAlgoWrapper.dev.cc.

References f, PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, and cms::alpakatools::uniform_elements().

132  {
133  // make a strided loop over the kernel grid, covering up to "size" elements
134  for (int32_t cluster_index : uniform_elements(acc, outputs.metadata().size())) {
135  const int max_energy_index = outputs_service[cluster_index].maxEnergyIndex();
136 
137  if (outputs_service[cluster_index].total_weight_log() > 0.f) {
138  float inv_tot_weight = 1.f / outputs_service[cluster_index].total_weight_log();
139  outputs[cluster_index].x() *= inv_tot_weight;
140  outputs[cluster_index].y() *= inv_tot_weight;
141  } else {
142  outputs[cluster_index].x() = input_rechits_soa[max_energy_index].dim1();
143  outputs[cluster_index].y() = input_rechits_soa[max_energy_index].dim2();
144  }
145  outputs[cluster_index].z() = input_rechits_soa[max_energy_index].dim3();
146  } // uniform_elements
147  } // operator()
ALPAKA_FN_ACC auto uniform_elements(TAcc const &acc, TArgs... args)
Definition: workdivision.h:311
double f[11][100]