-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add ECAL portable data formats, collections and conditions for alpaka #42930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cmsbuild
merged 1 commit into
cms-sw:master
from
thomreis:ecal-reco-gpu-alpaka-migration-integration-133x
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
CondFormats/DataRecord/interface/EcalMultifitConditionsRcd.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #ifndef CondFormats_DataRecord_EcalMultifitConditionsRcd_h | ||
| #define CondFormats_DataRecord_EcalMultifitConditionsRcd_h | ||
|
|
||
| #include "FWCore/Framework/interface/DependentRecordImplementation.h" | ||
|
|
||
| #include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h" | ||
| #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" | ||
| #include "CondFormats/DataRecord/interface/EcalPulseCovariancesRcd.h" | ||
| #include "CondFormats/DataRecord/interface/EcalPulseShapesRcd.h" | ||
| #include "CondFormats/DataRecord/interface/EcalSampleMaskRcd.h" | ||
| #include "CondFormats/DataRecord/interface/EcalSamplesCorrelationRcd.h" | ||
| #include "CondFormats/DataRecord/interface/EcalTimeBiasCorrectionsRcd.h" | ||
| #include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h" | ||
| #include "CondFormats/DataRecord/interface/EcalTimeOffsetConstantRcd.h" | ||
|
|
||
| class EcalMultifitConditionsRcd | ||
| : public edm::eventsetup::DependentRecordImplementation<EcalMultifitConditionsRcd, | ||
| edm::mpl::Vector<EcalGainRatiosRcd, | ||
| EcalPedestalsRcd, | ||
| EcalPulseCovariancesRcd, | ||
| EcalPulseShapesRcd, | ||
| EcalSampleMaskRcd, | ||
| EcalSamplesCorrelationRcd, | ||
| EcalTimeBiasCorrectionsRcd, | ||
| EcalTimeCalibConstantsRcd, | ||
| EcalTimeOffsetConstantRcd>> {}; | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #ifndef CondFormats_DataRecord_EcalMultifitParametersRcd_h | ||
| #define CondFormats_DataRecord_EcalMultifitParametersRcd_h | ||
|
|
||
| #include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
|
|
||
| class EcalMultifitParametersRcd : public edm::eventsetup::EventSetupRecordImplementation<EcalMultifitParametersRcd> {}; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "CondFormats/DataRecord/interface/EcalMultifitConditionsRcd.h" | ||
| #include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
|
||
| EVENTSETUP_RECORD_REG(EcalMultifitConditionsRcd); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "CondFormats/DataRecord/interface/EcalMultifitParametersRcd.h" | ||
| #include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
|
||
| EVENTSETUP_RECORD_REG(EcalMultifitParametersRcd); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
CondFormats/EcalObjects/interface/EcalElectronicsMappingHost.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #ifndef CondFormats_EcalObjects_interface_EcalElectronicsMappingHost_h | ||
| #define CondFormats_EcalObjects_interface_EcalElectronicsMappingHost_h | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/EcalElectronicsMappingSoA.h" | ||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
|
||
| using EcalElectronicsMappingHost = PortableHostCollection<EcalElectronicsMappingSoA>; | ||
|
|
||
| #endif |
12 changes: 12 additions & 0 deletions
12
CondFormats/EcalObjects/interface/EcalElectronicsMappingSoA.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #ifndef CondFormats_EcalObjects_EcalElectronicsMappingSoA_h | ||
| #define CondFormats_EcalObjects_EcalElectronicsMappingSoA_h | ||
|
|
||
| #include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
| #include "DataFormats/SoATemplate/interface/SoAView.h" | ||
|
|
||
| GENERATE_SOA_LAYOUT(EcalElectronicsMappingSoALayout, SOA_COLUMN(uint32_t, rawid)) | ||
|
|
||
| using EcalElectronicsMappingSoA = EcalElectronicsMappingSoALayout<>; | ||
|
|
||
| #endif |
11 changes: 11 additions & 0 deletions
11
CondFormats/EcalObjects/interface/EcalMultifitConditionsHost.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #ifndef CondFormats_EcalObjects_interface_EcalMultifitConditionsHost_h | ||
| #define CondFormats_EcalObjects_interface_EcalMultifitConditionsHost_h | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/EcalMultifitConditionsSoA.h" | ||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
|
||
| using EcalMultifitConditionsHost = PortableHostCollection<EcalMultifitConditionsSoA>; | ||
|
|
||
| #endif |
60 changes: 60 additions & 0 deletions
60
CondFormats/EcalObjects/interface/EcalMultifitConditionsSoA.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #ifndef CondFormats_EcalObjects_EcalMultifitConditionsSoA_h | ||
| #define CondFormats_EcalObjects_EcalMultifitConditionsSoA_h | ||
|
|
||
| #include <array> | ||
| #include <Eigen/Dense> | ||
| #include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
| #include "DataFormats/SoATemplate/interface/SoAView.h" | ||
| #include "DataFormats/EcalDigi/interface/EcalConstants.h" | ||
| #include "CondFormats/EcalObjects/interface/EcalPulseShapes.h" | ||
|
|
||
| using PulseShapeArray = std::array<float, EcalPulseShape::TEMPLATESAMPLES>; | ||
| using SampleCorrelationArray = std::array<double, ecalPh1::sampleSize>; | ||
|
|
||
| using CovarianceMatrix = Eigen::Matrix<float, EcalPulseShape::TEMPLATESAMPLES, EcalPulseShape::TEMPLATESAMPLES>; | ||
|
|
||
| constexpr size_t kMaxTimeBiasCorrectionBinsEB = 71; | ||
| constexpr size_t kMaxTimeBiasCorrectionBinsEE = 58; | ||
| using TimeBiasCorrArrayEB = std::array<float, kMaxTimeBiasCorrectionBinsEB>; | ||
| using TimeBiasCorrArrayEE = std::array<float, kMaxTimeBiasCorrectionBinsEE>; | ||
|
|
||
| GENERATE_SOA_LAYOUT(EcalMultifitConditionsSoALayout, | ||
| SOA_COLUMN(uint32_t, rawid), | ||
| SOA_COLUMN(float, pedestals_mean_x12), | ||
| SOA_COLUMN(float, pedestals_mean_x6), | ||
| SOA_COLUMN(float, pedestals_mean_x1), | ||
| SOA_COLUMN(float, pedestals_rms_x12), | ||
| SOA_COLUMN(float, pedestals_rms_x6), | ||
| SOA_COLUMN(float, pedestals_rms_x1), | ||
| SOA_COLUMN(PulseShapeArray, pulseShapes), | ||
| // NxN N=templatesamples for each xtal | ||
| SOA_EIGEN_COLUMN(CovarianceMatrix, pulseCovariance), | ||
| SOA_COLUMN(float, gain12Over6), | ||
| SOA_COLUMN(float, gain6Over1), | ||
| SOA_COLUMN(float, timeCalibConstants), | ||
| // timeBiasCorrections (fixed since 2011) | ||
| SOA_SCALAR(TimeBiasCorrArrayEB, timeBiasCorrections_amplitude_EB), | ||
| SOA_SCALAR(TimeBiasCorrArrayEB, timeBiasCorrections_shift_EB), | ||
| SOA_SCALAR(TimeBiasCorrArrayEE, timeBiasCorrections_amplitude_EE), | ||
| SOA_SCALAR(TimeBiasCorrArrayEE, timeBiasCorrections_shift_EE), | ||
| SOA_SCALAR(size_t, timeBiasCorrectionSizeEB), | ||
| SOA_SCALAR(size_t, timeBiasCorrectionSizeEE), | ||
| // Sample correlation scalar: array of 10 values for each gain in EB and EE | ||
| SOA_SCALAR(SampleCorrelationArray, sampleCorrelation_EB_G12), | ||
| SOA_SCALAR(SampleCorrelationArray, sampleCorrelation_EB_G6), | ||
| SOA_SCALAR(SampleCorrelationArray, sampleCorrelation_EB_G1), | ||
| SOA_SCALAR(SampleCorrelationArray, sampleCorrelation_EE_G12), | ||
| SOA_SCALAR(SampleCorrelationArray, sampleCorrelation_EE_G6), | ||
| SOA_SCALAR(SampleCorrelationArray, sampleCorrelation_EE_G1), | ||
| // Samples Masks | ||
| SOA_SCALAR(unsigned int, sampleMask_EB), | ||
| SOA_SCALAR(unsigned int, sampleMask_EE), | ||
| SOA_SCALAR(float, timeOffset_EB), | ||
| SOA_SCALAR(float, timeOffset_EE), | ||
| // offset for hashed ID access to EE items of columns | ||
| SOA_SCALAR(uint32_t, offsetEE)) | ||
|
|
||
| using EcalMultifitConditionsSoA = EcalMultifitConditionsSoALayout<>; | ||
|
|
||
| #endif |
11 changes: 11 additions & 0 deletions
11
CondFormats/EcalObjects/interface/EcalMultifitParametersHost.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #ifndef CondFormats_EcalObjects_interface_EcalMultifitParametersHost_h | ||
| #define CondFormats_EcalObjects_interface_EcalMultifitParametersHost_h | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/EcalMultifitParametersSoA.h" | ||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
|
||
| using EcalMultifitParametersHost = PortableHostCollection<EcalMultifitParametersSoA>; | ||
|
|
||
| #endif |
22 changes: 22 additions & 0 deletions
22
CondFormats/EcalObjects/interface/EcalMultifitParametersSoA.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #ifndef CondFormats_EcalObjects_EcalMultifitParametersSoA_h | ||
| #define CondFormats_EcalObjects_EcalMultifitParametersSoA_h | ||
|
|
||
| #include <array> | ||
| #include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
| #include "DataFormats/SoATemplate/interface/SoAView.h" | ||
|
|
||
| constexpr size_t kNTimeFitParams = 8; | ||
| constexpr size_t kNAmplitudeFitParams = 2; | ||
| using TimeFitParamsArray = std::array<float, kNTimeFitParams>; | ||
| using AmplitudeFitParamsArray = std::array<float, kNAmplitudeFitParams>; | ||
|
|
||
| GENERATE_SOA_LAYOUT(EcalMultifitParametersSoALayout, | ||
| SOA_SCALAR(TimeFitParamsArray, timeFitParamsEB), | ||
| SOA_SCALAR(TimeFitParamsArray, timeFitParamsEE), | ||
| SOA_SCALAR(AmplitudeFitParamsArray, amplitudeFitParamsEB), | ||
| SOA_SCALAR(AmplitudeFitParamsArray, amplitudeFitParamsEE)) | ||
|
|
||
| using EcalMultifitParametersSoA = EcalMultifitParametersSoALayout<>; | ||
|
|
||
| #endif | ||
17 changes: 17 additions & 0 deletions
17
CondFormats/EcalObjects/interface/alpaka/EcalElectronicsMappingDevice.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #ifndef CondFormats_EcalObjects_interface_alpaka_EcalElectronicsMappingDevice_h | ||
| #define CondFormats_EcalObjects_interface_alpaka_EcalElectronicsMappingDevice_h | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/EcalElectronicsMappingHost.h" | ||
| #include "CondFormats/EcalObjects/interface/EcalElectronicsMappingSoA.h" | ||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
|
||
| namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
|
||
| using ::EcalElectronicsMappingHost; | ||
| using EcalElectronicsMappingDevice = PortableCollection<EcalElectronicsMappingSoA>; | ||
|
|
||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
| #endif |
17 changes: 17 additions & 0 deletions
17
CondFormats/EcalObjects/interface/alpaka/EcalMultifitConditionsDevice.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #ifndef CondFormats_EcalObjects_interface_alpaka_EcalMultifitConditionsDevice_h | ||
| #define CondFormats_EcalObjects_interface_alpaka_EcalMultifitConditionsDevice_h | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/EcalMultifitConditionsHost.h" | ||
| #include "CondFormats/EcalObjects/interface/EcalMultifitConditionsSoA.h" | ||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
|
||
| namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
|
||
| using ::EcalMultifitConditionsHost; | ||
| using EcalMultifitConditionsDevice = PortableCollection<EcalMultifitConditionsSoA>; | ||
|
|
||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
| #endif |
17 changes: 17 additions & 0 deletions
17
CondFormats/EcalObjects/interface/alpaka/EcalMultifitParametersDevice.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #ifndef CondFormats_EcalObjects_interface_alpaka_EcalMultifitParametersDevice_h | ||
| #define CondFormats_EcalObjects_interface_alpaka_EcalMultifitParametersDevice_h | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/EcalMultifitParametersHost.h" | ||
| #include "CondFormats/EcalObjects/interface/EcalMultifitParametersSoA.h" | ||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
|
||
| namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
|
||
| using ::EcalMultifitParametersHost; | ||
| using EcalMultifitParametersDevice = PortableCollection<EcalMultifitParametersSoA>; | ||
|
|
||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "CondFormats/EcalObjects/interface/EcalElectronicsMappingHost.h" | ||
| #include "FWCore/Utilities/interface/typelookup.h" | ||
|
|
||
| TYPELOOKUP_DATA_REG(EcalElectronicsMappingHost); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "CondFormats/EcalObjects/interface/EcalMultifitConditionsHost.h" | ||
| #include "FWCore/Utilities/interface/typelookup.h" | ||
|
|
||
| TYPELOOKUP_DATA_REG(EcalMultifitConditionsHost); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "CondFormats/EcalObjects/interface/EcalMultifitParametersHost.h" | ||
| #include "FWCore/Utilities/interface/typelookup.h" | ||
|
|
||
| TYPELOOKUP_DATA_REG(EcalMultifitParametersHost); |
4 changes: 4 additions & 0 deletions
4
CondFormats/EcalObjects/src/alpaka/ES_EcalElectronicsMappingDevice.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "HeterogeneousCore/AlpakaCore/interface/alpaka/typelookup.h" | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/alpaka/EcalElectronicsMappingDevice.h" | ||
| TYPELOOKUP_ALPAKA_DATA_REG(EcalElectronicsMappingDevice); |
4 changes: 4 additions & 0 deletions
4
CondFormats/EcalObjects/src/alpaka/ES_EcalMultifitConditionsDevice.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "HeterogeneousCore/AlpakaCore/interface/alpaka/typelookup.h" | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/alpaka/EcalMultifitConditionsDevice.h" | ||
| TYPELOOKUP_ALPAKA_DATA_REG(EcalMultifitConditionsDevice); |
4 changes: 4 additions & 0 deletions
4
CondFormats/EcalObjects/src/alpaka/ES_EcalMultifitParametersDevice.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "HeterogeneousCore/AlpakaCore/interface/alpaka/typelookup.h" | ||
|
|
||
| #include "CondFormats/EcalObjects/interface/alpaka/EcalMultifitParametersDevice.h" | ||
| TYPELOOKUP_ALPAKA_DATA_REG(EcalMultifitParametersDevice); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,12 @@ | ||
| <use name="DataFormats/Common"/> | ||
| <use name="DataFormats/EcalDetId"/> | ||
| <use name="DataFormats/DetId"/> | ||
| <use name="DataFormats/EcalDetId"/> | ||
| <use name="DataFormats/Portable"/> | ||
| <use name="DataFormats/SoATemplate"/> | ||
| <use name="FWCore/MessageLogger"/> | ||
| <use name="FWCore/Utilities"/> | ||
| <use name="HeterogeneousCore/AlpakaInterface"/> | ||
| <flags ALPAKA_BACKENDS="!serial"/> | ||
| <export> | ||
| <lib name="1"/> | ||
| </export> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #ifndef DataFormats_EcalDigi_EcalDigiHostCollection_h | ||
| #define DataFormats_EcalDigi_EcalDigiHostCollection_h | ||
|
|
||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "DataFormats/EcalDigi/interface/EcalDigiSoA.h" | ||
|
|
||
| // EcalDigiSoA in host memory | ||
| using EcalDigiHostCollection = PortableHostCollection<EcalDigiSoA>; | ||
|
|
||
| #endif |
10 changes: 10 additions & 0 deletions
10
DataFormats/EcalDigi/interface/EcalDigiPhase2HostCollection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #ifndef DataFormats_EcalDigi_EcalDigiPhase2HostCollection_h | ||
| #define DataFormats_EcalDigi_EcalDigiPhase2HostCollection_h | ||
|
|
||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "DataFormats/EcalDigi/interface/EcalDigiPhase2SoA.h" | ||
|
|
||
| // EcalDigiPhase2SoA in host memory | ||
| using EcalDigiPhase2HostCollection = PortableHostCollection<EcalDigiPhase2SoA>; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #ifndef DataFormats_EcalDigi_EcalDigiPhase2SoA_h | ||
| #define DataFormats_EcalDigi_EcalDigiPhase2SoA_h | ||
|
|
||
| #include "DataFormats/Common/interface/StdArray.h" | ||
| #include "DataFormats/EcalDigi/interface/EcalConstants.h" | ||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
|
|
||
| // due to a ROOT limitation the std::array needs to be wrapped | ||
| // https://github.com/root-project/root/issues/12007 | ||
| using EcalDataArrayPhase2 = edm::StdArray<uint16_t, ecalPh2::sampleSize>; | ||
|
|
||
| GENERATE_SOA_LAYOUT(EcalDigiPhase2SoALayout, | ||
| SOA_COLUMN(uint32_t, id), | ||
| SOA_COLUMN(EcalDataArrayPhase2, data), | ||
| SOA_SCALAR(uint32_t, size)) | ||
|
|
||
| using EcalDigiPhase2SoA = EcalDigiPhase2SoALayout<>; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #ifndef DataFormats_EcalDigi_EcalDigiSoA_h | ||
| #define DataFormats_EcalDigi_EcalDigiSoA_h | ||
|
|
||
| #include "DataFormats/Common/interface/StdArray.h" | ||
| #include "DataFormats/EcalDigi/interface/EcalConstants.h" | ||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
|
|
||
| // due to a ROOT limitation the std::array needs to be wrapped | ||
| // https://github.com/root-project/root/issues/12007 | ||
| using EcalDataArray = edm::StdArray<uint16_t, ecalPh1::sampleSize>; | ||
|
|
||
| GENERATE_SOA_LAYOUT(EcalDigiSoALayout, | ||
| SOA_COLUMN(uint32_t, id), | ||
| SOA_COLUMN(EcalDataArray, data), | ||
| SOA_SCALAR(uint32_t, size)) | ||
|
|
||
| using EcalDigiSoA = EcalDigiSoALayout<>; | ||
|
|
||
| #endif |
15 changes: 15 additions & 0 deletions
15
DataFormats/EcalDigi/interface/alpaka/EcalDigiDeviceCollection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #ifndef DataFormats_EcalDigi_interface_alpaka_EcalDigiDeviceCollection_h | ||
| #define DataFormats_EcalDigi_interface_alpaka_EcalDigiDeviceCollection_h | ||
|
|
||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "DataFormats/EcalDigi/interface/EcalDigiSoA.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
|
||
| namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
|
||
| // EcalDigiSoA in device global memory | ||
| using EcalDigiDeviceCollection = PortableCollection<EcalDigiSoA>; | ||
|
|
||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: are these number of parameters fixed? Shouldn't these numbers come from the algorithm that defines them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameters are taken from the CPU multifit configuration here: https://github.com/cms-sw/cmssw/blob/master/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitWorkerMultiFit.cc#L744-L765
I do not know where they originally come from.
In the CPU ratio timing the parameters are stored in vectors and could theoretically change. I do not think this has ever happened though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was exactly the origin of my doubt. I understand that in a SoA fixed size arrays are mandatory. And the size of those arrays depends from their definition in (in this case) EcalUncalibRecHitWorkerMultiFit.cc, which "could theoretically change" even though quite likely "this has never happened".
I think we can either simply rely on the fact that it will never change (and do nothing), or try to enforce the same (for example, by asserting in case the two sizes are different: but this has to be done in the plugin, not in this code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which of the two options is preferred? If it is the second, I can add the assert to the multifit code in this PR or a separate one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if it is feasible, I would go with the assert in the multifit code for all the sizes (re)defined here; better if it is in this PR, which had all signatures cleaned nonetheless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that the check should go in the alpaka version of the multifit code, not in the "legacy" one that does not uses these conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the check is to happen in the alpaka version then there is no change needed for this PR. The required assert will be part of the PR with the multifit migration.
It has already been implemented in the development branch thomreis@e0733d7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@perrotta are you happy with this resolution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fine with me.
We can discuss it in your next development PR, but why do you check in some cases that the number of parameters is lower or equal than the EcalMultiFitConditionsSoA expects? Even if the code may technically work as such, shouldn't they be identically the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look at the tags on CondDB and the MC one only has one value for the barrel and one for the endcap. The data tag uses the sizes defined in the SoA.