-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Refactoring of TICL EnergyRegression and PID model #45821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,14 +10,9 @@ | |
| mightGet = cms.optional.untracked.vstring, | ||
| original_mask = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded","InitialLayerClustersMask"), | ||
| patternRecognitionBy = cms.string('CLUE3D'), | ||
| inferenceAlgo = cms.string('TracksterInferenceByCNNv4'), | ||
| pluginPatternRecognitionByCA = cms.PSet( | ||
| algo_verbosity = cms.int32(0), | ||
| eid_input_name = cms.string('input'), | ||
| eid_min_cluster_energy = cms.double(1), | ||
| eid_n_clusters = cms.int32(10), | ||
| eid_n_layers = cms.int32(50), | ||
| eid_output_name_energy = cms.string('output/regressed_energy'), | ||
| eid_output_name_id = cms.string('output/id_probabilities'), | ||
| energy_em_over_total_threshold = cms.double(-1), | ||
| etaLimitIncreaseWindow = cms.double(2.1), | ||
| filter_on_categories = cms.vint32(0), | ||
|
|
@@ -100,34 +95,51 @@ | |
| 2, | ||
| 2 | ||
| ), | ||
| eid_input_name = cms.string('input'), | ||
| eid_output_name_energy = cms.string('output/regressed_energy'), | ||
| eid_output_name_id = cms.string('output/id_probabilities'), | ||
| eid_min_cluster_energy = cms.double(1), | ||
| eid_n_layers = cms.int32(50), | ||
| eid_n_clusters = cms.int32(10), | ||
| computeLocalTime = cms.bool(False), | ||
| doPidCut = cms.bool(True), | ||
| cutHadProb = cms.double(999.), | ||
| type = cms.string('CLUE3D') | ||
|
|
||
| ), | ||
| pluginPatternRecognitionByFastJet = cms.PSet( | ||
| algo_verbosity = cms.int32(0), | ||
| antikt_radius = cms.double(0.09), | ||
| eid_input_name = cms.string('input'), | ||
| minNumLayerCluster = cms.int32(5), | ||
| type = cms.string('FastJet') | ||
| ), | ||
| pluginInferenceAlgoTracksterInferenceByCNNv4 = cms.PSet( | ||
| algo_verbosity = cms.int32(0), | ||
| onnxModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv4/onnx_models/energy_id_v0.onnx'), | ||
| inputNames = cms.vstring('input:0'), | ||
| outputNames = cms.vstring("output/regressed_energy:0", "output/id_probabilities:0"), | ||
| eid_min_cluster_energy = cms.double(1), | ||
| eid_n_layers = cms.int32(50), | ||
| eid_n_clusters = cms.int32(10), | ||
| doPID = cms.int32(1), | ||
| doRegression = cms.int32(0), | ||
| type = cms.string('TracksterInferenceByCNNv4') | ||
| ), | ||
| pluginInferenceAlgoTracksterInferenceByDNN = cms.PSet( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused. I see that here you use the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Marco, so this additional empty plugin is set up in anticipation of future models that might arrive later, so we prepared the configuration for it in advance. Thanks! |
||
| 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_n_layers = cms.int32(50), | ||
| eid_output_name_energy = cms.string('output/regressed_energy'), | ||
| eid_output_name_id = cms.string('output/id_probabilities'), | ||
| minNumLayerCluster = cms.int32(5), | ||
| type = cms.string('FastJet') | ||
| eid_n_clusters = cms.int32(10), | ||
| doPID = cms.int32(1), | ||
| 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"), | ||
| tfDnnLabel = cms.string('tracksterSelectionTf'), | ||
| time_layerclusters = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded","timeLayerCluster") | ||
| time_layerclusters = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded","timeLayerCluster"), | ||
| ) | ||
|
|
||
| from Configuration.ProcessModifiers.ticl_v5_cff import ticl_v5 | ||
| ticl_v5.toModify(hltTiclTrackstersCLUE3DHighL1Seeded.pluginPatternRecognitionByCLUE3D, computeLocalTime = cms.bool(True), doPidCut = cms.bool(False)) | ||
| ticl_v5.toModify(hltTiclTrackstersCLUE3DHighL1Seeded.inferenceAlgo, type = cms.string('TracksterInferenceByDNN')) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // Author: Felice Pantaleo - felice.pantaleo@cern.ch | ||
| // Date: 07/2024 | ||
|
|
||
| #ifndef RecoHGCal_TICL_TracksterInferenceAlgo_H__ | ||
| #define RecoHGCal_TICL_TracksterInferenceAlgo_H__ | ||
|
|
||
| #include <vector> | ||
| #include "DataFormats/HGCalReco/interface/Trackster.h" | ||
| #include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
| #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
| #include "FWCore/Framework/interface/Event.h" | ||
| #include "FWCore/Framework/interface/EventSetup.h" | ||
|
|
||
| #include "DataFormats/Candidate/interface/Candidate.h" | ||
| #include "DataFormats/VertexReco/interface/Vertex.h" | ||
| #include "DataFormats/CaloRecHit/interface/CaloCluster.h" | ||
| #include "DataFormats/HGCalReco/interface/TICLCandidate.h" | ||
| #include "FWCore/Framework/interface/ConsumesCollector.h" | ||
| #include "PhysicsTools/ONNXRuntime/interface/ONNXRuntime.h" | ||
| #include "FWCore/PluginManager/interface/PluginFactory.h" | ||
|
|
||
| namespace ticl { | ||
| class TracksterInferenceAlgoBase { | ||
| public: | ||
| explicit TracksterInferenceAlgoBase(const edm::ParameterSet& conf) | ||
| : algo_verbosity_(conf.getParameter<int>("algo_verbosity")) {} | ||
| virtual ~TracksterInferenceAlgoBase() {} | ||
|
|
||
| virtual void inputData(const std::vector<reco::CaloCluster>& layerClusters, std::vector<Trackster>& tracksters) = 0; | ||
| virtual void runInference(std::vector<Trackster>& tracksters) = 0; | ||
| static void fillPSetDescription(edm::ParameterSetDescription& desc) { desc.add<int>("algo_verbosity", 0); }; | ||
|
|
||
| protected: | ||
| int algo_verbosity_; | ||
| }; | ||
| } // namespace ticl | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Author: Felice Pantaleo - felice.pantaleo@cern.ch | ||
| // Date: 07/2024 | ||
|
|
||
| #ifndef RecoHGCal_TICL_TracksterInferenceAlgoFactory_H__ | ||
| #define RecoHGCal_TICL_TracksterInferenceAlgoFactory_H__ | ||
|
|
||
| #include "FWCore/PluginManager/interface/PluginFactory.h" | ||
| #include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
| #include "PhysicsTools/ONNXRuntime/interface/ONNXRuntime.h" | ||
| #include "RecoHGCal/TICL/interface/TracksterInferenceAlgoBase.h" | ||
|
|
||
| typedef edmplugin::PluginFactory<ticl::TracksterInferenceAlgoBase*(const edm::ParameterSet&)> | ||
| TracksterInferenceAlgoFactory; | ||
|
|
||
| #endif |
Uh oh!
There was an error while loading. Please reload this page.