CMS 3D CMS Logo

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

Public Member Functions

 EcalMultifitConditionsHostESProducer (edm::ParameterSet const &iConfig)
 
std::unique_ptr< EcalMultifitConditionsHostproduce (EcalMultifitConditionsRcd const &iRecord)
 
- 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< EcalGainRatios, EcalGainRatiosRcdgainRatiosToken_
 
edm::ESGetToken< EcalPedestals, EcalPedestalsRcdpedestalsToken_
 
edm::ESGetToken< EcalPulseCovariances, EcalPulseCovariancesRcdpulseCovariancesToken_
 
edm::ESGetToken< EcalPulseShapes, EcalPulseShapesRcdpulseShapesToken_
 
edm::ESGetToken< EcalSampleMask, EcalSampleMaskRcdsampleMaskToken_
 
edm::ESGetToken< EcalSamplesCorrelation, EcalSamplesCorrelationRcdsamplesCorrelationToken_
 
edm::ESGetToken< EcalTimeBiasCorrections, EcalTimeBiasCorrectionsRcdtimeBiasCorrectionsToken_
 
edm::ESGetToken< EcalTimeCalibConstants, EcalTimeCalibConstantsRcdtimeCalibConstantsToken_
 
edm::ESGetToken< EcalTimeOffsetConstant, EcalTimeOffsetConstantRcdtimeOffsetConstantToken_
 

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 41 of file EcalMultifitConditionsHostESProducer.cc.

Constructor & Destructor Documentation

◆ EcalMultifitConditionsHostESProducer()

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

Definition at line 43 of file EcalMultifitConditionsHostESProducer.cc.

References gpuPixelDoublets::cc, gainRatiosToken_, pedestalsToken_, pulseCovariancesToken_, pulseShapesToken_, sampleMaskToken_, samplesCorrelationToken_, edm::ESProducer::setWhatProduced(), timeBiasCorrectionsToken_, timeCalibConstantsToken_, and timeOffsetConstantToken_.

43  : ESProducer(iConfig) {
44  auto cc = setWhatProduced(this);
45  pedestalsToken_ = cc.consumes();
46  gainRatiosToken_ = cc.consumes();
47  pulseShapesToken_ = cc.consumes();
48  pulseCovariancesToken_ = cc.consumes();
49  samplesCorrelationToken_ = cc.consumes();
50  timeBiasCorrectionsToken_ = cc.consumes();
51  timeCalibConstantsToken_ = cc.consumes();
52  sampleMaskToken_ = cc.consumes();
53  timeOffsetConstantToken_ = cc.consumes();
54  }
edm::ESGetToken< EcalSamplesCorrelation, EcalSamplesCorrelationRcd > samplesCorrelationToken_
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< EcalTimeBiasCorrections, EcalTimeBiasCorrectionsRcd > timeBiasCorrectionsToken_
edm::ESGetToken< EcalTimeCalibConstants, EcalTimeCalibConstantsRcd > timeCalibConstantsToken_
edm::ESGetToken< EcalPulseCovariances, EcalPulseCovariancesRcd > pulseCovariancesToken_
edm::ESGetToken< EcalTimeOffsetConstant, EcalTimeOffsetConstantRcd > timeOffsetConstantToken_

Member Function Documentation

◆ fillDescriptions()

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

◆ produce()

std::unique_ptr<EcalMultifitConditionsHost> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::produce ( EcalMultifitConditionsRcd const &  iRecord)
inline

Definition at line 61 of file EcalMultifitConditionsHostESProducer.cc.

References cms::cuda::assert(), nano_mu_digi_cff::float, gainRatiosToken_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), cms::alpakatools::host(), mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, kMaxTimeBiasCorrectionBinsEB, kMaxTimeBiasCorrectionBinsEE, SiStripPI::min, pedestalsToken_, pulseCovariancesToken_, pulseShapesToken_, sampleMaskToken_, samplesCorrelationToken_, ecalPh1::sampleSize, EcalPulseShape::TEMPLATESAMPLES, timeBiasCorrectionsToken_, timeCalibConstantsToken_, timeOffsetConstantToken_, and heppy_batch::val.

