Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f0dd408
Add T4
jchismar Sep 19, 2024
a459af7
update T4
jchismar Sep 23, 2024
5f2f2b1
correct the ranges transfer from GPU to CPU for T4 objects
YonsiG Sep 30, 2024
f40f298
remove unused chi2 for T4
YonsiG Sep 30, 2024
0c0018e
add T4 as lower level object to plotting
jchismar Oct 7, 2024
8293123
update T4 definition
jchismar Oct 18, 2024
4eecd8c
Add T4 dup removal and fix hit indexing
jchismar Oct 31, 2024
80637e7
Add T4 as TC
jchismar Nov 8, 2024
f9bcc37
Add T4 charge cut and pointing constraints
jchismar Nov 8, 2024
a62dd57
add T4 rzChiSquared cut
jchismar Nov 13, 2024
d625322
debug
jchismar Nov 21, 2024
62fc67c
add T4 DNN branches to ntuple
jchismar Nov 25, 2024
f0acac3
add T4 DNN
jchismar Dec 18, 2024
caeaa98
T4 dnn updates
jchismar Jan 17, 2025
a1f335d
add downsampling to t4 dnn
jchismar Jan 31, 2025
ac33301
add T3 DNN
jchismar Feb 26, 2025
eb026e7
update occupancy and T4 duplicate removal
jchismar Mar 31, 2025
31a3a53
T4 DNN trained on full T3s + weighting
jchismar Mar 31, 2025
21eeda4
update debug output ntuple
jchismar Mar 31, 2025
a5debe1
add multi-class architecture to T4 DNN
jchismar Apr 4, 2025
cb4b43e
add multi-class training
jchismar Apr 4, 2025
a177c5d
create pT4
jchismar Apr 8, 2025
84bbb3d
add pT4 DNN, pT4 cross cleaning
jchismar Apr 28, 2025
f2c4ff0
add T4 layer adjustment for eta/phi consistency, update dup rem and c…
jchismar May 23, 2025
a66b4c5
add compile time flag for using t4 and pt4, update t4 cuts
jchismar Jun 10, 2025
795ca9c
clean up code, update tight DNN T4 flag
jchismar Jun 17, 2025
8a97aab
update T4 and pT4 files
jchismar Jun 18, 2025
722178e
finish updates for adding T4/pT4
jchismar Jun 30, 2025
473c80d
clean up
jchismar Jun 30, 2025
48f5332
histogram bug fix and clean up
jchismar Jul 1, 2025
9f0a408
add pT4 DNN training file
jchismar Jul 2, 2025
6cb0787
T4 DNN debug output ntuple branch bug fix
jchismar Jul 2, 2025
41e6ba2
code clean up
jchismar Jul 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion RecoTracker/LSTCore/interface/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace lst {
enum PixelType : int8_t { kInvalid = -1, kHighPt = 0, kLowPtPosCurv = 1, kLowPtNegCurv = 2 };

// Named types for LST objects
enum LSTObjType { T5 = 4, pT3 = 5, pT5 = 7, pLS = 8 };
enum LSTObjType { T5 = 4, pT3 = 5, pT5 = 7, pLS = 8, T4 = 9, pT4 = 11};

constexpr unsigned int max_blocks = 80;
constexpr unsigned int max_connected_modules = 40;
Expand All @@ -29,6 +29,7 @@ namespace lst {

constexpr unsigned int n_max_pixel_triplets = 5000;
constexpr unsigned int n_max_pixel_quintuplets = 15000;
constexpr unsigned int n_max_pixel_quadruplets = 15000;

constexpr unsigned int n_max_pixel_track_candidates = 300000;
constexpr unsigned int n_max_nonpixel_track_candidates = 10000;
Expand Down Expand Up @@ -87,6 +88,18 @@ namespace lst {
using ArrayU16xLayers = edm::StdArray<uint16_t, kLayers>;
using ArrayUxHits = edm::StdArray<unsigned int, kHits>;
};
struct Params_T4 {
static constexpr int kLayers = 4, kHits = 8;
using ArrayU8xLayers = edm::StdArray<uint8_t, kLayers>;
using ArrayU16xLayers = edm::StdArray<uint16_t, kLayers>;
using ArrayUxHits = edm::StdArray<unsigned int, kHits>;
};
struct Params_pT4 {
static constexpr int kLayers = 6, kHits = 12;
using ArrayU8xLayers = edm::StdArray<uint8_t, kLayers>;
using ArrayU16xLayers = edm::StdArray<uint16_t, kLayers>;
using ArrayUxHits = edm::StdArray<unsigned int, kHits>;
};

using ArrayIx2 = edm::StdArray<int, 2>;
using ArrayUx2 = edm::StdArray<unsigned int, 2>;
Expand Down
8 changes: 7 additions & 1 deletion RecoTracker/LSTCore/interface/ObjectRangesSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace lst {
SOA_COLUMN(ArrayIx2, segmentRanges),
SOA_COLUMN(ArrayIx2, tripletRanges),
SOA_COLUMN(ArrayIx2, quintupletRanges),
SOA_COLUMN(ArrayIx2, quadrupletRanges),
SOA_COLUMN(int, miniDoubletModuleIndices),
SOA_COLUMN(int, miniDoubletModuleOccupancy),
SOA_COLUMN(int, segmentModuleIndices),
Expand All @@ -21,12 +22,17 @@ namespace lst {
SOA_COLUMN(int, tripletModuleOccupancy),
SOA_COLUMN(int, quintupletModuleIndices),
SOA_COLUMN(int, quintupletModuleOccupancy),
SOA_COLUMN(int, quadrupletModuleIndices),
SOA_COLUMN(int, quadrupletModuleOccupancy),
SOA_COLUMN(uint16_t, indicesOfEligibleT5Modules),
SOA_COLUMN(uint16_t, indicesOfEligibleT4Modules),
SOA_SCALAR(unsigned int, nTotalMDs),
SOA_SCALAR(unsigned int, nTotalSegs),
SOA_SCALAR(unsigned int, nTotalTrips),
SOA_SCALAR(unsigned int, nTotalQuints),
SOA_SCALAR(uint16_t, nEligibleT5Modules))
SOA_SCALAR(unsigned int, nTotalQuads),
SOA_SCALAR(uint16_t, nEligibleT5Modules),
SOA_SCALAR(uint16_t, nEligibleT4Modules))

using ObjectRangesSoA = ObjectRangesSoALayout<>;

Expand Down
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/PixelQuadrupletsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_PixelQuadrupletsHostCollection_h
#define RecoTracker_LSTCore_interface_PixelQuadrupletsHostCollection_h

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

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

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

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

namespace lst {
GENERATE_SOA_LAYOUT(PixelQuadrupletsSoALayout,
SOA_COLUMN(unsigned int, pixelSegmentIndices),
SOA_COLUMN(unsigned int, quadrupletIndices),
SOA_COLUMN(Params_pT4::ArrayU16xLayers, lowerModuleIndices), // lower module index (OT part)
SOA_COLUMN(Params_pT4::ArrayU8xLayers, logicalLayers), // layer ID
SOA_COLUMN(Params_pT4::ArrayUxHits, hitIndices), // hit indices
SOA_COLUMN(float, rPhiChiSquared), // chi2 from pLS to T4
SOA_COLUMN(float, rPhiChiSquaredInwards), // chi2 from T4 to pLS
SOA_COLUMN(float, rzChiSquared),
SOA_COLUMN(FPX, pixelRadius), // pLS pt converted
SOA_COLUMN(FPX, pixelRadiusError),
SOA_COLUMN(FPX, quadrupletRadius), // T4 circle
SOA_COLUMN(FPX, eta),
SOA_COLUMN(FPX, phi),
SOA_COLUMN(float, pt),
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, nPixelQuadruplets),
SOA_SCALAR(unsigned int, totOccupancyPixelQuadruplets));

using PixelQuadrupletsSoA = PixelQuadrupletsSoALayout<>;
using PixelQuadruplets = PixelQuadrupletsSoA::View;
using PixelQuadrupletsConst = PixelQuadrupletsSoA::ConstView;
} // namespace lst
#endif
1 change: 1 addition & 0 deletions RecoTracker/LSTCore/interface/PixelSegmentsSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace lst {
SOA_COLUMN(Params_pLS::ArrayFxEmbed, plsEmbed),
SOA_COLUMN(char, isDup),
SOA_COLUMN(bool, partOfPT5),
SOA_COLUMN(bool, partOfPT4),
SOA_COLUMN(float, score),
SOA_COLUMN(float, circleCenterX),
SOA_COLUMN(float, circleCenterY),
Expand Down
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/QuadrupletsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_QuadrupletsHostCollection_h
#define RecoTracker_LSTCore_interface_QuadrupletsHostCollection_h

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

namespace lst {
using QuadrupletsHostCollection = PortableHostMultiCollection<QuadrupletsSoA, QuadrupletsOccupancySoA>;
} // namespace lst
#endif
56 changes: 56 additions & 0 deletions RecoTracker/LSTCore/interface/QuadrupletsSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#ifndef RecoTracker_LSTCore_interface_QuadrupletsSoA_h
#define RecoTracker_LSTCore_interface_QuadrupletsSoA_h

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

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

namespace lst {
GENERATE_SOA_LAYOUT(QuadrupletsSoALayout,
SOA_COLUMN(ArrayUx2, tripletIndices), // inner and outer triplet indices
SOA_COLUMN(Params_T4::ArrayU16xLayers, lowerModuleIndices), // lower module index in each layer
SOA_COLUMN(Params_T4::ArrayU8xLayers, logicalLayers), // layer ID
SOA_COLUMN(Params_T4::ArrayUxHits, hitIndices), // hit indices
SOA_COLUMN(FPX, innerRadius), // inner triplet circle 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, partOfPT4),
SOA_COLUMN(bool, partOfTC),
SOA_COLUMN(float, regressionRadius),
SOA_COLUMN(float, nonAnchorRegressionRadius),
SOA_COLUMN(float, regressionG),
SOA_COLUMN(float, regressionF),
SOA_COLUMN(float, rzChiSquared), // r-z only chi2
SOA_COLUMN(float, chiSquared),
SOA_COLUMN(float, nonAnchorChiSquared),
//mainly for debug, can probably be removed
SOA_COLUMN(float, promptscore_t4dnn),
SOA_COLUMN(float, displacedscore_t4dnn),
SOA_COLUMN(float, fakescore_t4dnn),
// SOA_COLUMN(float, uncertainty),
SOA_COLUMN(bool, tightDNNFlag),
SOA_COLUMN(int, layer),
//
SOA_COLUMN(float, dBeta));

using QuadrupletsSoA = QuadrupletsSoALayout<>;
using Quadruplets = QuadrupletsSoA::View;
using QuadrupletsConst = QuadrupletsSoA::ConstView;

GENERATE_SOA_LAYOUT(QuadrupletsOccupancySoALayout,
SOA_COLUMN(unsigned int, nQuadruplets),
SOA_COLUMN(unsigned int, totOccupancyQuadruplets));

using QuadrupletsOccupancySoA = QuadrupletsOccupancySoALayout<>;
using QuadrupletsOccupancy = QuadrupletsOccupancySoA::View;
using QuadrupletsOccupancyConst = QuadrupletsOccupancySoA::ConstView;

} // namespace lst
#endif
4 changes: 3 additions & 1 deletion RecoTracker/LSTCore/interface/TrackCandidatesSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ namespace lst {
SOA_SCALAR(unsigned int, nTrackCandidatespT3), //
SOA_SCALAR(unsigned int, nTrackCandidatespT5), //
SOA_SCALAR(unsigned int, nTrackCandidatespLS), //
SOA_SCALAR(unsigned int, nTrackCandidatesT5)) //
SOA_SCALAR(unsigned int, nTrackCandidatesT5), //
SOA_SCALAR(unsigned int, nTrackCandidatesT4),
SOA_SCALAR(unsigned int, nTrackCandidatespT4))

using TrackCandidatesSoA = TrackCandidatesSoALayout<>;
using TrackCandidates = TrackCandidatesSoA::View;
Expand Down
4 changes: 3 additions & 1 deletion RecoTracker/LSTCore/interface/TripletsSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ namespace lst {
SOA_COLUMN(float, fakeScore), // DNN confidence score for fake t3
SOA_COLUMN(float, promptScore), // DNN confidence score for real (prompt) t3
SOA_COLUMN(float, displacedScore), // DNN confidence score for real (displaced) t3
SOA_COLUMN(float, charge),
#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
SOA_COLUMN(bool, partOfPT3), // is it used in a pT3
SOA_COLUMN(bool, partOfPT4)); // is it used in a pT4

using TripletsSoA = TripletsSoALayout<>;
using Triplets = TripletsSoA::View;
Expand Down
19 changes: 19 additions & 0 deletions RecoTracker/LSTCore/interface/alpaka/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,25 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
HOST_DEVICE_CONSTANT float kWpHigh = 0.0473f;
} // namespace pt3dnn

