5 #ifndef EFTRACKING_FPGA_INTEGRATION_FPGADATAFORMATUTILITIES_H
6 #define EFTRACKING_FPGA_INTEGRATION_FPGADATAFORMATUTILITIES_H
14 consteval uint64_t
SELECTBITS(uint8_t len, uint8_t startbit) {
15 return (len == 64 ? 0xFFFFFFFFFFFFFFFFULL : (((1ULL << len) - 1ULL) << startbit));
266 temp.hdr_crc = hdr_crc;
352 inline M_HDR_w1 fill_M_HDR_w1 (
const uint64_t& flag,
const uint64_t& modid,
const uint64_t& modhash,
const uint64_t& spare) {
356 temp.modhash = modhash;
429 inline SLICE_HDR_w1 fill_SLICE_HDR_w1 (
const uint64_t& flag,
const uint64_t& sliceid,
const uint64_t& eta_region,
const uint64_t& phi_region,
const uint64_t& spare) {
432 temp.sliceid = sliceid;
433 temp.eta_region = eta_region;
434 temp.phi_region = phi_region;
581 inline RD_HDR_w1 fill_RD_HDR_w1 (
const uint64_t& flag,
const uint64_t&
type,
const uint64_t& eta_region,
const uint64_t& phi_region,
const uint64_t& slice,
const uint64_t& hough_x_bin,
const uint64_t& hough_y_bin,
const uint64_t& second_stage,
const uint64_t& layer_bitmask,
const uint64_t& spare) {
585 temp.eta_region = eta_region;
586 temp.phi_region = phi_region;
588 temp.hough_x_bin = hough_x_bin;
589 temp.hough_y_bin = hough_y_bin;
590 temp.second_stage = second_stage;
591 temp.layer_bitmask = layer_bitmask;
599 temp.global_eta = global_eta;
813 inline GTRACK_HDR_w1 fill_GTRACK_HDR_w1 (
const uint64_t& flag,
const uint64_t&
type,
const uint64_t& eta_region,
const uint64_t& phi_region,
const uint64_t& phi_bin,
const uint64_t& z_bin,
const uint64_t& second_stage,
const uint64_t& layer_bitmask) {
817 temp.eta_region = eta_region;
818 temp.phi_region = phi_region;
819 temp.phi_bin = phi_bin;
821 temp.second_stage = second_stage;
822 temp.layer_bitmask = layer_bitmask;
964 inline PIXEL_CLUSTER fill_PIXEL_CLUSTER (
const uint64_t& last,
const uint64_t& col,
const uint64_t& row,
const double& centroid_col,
const double& centroid_row,
const uint64_t& spare) {
1057 uint64_t temp = up << 32;
1058 return (temp | low);
1065 temp.nstrips = nstrips;
1066 temp.strip_index = strip_index;
1196 inline GHITZ_w1 fill_GHITZ_w1 (
const uint64_t& last,
const uint64_t& lyr,
const double& rad,
const double&
phi,
const double&
z,
const uint64_t& lastofslice,
const uint64_t& spare) {
1203 temp.lastofslice = lastofslice;
1208 inline GHITZ_w2 fill_GHITZ_w2 (
const uint64_t& cluster1,
const uint64_t& cluster2,
const uint64_t& row,
const uint64_t& spare) {
1211 temp.cluster2 = cluster2;
1533 temp.id_hash = id_hash;
1575 temp.channels_in_phi = channels_in_phi;
1589 temp.lastword = lastword;
1989 temp.id_hash = id_hash;
2022 temp.channels_in_phi = channels_in_phi;
2023 temp.channels_in_eta = channels_in_eta;
2024 temp.width_in_eta = width_in_eta;
2054 temp.total_tot = total_tot;
2055 temp.lastword = lastword;
2212 inline PIXEL_EF_RDO fill_PIXEL_EF_RDO (
const uint64_t& last,
const uint64_t& row,
const uint64_t& col,
const uint64_t& tot,
const uint64_t& lvl1,
const uint64_t& spare) {
2305 uint64_t temp = up << 32;
2306 return (temp | low);
2309 inline STRIP_EF_RDO fill_STRIP_EF_RDO (
const uint64_t& last,
const uint64_t& chipid,
const uint64_t& strip_num,
const uint64_t& cluster_map,
const uint64_t& spare) {
2312 temp.chipid = chipid;
2313 temp.strip_num = strip_num;
2314 temp.cluster_map = cluster_map;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
static std::vector< uint32_t > runnumber