Skip to content

Commit

Permalink
Merge pull request #46539 from waredjeb/TICLv5p1_14_2_X_2024-10-20-0000
Browse files Browse the repository at this point in the history
TICLv5a : Improve skeleton linking and parameters tuning
  • Loading branch information
cmsbuild authored Nov 23, 2024
2 parents 9357092 + d112936 commit bddc8bc
Show file tree
Hide file tree
Showing 16 changed files with 617 additions and 279 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import FWCore.ParameterSet.Config as cms

hltFilteredLayerClustersRecoveryL1Seeded = cms.EDProducer("FilteredLayerClustersProducer",
LayerClusters = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded"),
LayerClustersInputMask = cms.InputTag("hltTiclTrackstersCLUE3DHighL1Seeded"),
algo_number = cms.vint32(6, 7, 8),
clusterFilter = cms.string('ClusterFilterBySize'),
iteration_label = cms.string('Recovery'),
max_cluster_size = cms.int32(9999),
max_layerId = cms.int32(9999),
mightGet = cms.optional.untracked.vstring,
min_cluster_size = cms.int32(2),
min_layerId = cms.int32(0)
)
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import FWCore.ParameterSet.Config as cms
from ..psets.hltTiclTracksterLinksPSet_cfi import hltTiclTracksterLinksPSet

hltTiclTracksterLinksL1Seeded = cms.EDProducer("TracksterLinksProducer",
detector = cms.string('HGCAL'),
layer_clusters = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded"),
layer_clustersTime = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded","timeLayerCluster"),
inferenceAlgo = cms.string('TracksterInferenceByDNN'),
linkingPSet = cms.PSet(
algo_verbosity = cms.int32(0),
cylinder_radius_sqr = cms.vdouble(9, 9),
dot_prod_th = cms.double(0.97),
max_distance_projective_sqr = cms.vdouble(60, 60),
max_distance_projective_sqr_closest_points = cms.vdouble(60, 60),
max_z_distance_closest_points = cms.vdouble(35, 35),
min_distance_z = cms.vdouble(30, 30),
min_num_lcs = cms.uint32(7),
min_trackster_energy = cms.double(10),
pca_quality_th = cms.double(0.85),
track_time_quality_threshold = cms.double(0.5),
type = cms.string('Skeletons'),
wind = cms.double(0.036)
),
linkingPSet = hltTiclTracksterLinksPSet,
pluginInferenceAlgoTracksterInferenceByDNN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/linking/id_v0.onnx'),
Expand All @@ -38,7 +25,7 @@
original_masks = cms.VInputTag("hltHgcalMergeLayerClustersL1Seeded:InitialLayerClustersMask"),
propagator = cms.string('PropagatorWithMaterial'),
regressionAndPid = cms.bool(True),
tracksters_collections = cms.VInputTag("hltTiclTrackstersCLUE3DHighL1Seeded", "hltTiclTrackstersPassthrough")
tracksters_collections = cms.VInputTag("hltTiclTrackstersCLUE3DHighL1Seeded", "hltTiclTrackstersRecoveryL1Seeded")
)


This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import FWCore.ParameterSet.Config as cms
from ..psets.hltTiclTracksterLinksPSet_cfi import hltTiclTracksterLinksPSet

