Skip to content

Commit

Permalink
Merge pull request #104 from slava77/CMSSW_14_2_0_pre1/LSTb7-SoA-TC-T5
Browse files Browse the repository at this point in the history
continuing migration to SoA: upd TC, migrate T3s, T5s, pT3s and pT5s ...
  • Loading branch information
ariostas authored Oct 25, 2024
2 parents cb84b9c + 00013dd commit ccc4bf4
Show file tree
Hide file tree
Showing 25 changed files with 1,029 additions and 1,369 deletions.
9 changes: 9 additions & 0 deletions RecoTracker/LSTCore/interface/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,21 @@ namespace lst {
};
struct Params_T3 {
static constexpr int kLayers = 3, kHits = 6;
using ArrayU8xLayers = edm::StdArray<uint8_t, kLayers>;
using ArrayU16xLayers = edm::StdArray<uint16_t, kLayers>;
using ArrayUxHits = edm::StdArray<unsigned int, kHits>;
};
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;
using ArrayU8xLayers = edm::StdArray<uint8_t, kLayers>;
using ArrayU16xLayers = edm::StdArray<uint16_t, kLayers>;
using ArrayUxHits = edm::StdArray<unsigned int, kHits>;
};
struct Params_pT5 {
static constexpr int kLayers = 7, kHits = 14;
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
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/QuintupletsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_QuintupletsHostCollection_h
#define RecoTracker_LSTCore_interface_QuintupletsHostCollection_h

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

namespace lst {
using QuintupletsHostCollection = PortableHostMultiCollection<QuintupletsSoA, QuintupletsOccupancySoA>;
} // namespace lst
#endif
46 changes: 46 additions & 0 deletions RecoTracker/LSTCore/interface/QuintupletsSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#ifndef RecoTracker_LSTCore_interface_QuintupletsSoA_h
#define RecoTracker_LSTCore_interface_QuintupletsSoA_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(QuintupletsSoALayout,
SOA_COLUMN(ArrayUx2, tripletIndices), // inner and outer triplet indices
SOA_COLUMN(Params_T5::ArrayU16xLayers, lowerModuleIndices), // lower module index in each layer
SOA_COLUMN(Params_T5::ArrayU8xLayers, logicalLayers), // layer ID
SOA_COLUMN(Params_T5::ArrayUxHits, hitIndices), // hit indices
SOA_COLUMN(FPX, innerRadius), // inner triplet circle radius
SOA_COLUMN(FPX, bridgeRadius), // "middle"/bridge triplet radius
SOA_COLUMN(FPX, outerRadius), // outer triplet radius
SOA_COLUMN(FPX, pt),
SOA_COLUMN(FPX, eta),
SOA_COLUMN(FPX, phi),
SOA_COLUMN(FPX, score_rphisum), // r-phi based score
SOA_COLUMN(char, isDup), // duplicate flag
SOA_COLUMN(bool, tightCutFlag), // tight pass to be a TC
SOA_COLUMN(bool, partOfPT5),
SOA_COLUMN(float, regressionRadius),
SOA_COLUMN(float, regressionG),
SOA_COLUMN(float, regressionF),
SOA_COLUMN(float, rzChiSquared), // r-z only chi2
SOA_COLUMN(float, chiSquared),
SOA_COLUMN(float, nonAnchorChiSquared));

using QuintupletsSoA = QuintupletsSoALayout<>;
using Quintuplets = QuintupletsSoA::View;
using QuintupletsConst = QuintupletsSoA::ConstView;

GENERATE_SOA_LAYOUT(QuintupletsOccupancySoALayout,
SOA_COLUMN(unsigned int, nQuintuplets),
SOA_COLUMN(unsigned int, totOccupancyQuintuplets));

using QuintupletsOccupancySoA = QuintupletsOccupancySoALayout<>;
using QuintupletsOccupancy = QuintupletsOccupancySoA::View;
using QuintupletsOccupancyConst = QuintupletsOccupancySoA::ConstView;

} // namespace lst
#endif
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/TripletsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_TripletsHostCollection_h
#define RecoTracker_LSTCore_interface_TripletsHostCollection_h

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

namespace lst {
using TripletsHostCollection = PortableHostMultiCollection<TripletsSoA, TripletsOccupancySoA>;
} // namespace lst
#endif
42 changes: 42 additions & 0 deletions RecoTracker/LSTCore/interface/TripletsSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#ifndef RecoTracker_LSTCore_interface_TripletsSoA_h
#define RecoTracker_LSTCore_interface_TripletsSoA_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(TripletsSoALayout,
SOA_COLUMN(ArrayUx2, segmentIndices), // inner and outer segment indices
SOA_COLUMN(Params_T3::ArrayU16xLayers, lowerModuleIndices), // lower module index in each layer
SOA_COLUMN(Params_T3::ArrayU8xLayers, logicalLayers), // layer ID
SOA_COLUMN(Params_T3::ArrayUxHits, hitIndices), // hit indices
SOA_COLUMN(FPX, betaIn), // beta/chord angle of the inner segment
SOA_COLUMN(float, centerX), // lower/anchor-hit based circle center x
SOA_COLUMN(float, centerY), // lower/anchor-hit based circle center y
SOA_COLUMN(float, radius), // lower/anchor-hit based circle radius
#ifdef CUT_VALUE_DEBUG
SOA_COLUMN(float, zOut),
SOA_COLUMN(float, rtOut),
SOA_COLUMN(float, betaInCut),
#endif
SOA_COLUMN(bool, partOfPT5), // is it used in a pT5
SOA_COLUMN(bool, partOfT5), // is it used in a T5
SOA_COLUMN(bool, partOfPT3)); // is it used in a pT3

using TripletsSoA = TripletsSoALayout<>;
using Triplets = TripletsSoA::View;
using TripletsConst = TripletsSoA::ConstView;

GENERATE_SOA_LAYOUT(TripletsOccupancySoALayout,
SOA_COLUMN(unsigned int, nTriplets),
SOA_COLUMN(unsigned int, totOccupancyTriplets));

using TripletsOccupancySoA = TripletsOccupancySoALayout<>;
using TripletsOccupancy = TripletsOccupancySoA::View;
using TripletsOccupancyConst = TripletsOccupancySoA::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
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/alpaka/QuintupletsDeviceCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_QuintupletsDeviceCollection_h
#define RecoTracker_LSTCore_interface_QuintupletsDeviceCollection_h

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

namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
using QuintupletsDeviceCollection = PortableCollection2<QuintupletsSoA, QuintupletsOccupancySoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst
#endif
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/alpaka/TripletsDeviceCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_TripletsDeviceCollection_h
#define RecoTracker_LSTCore_interface_TripletsDeviceCollection_h

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

namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
using TripletsDeviceCollection = PortableCollection2<TripletsSoA, TripletsOccupancySoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst
#endif
Loading

0 comments on commit ccc4bf4

Please sign in to comment.