namespace t4dnn {
HOST_DEVICE_CONSTANT float kZ_max = 267.2349854f;
HOST_DEVICE_CONSTANT float kR_max = 110.1099396f;
HOST_DEVICE_CONSTANT float kEta_norm = 2.5f;

HOST_DEVICE_CONSTANT float kWp_prompt[kPtBins][kEtaBins] = {
{0.6398, 0.6448, 0.6586, 0.6875, 0.6146, 0.6181, 0.6515, 0.6528, 0.6872, 0.6870}, //85% low pt, w/ radii, t3 scores
{0.2145, 0.2547, 0.2754, 0.2830, 0.2413, 0.2249, 0.3232, 0.3532, 0.3180, 0.2721}}; //90% high pt, w/ radii, t3 scores
HOST_DEVICE_CONSTANT float kWp_displaced[kPtBins][kEtaBins] = {
{0.4056, 0.4600, 0.4429, 0.4547, 0.3771, 0.3657, 0.3660, 0.3992, 0.4521, 0.4764}, //75% low pt, w/ radii, t3 scores
{0.4893, 0.4653, 0.4464, 0.4310, 0.3706, 0.3340, 0.3140, 0.2800, 0.3107, 0.3028}}; //85% high pt, w/ radii, t3 scores
} // namespace t4dnn

