CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster Class Reference
Inheritance diagram for ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster:
ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<> edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >

Public Types

using Algo = pixelDetails::SiPixelRawToClusterKernel< pixelTopology::Phase2 >
 
- Public Types inherited from edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 

Public Member Functions

 SiPixelPhase2DigiToCluster (const edm::ParameterSet &iConfig)
 
 ~SiPixelPhase2DigiToCluster () override=default
 
- Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>
void acquire (edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder holder) final
 
void produce (edm::Event &iEvent, edm::EventSetup const &iSetup) final
 
- Public Member Functions inherited from edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void acquire (device::Event const &iEvent, device::EventSetup const &iSetup) override
 
void produce (device::Event &iEvent, device::EventSetup const &iSetup) override
 

Private Attributes

Algo Algo_
 
device::EDPutToken< SiPixelClustersSoACollectionclusterPutToken_
 
const SiPixelClusterThresholds clusterThresholds_
 
device::EDPutToken< SiPixelDigisSoACollectiondigiPutToken_
 
SiPixelDigisSoACollection digis_d
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
uint32_t nDigis_ = 0
 
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelDigiToken_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
auto produces () noexcept
 
ProducesCollector producesCollector ()
 

Detailed Description

Definition at line 32 of file SiPixelPhase2DigiToCluster.cc.

Member Typedef Documentation

◆ Algo

Definition at line 38 of file SiPixelPhase2DigiToCluster.cc.

Constructor & Destructor Documentation

◆ SiPixelPhase2DigiToCluster()

ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::SiPixelPhase2DigiToCluster ( const edm::ParameterSet iConfig)
explicit

Definition at line 58 of file SiPixelPhase2DigiToCluster.cc.

References edm::ParameterSet::getParameter().

63  clusterThresholds_{iConfig.getParameter<int32_t>("clusterThreshold_layer1"),
64  iConfig.getParameter<int32_t>("clusterThreshold_otherLayers"),
65  static_cast<float>(iConfig.getParameter<double>("ElectronPerADCGain")),
66  static_cast<int8_t>(iConfig.getParameter<int>("Phase2ReadoutMode")),
67  static_cast<uint16_t>(iConfig.getParameter<uint32_t>("Phase2DigiBaseline")),
68  static_cast<uint8_t>(iConfig.getParameter<uint32_t>("Phase2KinkADC"))} {}
device::EDPutToken< SiPixelDigisSoACollection > digiPutToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
device::EDPutToken< SiPixelClustersSoACollection > clusterPutToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelDigiToken_

◆ ~SiPixelPhase2DigiToCluster()

ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::~SiPixelPhase2DigiToCluster ( )
overridedefault

Member Function Documentation

◆ acquire()

void ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::acquire ( device::Event const &  iEvent,
device::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>.

Definition at line 85 of file SiPixelPhase2DigiToCluster.cc.

References Algo_, clusterThresholds_, digis_d, geomToken_, ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getData(), TrackerGeometry::idToDetUnit(), iEvent, GeomDet::index(), input, ALPAKA_ACCELERATOR_NAMESPACE::pixelDetails::SiPixelRawToClusterKernel< TrackerTraits >::makePhase2ClustersAsync(), nDigis_, pixelDigiToken_, and multPhiCorr_741_25nsDY_cfi::px.

85  {
86  auto const& input = iEvent.get(pixelDigiToken_);
87 
88  const TrackerGeometry* geom_ = &iSetup.getData(geomToken_);
89 
90  uint32_t nDigis = 0;
91 
92  for (const auto& det : input) {
93  nDigis += det.size();
94  }
95 
96  if (nDigis == 0)
97  return;
98 
99  nDigis_ = nDigis;
100  SiPixelDigisHost digis_h(nDigis_, iEvent.queue());
101 
102  nDigis = 0;
103  for (const auto& det : input) {
104  unsigned int detid = det.detId();
105  DetId detIdObject(detid);
106  const GeomDetUnit* genericDet = geom_->idToDetUnit(detIdObject);
107  auto const gind = genericDet->index();
108  for (auto const& px : det) {
109  digis_h.view()[nDigis].moduleId() = uint16_t(gind);
110 
111  digis_h.view()[nDigis].xx() = uint16_t(px.row());
112  digis_h.view()[nDigis].yy() = uint16_t(px.column());
113  digis_h.view()[nDigis].adc() = uint16_t(px.adc());
114 
115  digis_h.view()[nDigis].clus() = 0;
116 
117  digis_h.view()[nDigis].pdigi() = uint32_t(px.packedData());
118 
119  digis_h.view()[nDigis].rawIdArr() = uint32_t(detid);
120 
121  nDigis++;
122  }
123  }
124 
125  digis_d = SiPixelDigisSoACollection(nDigis, iEvent.queue());
126  alpaka::memcpy(iEvent.queue(), digis_d.buffer(), digis_h.buffer());
127 
129  }
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
int index() const
Definition: GeomDet.h:83
void makePhase2ClustersAsync(Queue &queue, const SiPixelClusterThresholds clusterThresholds, SiPixelDigisSoAView &digis_view, const uint32_t numDigis)
static std::string const input
Definition: EdmProvDump.cc:50
int iEvent
Definition: GenABIO.cc:224
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, SiPixelDigisHost, SiPixelDigisDevice< Device > > SiPixelDigisSoACollection
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: DetId.h:17
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelDigiToken_

◆ fillDescriptions()

void ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 70 of file SiPixelPhase2DigiToCluster.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), pixelClustering::clusterThresholdPhase2LayerOne, pixelClustering::clusterThresholdPhase2OtherLayers, submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

