forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged devel_pfRecHitAlpakaES_integ_v2 from repository missirol with …
…cms-merge-topic
- Loading branch information
Showing
27 changed files
with
728 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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 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 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
8 changes: 8 additions & 0 deletions
8
RecoParticleFlow/PFRecHitProducer/interface/JobConfigurationAlpakaRecord.h
This file contains 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 RecoParticleFlow_PFRecHitProducer_interface_JobConfigurationAlpakaRecord_h | ||
#define RecoParticleFlow_PFRecHitProducer_interface_JobConfigurationAlpakaRecord_h | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
|
||
class JobConfigurationAlpakaRecord : public edm::eventsetup::EventSetupRecordImplementation<JobConfigurationAlpakaRecord> {}; | ||
|
||
#endif // RecoParticleFlow_PFRecHitProducer_interface_JobConfigurationAlpakaRecord_h |
17 changes: 17 additions & 0 deletions
17
RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHEParamsAlpakaESData.h
This file contains 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 RecoParticleFlow_PFRecHitProducer_interface_AlpakaESTestData_h | ||
#define RecoParticleFlow_PFRecHitProducer_interface_AlpakaESTestData_h | ||
|
||
#include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/CopyToDevice.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
||
#include "RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHEParamsAlpakaESDataSoA.h" | ||
|
||
namespace reco { | ||
|
||
using PFRecHitHBHEParamsAlpakaESDataHost = PortableHostCollection<PFRecHitHBHEParamsAlpakaESDataSoA>; | ||
|
||
} | ||
|
||
#endif |
17 changes: 17 additions & 0 deletions
17
RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHEParamsAlpakaESDataSoA.h
This file contains 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 RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHEParamsAlpakaESDataSoA_h | ||
#define RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHEParamsAlpakaESDataSoA_h | ||
|
||
#include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
#include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
#include "DataFormats/SoATemplate/interface/SoAView.h" | ||
|
||
namespace reco { | ||
|
||
GENERATE_SOA_LAYOUT(PFRecHitHBHEParamsAlpakaESDataSoALayout, | ||
SOA_COLUMN(float, energyThresholds)) | ||
|
||
using PFRecHitHBHEParamsAlpakaESDataSoA = PFRecHitHBHEParamsAlpakaESDataSoALayout<>; | ||
|
||
} | ||
|
||
#endif |
17 changes: 17 additions & 0 deletions
17
RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHETopologyAlpakaESData.h
This file contains 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 RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHETopologyAlpakaESData_h | ||
#define RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHETopologyAlpakaESData_h | ||
|
||
#include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/CopyToDevice.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
||
#include "RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHETopologyAlpakaESDataSoA.h" | ||
|
||
namespace reco { | ||
|
||
using PFRecHitHBHETopologyAlpakaESDataHost = PortableHostCollection<PFRecHitHBHETopologyAlpakaESDataSoA>; | ||
|
||
} | ||
|
||
#endif |
27 changes: 27 additions & 0 deletions
27
RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHETopologyAlpakaESDataSoA.h
This file contains 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 RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHETopologyAlpakaESDataSoA_h | ||
#define RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHETopologyAlpakaESDataSoA_h | ||
|
||
#include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
#include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
#include "DataFormats/SoATemplate/interface/SoAView.h" | ||
|
||
namespace reco { | ||
|
||
GENERATE_SOA_LAYOUT(PFRecHitHBHETopologyAlpakaESDataSoALayout, | ||
SOA_COLUMN(float, positionX), | ||
SOA_COLUMN(float, positionY), | ||
SOA_COLUMN(float, positionZ), | ||
SOA_COLUMN(int32_t, neighbour0), | ||
SOA_COLUMN(int32_t, neighbour1), | ||
SOA_COLUMN(int32_t, neighbour2), | ||
SOA_COLUMN(int32_t, neighbour3), | ||
SOA_COLUMN(int32_t, neighbour4), | ||
SOA_COLUMN(int32_t, neighbour5), | ||
SOA_COLUMN(int32_t, neighbour6), | ||
SOA_COLUMN(int32_t, neighbour7)) | ||
|
||
using PFRecHitHBHETopologyAlpakaESDataSoA = PFRecHitHBHETopologyAlpakaESDataSoALayout<>; | ||
|
||
} | ||
|
||
#endif |
11 changes: 11 additions & 0 deletions
11
RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHETopologyAlpakaESRcd.h
This file contains 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 RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHETopologyAlpakaESRcd_h | ||
#define RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHETopologyAlpakaESRcd_h | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
#include "FWCore/Framework/interface/DependentRecordImplementation.h" | ||
#include "Geometry/Records/interface/CaloGeometryRecord.h" | ||
#include "Geometry/Records/interface/HcalRecNumberingRecord.h" | ||
|
||
class PFRecHitHBHETopologyAlpakaESRcd : public edm::eventsetup::DependentRecordImplementation<PFRecHitHBHETopologyAlpakaESRcd, edm::mpl::Vector<HcalRecNumberingRecord, CaloGeometryRecord>> {}; | ||
|
||
#endif // RecoParticleFlow_PFRecHitProducer_interface_PFRecHitHBHETopologyAlpakaESRcd_h |
18 changes: 18 additions & 0 deletions
18
RecoParticleFlow/PFRecHitProducer/interface/alpaka/PFRecHitHBHEParamsAlpakaESData.h
This file contains 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,18 @@ | ||
#ifndef RecoParticleFlow_PFRecHitProducer_interface_alpaka_PFRecHitHBHEParamsAlpakaESData_h | ||
#define RecoParticleFlow_PFRecHitProducer_interface_alpaka_PFRecHitHBHEParamsAlpakaESData_h | ||
|
||
#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
||
#include "RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHEParamsAlpakaESData.h" | ||
#include "RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHEParamsAlpakaESDataSoA.h" | ||
|
||
namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
||
using PFRecHitHBHEParamsAlpakaESDataHost = reco::PFRecHitHBHEParamsAlpakaESDataHost; | ||
using PFRecHitHBHEParamsAlpakaESDataDevice = PortableCollection<reco::PFRecHitHBHEParamsAlpakaESDataSoA>; | ||
|
||
} // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
||
#endif |
18 changes: 18 additions & 0 deletions
18
RecoParticleFlow/PFRecHitProducer/interface/alpaka/PFRecHitHBHETopologyAlpakaESData.h
This file contains 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,18 @@ | ||
#ifndef RecoParticleFlow_PFRecHitProducer_interface_alpaka_PFRecHitHBHETopologyAlpakaESData_h | ||
#define RecoParticleFlow_PFRecHitProducer_interface_alpaka_PFRecHitHBHETopologyAlpakaESData_h | ||
|
||
#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
||
#include "RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHETopologyAlpakaESData.h" | ||
#include "RecoParticleFlow/PFRecHitProducer/interface/PFRecHitHBHETopologyAlpakaESDataSoA.h" | ||
|
||
namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
||
using PFRecHitHBHETopologyAlpakaESDataHost = reco::PFRecHitHBHETopologyAlpakaESDataHost; | ||
using PFRecHitHBHETopologyAlpakaESDataDevice = PortableCollection<reco::PFRecHitHBHETopologyAlpakaESDataSoA>; | ||
|
||
} // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
||
#endif |
This file contains 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,26 +1,30 @@ | ||
<library name="RecoParticleFlowPFRecHitProducersPlugins" file="*.cc"> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/Utilities"/> | ||
<use name="alpaka"/> | ||
<use name="HeterogeneousCore/AlpakaTest"/> | ||
<use name="DataFormats/Common"/> | ||
<use name="DataFormats/ParticleFlowReco"/> | ||
<use name="CommonTools/ParticleFlow"/> | ||
<use name="DQMServices/Core"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/Utilities"/> | ||
<use name="alpaka"/> | ||
<use name="HeterogeneousCore/AlpakaTest"/> | ||
<use name="DataFormats/Common"/> | ||
<use name="DataFormats/ParticleFlowReco"/> | ||
<use name="CommonTools/ParticleFlow"/> | ||
<use name="DQMServices/Core"/> | ||
<flags EDM_PLUGIN="1"/> | ||
</library> | ||
|
||
<!-- alpaka-based portable plugins --> | ||
<library name="RecoParticleFlowPFRecHitProducersPluginsPortable" file="alpaka/*.cc"> | ||
<use name="alpaka"/> | ||
<use name="DataFormats/ParticleFlowReco"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/Utilities"/> | ||
<use name="HeterogeneousCore/AlpakaCore"/> | ||
<use name="HeterogeneousCore/AlpakaInterface"/> | ||
<use name="HeterogeneousCore/AlpakaTest"/> | ||
|
||
<use name="alpaka"/> | ||
<use name="DataFormats/ParticleFlowReco"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/Utilities"/> | ||
<use name="Geometry/CaloGeometry"/> | ||
<use name="Geometry/CaloTopology"/> | ||
<use name="Geometry/Records"/> | ||
<use name="HeterogeneousCore/AlpakaCore"/> | ||
<use name="HeterogeneousCore/AlpakaInterface"/> | ||
<use name="RecoParticleFlow/PFRecHitProducer"/> | ||
<flags ALPAKA_BACKENDS="1"/> | ||
<flags EDM_PLUGIN="1"/> | ||
</library> | ||
</library> |
61 changes: 61 additions & 0 deletions
61
RecoParticleFlow/PFRecHitProducer/plugins/alpaka/PFRecHitHBHEParamsESProducer.cc
This file contains 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,61 @@ | ||
#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" | ||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "FWCore/Utilities/interface/Exception.h" | ||
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/ESProducer.h" | ||
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/ModuleFactory.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
#include "RecoParticleFlow/PFRecHitProducer/interface/JobConfigurationAlpakaRecord.h" | ||
#include "RecoParticleFlow/PFRecHitProducer/interface/alpaka/PFRecHitHBHEParamsAlpakaESData.h" | ||
|
||
namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
||
class PFRecHitHBHEParamsESProducer : public ESProducer { | ||
public: | ||
PFRecHitHBHEParamsESProducer(edm::ParameterSet const& iConfig) : | ||
energyThresholdsHB_(iConfig.getParameter<std::vector<double>>("energyThresholdsHB")), | ||
energyThresholdsHE_(iConfig.getParameter<std::vector<double>>("energyThresholdsHE")) { | ||
|
||
if (energyThresholdsHB_.size() != kMaxDepthHB) { | ||
throw cms::Exception("InvalidConfiguration") << "\"energyThresholdsHB\" must be a cms.vdouble() of size " << kMaxDepthHB; | ||
} | ||
|
||
if (energyThresholdsHE_.size() != kMaxDepthHE) { | ||
throw cms::Exception("InvalidConfiguration") << "\"energyThresholdsHE\" must be a cms.vdouble() of size " << kMaxDepthHE; | ||
} | ||
|
||
setWhatProduced(this); | ||
} | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||
edm::ParameterSetDescription desc; | ||
desc.add<std::string>("appendToDataLabel", ""); | ||
desc.add<std::vector<double>>("energyThresholdsHB", {0.1, 0.2, 0.3, 0.3}); | ||
desc.add<std::vector<double>>("energyThresholdsHE", {0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2}); | ||
descriptions.addWithDefaultLabel(desc); | ||
} | ||
|
||
std::unique_ptr<PFRecHitHBHEParamsAlpakaESDataHost> produce(JobConfigurationAlpakaRecord const& iRecord) { | ||
auto product = std::make_unique<PFRecHitHBHEParamsAlpakaESDataHost>(kMaxDepthHB + kMaxDepthHE, cms::alpakatools::host()); | ||
for (int idx = 0; idx < kMaxDepthHB; ++idx) { | ||
product->view().energyThresholds()[idx] = energyThresholdsHB_[idx]; | ||
} | ||
for (int idx = 0; idx < kMaxDepthHE; ++idx) { | ||
product->view().energyThresholds()[idx+kMaxDepthHB] = energyThresholdsHE_[idx]; | ||
} | ||
return product; | ||
} | ||
|
||
private: | ||
constexpr static uint8_t kMaxDepthHB = 4; | ||
constexpr static uint8_t kMaxDepthHE = 7; | ||
|
||
std::vector<double> energyThresholdsHB_; | ||
std::vector<double> energyThresholdsHE_; | ||
}; | ||
|
||
} // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
||
DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(PFRecHitHBHEParamsESProducer); |
Oops, something went wrong.