CMS 3D CMS Logo

PatternRecognitionbyCA.cc
Go to the documentation of this file.
1 // Author: Felice Pantaleo, Marco Rovere - felice.pantaleo@cern.ch, marco.rovere@cern.ch
2 // Date: 11/2018
3 #include <algorithm>
4 #include <set>
5 #include <vector>
6 
10 
11 #include "TrackstersPCA.h"
15 
16 using namespace ticl;
17 
18 template <typename TILES>
20  : PatternRecognitionAlgoBaseT<TILES>(conf, iC),
21  caloGeomToken_(iC.esConsumes<CaloGeometry, CaloGeometryRecord>()),
22  theGraph_(std::make_unique<HGCGraphT<TILES>>()),
23  oneTracksterPerTrackSeed_(conf.getParameter<bool>("oneTracksterPerTrackSeed")),
24  promoteEmptyRegionToTrackster_(conf.getParameter<bool>("promoteEmptyRegionToTrackster")),
25  out_in_dfs_(conf.getParameter<bool>("out_in_dfs")),
26  max_out_in_hops_(conf.getParameter<int>("max_out_in_hops")),
27  min_cos_theta_(conf.getParameter<double>("min_cos_theta")),
28  min_cos_pointing_(conf.getParameter<double>("min_cos_pointing")),
29  root_doublet_max_distance_from_seed_squared_(
30  conf.getParameter<double>("root_doublet_max_distance_from_seed_squared")),
31  etaLimitIncreaseWindow_(conf.getParameter<double>("etaLimitIncreaseWindow")),
32  skip_layers_(conf.getParameter<int>("skip_layers")),
33  max_missing_layers_in_trackster_(conf.getParameter<int>("max_missing_layers_in_trackster")),
34  check_missing_layers_(max_missing_layers_in_trackster_ < 100),
35  shower_start_max_layer_(conf.getParameter<int>("shower_start_max_layer")),
36  min_layers_per_trackster_(conf.getParameter<int>("min_layers_per_trackster")),
37  filter_on_categories_(conf.getParameter<std::vector<int>>("filter_on_categories")),
38  pid_threshold_(conf.getParameter<double>("pid_threshold")),
39  energy_em_over_total_threshold_(conf.getParameter<double>("energy_em_over_total_threshold")),
40  max_longitudinal_sigmaPCA_(conf.getParameter<double>("max_longitudinal_sigmaPCA")),
41  min_clusters_per_ntuplet_(min_layers_per_trackster_),
42  max_delta_time_(conf.getParameter<double>("max_delta_time")),
43  eidInputName_(conf.getParameter<std::string>("eid_input_name")),
44  eidOutputNameEnergy_(conf.getParameter<std::string>("eid_output_name_energy")),
45  eidOutputNameId_(conf.getParameter<std::string>("eid_output_name_id")),
46  eidMinClusterEnergy_(conf.getParameter<double>("eid_min_cluster_energy")),
47  eidNLayers_(conf.getParameter<int>("eid_n_layers")),
48  eidNClusters_(conf.getParameter<int>("eid_n_clusters")),
49  computeLocalTime_(conf.getParameter<bool>("computeLocalTime")),
50  siblings_maxRSquared_(conf.getParameter<std::vector<double>>("siblings_maxRSquared")){};
51 
52 template <typename TILES>
54 
55 template <typename TILES>
58  std::vector<Trackster> &result,
59  std::unordered_map<int, std::vector<int>> &seedToTracksterAssociation) {
60  // Protect from events with no seeding regions
61  if (input.regions.empty())
62  return;
63 
64  edm::EventSetup const &es = input.es;
65  const CaloGeometry &geom = es.getData(caloGeomToken_);
66  rhtools_.setGeometry(geom);
67 
69  theGraph_->clear();
71  LogDebug("HGCPatternRecoByCA") << "Making Tracksters with CA" << std::endl;
72  }
73 
77 
78  bool isRegionalIter = (input.regions[0].index != -1);
79  std::vector<HGCDoublet::HGCntuplet> foundNtuplets;
80  std::vector<int> seedIndices;
81  std::vector<uint8_t> layer_cluster_usage(input.layerClusters.size(), 0);
82  theGraph_->makeAndConnectDoublets(input.tiles,
83  input.regions,
84  nEtaBin,
85  nPhiBin,
86  input.layerClusters,
87  input.mask,
88  input.layerClustersTime,
89  1,
90  1,
91  min_cos_theta_,
92  min_cos_pointing_,
93  root_doublet_max_distance_from_seed_squared_,
94  etaLimitIncreaseWindow_,
95  skip_layers_,
96  rhtools_.lastLayer(isHFnose),
97  max_delta_time_,
98  rhtools_.lastLayerEE(isHFnose),
99  rhtools_.lastLayerFH(),
100  siblings_maxRSquared_);
101 
102  theGraph_->findNtuplets(foundNtuplets, seedIndices, min_clusters_per_ntuplet_, out_in_dfs_, max_out_in_hops_);
103  //#ifdef FP_DEBUG
104  const auto &doublets = theGraph_->getAllDoublets();
105  int tracksterId = -1;
106 
107  // container for holding tracksters before selection
108  std::vector<Trackster> tmpTracksters;
109  tmpTracksters.reserve(foundNtuplets.size());
110 
111  for (auto const &ntuplet : foundNtuplets) {
112  tracksterId++;
113 
114  std::set<unsigned int> effective_cluster_idx;
115 
116  for (auto const &doublet : ntuplet) {
117  auto innerCluster = doublets[doublet].innerClusterId();
118  auto outerCluster = doublets[doublet].outerClusterId();
119 
120  effective_cluster_idx.insert(innerCluster);
121  effective_cluster_idx.insert(outerCluster);
122 
124  LogDebug("HGCPatternRecoByCA") << " New doublet " << doublet << " for trackster: " << result.size()
125  << " InnerCl " << innerCluster << " " << input.layerClusters[innerCluster].x()
126  << " " << input.layerClusters[innerCluster].y() << " "
127  << input.layerClusters[innerCluster].z() << " OuterCl " << outerCluster << " "
128  << input.layerClusters[outerCluster].x() << " "
129  << input.layerClusters[outerCluster].y() << " "
130  << input.layerClusters[outerCluster].z() << " " << tracksterId << std::endl;
131  }
132  }
133  unsigned showerMinLayerId = 99999;
134  std::vector<unsigned int> uniqueLayerIds;
135  uniqueLayerIds.reserve(effective_cluster_idx.size());
136  std::vector<std::pair<unsigned int, unsigned int>> lcIdAndLayer;
137  lcIdAndLayer.reserve(effective_cluster_idx.size());
138  for (auto const i : effective_cluster_idx) {
139  auto const &haf = input.layerClusters[i].hitsAndFractions();
140  auto layerId = rhtools_.getLayerWithOffset(haf[0].first);
141  showerMinLayerId = std::min(layerId, showerMinLayerId);
142  uniqueLayerIds.push_back(layerId);
143  lcIdAndLayer.emplace_back(i, layerId);
144  }
145  std::sort(uniqueLayerIds.begin(), uniqueLayerIds.end());
146  uniqueLayerIds.erase(std::unique(uniqueLayerIds.begin(), uniqueLayerIds.end()), uniqueLayerIds.end());
147  unsigned int numberOfLayersInTrackster = uniqueLayerIds.size();
148  if (check_missing_layers_) {
149  int numberOfMissingLayers = 0;
150  unsigned int j = showerMinLayerId;
151  unsigned int indexInVec = 0;
152  for (const auto &layer : uniqueLayerIds) {
153  if (layer != j) {
154  numberOfMissingLayers++;
155  j++;
156  if (numberOfMissingLayers > max_missing_layers_in_trackster_) {
157  numberOfLayersInTrackster = indexInVec;
158  for (auto &llpair : lcIdAndLayer) {
159  if (llpair.second >= layer) {
160  effective_cluster_idx.erase(llpair.first);
161  }
162  }
163  break;
164  }
165  }
166  indexInVec++;
167  j++;
168  }
169  }
170  if ((numberOfLayersInTrackster >= min_layers_per_trackster_) and (showerMinLayerId <= shower_start_max_layer_)) {
171  // Put back indices, in the form of a Trackster, into the results vector
172  Trackster tmp;
173  tmp.vertices().reserve(effective_cluster_idx.size());
174  tmp.vertex_multiplicity().resize(effective_cluster_idx.size(), 1);
175  //regions and seedIndices can have different size
176  //if a seeding region does not lead to any trackster
177  tmp.setSeed(input.regions[0].collectionID, seedIndices[tracksterId]);
178 
179  std::copy(std::begin(effective_cluster_idx), std::end(effective_cluster_idx), std::back_inserter(tmp.vertices()));
180  tmpTracksters.push_back(tmp);
181  }
182  }
183  ticl::assignPCAtoTracksters(tmpTracksters,
184  input.layerClusters,
185  input.layerClustersTime,
186  rhtools_.getPositionLayer(rhtools_.lastLayerEE(isHFnose), isHFnose).z(),
187  rhtools_,
188  computeLocalTime_);
189 
190  // run energy regression and ID
191  energyRegressionAndID(input.layerClusters, input.tfSession, tmpTracksters);
192  // Filter results based on PID criteria or EM/Total energy ratio.
193  // We want to **keep** tracksters whose cumulative
194  // probability summed up over the selected categories
195  // is greater than the chosen threshold. Therefore
196  // the filtering function should **discard** all
197  // tracksters **below** the threshold.
198  auto filter_on_pids = [&](Trackster &t) -> bool {
199  auto cumulative_prob = 0.;
200  for (auto index : filter_on_categories_) {
201  cumulative_prob += t.id_probabilities(index);
202  }
203  return (cumulative_prob <= pid_threshold_) &&
204  (t.raw_em_energy() < energy_em_over_total_threshold_ * t.raw_energy());
205  };
206 
207  std::vector<unsigned int> selectedTrackstersIds;
208  for (unsigned i = 0; i < tmpTracksters.size(); ++i) {
209  if (!filter_on_pids(tmpTracksters[i]) and tmpTracksters[i].sigmasPCA()[0] < max_longitudinal_sigmaPCA_) {
210  selectedTrackstersIds.push_back(i);
211  }
212  }
213 
214  result.reserve(selectedTrackstersIds.size());
215 
216  for (unsigned i = 0; i < selectedTrackstersIds.size(); ++i) {
217  const auto &t = tmpTracksters[selectedTrackstersIds[i]];
218  for (auto const lcId : t.vertices()) {
219  layer_cluster_usage[lcId]++;
221  LogDebug("HGCPatternRecoByCA") << "LayerID: " << lcId << " count: " << (int)layer_cluster_usage[lcId]
222  << std::endl;
223  }
224  if (isRegionalIter) {
225  seedToTracksterAssociation[t.seedIndex()].push_back(i);
226  }
227  result.push_back(t);
228  }
229 
230  for (auto &trackster : result) {
231  assert(trackster.vertices().size() <= trackster.vertex_multiplicity().size());
232  for (size_t i = 0; i < trackster.vertices().size(); ++i) {
233  trackster.vertex_multiplicity()[i] = layer_cluster_usage[trackster.vertices(i)];
235  LogDebug("HGCPatternRecoByCA") << "LayerID: " << trackster.vertices(i)
236  << " count: " << (int)trackster.vertex_multiplicity(i) << std::endl;
237  }
238  }
239  // Now decide if the tracksters from the track-based iterations have to be merged
240  if (oneTracksterPerTrackSeed_) {
241  std::vector<Trackster> tmp;
242  mergeTrackstersTRK(result, input.layerClusters, tmp, seedToTracksterAssociation);
243  tmp.swap(result);
244  }
245 
247  input.layerClusters,
248  input.layerClustersTime,
249  rhtools_.getPositionLayer(rhtools_.lastLayerEE(isHFnose), isHFnose).z(),
250  rhtools_,
251  computeLocalTime_);
252 
253  // run energy regression and ID
254  energyRegressionAndID(input.layerClusters, input.tfSession, result);
255 
256  // now adding dummy tracksters from seeds not connected to any shower in the result collection
257  // these are marked as charged hadrons with probability 1.
258  if (promoteEmptyRegionToTrackster_) {
259  emptyTrackstersFromSeedsTRK(result, seedToTracksterAssociation, input.regions[0].collectionID);
260  }
261 
263  for (auto &trackster : result) {
264  LogDebug("HGCPatternRecoByCA") << "Trackster characteristics: " << std::endl;
265  LogDebug("HGCPatternRecoByCA") << "Size: " << trackster.vertices().size() << std::endl;
266  auto counter = 0;
267  for (auto const &p : trackster.id_probabilities()) {
268  LogDebug("HGCPatternRecoByCA") << counter++ << ": " << p << std::endl;
269  }
270  }
271  }
272  theGraph_->clear();
273 }
274 
275 template <typename TILES>
277  const std::vector<Trackster> &input,
278  const std::vector<reco::CaloCluster> &layerClusters,
279  std::vector<Trackster> &output,
280  std::unordered_map<int, std::vector<int>> &seedToTracksterAssociation) const {
281  output.reserve(input.size());
282  for (auto &thisSeed : seedToTracksterAssociation) {
283  auto &tracksters = thisSeed.second;
284  if (!tracksters.empty()) {
285  auto numberOfTrackstersInSeed = tracksters.size();
286  output.emplace_back(input[tracksters[0]]);
287  auto &outTrackster = output.back();
288  tracksters[0] = output.size() - 1;
289  auto updated_size = outTrackster.vertices().size();
290  for (unsigned int j = 1; j < numberOfTrackstersInSeed; ++j) {
291  auto &thisTrackster = input[tracksters[j]];
292  updated_size += thisTrackster.vertices().size();
294  LogDebug("HGCPatternRecoByCA") << "Updated size: " << updated_size << std::endl;
295  }
296  outTrackster.vertices().reserve(updated_size);
297  outTrackster.vertex_multiplicity().reserve(updated_size);
298  std::copy(std::begin(thisTrackster.vertices()),
299  std::end(thisTrackster.vertices()),
300  std::back_inserter(outTrackster.vertices()));
301  std::copy(std::begin(thisTrackster.vertex_multiplicity()),
302  std::end(thisTrackster.vertex_multiplicity()),
303  std::back_inserter(outTrackster.vertex_multiplicity()));
304  }
305  tracksters.resize(1);
306 
307  // Find duplicate LCs
308  auto &orig_vtx = outTrackster.vertices();
309  auto vtx_sorted{orig_vtx};
310  std::sort(std::begin(vtx_sorted), std::end(vtx_sorted));
311  for (unsigned int iLC = 1; iLC < vtx_sorted.size(); ++iLC) {
312  if (vtx_sorted[iLC] == vtx_sorted[iLC - 1]) {
313  // Clean up duplicate LCs
314  const auto lcIdx = vtx_sorted[iLC];
315  const auto firstEl = std::find(orig_vtx.begin(), orig_vtx.end(), lcIdx);
316  const auto firstPos = std::distance(std::begin(orig_vtx), firstEl);
317  auto iDup = std::find(std::next(firstEl), orig_vtx.end(), lcIdx);
318  while (iDup != orig_vtx.end()) {
319  orig_vtx.erase(iDup);
320  outTrackster.vertex_multiplicity().erase(outTrackster.vertex_multiplicity().begin() +
321  std::distance(std::begin(orig_vtx), iDup));
322  outTrackster.vertex_multiplicity()[firstPos] -= 1;
323  iDup = std::find(std::next(firstEl), orig_vtx.end(), lcIdx);
324  };
325  }
326  }
327  }
328  }
329  output.shrink_to_fit();
330 }
331 
332 template <typename TILES>
334  std::vector<Trackster> &tracksters,
335  std::unordered_map<int, std::vector<int>> &seedToTracksterAssociation,
336  const edm::ProductID &collectionID) const {
337  for (auto &thisSeed : seedToTracksterAssociation) {
338  if (thisSeed.second.empty()) {
339  Trackster t;
340  t.setRegressedEnergy(0.f);
341  t.zeroProbabilities();
343  t.setSeed(collectionID, thisSeed.first);
344  tracksters.emplace_back(t);
345  thisSeed.second.emplace_back(tracksters.size() - 1);
346  }
347  }
348 }
349 
350 template <typename TILES>
351 void PatternRecognitionbyCA<TILES>::energyRegressionAndID(const std::vector<reco::CaloCluster> &layerClusters,
352  const tensorflow::Session *eidSession,
353  std::vector<Trackster> &tracksters) {
354  // Energy regression and particle identification strategy:
355  //
356  // 1. Set default values for regressed energy and particle id for each trackster.
357  // 2. Store indices of tracksters whose total sum of cluster energies is above the
358  // eidMinClusterEnergy_ (GeV) threshold. Inference is not applied for soft tracksters.
359  // 3. When no trackster passes the selection, return.
360  // 4. Create input and output tensors. The batch dimension is determined by the number of
361  // selected tracksters.
362  // 5. Fill input tensors with layer cluster features. Per layer, clusters are ordered descending
363  // by energy. Given that tensor data is contiguous in memory, we can use pointer arithmetic to
364  // fill values, even with batching.
365  // 6. Zero-fill features for empty clusters in each layer.
366  // 7. Batched inference.
367  // 8. Assign the regressed energy and id probabilities to each trackster.
368  //
369  // Indices used throughout this method:
370  // i -> batch element / trackster
371  // j -> layer
372  // k -> cluster
373  // l -> feature
374 
375  // set default values per trackster, determine if the cluster energy threshold is passed,
376  // and store indices of hard tracksters
377  std::vector<int> tracksterIndices;
378  for (int i = 0; i < (int)tracksters.size(); i++) {
379  // calculate the cluster energy sum (2)
380  // note: after the loop, sumClusterEnergy might be just above the threshold which is enough to
381  // decide whether to run inference for the trackster or not
382  float sumClusterEnergy = 0.;
383  for (const unsigned int &vertex : tracksters[i].vertices()) {
384  sumClusterEnergy += (float)layerClusters[vertex].energy();
385  // there might be many clusters, so try to stop early
386  if (sumClusterEnergy >= eidMinClusterEnergy_) {
387  // set default values (1)
388  tracksters[i].setRegressedEnergy(0.f);
389  tracksters[i].zeroProbabilities();
390  tracksterIndices.push_back(i);
391  break;
392  }
393  }
394  }
395 
396  // do nothing when no trackster passes the selection (3)
397  int batchSize = (int)tracksterIndices.size();
398  if (batchSize == 0) {
399  return;
400  }
401 
402  // create input and output tensors (4)
403  tensorflow::TensorShape shape({batchSize, eidNLayers_, eidNClusters_, eidNFeatures_});
404  tensorflow::Tensor input(tensorflow::DT_FLOAT, shape);
405  tensorflow::NamedTensorList inputList = {{eidInputName_, input}};
406 
407  std::vector<tensorflow::Tensor> outputs;
408  std::vector<std::string> outputNames;
409  if (!eidOutputNameEnergy_.empty()) {
410  outputNames.push_back(eidOutputNameEnergy_);
411  }
412  if (!eidOutputNameId_.empty()) {
413  outputNames.push_back(eidOutputNameId_);
414  }
415 
416  // fill input tensor (5)
417  for (int i = 0; i < batchSize; i++) {
418  const Trackster &trackster = tracksters[tracksterIndices[i]];
419 
420  // per layer, we only consider the first eidNClusters_ clusters in terms of energy, so in order
421  // to avoid creating large / nested structures to do the sorting for an unknown number of total
422  // clusters, create a sorted list of layer cluster indices to keep track of the filled clusters
423  std::vector<int> clusterIndices(trackster.vertices().size());
424  for (int k = 0; k < (int)trackster.vertices().size(); k++) {
425  clusterIndices[k] = k;
426  }
427  sort(clusterIndices.begin(), clusterIndices.end(), [&layerClusters, &trackster](const int &a, const int &b) {
428  return layerClusters[trackster.vertices(a)].energy() > layerClusters[trackster.vertices(b)].energy();
429  });
430 
431  // keep track of the number of seen clusters per layer
432  std::vector<int> seenClusters(eidNLayers_);
433 
434  // loop through clusters by descending energy
435  for (const int &k : clusterIndices) {
436  // get features per layer and cluster and store the values directly in the input tensor
437  const reco::CaloCluster &cluster = layerClusters[trackster.vertices(k)];
438  int j = rhtools_.getLayerWithOffset(cluster.hitsAndFractions()[0].first) - 1;
439  if (j < eidNLayers_ && seenClusters[j] < eidNClusters_) {
440  // get the pointer to the first feature value for the current batch, layer and cluster
441  float *features = &input.tensor<float, 4>()(i, j, seenClusters[j], 0);
442 
443  // fill features
444  *(features++) = float(cluster.energy() / float(trackster.vertex_multiplicity(k)));
445  *(features++) = float(std::abs(cluster.eta()));
446  *(features) = float(cluster.phi());
447 
448  // increment seen clusters
449  seenClusters[j]++;
450  }
451  }
452 
453  // zero-fill features of empty clusters in each layer (6)
454  for (int j = 0; j < eidNLayers_; j++) {
455  for (int k = seenClusters[j]; k < eidNClusters_; k++) {
456  float *features = &input.tensor<float, 4>()(i, j, k, 0);
457  for (int l = 0; l < eidNFeatures_; l++) {
458  *(features++) = 0.f;
459  }
460  }
461  }
462  }
463 
464  // run the inference (7)
466 
467  // store regressed energy per trackster (8)
468  if (!eidOutputNameEnergy_.empty()) {
469  // get the pointer to the energy tensor, dimension is batch x 1
470  float *energy = outputs[0].flat<float>().data();
471 
472  for (const int &i : tracksterIndices) {
473  tracksters[i].setRegressedEnergy(*(energy++));
474  }
475  }
476 
477  // store id probabilities per trackster (8)
478  if (!eidOutputNameId_.empty()) {
479  // get the pointer to the id probability tensor, dimension is batch x id_probabilities.size()
480  int probsIdx = eidOutputNameEnergy_.empty() ? 0 : 1;
481  float *probs = outputs[probsIdx].flat<float>().data();
482 
483  for (const int &i : tracksterIndices) {
484  tracksters[i].setProbabilities(probs);
485  probs += tracksters[i].id_probabilities().size();
486  }
487  }
488 }
489 
490 template <typename TILES>
492  iDesc.add<int>("algo_verbosity", 0);
493  iDesc.add<bool>("oneTracksterPerTrackSeed", false);
494  iDesc.add<bool>("promoteEmptyRegionToTrackster", false);
495  iDesc.add<bool>("out_in_dfs", true);
496  iDesc.add<int>("max_out_in_hops", 10);
497  iDesc.add<double>("min_cos_theta", 0.915);
498  iDesc.add<double>("min_cos_pointing", -1.);
499  iDesc.add<double>("root_doublet_max_distance_from_seed_squared", 9999);
500  iDesc.add<double>("etaLimitIncreaseWindow", 2.1);
501  iDesc.add<int>("skip_layers", 0);
502  iDesc.add<int>("max_missing_layers_in_trackster", 9999);
503  iDesc.add<int>("shower_start_max_layer", 9999)->setComment("make default such that no filtering is applied");
504  iDesc.add<int>("min_layers_per_trackster", 10);
505  iDesc.add<std::vector<int>>("filter_on_categories", {0});
506  iDesc.add<double>("pid_threshold", 0.)->setComment("make default such that no filtering is applied");
507  iDesc.add<double>("energy_em_over_total_threshold", -1.)
508  ->setComment("make default such that no filtering is applied");
509  iDesc.add<double>("max_longitudinal_sigmaPCA", 9999);
510  iDesc.add<double>("max_delta_time", 3.)->setComment("nsigma");
511  iDesc.add<std::string>("eid_input_name", "input");
512  iDesc.add<std::string>("eid_output_name_energy", "output/regressed_energy");
513  iDesc.add<std::string>("eid_output_name_id", "output/id_probabilities");
514  iDesc.add<double>("eid_min_cluster_energy", 1.);
515  iDesc.add<int>("eid_n_layers", 50);
516  iDesc.add<int>("eid_n_clusters", 10);
517  iDesc.add<bool>("computeLocalTime", false);
518  iDesc.add<std::vector<double>>("siblings_maxRSquared", {6e-4, 6e-4, 6e-4});
519 }
520 
void setComment(std::string const &value)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
std::vector< NamedTensor > NamedTensorList
Definition: TensorFlow.h:31
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:210
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void mergeTrackstersTRK(const std::vector< Trackster > &, const std::vector< reco::CaloCluster > &, std::vector< Trackster > &, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation) const
void emptyTrackstersFromSeedsTRK(std::vector< Trackster > &tracksters, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation, const edm::ProductID &collectionID) const
void assignPCAtoTracksters(std::vector< Trackster > &tracksters, const std::vector< reco::CaloCluster > &layerClusters, const edm::ValueMap< std::pair< float, float >> &layerClustersTime, double z_limit_em, hgcal::RecHitTools const &rhTools, bool computeLocalTime=false, bool energyWeight=true, bool clean=false, int minLayer=10, int maxLayer=10)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
assert(be >=bs)
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
void makeTracksters(const typename PatternRecognitionAlgoBaseT< TILES >::Inputs &input, std::vector< Trackster > &result, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation) override
static std::string const input
Definition: EdmProvDump.cc:50
std::vector< float > features(const reco::PreId &ecal, const reco::PreId &hcal, double rho, const reco::BeamSpot &spot, noZS::EcalClusterLazyTools &ecalTools)
def unique(seq, keepstr=True)
Definition: tier0.py:24
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, std::vector< Tensor > *outputs, const thread::ThreadPoolOptions &threadPoolOptions)
Definition: TensorFlow.cc:271
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
string inputList
Definition: crabTemplate.py:6
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double energy() const
cluster energy
Definition: CaloCluster.h:149
std::vector< unsigned int > & vertices()
Definition: Trackster.h:57
void energyRegressionAndID(const std::vector< reco::CaloCluster > &layerClusters, const tensorflow::Session *, std::vector< Trackster > &result)
PatternRecognitionbyCA(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
std::vector< float > & vertex_multiplicity()
Definition: Trackster.h:58
double b
Definition: hdecay.h:120
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
static constexpr int nPhiBins
double a
Definition: hdecay.h:121
Definition: Common.h:10
Definition: output.py:1
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
tmp
align.sh
Definition: createJobs.py:716
#define LogDebug(id)