61  {
62  auto const& pedestalsData = iRecord.get(pedestalsToken_);
63  auto const& gainRatiosData = iRecord.get(gainRatiosToken_);
64  auto const& pulseShapesData = iRecord.get(pulseShapesToken_);
65  auto const& pulseCovariancesData = iRecord.get(pulseCovariancesToken_);
66  auto const& samplesCorrelationData = iRecord.get(samplesCorrelationToken_);
67  auto const& timeBiasCorrectionsData = iRecord.get(timeBiasCorrectionsToken_);
68  auto const& timeCalibConstantsData = iRecord.get(timeCalibConstantsToken_);
69  auto const& sampleMaskData = iRecord.get(sampleMaskToken_);
70  auto const& timeOffsetConstantData = iRecord.get(timeOffsetConstantToken_);
71 
72  size_t numberOfXtals = pedestalsData.size();
73 
74  auto product = std::make_unique<EcalMultifitConditionsHost>(numberOfXtals, cms::alpakatools::host());
75  auto view = product->view();
76 
77  // Filling pedestals
78  const auto barrelSize = pedestalsData.barrelItems().size();
79  const auto endcapSize = pedestalsData.endcapItems().size();
80 
81  auto const& pedestalsEB = pedestalsData.barrelItems();
82  auto const& pedestalsEE = pedestalsData.endcapItems();
83  auto const& gainRatiosEB = gainRatiosData.barrelItems();
84  auto const& gainRatiosEE = gainRatiosData.endcapItems();
85  auto const& pulseShapesEB = pulseShapesData.barrelItems();
86  auto const& pulseShapesEE = pulseShapesData.endcapItems();
87  auto const& pulseCovariancesEB = pulseCovariancesData.barrelItems();
88  auto const& pulseCovariancesEE = pulseCovariancesData.endcapItems();
89  auto const& timeCalibConstantsEB = timeCalibConstantsData.barrelItems();
90  auto const& timeCalibConstantsEE = timeCalibConstantsData.endcapItems();
91 
92  for (unsigned int i = 0; i < barrelSize; ++i) {
93  auto vi = view[i];
94 
95  vi.pedestals_mean_x12() = pedestalsEB[i].mean_x12;
96  vi.pedestals_rms_x12() = pedestalsEB[i].rms_x12;
97  vi.pedestals_mean_x6() = pedestalsEB[i].mean_x6;
98  vi.pedestals_rms_x6() = pedestalsEB[i].rms_x6;
99  vi.pedestals_mean_x1() = pedestalsEB[i].mean_x1;
100  vi.pedestals_rms_x1() = pedestalsEB[i].rms_x1;
101 
102  vi.gain12Over6() = gainRatiosEB[i].gain12Over6();
103  vi.gain6Over1() = gainRatiosEB[i].gain6Over1();
104 
105  vi.timeCalibConstants() = timeCalibConstantsEB[i];
106 
107  std::memcpy(vi.pulseShapes().data(), pulseShapesEB[i].pdfval, sizeof(float) * EcalPulseShape::TEMPLATESAMPLES);
108  for (unsigned int j = 0; j < EcalPulseShape::TEMPLATESAMPLES; ++j) {
109  for (unsigned int k = 0; k < EcalPulseShape::TEMPLATESAMPLES; ++k) {
110  vi.pulseCovariance()(j, k) = pulseCovariancesEB[i].val(j, k);
111  }
112  }
113  } // end Barrel loop
114  for (unsigned int i = 0; i < endcapSize; ++i) {
115  auto vi = view[barrelSize + i];
116 
117  vi.pedestals_mean_x12() = pedestalsEE[i].mean_x12;
118  vi.pedestals_rms_x12() = pedestalsEE[i].rms_x12;
119  vi.pedestals_mean_x6() = pedestalsEE[i].mean_x6;
120  vi.pedestals_rms_x6() = pedestalsEE[i].rms_x6;
121  vi.pedestals_mean_x1() = pedestalsEE[i].mean_x1;
122  vi.pedestals_rms_x1() = pedestalsEE[i].rms_x1;
123 
124  vi.gain12Over6() = gainRatiosEE[i].gain12Over6();
125  vi.gain6Over1() = gainRatiosEE[i].gain6Over1();
126 
127  vi.timeCalibConstants() = timeCalibConstantsEE[i];
128 
129  std::memcpy(vi.pulseShapes().data(), pulseShapesEE[i].pdfval, sizeof(float) * EcalPulseShape::TEMPLATESAMPLES);
130 
131  for (unsigned int j = 0; j < EcalPulseShape::TEMPLATESAMPLES; ++j) {
132  for (unsigned int k = 0; k < EcalPulseShape::TEMPLATESAMPLES; ++k) {
133  vi.pulseCovariance()(j, k) = pulseCovariancesEE[i].val(j, k);
134  }
135  }
136  } // end Endcap loop
137 
138  // === Scalar data (not by xtal)
139  // TimeBiasCorrection
140  auto const timeCorrAmplBinsSizeEB = timeBiasCorrectionsData.EBTimeCorrAmplitudeBins.size();
141  auto const timeCorrShiftBinsSizeEB = timeBiasCorrectionsData.EBTimeCorrShiftBins.size();
142  // Assert that there are not more parameters than the EcalMultiFitConditionsSoA expects
143  assert(timeCorrAmplBinsSizeEB <= kMaxTimeBiasCorrectionBinsEB);
144  assert(timeCorrShiftBinsSizeEB <= kMaxTimeBiasCorrectionBinsEB);
145  std::memcpy(view.timeBiasCorrections_amplitude_EB().data(),
146  timeBiasCorrectionsData.EBTimeCorrAmplitudeBins.data(),
147  sizeof(float) * timeCorrAmplBinsSizeEB);
148  std::memcpy(view.timeBiasCorrections_shift_EB().data(),
149  timeBiasCorrectionsData.EBTimeCorrShiftBins.data(),
150  sizeof(float) * timeCorrShiftBinsSizeEB);
151 
152  auto const timeCorrAmplBinsSizeEE = timeBiasCorrectionsData.EETimeCorrAmplitudeBins.size();
153  auto const timeCorrShiftBinsSizeEE = timeBiasCorrectionsData.EETimeCorrShiftBins.size();
154  // Assert that there are not more parameters than the EcalMultiFitConditionsSoA expects
155  assert(timeCorrAmplBinsSizeEE <= kMaxTimeBiasCorrectionBinsEE);
156  assert(timeCorrShiftBinsSizeEE <= kMaxTimeBiasCorrectionBinsEE);
157  std::memcpy(view.timeBiasCorrections_amplitude_EE().data(),
158  timeBiasCorrectionsData.EETimeCorrAmplitudeBins.data(),
159  sizeof(float) * timeCorrAmplBinsSizeEE);
160  std::memcpy(view.timeBiasCorrections_shift_EE().data(),
161  timeBiasCorrectionsData.EETimeCorrShiftBins.data(),
162  sizeof(float) * timeCorrShiftBinsSizeEE);
163 
164  view.timeBiasCorrectionSizeEB() = std::min(timeCorrAmplBinsSizeEB, kMaxTimeBiasCorrectionBinsEB);
165  view.timeBiasCorrectionSizeEE() = std::min(timeCorrAmplBinsSizeEE, kMaxTimeBiasCorrectionBinsEE);
166 
167  // SampleCorrelation
168  std::memcpy(view.sampleCorrelation_EB_G12().data(),
169  samplesCorrelationData.EBG12SamplesCorrelation.data(),
170  sizeof(double) * ecalPh1::sampleSize);
171  std::memcpy(view.sampleCorrelation_EB_G6().data(),
172  samplesCorrelationData.EBG6SamplesCorrelation.data(),
173  sizeof(double) * ecalPh1::sampleSize);
174  std::memcpy(view.sampleCorrelation_EB_G1().data(),
175  samplesCorrelationData.EBG1SamplesCorrelation.data(),
176  sizeof(double) * ecalPh1::sampleSize);
177 
178  std::memcpy(view.sampleCorrelation_EE_G12().data(),
179  samplesCorrelationData.EEG12SamplesCorrelation.data(),
180  sizeof(double) * ecalPh1::sampleSize);
181  std::memcpy(view.sampleCorrelation_EE_G6().data(),
182  samplesCorrelationData.EEG6SamplesCorrelation.data(),
183  sizeof(double) * ecalPh1::sampleSize);
184  std::memcpy(view.sampleCorrelation_EE_G1().data(),
185  samplesCorrelationData.EEG1SamplesCorrelation.data(),
186  sizeof(double) * ecalPh1::sampleSize);
187 
188  // Sample masks
189  view.sampleMask_EB() = sampleMaskData.getEcalSampleMaskRecordEB();
190  view.sampleMask_EE() = sampleMaskData.getEcalSampleMaskRecordEE();
191 
192  // Time offsets
193  view.timeOffset_EB() = timeOffsetConstantData.getEBValue();
194  view.timeOffset_EE() = timeOffsetConstantData.getEEValue();
195 
196  // number of barrel items as offset for hashed ID access to EE items of columns
197  view.offsetEE() = barrelSize;
198 
199  return product;
200  }
edm::ESGetToken< EcalSamplesCorrelation, EcalSamplesCorrelationRcd > samplesCorrelationToken_
static const int TEMPLATESAMPLES
constexpr size_t kMaxTimeBiasCorrectionBinsEB
assert(be >=bs)
edm::ESGetToken< EcalTimeBiasCorrections, EcalTimeBiasCorrectionsRcd > timeBiasCorrectionsToken_
edm::ESGetToken< EcalTimeCalibConstants, EcalTimeCalibConstantsRcd > timeCalibConstantsToken_
constexpr size_t kMaxTimeBiasCorrectionBinsEE
edm::ESGetToken< EcalPulseCovariances, EcalPulseCovariancesRcd > pulseCovariancesToken_
alpaka::DevCpu const & host()
Definition: host.h:14
edm::ESGetToken< EcalTimeOffsetConstant, EcalTimeOffsetConstantRcd > timeOffsetConstantToken_
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:53

