-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
89 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef DataFormats_HGCalDigi_interface_HGCalECONDInfoHost_h | ||
#define DataFormats_HGCalDigi_interface_HGCalECONDInfoHost_h | ||
|
||
#include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
#include "DataFormats/HGCalDigi/interface/HGCalECONDInfoSoA.h" | ||
|
||
namespace hgcaldigi { | ||
|
||
// SoA with x, y, z, id fields in host memory | ||
using HGCalECONDInfoHost = PortableHostCollection<HGCalECONDInfoSoA>; | ||
|
||
} // namespace hgcaldigi | ||
|
||
#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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#ifndef DataFormats_HGCalDigi_interface_HGCalECONDInfoSoA_h | ||
#define DataFormats_HGCalDigi_interface_HGCalECONDInfoSoA_h | ||
|
||
#include <Eigen/Core> | ||
#include <Eigen/Dense> | ||
|
||
#include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
#include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
#include "DataFormats/SoATemplate/interface/SoAView.h" | ||
|
||
namespace hgcaldigi { | ||
// Generate structure of arrays (SoA) layout with Digi dataformat | ||
GENERATE_SOA_LAYOUT(HGCalECONDInfoSoALayout, | ||
// Capture block information: | ||
// 0b000: Normal packet | ||
// 0b001: No ECOND packet. Packet was detected and discarded because too large (>250) | ||
// 0b010: Packet with payload CRC error | ||
// 0b011: Packet with EventID mismatch. | ||
// 0b100: No ECOND packet. The event builder state machine timed-out. | ||
// 0b101: No ECOND packet due to BCID and/or OrbitID mismatch. | ||
// 0b110: No ECOND packet. Packet was detected but was discarded due to Main Buffer overflow. | ||
SOA_COLUMN(uint8_t, cbFlag), //cbflag | ||
// ECON-D header information | ||
// bit 0: Truncation flag | ||
// bit 1: Match flag | ||
// bit 2-3: E/B/O bits | ||
// bit 4-5: H/T bits | ||
// bit 6: Expected flag | ||
// bit 7: logical OR of Stat for all active eRx | ||
SOA_COLUMN(uint8_t, econdFlag), //econdFlag | ||
// Exception flag | ||
// 0: Normal | ||
// 1: Wrong S-Link header marker | ||
// 2: Wrong Capture block header marker | ||
// These will be saved to the first ECON-D in the block | ||
// 3: Wrong ECON-D header marker | ||
// 4: ECON-D payload length overflow(>469) | ||
// 5: unpacked ECON-D length and payload length not match | ||
SOA_COLUMN(uint8_t, exception), | ||
// Location | ||
// If exception found before ECON-D, this would be 0 | ||
// Otherwise the 64b index of ECON-D header | ||
SOA_COLUMN(uint32_t, location), | ||
// Payload length | ||
// If exception found before ECON-D, this would be 0 | ||
// Otherwise the payload length of the ECON-D | ||
SOA_COLUMN(uint16_t, payloadLength) | ||
) | ||
using HGCalECONDInfoSoA = HGCalECONDInfoSoALayout<>; | ||
} // namespace hgcaldigi | ||
|
||
#endif |
23 changes: 23 additions & 0 deletions
23
DataFormats/HGCalDigi/interface/alpaka/HGCalECONDInfoDevice.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,23 @@ | ||
#ifndef DataFormats_HGCalDigi_interface_alpaka_HGCalECONDInfoDevice_h | ||
#define DataFormats_HGCalDigi_interface_alpaka_HGCalECONDInfoDevice_h | ||
|
||
#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
#include "DataFormats/HGCalDigi/interface/HGCalECONDInfoSoA.h" | ||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
||
namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
||
namespace hgcaldigi { | ||
|
||
// make the names from the top-level hgcaldigi namespace visible for unqualified lookup | ||
// inside the ALPAKA_ACCELERATOR_NAMESPACE::hgcaldigi namespace | ||
using namespace ::hgcaldigi; | ||
|
||
// SoA in device global memory | ||
using HGCalECONDInfoDevice = PortableCollection<HGCalECONDInfoSoA>; | ||
|
||
} // namespace hgcaldigi | ||
|
||
} // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
||
#endif |