hltTiclTracksterLinks = cms.EDProducer("TracksterLinksProducer",
detector = cms.string('HGCAL'),
layer_clusters = cms.InputTag("hltHgcalMergeLayerClusters"),
layer_clustersTime = cms.InputTag("hltHgcalMergeLayerClusters","timeLayerCluster"),
inferenceAlgo = cms.string('TracksterInferenceByDNN'),
linkingPSet = cms.PSet(
algo_verbosity = cms.int32(0),
cylinder_radius_sqr = cms.vdouble(9, 9),
dot_prod_th = cms.double(0.97),
max_distance_projective_sqr = cms.vdouble(60, 60),
max_distance_projective_sqr_closest_points = cms.vdouble(60, 60),
max_z_distance_closest_points = cms.vdouble(35, 35),
min_distance_z = cms.vdouble(30, 30),
min_num_lcs = cms.uint32(7),
min_trackster_energy = cms.double(10),
pca_quality_th = cms.double(0.85),
track_time_quality_threshold = cms.double(0.5),
type = cms.string('Skeletons'),
wind = cms.double(0.036)
),
linkingPSet = hltTiclTracksterLinksPSet,
pluginInferenceAlgoTracksterInferenceByDNN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/linking/id_v0.onnx'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import FWCore.ParameterSet.Config as cms

hltTiclTrackstersRecoveryL1Seeded = cms.EDProducer("TrackstersProducer",
detector = cms.string('HGCAL'),
filtered_mask = cms.InputTag("hltFilteredLayerClustersRecoveryL1Seeded","Recovery"),
itername = cms.string('Recovery'),
layer_clusters = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded"),
layer_clusters_hfnose_tiles = cms.InputTag("ticlLayerTileHFNose"),
layer_clusters_tiles = cms.InputTag("hltTiclLayerTileProducerL1Seeded"),
mightGet = cms.optional.untracked.vstring,
original_mask = cms.InputTag("hltTiclTrackstersCLUE3DHighL1Seeded"),
patternRecognitionBy = cms.string('Recovery'),
inferenceAlgo = cms.string('TracksterInferenceByDNN'),
pluginPatternRecognitionByCA = cms.PSet(
algo_verbosity = cms.int32(0),
computeLocalTime = cms.bool(True),
energy_em_over_total_threshold = cms.double(-1),
etaLimitIncreaseWindow = cms.double(2.1),
filter_on_categories = cms.vint32(0),
max_delta_time = cms.double(3),
max_longitudinal_sigmaPCA = cms.double(9999),
max_missing_layers_in_trackster = cms.int32(9999),
max_out_in_hops = cms.int32(10),
min_cos_pointing = cms.double(-1),
min_cos_theta = cms.double(0.915),
min_layers_per_trackster = cms.int32(10),
oneTracksterPerTrackSeed = cms.bool(False),
out_in_dfs = cms.bool(True),
pid_threshold = cms.double(0),
promoteEmptyRegionToTrackster = cms.bool(False),
root_doublet_max_distance_from_seed_squared = cms.double(9999),
shower_start_max_layer = cms.int32(9999),
siblings_maxRSquared = cms.vdouble(0.0006, 0.0006, 0.0006),
skip_layers = cms.int32(0),
type = cms.string('CA')
),
pluginPatternRecognitionByCLUE3D = cms.PSet(
algo_verbosity = cms.int32(0),
computeLocalTime = cms.bool(True),
criticalDensity = cms.vdouble(4, 4, 4),
criticalEtaPhiDistance = cms.vdouble(0.025, 0.025, 0.025),
criticalSelfDensity = cms.vdouble(0.15, 0.15, 0.15),
criticalXYDistance = cms.vdouble(1.8, 1.8, 1.8),
criticalZDistanceLyr = cms.vint32(5, 5, 5),
cutHadProb = cms.double(0.5),
densityEtaPhiDistanceSqr = cms.vdouble(0.0008, 0.0008, 0.0008),
densityOnSameLayer = cms.bool(False),
densitySiblingLayers = cms.vint32(3, 3, 3),
densityXYDistanceSqr = cms.vdouble(3.24, 3.24, 3.24),
doPidCut = cms.bool(False),
kernelDensityFactor = cms.vdouble(0.2, 0.2, 0.2),
minNumLayerCluster = cms.vint32(2, 2, 2),
nearestHigherOnSameLayer = cms.bool(False),
outlierMultiplier = cms.vdouble(2, 2, 2),
rescaleDensityByZ = cms.bool(False),
type = cms.string('CLUE3D'),
useAbsoluteProjectiveScale = cms.bool(True),
useClusterDimensionXY = cms.bool(False)
),
pluginPatternRecognitionByFastJet = cms.PSet(
algo_verbosity = cms.int32(0),
antikt_radius = cms.double(0.09),
computeLocalTime = cms.bool(True),
minNumLayerCluster = cms.int32(5),
type = cms.string('FastJet')
),
pluginPatternRecognitionByRecovery = cms.PSet(
algo_verbosity = cms.int32(0),
type = cms.string('Recovery')
),

pluginInferenceAlgoTracksterInferenceByDNN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
eid_min_cluster_energy = cms.double(1),
eid_n_layers = cms.int32(50),
eid_n_clusters = cms.int32(10),
doPID = cms.int32(0),
doRegression = cms.int32(0),
type = cms.string('TracksterInferenceByDNN')
),
pluginInferenceAlgoTracksterInferenceByANN = cms.PSet(
algo_verbosity = cms.int32(0),
type = cms.string('TracksterInferenceByANN')

),
seeding_regions = cms.InputTag("hltTiclSeedingL1"),
time_layerclusters = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded","timeLayerCluster")
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import FWCore.ParameterSet.Config as cms

hltTiclTracksterLinksPSet = cms.PSet(
cylinder_radius_sqr_split = cms.double(9),
proj_distance_split = cms.double(5),
track_time_quality_threshold = cms.double(0.5),
min_num_lcs = cms.uint32(15),
min_trackster_energy = cms.double(20),
pca_quality_th = cms.double(0.85),
dot_prod_th = cms.double(0.97),
deltaRxy = cms.double(4),
lower_boundary = cms.vdouble(
20,
10
),
upper_boundary = cms.vdouble(
150,
100
),
upper_distance_projective_sqr = cms.vdouble(
30,
60
),
lower_distance_projective_sqr = cms.vdouble(
30,
60
),
min_distance_z = cms.vdouble(
35,
35
),
upper_distance_projective_sqr_closest_points = cms.vdouble(
5,
30
),
lower_distance_projective_sqr_closest_points = cms.vdouble(
10,
50
),
max_z_distance_closest_points = cms.vdouble(
35,
35
),
cylinder_radius_sqr = cms.vdouble(
9,
15
),
algo_verbosity = cms.int32(0),
type = cms.string('Skeletons')
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from ..modules.hltHgcalSoARecHitsLayerClustersProducer_cfi import *
from ..modules.hltHgcalSoALayerClustersProducer_cfi import *
from ..modules.hltHgcalLayerClustersFromSoAProducer_cfi import *
from ..modules.hltTiclTracksterLinksUnseeded_cfi import *
from ..modules.hltTiclTracksterLinks_cfi import *

_HgcalLocalRecoUnseededSequence = cms.Sequence(hltHgcalDigis+hltHGCalUncalibRecHit+hltHGCalRecHit+hltParticleFlowRecHitHGC+hltHgcalLayerClustersEE+hltHgcalLayerClustersHSci+hltHgcalLayerClustersHSi+hltHgcalMergeLayerClusters)
_HgcalTICLPatternRecognitionUnseededSequence = cms.Sequence(hltFilteredLayerClustersCLUE3DHigh+hltTiclSeedingGlobal+hltTiclLayerTileProducer+hltTiclTrackstersCLUE3DHigh)
Expand Down Expand Up @@ -49,7 +49,7 @@
)

# Use EGammaSuperClusterProducer at HLT in ticl v5
hltTiclTracksterLinksSuperclusteringDNNUnseeded = hltTiclTracksterLinksUnseeded.clone(
hltTiclTracksterLinksSuperclusteringDNNUnseeded = hltTiclTracksterLinks.clone(
linkingPSet = cms.PSet(
type=cms.string("SuperClusteringDNN"),
algo_verbosity=cms.int32(0),
Expand All @@ -59,7 +59,7 @@
tracksters_collections = [cms.InputTag("hltTiclTrackstersCLUE3DHigh")], # to be changed to ticlTrackstersCLUE3DEM once separate CLUE3D iterations are introduced
)

hltTiclTracksterLinksSuperclusteringMustacheUnseeded = hltTiclTracksterLinksUnseeded.clone(
hltTiclTracksterLinksSuperclusteringMustacheUnseeded = hltTiclTracksterLinks.clone(
linkingPSet = cms.PSet(
type=cms.string("SuperClusteringMustache"),
algo_verbosity=cms.int32(0)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import FWCore.ParameterSet.Config as cms

from ..modules.hltFilteredLayerClustersRecoveryL1Seeded_cfi import *
from ..modules.hltTiclTrackstersRecoveryL1Seeded_cfi import *

HLTTiclTrackstersRecoverySequence = cms.Sequence(hltFilteredLayerClustersRecovery+hltTiclTrackstersRecovery)
18 changes: 14 additions & 4 deletions RecoHGCal/TICL/plugins/TICLDumper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ class TICLDumper : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::Sh
const edm::EDGetTokenT<std::vector<reco::Muon>> muons_token_;
const edm::EDGetTokenT<edm::ValueMap<std::pair<float, float>>> clustersTime_token_;
const edm::EDGetTokenT<std::vector<int>> tracksterSeeds_token_;
const edm::EDGetTokenT<std::vector<std::vector<unsigned int>>> superclustering_linkedResultTracksters_token;
const edm::EDGetTokenT<reco::SuperClusterCollection> recoSuperClusters_token;
const edm::EDGetTokenT<reco::CaloClusterCollection> recoSuperClusters_caloClusters_token;
const edm::EDGetTokenT<std::vector<ticl::Trackster>> recoSuperClusters_sourceTracksters_token;
edm::EDGetTokenT<std::vector<std::vector<unsigned int>>> superclustering_linkedResultTracksters_token;
edm::EDGetTokenT<reco::SuperClusterCollection> recoSuperClusters_token;
edm::EDGetTokenT<reco::CaloClusterCollection> recoSuperClusters_caloClusters_token;
edm::EDGetTokenT<std::vector<ticl::Trackster>> recoSuperClusters_sourceTracksters_token;
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeometry_token_;
const edm::EDGetTokenT<std::vector<ticl::Trackster>> simTracksters_SC_token_; // needed for simticlcandidate
const edm::EDGetTokenT<std::vector<TICLCandidate>> simTICLCandidate_token_;
Expand Down Expand Up @@ -884,6 +884,16 @@ TICLDumper::TICLDumper(const edm::ParameterSet& ps)
saveTICLCandidate_(ps.getParameter<bool>("saveSimTICLCandidate")),
saveSimTICLCandidate_(ps.getParameter<bool>("saveSimTICLCandidate")),
saveTracks_(ps.getParameter<bool>("saveTracks")) {
if (saveSuperclustering_) {
superclustering_linkedResultTracksters_token =
consumes<std::vector<std::vector<unsigned int>>>(ps.getParameter<edm::InputTag>("superclustering"));
recoSuperClusters_token =
consumes<reco::SuperClusterCollection>(ps.getParameter<edm::InputTag>("recoSuperClusters"));
recoSuperClusters_caloClusters_token =
consumes<reco::CaloClusterCollection>(ps.getParameter<edm::InputTag>("recoSuperClusters"));
recoSuperClusters_sourceTracksters_token = consumes<std::vector<ticl::Trackster>>(
ps.getParameter<edm::InputTag>("recoSuperClusters_sourceTracksterCollection"));
}
std::string detectorName_ = (detector_ == "HFNose") ? "HGCalHFNoseSensitive" : "HGCalEESensitive";
hdc_token_ =
esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag("", detectorName_));
Expand Down
Loading

0 comments on commit bddc8bc

Please sign in to comment.