41 static std::unique_ptr<TrackstersCache> initializeGlobalCache(
const edm::ParameterSet&);
45 std::unique_ptr<PatternRecognitionAlgoBase>
myAlgo_;
61 std::unique_ptr<TrackstersCache>
cache = std::make_unique<TrackstersCache>(
params);
65 if (!graphPath.empty()) {
74 delete cache->eidGraphDef;
75 cache->eidGraphDef =
nullptr;
80 clusters_token_(consumes<
std::vector<
reco::CaloCluster>>(ps.getParameter<
edm::
InputTag>(
"layer_clusters"))),
81 filtered_layerclusters_mask_token_(consumes<
std::vector<
float>>(ps.getParameter<
edm::
InputTag>(
"filtered_mask"))),
82 original_layerclusters_mask_token_(consumes<
std::vector<
float>>(ps.getParameter<
edm::
InputTag>(
"original_mask"))),
86 seeding_regions_token_(
88 filter_on_categories_(ps.getParameter<
std::vector<
int>>(
"filter_on_categories")),
89 pid_threshold_(ps.getParameter<double>(
"pid_threshold")),
90 itername_(ps.getParameter<
std::
string>(
"itername")) {
91 produces<std::vector<Trackster>>();
92 produces<std::vector<float>>();
104 desc.
add<std::vector<int>>(
"filter_on_categories", {0});
105 desc.
add<
double>(
"pid_threshold", 0.);
106 desc.
add<
int>(
"algo_verbosity", 0);
107 desc.
add<
double>(
"min_cos_theta", 0.915);
108 desc.
add<
double>(
"min_cos_pointing", -1.);
109 desc.
add<
int>(
"missing_layers", 0);
110 desc.
add<
double>(
"etaLimitIncreaseWindow", 2.1);
111 desc.
add<
int>(
"min_clusters_per_ntuplet", 10);
112 desc.
add<
double>(
"max_delta_time", 3.);
113 desc.
add<
bool>(
"out_in_dfs",
true);
114 desc.
add<
int>(
"max_out_in_hops", 10);
115 desc.
add<
bool>(
"oneTracksterPerTrackSeed",
false);
116 desc.
add<
bool>(
"promoteEmptyRegionToTrackster",
false);
117 desc.
add<
std::string>(
"eid_graph_path",
"RecoHGCal/TICL/data/tf_models/energy_id_v0.pb");
119 desc.
add<
std::string>(
"eid_output_name_energy",
"output/regressed_energy");
120 desc.
add<
std::string>(
"eid_output_name_id",
"output/id_probabilities");
122 desc.
add<
double>(
"eid_min_cluster_energy", 1.);
123 desc.
add<
int>(
"eid_n_layers", 50);
124 desc.
add<
int>(
"eid_n_clusters", 10);
125 descriptions.
add(
"trackstersProducer", desc);
129 auto result = std::make_unique<std::vector<Trackster>>();
130 auto output_mask = std::make_unique<std::vector<float>>();
146 const auto& layerClusters = *cluster_h;
147 const auto& inputClusterMask = *filtered_layerclusters_mask_h;
148 const auto& layerClustersTimes = *time_clusters_h;
149 const auto& layer_clusters_tiles = *layer_clusters_tiles_h;
152 evt, es, layerClusters, inputClusterMask, layerClustersTimes, layer_clusters_tiles,
seeding_regions);
154 std::unordered_map<int, std::vector<int>> seedToTrackstersAssociation;
158 for (
unsigned int i = 0;
i < numberOfSeedingRegions; ++
i) {
165 output_mask->reserve(original_layerclusters_mask_h->size());
168 std::end(*original_layerclusters_mask_h),
169 std::back_inserter(*output_mask));
177 auto filter_on_pids = [&](
Trackster&
t) ->
bool {
178 auto cumulative_prob = 0.;
180 cumulative_prob +=
t.id_probabilities(
index);
189 for (
auto const& trackster : *
result) {
190 for (
auto const v : trackster.vertices()) {
193 (*output_mask)[
v] = 0.;