Member Data Documentation

◆ gainRatiosToken_

edm::ESGetToken<EcalGainRatios, EcalGainRatiosRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::gainRatiosToken_
private

◆ pedestalsToken_

edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::pedestalsToken_
private

◆ pulseCovariancesToken_

edm::ESGetToken<EcalPulseCovariances, EcalPulseCovariancesRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::pulseCovariancesToken_
private

◆ pulseShapesToken_

edm::ESGetToken<EcalPulseShapes, EcalPulseShapesRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::pulseShapesToken_
private

◆ sampleMaskToken_

edm::ESGetToken<EcalSampleMask, EcalSampleMaskRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::sampleMaskToken_
private

◆ samplesCorrelationToken_

edm::ESGetToken<EcalSamplesCorrelation, EcalSamplesCorrelationRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::samplesCorrelationToken_
private

◆ timeBiasCorrectionsToken_

edm::ESGetToken<EcalTimeBiasCorrections, EcalTimeBiasCorrectionsRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::timeBiasCorrectionsToken_
private

◆ timeCalibConstantsToken_

edm::ESGetToken<EcalTimeCalibConstants, EcalTimeCalibConstantsRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::timeCalibConstantsToken_
private

◆ timeOffsetConstantToken_

edm::ESGetToken<EcalTimeOffsetConstant, EcalTimeOffsetConstantRcd> ALPAKA_ACCELERATOR_NAMESPACE::EcalMultifitConditionsHostESProducer::timeOffsetConstantToken_
private