Skip to content

Commit

Permalink
migrate pT3 and pT5 to SoATemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
slava77devel committed Oct 24, 2024
1 parent 9b8d26d commit 00013dd
Show file tree
Hide file tree
Showing 16 changed files with 415 additions and 585 deletions.
3 changes: 3 additions & 0 deletions RecoTracker/LSTCore/interface/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ namespace lst {
};
struct Params_pT3 {
static constexpr int kLayers = 5, kHits = 10;
using ArrayU8xLayers = edm::StdArray<uint8_t, kLayers>;
using ArrayU16xLayers = edm::StdArray<uint16_t, kLayers>;
using ArrayUxHits = edm::StdArray<unsigned int, kHits>;
};
struct Params_T5 {
static constexpr int kLayers = 5, kHits = 10;
Expand Down
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/PixelQuintupletsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_PixelQuintupletsHostCollection_h
#define RecoTracker_LSTCore_interface_PixelQuintupletsHostCollection_h

#include "RecoTracker/LSTCore/interface/PixelQuintupletsSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

namespace lst {
using PixelQuintupletsHostCollection = PortableHostCollection<PixelQuintupletsSoA>;
} // namespace lst
#endif
35 changes: 35 additions & 0 deletions RecoTracker/LSTCore/interface/PixelQuintupletsSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef RecoTracker_LSTCore_interface_PixelQuintupletsSoA_h
#define RecoTracker_LSTCore_interface_PixelQuintupletsSoA_h

#include <alpaka/alpaka.hpp>
#include "DataFormats/Common/interface/StdArray.h"
#include "DataFormats/SoATemplate/interface/SoALayout.h"

#include "RecoTracker/LSTCore/interface/Constants.h"

namespace lst {
GENERATE_SOA_LAYOUT(PixelQuintupletsSoALayout,
SOA_COLUMN(unsigned int, pixelSegmentIndices),
SOA_COLUMN(unsigned int, quintupletIndices),
SOA_COLUMN(Params_pT5::ArrayU16xLayers, lowerModuleIndices), // lower module index (OT part)
SOA_COLUMN(Params_pT5::ArrayU8xLayers, logicalLayers), // layer ID
SOA_COLUMN(Params_pT5::ArrayUxHits, hitIndices), // hit indices
SOA_COLUMN(float, rPhiChiSquared), // chi2 from pLS to T5
SOA_COLUMN(float, rPhiChiSquaredInwards), // chi2 from T5 to pLS
SOA_COLUMN(float, rzChiSquared),
SOA_COLUMN(FPX, pixelRadius), // pLS pt converted
SOA_COLUMN(FPX, quintupletRadius), // T5 circle
SOA_COLUMN(FPX, eta),
SOA_COLUMN(FPX, phi),
SOA_COLUMN(FPX, score), // used for ranking (in e.g. duplicate cleaning)
SOA_COLUMN(FPX, centerX), // T3-based circle center x
SOA_COLUMN(FPX, centerY), // T3-based circle center y
SOA_COLUMN(bool, isDup),
SOA_SCALAR(unsigned int, nPixelQuintuplets),
SOA_SCALAR(unsigned int, totOccupancyPixelQuintuplets));

using PixelQuintupletsSoA = PixelQuintupletsSoALayout<>;
using PixelQuintuplets = PixelQuintupletsSoA::View;
using PixelQuintupletsConst = PixelQuintupletsSoA::ConstView;
} // namespace lst
#endif
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/PixelTripletsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_PixelTripletsHostCollection_h
#define RecoTracker_LSTCore_interface_PixelTripletsHostCollection_h

#include "RecoTracker/LSTCore/interface/PixelTripletsSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

namespace lst {
using PixelTripletsHostCollection = PortableHostCollection<PixelTripletsSoA>;
} // namespace lst
#endif
39 changes: 39 additions & 0 deletions RecoTracker/LSTCore/interface/PixelTripletsSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef RecoTracker_LSTCore_interface_PixelTripletsSoA_h
#define RecoTracker_LSTCore_interface_PixelTripletsSoA_h

#include <alpaka/alpaka.hpp>
#include "DataFormats/Common/interface/StdArray.h"
#include "DataFormats/SoATemplate/interface/SoALayout.h"

#include "RecoTracker/LSTCore/interface/Constants.h"

namespace lst {
GENERATE_SOA_LAYOUT(PixelTripletsSoALayout,
SOA_COLUMN(unsigned int, pixelSegmentIndices),
SOA_COLUMN(unsigned int, tripletIndices),
SOA_COLUMN(Params_pT3::ArrayU16xLayers, lowerModuleIndices), // lower module index (OT part)
SOA_COLUMN(Params_pT3::ArrayU8xLayers, logicalLayers), // layer ID
SOA_COLUMN(Params_pT3::ArrayUxHits, hitIndices), // hit indices
SOA_COLUMN(float, rPhiChiSquared), // chi2 from pLS to T3
SOA_COLUMN(float, rPhiChiSquaredInwards), // chi2 from T3 to pLS
SOA_COLUMN(float, rzChiSquared),
SOA_COLUMN(FPX, pixelRadius), // pLS pt converted
SOA_COLUMN(FPX, tripletRadius), // T3 circle
SOA_COLUMN(FPX, pt),
SOA_COLUMN(FPX, eta),
SOA_COLUMN(FPX, phi),
SOA_COLUMN(FPX, eta_pix), // eta from pLS
SOA_COLUMN(FPX, phi_pix), // phi from pLS
SOA_COLUMN(FPX, score), // used for ranking (in e.g. duplicate cleaning)
SOA_COLUMN(FPX, centerX), // T3-based circle center x
SOA_COLUMN(FPX, centerY), // T3-based circle center y
SOA_COLUMN(bool, isDup),
SOA_SCALAR(unsigned int, nPixelTriplets),
SOA_SCALAR(unsigned int, totOccupancyPixelTriplets));

using PixelTripletsSoA = PixelTripletsSoALayout<>;
using PixelTriplets = PixelTripletsSoA::View;
using PixelTripletsConst = PixelTripletsSoA::ConstView;

} // namespace lst
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_PixelQuintupletsDeviceCollection_h
#define RecoTracker_LSTCore_interface_PixelQuintupletsDeviceCollection_h

#include "RecoTracker/LSTCore/interface/PixelQuintupletsSoA.h"
#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
using PixelQuintupletsDeviceCollection = PortableCollection<PixelQuintupletsSoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_PixelTripletsDeviceCollection_h
#define RecoTracker_LSTCore_interface_PixelTripletsDeviceCollection_h

#include "RecoTracker/LSTCore/interface/PixelTripletsSoA.h"
#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
using PixelTripletsDeviceCollection = PortableCollection<PixelTripletsSoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst
#endif
Loading

0 comments on commit 00013dd

Please sign in to comment.