CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer Class Reference
Inheritance diagram for ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer:
edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

std::optional< SiPixelMappingHostproduce (const SiPixelMappingSoARecord &iRecord)
 
 SiPixelCablingSoAESProducer (edm::ParameterSet const &iConfig)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcdcablingMapToken_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeometryToken_
 
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcdqualityToken_
 
const bool useQuality_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 25 of file SiPixelCablingSoAESProducer.cc.

Constructor & Destructor Documentation

◆ SiPixelCablingSoAESProducer()

ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer::SiPixelCablingSoAESProducer ( edm::ParameterSet const &  iConfig)
inline

Definition at line 27 of file SiPixelCablingSoAESProducer.cc.

References gpuPixelDoublets::cc, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

28  : ESProducer(iConfig), useQuality_(iConfig.getParameter<bool>("UseQualityInfo")) {
29  auto cc = setWhatProduced(this);
30  cablingMapToken_ = cc.consumes(edm::ESInputTag{"", iConfig.getParameter<std::string>("CablingMapLabel")});
31  if (useQuality_) {
32  qualityToken_ = cc.consumes();
33  }
34  geometryToken_ = cc.consumes();
35  }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > qualityToken_

Member Function Documentation

◆ fillDescriptions()

static void ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 37 of file SiPixelCablingSoAESProducer.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

37  {
39  desc.add<std::string>("CablingMapLabel", "")->setComment("CablingMap label");
40  desc.add<bool>("UseQualityInfo", false);
41  descriptions.addWithDefaultLabel(desc);
42  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

std::optional<SiPixelMappingHost> ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer::produce ( const SiPixelMappingSoARecord iRecord)
inline

Definition at line 44 of file SiPixelCablingSoAESProducer.cc.

References L1TStage2BMTF_cff::fedIds, relativeConstraints::geom, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getTransientHandle(), cms::alpakatools::host(), mps_fire::i, sipixelobjects::PixelROC::idInDetUnit(), pixelClustering::invalidModuleId, LogDebug, pixelgpudetails::MAX_LINK, pixelgpudetails::MAX_ROC, pixelgpudetails::MAX_SIZE, castor_dqm_sourceclient_file_cfg::path, quality, sipixelobjects::PixelROC::rawId(), nano_mu_digi_cff::rawId, PixelMapPlotter::roc, and PortableHostCollection< T >::view().

44  {
45  auto cablingMap = iRecord.getTransientHandle(cablingMapToken_);
46  const SiPixelQuality* quality = nullptr;
47  if (useQuality_) {
48  auto qualityInfo = iRecord.getTransientHandle(qualityToken_);
49  quality = qualityInfo.product();
50  }
51 
52  auto geom = iRecord.getTransientHandle(geometryToken_);
54  std::vector<unsigned int> const& fedIds = cablingMap->fedIds();
55  std::unique_ptr<SiPixelFedCablingTree> const& cabling = cablingMap->cablingTree();
56 
57  unsigned int startFed = fedIds.front();
58  unsigned int endFed = fedIds.back();
59 
61  int index = 1;
62 
63  auto mapView = product.view();
64 
65  mapView.hasQuality() = useQuality_;
66  for (unsigned int fed = startFed; fed <= endFed; fed++) {
67  for (unsigned int link = 1; link <= pixelgpudetails::MAX_LINK; link++) {
68  for (unsigned int roc = 1; roc <= pixelgpudetails::MAX_ROC; roc++) {
69  path = {fed, link, roc};
70  const sipixelobjects::PixelROC* pixelRoc = cabling->findItem(path);
71  mapView[index].fed() = fed;
72  mapView[index].link() = link;
73  mapView[index].roc() = roc;
74  if (pixelRoc != nullptr) {
75  mapView[index].rawId() = pixelRoc->rawId();
76  mapView[index].rocInDet() = pixelRoc->idInDetUnit();
77  mapView[index].modToUnpDefault() = false;
78  if (quality != nullptr)
79  mapView[index].badRocs() = quality->IsRocBad(pixelRoc->rawId(), pixelRoc->idInDetUnit());
80  else
81  mapView[index].badRocs() = false;
82  } else { // store some dummy number
83  mapView[index].rawId() = pixelClustering::invalidModuleId;
84  mapView[index].rocInDet() = pixelClustering::invalidModuleId;
85  mapView[index].badRocs() = true;
86  mapView[index].modToUnpDefault() = true;
87  }
88  index++;
89  }
90  }
91  } // end of FED loop
92  // Given FedId, Link and idinLnk; use the following formula
93  // to get the rawId and idinDU
94  // index = (FedID-1200) * MAX_LINK* MAX_ROC + (Link-1)* MAX_ROC + idinLnk;
95  // where, MAX_LINK = 48, MAX_ROC = 8
96  // FedID varies between 1200 to 1338 (In total 108 FED's)
97  // Link varies between 1 to 48
98  // idinLnk varies between 1 to 8
99 
100  auto trackerGeom = iRecord.getTransientHandle(geometryToken_);
101 
102  for (int i = 1; i < index; i++) {
103  if (mapView[i].rawId() == pixelClustering::invalidModuleId) {
104  mapView[i].moduleId() = pixelClustering::invalidModuleId;
105  } else {
106  auto gdet = trackerGeom->idToDetUnit(mapView[i].rawId());
107  if (!gdet) {
108  LogDebug("SiPixelCablingSoAESProducer") << " Not found: " << mapView[i].rawId() << std::endl;
109  continue;
110  }
111  mapView[i].moduleId() = gdet->index();
112  }
113  LogDebug("SiPixelCablingSoAESProducer")
114  << "----------------------------------------------------------------------------" << std::endl;
115  LogDebug("SiPixelCablingSoAESProducer") << i << std::setw(20) << mapView[i].fed() << std::setw(20)
116  << mapView[i].link() << std::setw(20) << mapView[i].roc() << std::endl;
117  LogDebug("SiPixelCablingSoAESProducer")
118  << i << std::setw(20) << mapView[i].rawId() << std::setw(20) << mapView[i].rocInDet() << std::setw(20)
119  << mapView[i].moduleId() << std::endl;
120  LogDebug("SiPixelCablingSoAESProducer")
121  << i << std::setw(20) << mapView[i].badRocs() << std::setw(20) << std::endl;
122  LogDebug("SiPixelCablingSoAESProducer")
123  << "----------------------------------------------------------------------------" << std::endl;
124  }
125 
126  mapView.size() = index - 1;
127 
128  return product;
129  }
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_
string quality
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > qualityToken_
constexpr unsigned int MAX_ROC
alpaka::DevCpu const & host()
Definition: host.h:14
constexpr unsigned int MAX_SIZE
constexpr unsigned int MAX_LINK
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:34
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
constexpr uint16_t invalidModuleId
#define LogDebug(id)

Member Data Documentation

◆ cablingMapToken_

edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer::cablingMapToken_
private

Definition at line 132 of file SiPixelCablingSoAESProducer.cc.

◆ geometryToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer::geometryToken_
private

Definition at line 134 of file SiPixelCablingSoAESProducer.cc.

◆ qualityToken_

edm::ESGetToken<SiPixelQuality, SiPixelQualityRcd> ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer::qualityToken_
private

Definition at line 133 of file SiPixelCablingSoAESProducer.cc.

◆ useQuality_

const bool ALPAKA_ACCELERATOR_NAMESPACE::SiPixelCablingSoAESProducer::useQuality_
private

Definition at line 135 of file SiPixelCablingSoAESProducer.cc.