Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
detector = cms.string('HGCAL'),
layer_clusters = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded"),
layer_clustersTime = cms.InputTag("hltHgcalMergeLayerClustersL1Seeded","timeLayerCluster"),
inferenceAlgo = cms.string('TracksterInferenceByDNN'),
inferenceAlgo = cms.string('TracksterInferenceByPFN'),
linkingPSet = hltTiclTracksterLinksPSet,
pluginInferenceAlgoTracksterInferenceByDNN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/linking/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/linking/energy_v0.onnx'),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/linking/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/linking/energy_v0.onnx'),
inputNames = cms.vstring('input'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
Expand All @@ -21,6 +21,20 @@
doRegression = cms.int32(1),
type = cms.string('TracksterInferenceByDNN')
),
pluginInferenceAlgoTracksterInferenceByPFN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/linking/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/linking/energy_v0.onnx'),
inputNames = cms.vstring('input','input_tr_features'),
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(1),
doRegression = cms.int32(1),
type = cms.string('TracksterInferenceByPFN')
),
mightGet = cms.optional.untracked.vstring,
original_masks = cms.VInputTag("hltHgcalMergeLayerClustersL1Seeded:InitialLayerClustersMask"),
propagator = cms.string('PropagatorWithMaterial'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
detector = cms.string('HGCAL'),
layer_clusters = cms.InputTag("hltHgcalMergeLayerClusters"),
layer_clustersTime = cms.InputTag("hltHgcalMergeLayerClusters","timeLayerCluster"),
inferenceAlgo = cms.string('TracksterInferenceByDNN'),
inferenceAlgo = cms.string('TracksterInferenceByPFN'),
linkingPSet = hltTiclTracksterLinksPSet,
pluginInferenceAlgoTracksterInferenceByDNN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/linking/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/linking/energy_v0.onnx'),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/linking/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/linking/energy_v0.onnx'),
inputNames = cms.vstring('input'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
Expand All @@ -21,6 +21,20 @@
doRegression = cms.int32(1),
type = cms.string('TracksterInferenceByDNN')
),
pluginInferenceAlgoTracksterInferenceByPFN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/linking/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/linking/energy_v0.onnx'),
inputNames = cms.vstring('input','input_tr_features'),
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(1),
doRegression = cms.int32(1),
type = cms.string('TracksterInferenceByPFN')
),
mightGet = cms.optional.untracked.vstring,
original_masks = cms.VInputTag("hltHgcalMergeLayerClusters:InitialLayerClustersMask"),
propagator = cms.string('PropagatorWithMaterial'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
),
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'),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
Expand All @@ -131,7 +131,20 @@
doRegression = cms.int32(0),
type = cms.string('TracksterInferenceByDNN')
),
pluginInferenceAlgoTracksterInferenceByANN = cms.PSet(
pluginInferenceAlgoTracksterInferenceByPFN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input','input_tr_features'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
eid_n_layers = cms.int32(50),
eid_n_clusters = cms.int32(10),
doPID = cms.int32(1),
doRegression = cms.int32(0),
type = cms.string('TracksterInferenceByPFN')
),
pluginInferenceAlgoTracksterInferenceByANN = cms.PSet(
algo_verbosity = cms.int32(0),
type = cms.string('TracksterInferenceByANN')

Expand All @@ -142,5 +155,5 @@

from Configuration.ProcessModifiers.ticl_v5_cff import ticl_v5
ticl_v5.toModify(hltTiclTrackstersCLUE3DHighL1Seeded.pluginPatternRecognitionByCLUE3D, computeLocalTime = cms.bool(True))
ticl_v5.toModify(hltTiclTrackstersCLUE3DHighL1Seeded.inferenceAlgo, type = cms.string('TracksterInferenceByDNN'))
ticl_v5.toModify(hltTiclTrackstersCLUE3DHighL1Seeded.inferenceAlgo, type = cms.string('TracksterInferenceByPFN'))

Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
),
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'),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
Expand All @@ -132,6 +132,19 @@
doRegression = cms.int32(0),
type = cms.string('TracksterInferenceByDNN')
),
pluginInferenceAlgoTracksterInferenceByPFN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input','input_tr_features'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
eid_n_layers = cms.int32(50),
eid_n_clusters = cms.int32(10),
doPID = cms.int32(1),
doRegression = cms.int32(0),
type = cms.string('TracksterInferenceByPFN')
),
pluginInferenceAlgoTracksterInferenceByANN = cms.PSet(
algo_verbosity = cms.int32(0),
type = cms.string('TracksterInferenceByANN')
Expand All @@ -143,4 +156,4 @@

from Configuration.ProcessModifiers.ticl_v5_cff import ticl_v5
ticl_v5.toModify(hltTiclTrackstersCLUE3DHigh.pluginPatternRecognitionByCLUE3D, computeLocalTime = cms.bool(True))
ticl_v5.toModify(hltTiclTrackstersCLUE3DHigh.inferenceAlgo, type = cms.string('TracksterInferenceByDNN'))
ticl_v5.toModify(hltTiclTrackstersCLUE3DHigh.inferenceAlgo, type = cms.string('TracksterInferenceByPFN'))
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
mightGet = cms.optional.untracked.vstring,
original_mask = cms.InputTag("hltTiclTrackstersCLUE3DHighL1Seeded"),
patternRecognitionBy = cms.string('Recovery'),
inferenceAlgo = cms.string('TracksterInferenceByDNN'),
inferenceAlgo = cms.string('TracksterInferenceByPFN'),
pluginPatternRecognitionByCA = cms.PSet(
algo_verbosity = cms.int32(0),
computeLocalTime = cms.bool(True),
Expand Down Expand Up @@ -71,8 +71,8 @@

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'),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
Expand All @@ -83,6 +83,20 @@
doRegression = cms.int32(0),
type = cms.string('TracksterInferenceByDNN')
),
pluginInferenceAlgoTracksterInferenceByPFN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input','input_tr_features'),
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('TracksterInferenceByPFN')
),
pluginInferenceAlgoTracksterInferenceByANN = cms.PSet(
algo_verbosity = cms.int32(0),
type = cms.string('TracksterInferenceByANN')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
mightGet = cms.optional.untracked.vstring,
original_mask = cms.InputTag("hltTiclTrackstersCLUE3DHigh"),
patternRecognitionBy = cms.string('Recovery'),
inferenceAlgo = cms.string('TracksterInferenceByDNN'),
inferenceAlgo = cms.string('TracksterInferenceByPFN'),
pluginPatternRecognitionByCA = cms.PSet(
algo_verbosity = cms.int32(0),
computeLocalTime = cms.bool(True),
Expand Down Expand Up @@ -71,8 +71,8 @@

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'),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input'),
output_en = cms.vstring('enreg_output'),
output_id = cms.vstring('pid_output'),
Expand All @@ -83,6 +83,20 @@
doRegression = cms.int32(0),
type = cms.string('TracksterInferenceByDNN')
),
pluginInferenceAlgoTracksterInferenceByPFN = cms.PSet(
algo_verbosity = cms.int32(0),
onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/patternrecognition/id_v0.onnx'),
onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/PFN/patternrecognition/energy_v0.onnx'),
inputNames = cms.vstring('input','input_tr_features'),
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('TracksterInferenceByPFN')
),
pluginInferenceAlgoTracksterInferenceByANN = cms.PSet(
algo_verbosity = cms.int32(0),
type = cms.string('TracksterInferenceByANN')
Expand Down
41 changes: 41 additions & 0 deletions RecoHGCal/TICL/interface/TracksterInferenceByPFN.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#ifndef RecoHGCal_TICL_TracksterInferenceByPFN_H__
#define RecoHGCal_TICL_TracksterInferenceByPFN_H__

#include "RecoHGCal/TICL/interface/TracksterInferenceAlgoBase.h"
#include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h"

namespace ticl {

class TracksterInferenceByPFN : public TracksterInferenceAlgoBase {
public:
explicit TracksterInferenceByPFN(const edm::ParameterSet& conf);
void inputData(const std::vector<reco::CaloCluster>& layerClusters, std::vector<Trackster>& tracksters) override;
void runInference(std::vector<Trackster>& tracksters) override;

static void fillPSetDescription(edm::ParameterSetDescription& iDesc);

private:
const cms::Ort::ONNXRuntime* onnxPIDSession_;
const cms::Ort::ONNXRuntime* onnxEnergySession_;

const std::string id_modelPath_;
const std::string en_modelPath_;
const std::vector<std::string> inputNames_;
const std::vector<std::string> output_en_;
const std::vector<std::string> output_id_;
const float eidMinClusterEnergy_;
const int eidNLayers_;
const int eidNClusters_;
static constexpr int eidNFeatures_ = 7;
int doPID_;
int doRegression_;

hgcal::RecHitTools rhtools_;
std::vector<std::vector<int64_t>> input_shapes_;
std::vector<int> tracksterIndices_;
std::vector<std::vector<float>> input_Data_;
int batchSize_;
};
} // namespace ticl

#endif // RecoHGCal_TICL_TracksterInferenceByPFN_H__
2 changes: 2 additions & 0 deletions RecoHGCal/TICL/plugins/TracksterInferenceAlgoFactory.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#include "RecoHGCal/TICL/interface/TracksterInferenceAlgoFactory.h"
#include "RecoHGCal/TICL/interface/TracksterInferenceByPFN.h"
#include "RecoHGCal/TICL/interface/TracksterInferenceByDNN.h"
#include "RecoHGCal/TICL/interface/TracksterInferenceByANN.h"
#include "RecoHGCal/TICL/interface/TracksterInferenceByCNNv4.h"
#include "FWCore/ParameterSet/interface/ValidatedPluginFactoryMacros.h"
#include "FWCore/ParameterSet/interface/ValidatedPluginMacros.h"

EDM_REGISTER_VALIDATED_PLUGINFACTORY(TracksterInferenceAlgoFactory, "TracksterInferenceAlgoFactory");
DEFINE_EDM_VALIDATED_PLUGIN(TracksterInferenceAlgoFactory, ticl::TracksterInferenceByPFN, "TracksterInferenceByPFN");
DEFINE_EDM_VALIDATED_PLUGIN(TracksterInferenceAlgoFactory, ticl::TracksterInferenceByDNN, "TracksterInferenceByDNN");
DEFINE_EDM_VALIDATED_PLUGIN(TracksterInferenceAlgoFactory, ticl::TracksterInferenceByANN, "TracksterInferenceByANN");
DEFINE_EDM_VALIDATED_PLUGIN(TracksterInferenceAlgoFactory,
Expand Down
7 changes: 4 additions & 3 deletions RecoHGCal/TICL/plugins/TracksterInferenceByDNN.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ namespace ticl {
void TracksterInferenceByDNN::fillPSetDescription(edm::ParameterSetDescription& iDesc) {
iDesc.add<int>("algo_verbosity", 0);
iDesc
.add<edm::FileInPath>("onnxPIDModelPath",
edm::FileInPath("RecoHGCal/TICL/data/ticlv5/onnx_models/patternrecognition/id_v0.onnx"))
.add<edm::FileInPath>(
"onnxPIDModelPath",
edm::FileInPath("RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/id_v0.onnx"))
->setComment("Path to ONNX PID model CLU3D");
iDesc
.add<edm::FileInPath>(
"onnxEnergyModelPath",
edm::FileInPath("RecoHGCal/TICL/data/ticlv5/onnx_models/patternrecognition/energy_v0.onnx"))
edm::FileInPath("RecoHGCal/TICL/data/ticlv5/onnx_models/DNN/patternrecognition/energy_v0.onnx"))
->setComment("Path to ONNX Energy model CLU3D");
iDesc.add<std::vector<std::string>>("inputNames", {"input"});
iDesc.add<std::vector<std::string>>("output_en", {"enreg_output"});
Expand Down
Loading