Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CondFormats/DataRecord/interface/EcalMultifitConditionsRcd.h
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
8 changes: 8 additions & 0 deletions CondFormats/DataRecord/interface/EcalMultifitParametersRcd.h
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
4 changes: 4 additions & 0 deletions CondFormats/DataRecord/src/EcalMultifitConditionsRcd.cc
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);
4 changes: 4 additions & 0 deletions CondFormats/DataRecord/src/EcalMultifitParametersRcd.cc
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);
4 changes: 4 additions & 0 deletions CondFormats/EcalObjects/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
<use name="DataFormats/EcalDetId"/>
<use name="DataFormats/EcalDigi"/>
<use name="DataFormats/Math"/>
<use name="DataFormats/Portable"/>
<use name="DataFormats/SoATemplate"/>
<use name="HeterogeneousCore/CUDACore"/>
<use name="HeterogeneousCore/CUDAUtilities"/>
<use name="boost"/>
<use name="boost_serialization"/>
<use name="rootmath"/>
<use name="clhep"/>
<use name="cuda"/>
<use name="HeterogeneousCore/AlpakaInterface"/>
<flags ALPAKA_BACKENDS="!serial"/>
<export>
<lib name="1"/>
</export>
11 changes: 11 additions & 0 deletions CondFormats/EcalObjects/interface/EcalElectronicsMappingHost.h
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 CondFormats/EcalObjects/interface/EcalElectronicsMappingSoA.h
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 CondFormats/EcalObjects/interface/EcalMultifitConditionsHost.h
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 CondFormats/EcalObjects/interface/EcalMultifitConditionsSoA.h
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 CondFormats/EcalObjects/interface/EcalMultifitParametersHost.h
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 CondFormats/EcalObjects/interface/EcalMultifitParametersSoA.h
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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Contributor

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.

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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?

Copy link
Contributor

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?

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?

Copy link
Contributor Author

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.

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
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
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
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
4 changes: 4 additions & 0 deletions CondFormats/EcalObjects/src/ES_EcalElectronicsMappingHost.cc
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);
4 changes: 4 additions & 0 deletions CondFormats/EcalObjects/src/ES_EcalMultifitConditionsHost.cc
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);
4 changes: 4 additions & 0 deletions CondFormats/EcalObjects/src/ES_EcalMultifitParametersHost.cc
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);
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);
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);
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);
6 changes: 5 additions & 1 deletion DataFormats/EcalDigi/BuildFile.xml
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>
4 changes: 2 additions & 2 deletions DataFormats/EcalDigi/interface/EcalConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ecalPh2 {
public:
static constexpr double Samp_Period = 6.25; // ADC sampling period in ns
static constexpr unsigned int NGAINS = ecalph2::NGAINS; // Number of CATIA gains
static constexpr const float *gains = ecalph2::gains; // CATIA gain values
static constexpr const float* gains = ecalph2::gains; // CATIA gain values
static constexpr unsigned int gainId1 = 1; // Position of gain 1 in gains array
static constexpr unsigned int gainId10 = 0; // Position of gain 10 in gains array
static constexpr unsigned int sampleSize = 16; // Number of samples per event
Expand All @@ -49,7 +49,7 @@ class ecalPh1 {
public:
static constexpr double Samp_Period = 25.; // ADC sampling period in ns
static constexpr unsigned int NGAINS = ecalph1::NGAINS; // Number of MGPA gains including a zero gain
static constexpr const float *gains = ecalph1::gains; // MGPA gain values including a zero gain
static constexpr const float* gains = ecalph1::gains; // MGPA gain values including a zero gain
static constexpr unsigned int sampleSize = 10; // Number of samples per event
static constexpr unsigned int NBITS = 12; // Number of available bits
static constexpr unsigned int kNOffsets = 2000; // Number of time offsets generated for APD pulse shape
Expand Down
10 changes: 10 additions & 0 deletions DataFormats/EcalDigi/interface/EcalDigiHostCollection.h
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 DataFormats/EcalDigi/interface/EcalDigiPhase2HostCollection.h
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
19 changes: 19 additions & 0 deletions DataFormats/EcalDigi/interface/EcalDigiPhase2SoA.h
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
19 changes: 19 additions & 0 deletions DataFormats/EcalDigi/interface/EcalDigiSoA.h
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 DataFormats/EcalDigi/interface/alpaka/EcalDigiDeviceCollection.h
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
Loading