70  {
72 
73  desc.add<bool>("IncludeErrors", true);
74  desc.add<int32_t>("clusterThreshold_layer1",
76  desc.add<int32_t>("clusterThreshold_otherLayers", pixelClustering::clusterThresholdPhase2OtherLayers);
77  desc.add<double>("ElectronPerADCGain", 1500.);
78  desc.add<int32_t>("Phase2ReadoutMode", 3);
79  desc.add<uint32_t>("Phase2DigiBaseline", 1000);
80  desc.add<uint32_t>("Phase2KinkADC", 8);
81  desc.add<edm::InputTag>("InputDigis", edm::InputTag("simSiPixelDigis:Pixel"));
82  descriptions.addWithDefaultLabel(desc);
83  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
constexpr uint16_t clusterThresholdPhase2LayerOne
constexpr uint16_t clusterThresholdPhase2OtherLayers

◆ produce()

void ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::produce ( device::Event iEvent,
device::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>.

Definition at line 131 of file SiPixelPhase2DigiToCluster.cc.

References Algo_, clusterPutToken_, digiPutToken_, digis_d, ALPAKA_ACCELERATOR_NAMESPACE::pixelDetails::SiPixelRawToClusterKernel< TrackerTraits >::getClusters(), iEvent, eostools::move(), nDigis_, ALPAKA_ACCELERATOR_NAMESPACE::pixelDetails::SiPixelRawToClusterKernel< TrackerTraits >::nModules(), and pixelTopology::Phase2::numberOfModules.

131  {
132  if (nDigis_ == 0) {
134  SiPixelDigisSoACollection digis_d_zero{nDigis_, iEvent.queue()};
135  iEvent.emplace(digiPutToken_, std::move(digis_d_zero));
136  iEvent.emplace(clusterPutToken_, std::move(clusters_d));
137  return;
138  }
139 
140  digis_d.setNModules(Algo_.nModules());
143  }
device::EDPutToken< SiPixelDigisSoACollection > digiPutToken_
static constexpr uint16_t numberOfModules
int iEvent
Definition: GenABIO.cc:224
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, SiPixelDigisHost, SiPixelDigisDevice< Device > > SiPixelDigisSoACollection
device::EDPutToken< SiPixelClustersSoACollection > clusterPutToken_
def move(src, dest)
Definition: eostools.py:511
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, SiPixelClustersHost, SiPixelClustersDevice< Device > > SiPixelClustersSoACollection

Member Data Documentation

◆ Algo_

Algo ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::Algo_
private

Definition at line 50 of file SiPixelPhase2DigiToCluster.cc.

Referenced by acquire(), and produce().

◆ clusterPutToken_

device::EDPutToken<SiPixelClustersSoACollection> ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::clusterPutToken_
private

Definition at line 48 of file SiPixelPhase2DigiToCluster.cc.

Referenced by produce().

◆ clusterThresholds_

const SiPixelClusterThresholds ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::clusterThresholds_
private

Definition at line 52 of file SiPixelPhase2DigiToCluster.cc.

Referenced by acquire().

◆ digiPutToken_

device::EDPutToken<SiPixelDigisSoACollection> ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::digiPutToken_
private

Definition at line 47 of file SiPixelPhase2DigiToCluster.cc.

Referenced by produce().

◆ digis_d

SiPixelDigisSoACollection ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::digis_d
private

Definition at line 55 of file SiPixelPhase2DigiToCluster.cc.

Referenced by acquire(), and produce().

◆ geomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::geomToken_
private

Definition at line 44 of file SiPixelPhase2DigiToCluster.cc.

Referenced by acquire().

◆ nDigis_

uint32_t ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::nDigis_ = 0
private

Definition at line 53 of file SiPixelPhase2DigiToCluster.cc.

Referenced by acquire(), and produce().

◆ pixelDigiToken_

const edm::EDGetTokenT<edm::DetSetVector<PixelDigi> > ALPAKA_ACCELERATOR_NAMESPACE::SiPixelPhase2DigiToCluster::pixelDigiToken_
private

Definition at line 45 of file SiPixelPhase2DigiToCluster.cc.

Referenced by acquire().