namespace pt4dnn {
HOST_DEVICE_CONSTANT float kEta_norm = 2.5f;
HOST_DEVICE_CONSTANT float kWp[kEtaBins] =
{0.8497, 0.8674, 0.8501, 0.8416, 0.7457, 0.7593, 0.7884, 0.7622, 0.658, 0.5348}; //98% retention
} // namespace pt4dnn

} // namespace dnn

} // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef RecoTracker_LSTCore_interface_PixelQuadrupletsDeviceCollection_h
#define RecoTracker_LSTCore_interface_PixelQuadrupletsDeviceCollection_h

#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"

#include "RecoTracker/LSTCore/interface/alpaka/Common.h"
#include "RecoTracker/LSTCore/interface/PixelQuadrupletsSoA.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
using PixelQuadrupletsDeviceCollection = PortableCollection<PixelQuadrupletsSoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst
#endif
12 changes: 12 additions & 0 deletions RecoTracker/LSTCore/interface/alpaka/QuadrupletsDeviceCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef RecoTracker_LSTCore_interface_QuadrupletsDeviceCollection_h
#define RecoTracker_LSTCore_interface_QuadrupletsDeviceCollection_h

#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"

#include "RecoTracker/LSTCore/interface/alpaka/Common.h"
#include "RecoTracker/LSTCore/interface/QuadrupletsSoA.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
using QuadrupletsDeviceCollection = PortableCollection2<QuadrupletsSoA, QuadrupletsOccupancySoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst
#endif
Loading