CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
ticl::PatternRecognitionbyCLUE3D< TILES > Class Template Referencefinal

#include <PatternRecognitionbyCLUE3D.h>

Inheritance diagram for ticl::PatternRecognitionbyCLUE3D< TILES >:
ticl::PatternRecognitionAlgoBaseT< TILES >

Classes

struct  ClustersOnLayer
 

Public Member Functions

void energyRegressionAndID (const std::vector< reco::CaloCluster > &layerClusters, std::vector< Trackster > &result)
 
void makeTracksters (const typename PatternRecognitionAlgoBaseT< TILES >::Inputs &input, std::vector< Trackster > &result, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation) override
 
 PatternRecognitionbyCLUE3D (const edm::ParameterSet &conf, const CacheBase *cache, edm::ConsumesCollector)
 
 ~PatternRecognitionbyCLUE3D () override=default
 
- Public Member Functions inherited from ticl::PatternRecognitionAlgoBaseT< TILES >
virtual void makeTracksters (const Inputs &input, std::vector< Trackster > &result, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation)=0
 
 PatternRecognitionAlgoBaseT (const edm::ParameterSet &conf, const CacheBase *cache, edm::ConsumesCollector)
 
virtual ~PatternRecognitionAlgoBaseT ()
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &iDesc)
 

Private Member Functions

void calculateDistanceToHigher (const TILES &, const unsigned int layerId, const std::vector< std::pair< int, int >> &)
 
void calculateLocalDensity (const TILES &, const unsigned int layerId, const std::vector< std::pair< int, int >> &)
 
void dumpClusters (const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int) const
 
void dumpTiles (const TILES &) const
 
void dumpTracksters (const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int, const std::vector< Trackster > &) const
 
int findAndAssignTracksters (const TILES &, const std::vector< std::pair< int, int >> &)
 
void reset ()
 

Private Attributes

edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeomToken_
 
std::vector< ClustersOnLayerclusters_
 
const double criticalDensity_
 
const double criticalEtaPhiDistance_
 
const double densityEtaPhiDistanceSqr_
 
const double densityOnSameLayer_
 
const int densitySiblingLayers_
 
const std::string eidInputName_
 
const float eidMinClusterEnergy_
 
const int eidNClusters_
 
const int eidNLayers_
 
const std::string eidOutputNameEnergy_
 
const std::string eidOutputNameId_
 
tensorflow::Session * eidSession_
 
const std::vector< int > filter_on_categories_
 
const int minNumLayerCluster_
 
const double outlierMultiplier_
 
hgcal::RecHitTools rhtools_
 

Static Private Attributes

static const int eidNFeatures_ = 3
 

Additional Inherited Members

- Public Types inherited from ticl::PatternRecognitionAlgoBaseT< TILES >
enum  VerbosityLevel {
  None = 0, Basic, Advanced, Expert,
  Guru
}
 
- Protected Attributes inherited from ticl::PatternRecognitionAlgoBaseT< TILES >
int algo_verbosity_
 

Detailed Description

template<typename TILES>
class ticl::PatternRecognitionbyCLUE3D< TILES >

Definition at line 12 of file PatternRecognitionbyCLUE3D.h.

Constructor & Destructor Documentation

◆ PatternRecognitionbyCLUE3D()

template<typename TILES >
PatternRecognitionbyCLUE3D::PatternRecognitionbyCLUE3D ( const edm::ParameterSet conf,
const CacheBase cache,
edm::ConsumesCollector  iC 
)

Definition at line 24 of file PatternRecognitionbyCLUE3D.cc.

29  criticalDensity_(conf.getParameter<double>("criticalDensity")),
30  densitySiblingLayers_(conf.getParameter<int>("densitySiblingLayers")),
31  densityEtaPhiDistanceSqr_(conf.getParameter<double>("densityEtaPhiDistanceSqr")),
32  densityOnSameLayer_(conf.getParameter<bool>("densityOnSameLayer")),
33  criticalEtaPhiDistance_(conf.getParameter<double>("criticalEtaPhiDistance")),
34  outlierMultiplier_(conf.getParameter<double>("outlierMultiplier")),
35  minNumLayerCluster_(conf.getParameter<int>("minNumLayerCluster")),
36  eidInputName_(conf.getParameter<std::string>("eid_input_name")),
37  eidOutputNameEnergy_(conf.getParameter<std::string>("eid_output_name_energy")),
38  eidOutputNameId_(conf.getParameter<std::string>("eid_output_name_id")),
39  eidMinClusterEnergy_(conf.getParameter<double>("eid_min_cluster_energy")),
40  eidNLayers_(conf.getParameter<int>("eid_n_layers")),
41  eidNClusters_(conf.getParameter<int>("eid_n_clusters")),
42  eidSession_(nullptr) {
43  // mount the tensorflow graph onto the session when set
44  const TrackstersCache *trackstersCache = dynamic_cast<const TrackstersCache *>(cache);
45  if (trackstersCache == nullptr || trackstersCache->eidGraphDef == nullptr) {
46  throw cms::Exception("MissingGraphDef")
47  << "PatternRecognitionbyCLUE3D received an empty graph definition from the global cache";
48  }
50 }

References utilities::cache(), tensorflow::createSession(), ticl::TrackstersCache::eidGraphDef, ticl::PatternRecognitionbyCLUE3D< TILES >::eidSession_, and Exception.

◆ ~PatternRecognitionbyCLUE3D()

template<typename TILES >
ticl::PatternRecognitionbyCLUE3D< TILES >::~PatternRecognitionbyCLUE3D ( )
overridedefault

Member Function Documentation

◆ calculateDistanceToHigher()

template<typename TILES >
void PatternRecognitionbyCLUE3D::calculateDistanceToHigher ( const TILES &  tiles,
const unsigned int  layerId,
const std::vector< std::pair< int, int >> &  layerIdx2layerandSoa 
)
private

Definition at line 563 of file PatternRecognitionbyCLUE3D.cc.

564  {
565  int type = tiles[0].typeT();
568  auto &clustersOnLayer = clusters_[layerId];
569  unsigned int numberOfClusters = clustersOnLayer.x.size();
570 
571  for (unsigned int i = 0; i < numberOfClusters; i++) {
573  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
574  << "Starting searching nearestHigher on " << layerId << " with rho: " << clustersOnLayer.rho[i]
575  << " at eta, phi: " << tiles[layerId].etaBin(clustersOnLayer.eta[i]) << ", "
576  << tiles[layerId].etaBin(clustersOnLayer.phi[i]);
577  }
578  // We need to partition the two sides of the HGCAL detector
579  auto lastLayerPerSide = static_cast<unsigned int>(rhtools_.lastLayer(false));
580  unsigned int minLayer = 0;
581  unsigned int maxLayer = 2 * lastLayerPerSide - 1;
582  if (layerId < lastLayerPerSide) {
584  maxLayer = std::min(layerId + densitySiblingLayers_, lastLayerPerSide - 1);
585  } else {
586  minLayer = std::max(layerId - densitySiblingLayers_, lastLayerPerSide + 1);
587  maxLayer = std::min(layerId + densitySiblingLayers_, maxLayer);
588  }
590  float i_delta = maxDelta;
591  std::pair<int, int> i_nearestHigher(-1, -1);
592  for (unsigned int currentLayer = minLayer; currentLayer <= maxLayer; currentLayer++) {
593  const auto &tileOnLayer = tiles[currentLayer];
594  int etaWindow = 2;
595  int phiWindow = 2;
596  int etaBinMin = std::max(tileOnLayer.etaBin(clustersOnLayer.eta[i]) - etaWindow, 0);
597  int etaBinMax = std::min(tileOnLayer.etaBin(clustersOnLayer.eta[i]) + etaWindow, nEtaBin);
598  int phiBinMin = tileOnLayer.phiBin(clustersOnLayer.phi[i]) - phiWindow;
599  int phiBinMax = tileOnLayer.phiBin(clustersOnLayer.phi[i]) + phiWindow;
600  for (int ieta = etaBinMin; ieta <= etaBinMax; ++ieta) {
601  auto offset = ieta * nPhiBin;
602  for (int iphi_it = phiBinMin; iphi_it <= phiBinMax; ++iphi_it) {
603  int iphi = ((iphi_it % nPhiBin + nPhiBin) % nPhiBin);
605  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
606  << "Searching nearestHigher on " << currentLayer << " eta, phi: " << ieta << ", " << iphi_it;
607  }
608  for (auto otherClusterIdx : tileOnLayer[offset + iphi]) {
609  auto const &layerandSoa = layerIdx2layerandSoa[otherClusterIdx];
610  // Skip masked layer clusters
611  if ((layerandSoa.first == -1) && (layerandSoa.second == -1))
612  continue;
613  auto const &clustersOnOtherLayer = clusters_[layerandSoa.first];
614  float dist = reco::deltaR2(clustersOnLayer.eta[i],
615  clustersOnLayer.phi[i],
616  clustersOnOtherLayer.eta[layerandSoa.second],
617  clustersOnOtherLayer.phi[layerandSoa.second]);
618  bool foundHigher = (clustersOnOtherLayer.rho[layerandSoa.second] > clustersOnLayer.rho[i]) ||
619  (clustersOnOtherLayer.rho[layerandSoa.second] == clustersOnLayer.rho[i] &&
620  clustersOnOtherLayer.layerClusterOriginalIdx[layerandSoa.second] >
621  clustersOnLayer.layerClusterOriginalIdx[i]);
623  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
624  << "Searching nearestHigher on " << currentLayer
625  << " with rho: " << clustersOnOtherLayer.rho[layerandSoa.second]
626  << " on layerIdxInSOA: " << layerandSoa.first << ", " << layerandSoa.second
627  << " with distance: " << sqrt(dist) << " foundHigher: " << foundHigher;
628  }
629  if (foundHigher && dist <= i_delta) {
630  // update i_delta
631  i_delta = dist;
632  // update i_nearestHigher
633  i_nearestHigher = layerandSoa;
634  }
635  }
636  }
637  }
638  }
639 
640  bool foundNearestHigherInEtaPhiCylinder = (i_delta != maxDelta);
642  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
643  << "i_delta: " << sqrt(i_delta) << " passed: " << foundNearestHigherInEtaPhiCylinder << " "
644  << i_nearestHigher.first << " " << i_nearestHigher.second;
645  }
646  if (foundNearestHigherInEtaPhiCylinder) {
647  clustersOnLayer.delta[i] = sqrt(i_delta);
648  clustersOnLayer.nearestHigher[i] = i_nearestHigher;
649  } else {
650  // otherwise delta is guaranteed to be larger outlierDeltaFactor_*delta_c
651  // we can safely maximize delta to be maxDelta
652  clustersOnLayer.delta[i] = maxDelta;
653  clustersOnLayer.nearestHigher[i] = {-1, -1};
654  }
655  }
656 }

References reco::deltaR2(), mps_fire::i, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, SiStripPI::max, allConversions_cfi::maxDelta, min(), HLT_FULL_cff::minLayer, ticl::TileConstants::nEtaBins, ticl::TileConstantsHFNose::nEtaBins, ticl::TileConstants::nPhiBins, ticl::TileConstantsHFNose::nPhiBins, hltrates_dqm_sourceclient-live_cfg::offset, trackingPOGFilters_cfi::phiWindow, and mathSSE::sqrt().

◆ calculateLocalDensity()

template<typename TILES >
void PatternRecognitionbyCLUE3D::calculateLocalDensity ( const TILES &  tiles,
const unsigned int  layerId,
const std::vector< std::pair< int, int >> &  layerIdx2layerandSoa 
)
private

Definition at line 443 of file PatternRecognitionbyCLUE3D.cc.

444  {
445  int type = tiles[0].typeT();
448  auto &clustersOnLayer = clusters_[layerId];
449  unsigned int numberOfClusters = clustersOnLayer.x.size();
450 
451  auto isReachable = [&](float x1, float x2, float y1, float y2, float delta_sqr) -> bool {
453  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
454  << ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) << " vs " << delta_sqr << "["
455  << ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) < delta_sqr) << "]\n";
456  }
457  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) < delta_sqr;
458  };
459 
460  for (unsigned int i = 0; i < numberOfClusters; i++) {
461  // We need to partition the two sides of the HGCAL detector
462  auto lastLayerPerSide = static_cast<unsigned int>(rhtools_.lastLayer(false)) - 1;
463  unsigned int minLayer = 0;
464  unsigned int maxLayer = 2 * lastLayerPerSide - 1;
465  if (layerId < lastLayerPerSide) {
467  maxLayer = std::min(layerId + densitySiblingLayers_, lastLayerPerSide - 1);
468  } else {
469  minLayer = std::max(layerId - densitySiblingLayers_, lastLayerPerSide + 1);
470  maxLayer = std::min(layerId + densitySiblingLayers_, maxLayer);
471  }
472  for (unsigned int currentLayer = minLayer; currentLayer <= maxLayer; currentLayer++) {
474  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "RefLayer: " << layerId << " SoaIDX: " << i;
475  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "NextLayer: " << currentLayer;
476  }
477  const auto &tileOnLayer = tiles[currentLayer];
478  bool onSameLayer = (currentLayer == layerId);
480  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "onSameLayer: " << onSameLayer;
481  }
482  int etaWindow = onSameLayer ? 2 : 1;
483  int phiWindow = onSameLayer ? 2 : 1;
484  int etaBinMin = std::max(tileOnLayer.etaBin(clustersOnLayer.eta[i]) - etaWindow, 0);
485  int etaBinMax = std::min(tileOnLayer.etaBin(clustersOnLayer.eta[i]) + etaWindow, nEtaBin);
486  int phiBinMin = tileOnLayer.phiBin(clustersOnLayer.phi[i]) - phiWindow;
487  int phiBinMax = tileOnLayer.phiBin(clustersOnLayer.phi[i]) + phiWindow;
489  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "eta: " << clustersOnLayer.eta[i];
490  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "phi: " << clustersOnLayer.phi[i];
491  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "etaBinMin: " << etaBinMin << ", etaBinMax: " << etaBinMax;
492  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "phiBinMin: " << phiBinMin << ", phiBinMax: " << phiBinMax;
493  }
494  for (int ieta = etaBinMin; ieta <= etaBinMax; ++ieta) {
495  auto offset = ieta * nPhiBin;
497  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "offset: " << offset;
498  }
499  for (int iphi_it = phiBinMin; iphi_it <= phiBinMax; ++iphi_it) {
500  int iphi = ((iphi_it % nPhiBin + nPhiBin) % nPhiBin);
502  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "iphi: " << iphi;
503  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
504  << "Entries in tileBin: " << tileOnLayer[offset + iphi].size();
505  }
506  for (auto otherClusterIdx : tileOnLayer[offset + iphi]) {
507  auto const &layerandSoa = layerIdx2layerandSoa[otherClusterIdx];
508  // Skip masked layer clusters
509  if ((layerandSoa.first == -1) && (layerandSoa.second == -1)) {
511  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Skipping masked layerIdx " << otherClusterIdx;
512  }
513  continue;
514  }
515  auto const &clustersLayer = clusters_[layerandSoa.first];
517  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
518  << "OtherLayer: " << layerandSoa.first << " SoaIDX: " << layerandSoa.second;
519  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "OtherEta: " << clustersLayer.eta[layerandSoa.second];
520  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "OtherPhi: " << clustersLayer.phi[layerandSoa.second];
521  }
522  // extend by 26 mm, roughly 2 cells, more wrt sum of radii
523  float delta = clustersOnLayer.radius[i] + clustersLayer.radius[layerandSoa.second] + 2.6f;
524  if (densityOnSameLayer_ && onSameLayer) {
525  if (isReachable(clustersOnLayer.x[i],
526  clustersLayer.x[layerandSoa.second],
527  clustersOnLayer.y[i],
528  clustersLayer.y[layerandSoa.second],
529  delta * delta)) {
530  clustersOnLayer.rho[i] += (clustersOnLayer.layerClusterOriginalIdx[i] == otherClusterIdx ? 1.f : 0.2f) *
531  clustersLayer.energy[layerandSoa.second];
532  }
533  } else {
535  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Distance: "
536  << reco::deltaR2(clustersOnLayer.eta[i],
537  clustersOnLayer.phi[i],
538  clustersLayer.eta[layerandSoa.second],
539  clustersLayer.phi[layerandSoa.second]);
540  }
541  if (reco::deltaR2(clustersOnLayer.eta[i],
542  clustersOnLayer.phi[i],
543  clustersLayer.eta[layerandSoa.second],
544  clustersLayer.phi[layerandSoa.second]) < densityEtaPhiDistanceSqr_) {
545  auto energyToAdd = (clustersOnLayer.layerClusterOriginalIdx[i] == otherClusterIdx ? 1.f : 0.5f) *
546  clustersLayer.energy[layerandSoa.second];
547  clustersOnLayer.rho[i] += energyToAdd;
548  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
549  << "Adding " << energyToAdd << " partial " << clustersOnLayer.rho[i];
550  }
551  }
552  } // end of loop on possible compatible clusters
553  } // end of loop over phi-bin region
554  } // end of loop over eta-bin region
555  } // end of loop on the sibling layers
556  } // end of loop over clusters on this layer
558  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << std::endl;
559  }
560 }

References dumpMFGeometry_cfg::delta, reco::deltaR2(), mps_fire::i, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, SiStripPI::max, min(), HLT_FULL_cff::minLayer, ticl::TileConstants::nEtaBins, ticl::TileConstantsHFNose::nEtaBins, ticl::TileConstants::nPhiBins, ticl::TileConstantsHFNose::nPhiBins, hltrates_dqm_sourceclient-live_cfg::offset, trackingPOGFilters_cfi::phiWindow, testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, testProducerWithPsetDescEmpty_cfi::y1, and testProducerWithPsetDescEmpty_cfi::y2.

◆ dumpClusters()

template<typename TILES >
void PatternRecognitionbyCLUE3D::dumpClusters ( const std::vector< std::pair< int, int >> &  layerIdx2layerandSoa,
const int  eventNumber 
) const
private

Definition at line 108 of file PatternRecognitionbyCLUE3D.cc.

109  {
111  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "[evt, layer, x, y, eta, phi, cells, energy, radius, rho, delta, "
112  "isSeed, clusterIdx, layerClusterOriginalIdx";
113  }
114 
115  for (unsigned int layer = 0; layer < clusters_.size(); layer++) {
117  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "On Layer " << layer;
118  }
119  auto const &thisLayer = clusters_[layer];
120  int num = 0;
121  for (auto v : thisLayer.x) {
123  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
124  << "ClusterInfo: " << eventNumber << ", " << layer << ", " << v << ", " << thisLayer.y[num] << ", "
125  << thisLayer.eta[num] << ", " << thisLayer.phi[num] << ", " << thisLayer.cells[num] << ", "
126  << thisLayer.energy[num] << ", " << thisLayer.radius[num] << ", " << thisLayer.rho[num] << ", "
127  << thisLayer.delta[num] << ", " << thisLayer.isSeed[num] << ", " << thisLayer.clusterIndex[num] << ", "
128  << thisLayer.layerClusterOriginalIdx[num];
129  }
130  ++num;
131  }
132  }
133  for (unsigned int lcIdx = 0; lcIdx < layerIdx2layerandSoa.size(); lcIdx++) {
134  auto const &layerandSoa = layerIdx2layerandSoa[lcIdx];
135  // Skip masked layer clusters
136  if ((layerandSoa.first == -1) && (layerandSoa.second == -1))
137  continue;
139  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
140  << "lcIdx: " << lcIdx << " on Layer: " << layerandSoa.first << " SOA: " << layerandSoa.second;
141  }
142  }
143 }

References phase1PixelTopology::layer, EgammaValidation_cff::num, and findQualityFiles::v.

◆ dumpTiles()

template<typename TILES >
void PatternRecognitionbyCLUE3D::dumpTiles ( const TILES &  tiles) const
private

Definition at line 53 of file PatternRecognitionbyCLUE3D.cc.

53  {
54  int type = tiles[0].typeT();
57  auto lastLayerPerSide = (unsigned int)(rhtools_.lastLayer(false));
58  unsigned int maxLayer = 2 * lastLayerPerSide - 1;
59  for (unsigned int layer = 0; layer <= maxLayer; layer++) {
60  for (int ieta = 0; ieta < nEtaBin; ieta++) {
61  auto offset = ieta * nPhiBin;
62  for (int phi = 0; phi < nPhiBin; phi++) {
63  int iphi = ((phi % nPhiBin + nPhiBin) % nPhiBin);
64  if (!tiles[layer][offset + iphi].empty()) {
65  if (this->algo_verbosity_ > this->Advanced) {
66  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Layer: " << layer << " ieta: " << ieta << " phi: " << phi
67  << " " << tiles[layer][offset + iphi].size();
68  }
69  }
70  }
71  }
72  }
73 }

References relativeConstraints::empty, LEDCalibrationChannels::ieta, createfilelist::int, LEDCalibrationChannels::iphi, phase1PixelTopology::layer, ticl::TileConstants::nEtaBins, ticl::TileConstantsHFNose::nEtaBins, ticl::TileConstants::nPhiBins, ticl::TileConstantsHFNose::nPhiBins, and hltrates_dqm_sourceclient-live_cfg::offset.

◆ dumpTracksters()

template<typename TILES >
void PatternRecognitionbyCLUE3D::dumpTracksters ( const std::vector< std::pair< int, int >> &  layerIdx2layerandSoa,
const int  eventNumber,
const std::vector< Trackster > &  tracksters 
) const
private

Definition at line 76 of file PatternRecognitionbyCLUE3D.cc.

78  {
80  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
81  << "[evt, tracksterId, cells, prob_photon, prob_ele, prob_chad, prob_nhad, layer_i, x_i, y_i, eta_i, phi_i, "
82  "energy_i, radius_i, rho_i, delta_i, isSeed_i";
83  }
84 
85  int num = 0;
86  const std::string sep(", ");
87  for (auto const &t : tracksters) {
88  for (auto v : t.vertices()) {
89  auto [lyrIdx, soaIdx] = layerIdx2layerandSoa[v];
90  auto const &thisLayer = clusters_[lyrIdx];
92  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
93  << "TracksterInfo: " << eventNumber << sep << num << sep << t.vertices().size() << sep
94  << t.id_probability(ticl::Trackster::ParticleType::photon) << sep
95  << t.id_probability(ticl::Trackster::ParticleType::electron) << sep
96  << t.id_probability(ticl::Trackster::ParticleType::charged_hadron) << sep
97  << t.id_probability(ticl::Trackster::ParticleType::neutral_hadron) << sep << lyrIdx << sep
98  << thisLayer.x[soaIdx] << sep << thisLayer.y[soaIdx] << sep << thisLayer.eta[soaIdx] << sep
99  << thisLayer.phi[soaIdx] << sep << thisLayer.energy[soaIdx] << sep << thisLayer.radius[soaIdx] << sep
100  << thisLayer.rho[soaIdx] << sep << thisLayer.delta[soaIdx] << sep << thisLayer.isSeed[soaIdx] << '\n';
101  }
102  }
103  num++;
104  }
105 }

References ticl::Trackster::charged_hadron, ticl::Trackster::electron, ticl::Trackster::neutral_hadron, EgammaValidation_cff::num, ticl::Trackster::photon, AlCaHLTBitMon_QueryRunRegistry::string, submitPVValidationJobs::t, and findQualityFiles::v.

◆ energyRegressionAndID()

template<typename TILES >
void PatternRecognitionbyCLUE3D::energyRegressionAndID ( const std::vector< reco::CaloCluster > &  layerClusters,
std::vector< Trackster > &  result 
)

Definition at line 304 of file PatternRecognitionbyCLUE3D.cc.

305  {
306  // Energy regression and particle identification strategy:
307  //
308  // 1. Set default values for regressed energy and particle id for each trackster.
309  // 2. Store indices of tracksters whose total sum of cluster energies is above the
310  // eidMinClusterEnergy_ (GeV) treshold. Inference is not applied for soft tracksters.
311  // 3. When no trackster passes the selection, return.
312  // 4. Create input and output tensors. The batch dimension is determined by the number of
313  // selected tracksters.
314  // 5. Fill input tensors with layer cluster features. Per layer, clusters are ordered descending
315  // by energy. Given that tensor data is contiguous in memory, we can use pointer arithmetic to
316  // fill values, even with batching.
317  // 6. Zero-fill features for empty clusters in each layer.
318  // 7. Batched inference.
319  // 8. Assign the regressed energy and id probabilities to each trackster.
320  //
321  // Indices used throughout this method:
322  // i -> batch element / trackster
323  // j -> layer
324  // k -> cluster
325  // l -> feature
326 
327  // set default values per trackster, determine if the cluster energy threshold is passed,
328  // and store indices of hard tracksters
329  std::vector<int> tracksterIndices;
330  for (int i = 0; i < static_cast<int>(tracksters.size()); i++) {
331  // calculate the cluster energy sum (2)
332  // note: after the loop, sumClusterEnergy might be just above the threshold which is enough to
333  // decide whether to run inference for the trackster or not
334  float sumClusterEnergy = 0.;
335  for (const unsigned int &vertex : tracksters[i].vertices()) {
336  sumClusterEnergy += static_cast<float>(layerClusters[vertex].energy());
337  // there might be many clusters, so try to stop early
338  if (sumClusterEnergy >= eidMinClusterEnergy_) {
339  // set default values (1)
340  tracksters[i].setRegressedEnergy(0.f);
341  tracksters[i].zeroProbabilities();
342  tracksterIndices.push_back(i);
343  break;
344  }
345  }
346  }
347 
348  // do nothing when no trackster passes the selection (3)
349  int batchSize = static_cast<int>(tracksterIndices.size());
350  if (batchSize == 0) {
351  return;
352  }
353 
354  // create input and output tensors (4)
355  tensorflow::TensorShape shape({batchSize, eidNLayers_, eidNClusters_, eidNFeatures_});
356  tensorflow::Tensor input(tensorflow::DT_FLOAT, shape);
358 
359  std::vector<tensorflow::Tensor> outputs;
360  std::vector<std::string> outputNames;
361  if (!eidOutputNameEnergy_.empty()) {
363  }
364  if (!eidOutputNameId_.empty()) {
365  outputNames.push_back(eidOutputNameId_);
366  }
367 
368  // fill input tensor (5)
369  for (int i = 0; i < batchSize; i++) {
370  const Trackster &trackster = tracksters[tracksterIndices[i]];
371 
372  // per layer, we only consider the first eidNClusters_ clusters in terms of energy, so in order
373  // to avoid creating large / nested structures to do the sorting for an unknown number of total
374  // clusters, create a sorted list of layer cluster indices to keep track of the filled clusters
375  std::vector<int> clusterIndices(trackster.vertices().size());
376  for (int k = 0; k < (int)trackster.vertices().size(); k++) {
377  clusterIndices[k] = k;
378  }
379  sort(clusterIndices.begin(), clusterIndices.end(), [&layerClusters, &trackster](const int &a, const int &b) {
380  return layerClusters[trackster.vertices(a)].energy() > layerClusters[trackster.vertices(b)].energy();
381  });
382 
383  // keep track of the number of seen clusters per layer
384  std::vector<int> seenClusters(eidNLayers_);
385 
386  // loop through clusters by descending energy
387  for (const int &k : clusterIndices) {
388  // get features per layer and cluster and store the values directly in the input tensor
389  const reco::CaloCluster &cluster = layerClusters[trackster.vertices(k)];
390  int j = rhtools_.getLayerWithOffset(cluster.hitsAndFractions()[0].first) - 1;
391  if (j < eidNLayers_ && seenClusters[j] < eidNClusters_) {
392  // get the pointer to the first feature value for the current batch, layer and cluster
393  float *features = &input.tensor<float, 4>()(i, j, seenClusters[j], 0);
394 
395  // fill features
396  *(features++) = float(cluster.energy() / float(trackster.vertex_multiplicity(k)));
397  *(features++) = float(std::abs(cluster.eta()));
398  *(features) = float(cluster.phi());
399 
400  // increment seen clusters
401  seenClusters[j]++;
402  }
403  }
404 
405  // zero-fill features of empty clusters in each layer (6)
406  for (int j = 0; j < eidNLayers_; j++) {
407  for (int k = seenClusters[j]; k < eidNClusters_; k++) {
408  float *features = &input.tensor<float, 4>()(i, j, k, 0);
409  for (int l = 0; l < eidNFeatures_; l++) {
410  *(features++) = 0.f;
411  }
412  }
413  }
414  }
415 
416  // run the inference (7)
418 
419  // store regressed energy per trackster (8)
420  if (!eidOutputNameEnergy_.empty()) {
421  // get the pointer to the energy tensor, dimension is batch x 1
422  float *energy = outputs[0].flat<float>().data();
423 
424  for (const int &i : tracksterIndices) {
425  tracksters[i].setRegressedEnergy(*(energy++));
426  }
427  }
428 
429  // store id probabilities per trackster (8)
430  if (!eidOutputNameId_.empty()) {
431  // get the pointer to the id probability tensor, dimension is batch x id_probabilities.size()
432  int probsIdx = eidOutputNameEnergy_.empty() ? 0 : 1;
433  float *probs = outputs[probsIdx].flat<float>().data();
434 
435  for (const int &i : tracksterIndices) {
436  tracksters[i].setProbabilities(probs);
437  probs += tracksters[i].id_probabilities().size();
438  }
439  }
440 }

References a, funct::abs(), b, data, HCALHighEnergyHPDFilter_cfi::energy, reco::CaloCluster::energy(), reco::CaloCluster::eta(), f, lowptgsfeleseed::features(), dqmMemoryStats::float, reco::CaloCluster::hitsAndFractions(), mps_fire::i, input, createfilelist::int, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, HLTEgPhaseIITestSequence_cff::layerClusters, jets_cff::outputNames, PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, reco::CaloCluster::phi(), tensorflow::run(), jetUpdater_cfi::sort, bphysicsOniaDQM_cfi::vertex, ticl::Trackster::vertex_multiplicity(), AlignmentTracksFromVertexSelector_cfi::vertices, and ticl::Trackster::vertices().

◆ fillPSetDescription()

template<typename TILES >
void PatternRecognitionbyCLUE3D::fillPSetDescription ( edm::ParameterSetDescription iDesc)
static

Definition at line 719 of file PatternRecognitionbyCLUE3D.cc.

719  {
720  iDesc.add<int>("algo_verbosity", 0);
721  iDesc.add<double>("criticalDensity", 4)->setComment("in GeV");
722  iDesc.add<int>("densitySiblingLayers", 3);
723  iDesc.add<double>("densityEtaPhiDistanceSqr", 0.0008);
724  iDesc.add<bool>("densityOnSameLayer", false);
725  iDesc.add<double>("criticalEtaPhiDistance", 0.035);
726  iDesc.add<double>("outlierMultiplier", 2);
727  iDesc.add<int>("minNumLayerCluster", 5)->setComment("Not Inclusive");
728  iDesc.add<std::string>("eid_input_name", "input");
729  iDesc.add<std::string>("eid_output_name_energy", "output/regressed_energy");
730  iDesc.add<std::string>("eid_output_name_id", "output/id_probabilities");
731  iDesc.add<double>("eid_min_cluster_energy", 1.);
732  iDesc.add<int>("eid_n_layers", 50);
733  iDesc.add<int>("eid_n_clusters", 10);
734 }

References edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ findAndAssignTracksters()

template<typename TILES >
int PatternRecognitionbyCLUE3D::findAndAssignTracksters ( const TILES &  tiles,
const std::vector< std::pair< int, int >> &  layerIdx2layerandSoa 
)
private

Definition at line 659 of file PatternRecognitionbyCLUE3D.cc.

660  {
661  unsigned int nTracksters = 0;
662 
663  std::vector<std::pair<int, int>> localStack;
664  // find cluster seeds and outlier
665  for (unsigned int layer = 0; layer < 2 * rhtools_.lastLayer(); layer++) {
666  auto &clustersOnLayer = clusters_[layer];
667  unsigned int numberOfClusters = clustersOnLayer.x.size();
668  for (unsigned int i = 0; i < numberOfClusters; i++) {
669  // initialize clusterIndex
670  clustersOnLayer.clusterIndex[i] = -1;
671  bool isSeed =
672  (clustersOnLayer.delta[i] > criticalEtaPhiDistance_) && (clustersOnLayer.rho[i] >= criticalDensity_);
673  bool isOutlier = (clustersOnLayer.delta[i] > outlierMultiplier_ * criticalEtaPhiDistance_) &&
674  (clustersOnLayer.rho[i] < criticalDensity_);
675  if (isSeed) {
677  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
678  << "Found seed on Layer " << layer << " SOAidx: " << i << " assigned ClusterIdx: " << nTracksters;
679  }
680  clustersOnLayer.clusterIndex[i] = nTracksters++;
681  clustersOnLayer.isSeed[i] = true;
682  localStack.emplace_back(layer, i);
683  } else if (!isOutlier) {
684  auto [lyrIdx, soaIdx] = clustersOnLayer.nearestHigher[i];
686  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
687  << "Found follower on Layer " << layer << " SOAidx: " << i << " attached to cluster on layer: " << lyrIdx
688  << " SOAidx: " << soaIdx;
689  }
690  clusters_[lyrIdx].followers[soaIdx].emplace_back(layer, i);
691  } else {
693  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
694  << "Found Outlier on Layer " << layer << " SOAidx: " << i << " with rho: " << clustersOnLayer.rho[i]
695  << " and delta: " << clustersOnLayer.delta[i];
696  }
697  }
698  }
699  }
700 
701  // Propagate cluster index
702  while (!localStack.empty()) {
703  auto [lyrIdx, soaIdx] = localStack.back();
704  auto &thisSeed = clusters_[lyrIdx].followers[soaIdx];
705  localStack.pop_back();
706 
707  // loop over followers
708  for (auto [follower_lyrIdx, follower_soaIdx] : thisSeed) {
709  // pass id to a follower
710  clusters_[follower_lyrIdx].clusterIndex[follower_soaIdx] = clusters_[lyrIdx].clusterIndex[soaIdx];
711  // push this follower to localStack
712  localStack.emplace_back(follower_lyrIdx, follower_soaIdx);
713  }
714  }
715  return nTracksters;
716 }

References mps_fire::i, and phase1PixelTopology::layer.

◆ makeTracksters()

template<typename TILES >
void PatternRecognitionbyCLUE3D::makeTracksters ( const typename PatternRecognitionAlgoBaseT< TILES >::Inputs input,
std::vector< Trackster > &  result,
std::unordered_map< int, std::vector< int >> &  seedToTracksterAssociation 
)
override

Definition at line 146 of file PatternRecognitionbyCLUE3D.cc.

149  {
150  // Protect from events with no seeding regions
151  if (input.regions.empty())
152  return;
153 
154  const int eventNumber = input.ev.eventAuxiliary().event();
156  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "New Event";
157  }
158 
159  edm::EventSetup const &es = input.es;
162 
163  clusters_.clear();
164  clusters_.resize(2 * rhtools_.lastLayer(false));
165  std::vector<std::pair<int, int>> layerIdx2layerandSoa; //used everywhere also to propagate cluster masking
166 
167  layerIdx2layerandSoa.reserve(input.layerClusters.size());
168  unsigned int layerIdx = 0;
169  for (auto const &lc : input.layerClusters) {
170  if (input.mask[layerIdx] == 0.) {
172  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Skipping masked clustrer: " << layerIdx;
173  }
174  layerIdx2layerandSoa.emplace_back(-1, -1);
175  layerIdx++;
176  continue;
177  }
178  const auto firstHitDetId = lc.hitsAndFractions()[0].first;
179  int layer = rhtools_.getLayerWithOffset(firstHitDetId) - 1 +
180  rhtools_.lastLayer(false) * ((rhtools_.zside(firstHitDetId) + 1) >> 1);
181  assert(layer >= 0);
182 
183  layerIdx2layerandSoa.emplace_back(layer, clusters_[layer].x.size());
184  float sum_x = 0.;
185  float sum_y = 0.;
186  float sum_sqr_x = 0.;
187  float sum_sqr_y = 0.;
188  float ref_x = lc.x();
189  float ref_y = lc.y();
190  float invClsize = 1. / lc.hitsAndFractions().size();
191  for (auto const &hitsAndFractions : lc.hitsAndFractions()) {
192  auto const &point = rhtools_.getPosition(hitsAndFractions.first);
193  sum_x += point.x() - ref_x;
194  sum_sqr_x += (point.x() - ref_x) * (point.x() - ref_x);
195  sum_y += point.y() - ref_y;
196  sum_sqr_y += (point.y() - ref_y) * (point.y() - ref_y);
197  }
198  // The variance of X for X uniform in circle of radius R is R^2/4,
199  // therefore we multiply the sqrt(var) by 2 to have a rough estimate of the
200  // radius. On the other hand, while averaging the x and y radius, we would
201  // end up dividing by 2. Hence we omit the value here and in the average
202  // below, too.
203  float radius_x = sqrt((sum_sqr_x - (sum_x * sum_x) * invClsize) * invClsize);
204  float radius_y = sqrt((sum_sqr_y - (sum_y * sum_y) * invClsize) * invClsize);
205  clusters_[layer].x.emplace_back(lc.x());
206  clusters_[layer].y.emplace_back(lc.y());
207  clusters_[layer].radius.emplace_back(radius_x + radius_y);
208  clusters_[layer].eta.emplace_back(lc.eta());
209  clusters_[layer].phi.emplace_back(lc.phi());
210  clusters_[layer].cells.push_back(lc.hitsAndFractions().size());
211  clusters_[layer].energy.emplace_back(lc.energy());
212  clusters_[layer].isSeed.push_back(false);
213  clusters_[layer].clusterIndex.emplace_back(-1);
214  clusters_[layer].layerClusterOriginalIdx.emplace_back(layerIdx++);
215  clusters_[layer].nearestHigher.emplace_back(-1, -1);
216  clusters_[layer].rho.emplace_back(0.f);
217  clusters_[layer].delta.emplace_back(std::numeric_limits<float>::max());
218  }
219  for (unsigned int layer = 0; layer < clusters_.size(); layer++) {
220  clusters_[layer].followers.resize(clusters_[layer].x.size());
221  }
222 
223  auto lastLayerPerSide = (unsigned int)(rhtools_.lastLayer(false));
224  unsigned int maxLayer = 2 * lastLayerPerSide - 1;
225  std::vector<int> numberOfClustersPerLayer(maxLayer, 0);
226  for (unsigned int i = 0; i <= maxLayer; i++) {
227  calculateLocalDensity(input.tiles, i, layerIdx2layerandSoa);
228  }
229  for (unsigned int i = 0; i <= maxLayer; i++) {
230  calculateDistanceToHigher(input.tiles, i, layerIdx2layerandSoa);
231  }
232 
233  auto nTracksters = findAndAssignTracksters(input.tiles, layerIdx2layerandSoa);
235  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Reconstructed " << nTracksters << " tracksters" << std::endl;
236  dumpClusters(layerIdx2layerandSoa, eventNumber);
237  }
238 
239  // Build Trackster
240  result.resize(nTracksters);
241 
242  for (unsigned int layer = 0; layer < clusters_.size(); ++layer) {
243  const auto &thisLayer = clusters_[layer];
245  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Examining Layer: " << layer;
246  }
247  for (unsigned int lc = 0; lc < thisLayer.x.size(); ++lc) {
249  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Trackster " << thisLayer.clusterIndex[lc];
250  }
251  if (thisLayer.clusterIndex[lc] >= 0) {
253  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << " adding lcIdx: " << thisLayer.layerClusterOriginalIdx[lc];
254  }
255  result[thisLayer.clusterIndex[lc]].vertices().push_back(thisLayer.layerClusterOriginalIdx[lc]);
256  result[thisLayer.clusterIndex[lc]].vertex_multiplicity().push_back(1);
257  // loop over followers
258  for (auto [follower_lyrIdx, follower_soaIdx] : thisLayer.followers[lc]) {
259  std::array<unsigned int, 2> edge = {
260  {(unsigned int)thisLayer.layerClusterOriginalIdx[lc],
261  (unsigned int)clusters_[follower_lyrIdx].layerClusterOriginalIdx[follower_soaIdx]}};
262  result[thisLayer.clusterIndex[lc]].edges().push_back(edge);
263  }
264  }
265  }
266  }
267 
268  result.erase(
269  std::remove_if(std::begin(result),
270  std::end(result),
271  [&](auto const &v) { return static_cast<int>(v.vertices().size()) < minNumLayerCluster_; }),
272  result.end());
273  result.shrink_to_fit();
274 
276  input.layerClusters,
277  input.layerClustersTime,
278  rhtools_.getPositionLayer(rhtools_.lastLayerEE(false), false).z());
279 
280  // run energy regression and ID
281  energyRegressionAndID(input.layerClusters, result);
283  for (auto const &t : result) {
284  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Barycenter: " << t.barycenter();
285  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "LCs: " << t.vertices().size();
286  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Energy: " << t.raw_energy();
287  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Regressed: " << t.regressed_energy();
288  }
289  }
290 
291  // Dump Tracksters information
293  dumpTracksters(layerIdx2layerandSoa, eventNumber, result);
294  }
295 
296  // Reset internal clusters_ structure of array for next event
297  reset();
299  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << std::endl;
300  }
301 }

References cms::cuda::assert(), ticl::assignPCAtoTracksters(), mps_fire::end, f, relativeConstraints::geom, edm::EventSetup::getData(), mps_fire::i, input, createfilelist::int, phase1PixelTopology::layer, SiStripPI::max, point, reset(), mps_fire::result, mathSSE::sqrt(), makeMuonMisalignmentScenario::sum_x, makeMuonMisalignmentScenario::sum_y, submitPVValidationJobs::t, and findQualityFiles::v.

◆ reset()

template<typename TILES >
void ticl::PatternRecognitionbyCLUE3D< TILES >::reset ( void  )
inlineprivate

Definition at line 79 of file PatternRecognitionbyCLUE3D.h.

79  {
80  for (auto& c : clusters_) {
81  c.clear();
82  c.shrink_to_fit();
83  }
84  }

References c, and ticl::PatternRecognitionbyCLUE3D< TILES >::clusters_.

Member Data Documentation

◆ caloGeomToken_

template<typename TILES >
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> ticl::PatternRecognitionbyCLUE3D< TILES >::caloGeomToken_
private

Definition at line 96 of file PatternRecognitionbyCLUE3D.h.

◆ clusters_

template<typename TILES >
std::vector<ClustersOnLayer> ticl::PatternRecognitionbyCLUE3D< TILES >::clusters_
private

◆ criticalDensity_

template<typename TILES >
const double ticl::PatternRecognitionbyCLUE3D< TILES >::criticalDensity_
private

Definition at line 97 of file PatternRecognitionbyCLUE3D.h.

◆ criticalEtaPhiDistance_

template<typename TILES >
const double ticl::PatternRecognitionbyCLUE3D< TILES >::criticalEtaPhiDistance_
private

Definition at line 101 of file PatternRecognitionbyCLUE3D.h.

◆ densityEtaPhiDistanceSqr_

template<typename TILES >
const double ticl::PatternRecognitionbyCLUE3D< TILES >::densityEtaPhiDistanceSqr_
private

Definition at line 99 of file PatternRecognitionbyCLUE3D.h.

◆ densityOnSameLayer_

template<typename TILES >
const double ticl::PatternRecognitionbyCLUE3D< TILES >::densityOnSameLayer_
private

Definition at line 100 of file PatternRecognitionbyCLUE3D.h.

◆ densitySiblingLayers_

template<typename TILES >
const int ticl::PatternRecognitionbyCLUE3D< TILES >::densitySiblingLayers_
private

Definition at line 98 of file PatternRecognitionbyCLUE3D.h.

◆ eidInputName_

template<typename TILES >
const std::string ticl::PatternRecognitionbyCLUE3D< TILES >::eidInputName_
private

Definition at line 105 of file PatternRecognitionbyCLUE3D.h.

◆ eidMinClusterEnergy_

template<typename TILES >
const float ticl::PatternRecognitionbyCLUE3D< TILES >::eidMinClusterEnergy_
private

Definition at line 108 of file PatternRecognitionbyCLUE3D.h.

◆ eidNClusters_

template<typename TILES >
const int ticl::PatternRecognitionbyCLUE3D< TILES >::eidNClusters_
private

Definition at line 110 of file PatternRecognitionbyCLUE3D.h.

◆ eidNFeatures_

template<typename TILES >
const int ticl::PatternRecognitionbyCLUE3D< TILES >::eidNFeatures_ = 3
staticprivate

Definition at line 115 of file PatternRecognitionbyCLUE3D.h.

◆ eidNLayers_

template<typename TILES >
const int ticl::PatternRecognitionbyCLUE3D< TILES >::eidNLayers_
private

Definition at line 109 of file PatternRecognitionbyCLUE3D.h.

◆ eidOutputNameEnergy_

template<typename TILES >
const std::string ticl::PatternRecognitionbyCLUE3D< TILES >::eidOutputNameEnergy_
private

Definition at line 106 of file PatternRecognitionbyCLUE3D.h.

◆ eidOutputNameId_

template<typename TILES >
const std::string ticl::PatternRecognitionbyCLUE3D< TILES >::eidOutputNameId_
private

Definition at line 107 of file PatternRecognitionbyCLUE3D.h.

◆ eidSession_

template<typename TILES >
tensorflow::Session* ticl::PatternRecognitionbyCLUE3D< TILES >::eidSession_
private

◆ filter_on_categories_

template<typename TILES >
const std::vector<int> ticl::PatternRecognitionbyCLUE3D< TILES >::filter_on_categories_
private

Definition at line 104 of file PatternRecognitionbyCLUE3D.h.

◆ minNumLayerCluster_

template<typename TILES >
const int ticl::PatternRecognitionbyCLUE3D< TILES >::minNumLayerCluster_
private

Definition at line 103 of file PatternRecognitionbyCLUE3D.h.

◆ outlierMultiplier_

template<typename TILES >
const double ticl::PatternRecognitionbyCLUE3D< TILES >::outlierMultiplier_
private

Definition at line 102 of file PatternRecognitionbyCLUE3D.h.

◆ rhtools_

template<typename TILES >
hgcal::RecHitTools ticl::PatternRecognitionbyCLUE3D< TILES >::rhtools_
private

Definition at line 112 of file PatternRecognitionbyCLUE3D.h.

reco::CaloCluster::phi
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
ticl::PatternRecognitionbyCLUE3D::eidInputName_
const std::string eidInputName_
Definition: PatternRecognitionbyCLUE3D.h:105
ticl::Trackster::ParticleType::neutral_hadron
tensorflow::createSession
Session * createSession(SessionOptions &sessionOptions)
Definition: TensorFlow.cc:85
ticl::TileConstantsHFNose::nEtaBins
static constexpr int nEtaBins
Definition: Common.h:23
ticl::PatternRecognitionbyCLUE3D::eidNClusters_
const int eidNClusters_
Definition: PatternRecognitionbyCLUE3D.h:110
ticl::PatternRecognitionbyCLUE3D::energyRegressionAndID
void energyRegressionAndID(const std::vector< reco::CaloCluster > &layerClusters, std::vector< Trackster > &result)
Definition: PatternRecognitionbyCLUE3D.cc:304
mps_fire.i
i
Definition: mps_fire.py:428
ticl::TileConstants::nEtaBins
static constexpr int nEtaBins
Definition: Common.h:12
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
ticl::PatternRecognitionbyCLUE3D::clusters_
std::vector< ClustersOnLayer > clusters_
Definition: PatternRecognitionbyCLUE3D.h:94
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
ticl::PatternRecognitionbyCLUE3D::calculateDistanceToHigher
void calculateDistanceToHigher(const TILES &, const unsigned int layerId, const std::vector< std::pair< int, int >> &)
Definition: PatternRecognitionbyCLUE3D.cc:563
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
ticl::PatternRecognitionbyCLUE3D::eidMinClusterEnergy_
const float eidMinClusterEnergy_
Definition: PatternRecognitionbyCLUE3D.h:108
ticl::TileConstantsHFNose::nPhiBins
static constexpr int nPhiBins
Definition: Common.h:24
min
T min(T a, T b)
Definition: MathUtil.h:58
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
ticl::PatternRecognitionbyCLUE3D::dumpTracksters
void dumpTracksters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int, const std::vector< Trackster > &) const
Definition: PatternRecognitionbyCLUE3D.cc:76
ticl::Trackster::ParticleType::charged_hadron
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
PatBasicFWLiteJetAnalyzer_Selector_cfg.outputs
outputs
Definition: PatBasicFWLiteJetAnalyzer_Selector_cfg.py:48
ticl::PatternRecognitionbyCLUE3D::eidOutputNameId_
const std::string eidOutputNameId_
Definition: PatternRecognitionbyCLUE3D.h:107
cms::cuda::assert
assert(be >=bs)
makeMuonMisalignmentScenario.sum_y
int sum_y
Definition: makeMuonMisalignmentScenario.py:177
ticl::TileConstants::nPhiBins
static constexpr int nPhiBins
Definition: Common.h:13
findQualityFiles.v
v
Definition: findQualityFiles.py:179
allConversions_cfi.maxDelta
maxDelta
Definition: allConversions_cfi.py:44
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
AlignmentTracksFromVertexSelector_cfi.vertices
vertices
Definition: AlignmentTracksFromVertexSelector_cfi.py:5
ticl::assignPCAtoTracksters
void assignPCAtoTracksters(std::vector< Trackster > &, const std::vector< reco::CaloCluster > &, const edm::ValueMap< std::pair< float, float >> &, double, bool energyWeight=true)
Definition: TrackstersPCA.cc:12
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
ticl::PatternRecognitionbyCLUE3D::criticalDensity_
const double criticalDensity_
Definition: PatternRecognitionbyCLUE3D.h:97
ticl::PatternRecognitionAlgoBaseT
Definition: PatternRecognitionAlgoBase.h:25
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
CaloGeometry
Definition: CaloGeometry.h:21
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
ticl::PatternRecognitionbyCLUE3D::dumpClusters
void dumpClusters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int) const
Definition: PatternRecognitionbyCLUE3D.cc:108
ticl::TrackstersCache
Definition: GlobalCache.h:19
reco::CaloCluster
Definition: CaloCluster.h:31
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
mps_fire.end
end
Definition: mps_fire.py:242
ticl::PatternRecognitionbyCLUE3D::calculateLocalDensity
void calculateLocalDensity(const TILES &, const unsigned int layerId, const std::vector< std::pair< int, int >> &)
Definition: PatternRecognitionbyCLUE3D.cc:443
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HLTEgPhaseIITestSequence_cff.layerClusters
layerClusters
Definition: HLTEgPhaseIITestSequence_cff.py:2506
ticl::Trackster::ParticleType::photon
ticl::PatternRecognitionbyCLUE3D::findAndAssignTracksters
int findAndAssignTracksters(const TILES &, const std::vector< std::pair< int, int >> &)
Definition: PatternRecognitionbyCLUE3D.cc:659
b
double b
Definition: hdecay.h:118
utilities.cache
def cache(function)
Definition: utilities.py:3
trackingPOGFilters_cfi.phiWindow
phiWindow
Definition: trackingPOGFilters_cfi.py:109
lowptgsfeleseed::features
std::vector< float > features(const reco::PreId &ecal, const reco::PreId &hcal, double rho, const reco::BeamSpot &spot, noZS::EcalClusterLazyTools &ecalTools)
Definition: LowPtGsfElectronFeatures.cc:17
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
a
double a
Definition: hdecay.h:119
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
ticl::PatternRecognitionbyCLUE3D::rhtools_
hgcal::RecHitTools rhtools_
Definition: PatternRecognitionbyCLUE3D.h:112
PVValHelper::phi
Definition: PVValidationHelpers.h:69
reco::CaloCluster::hitsAndFractions
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:210
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HLT_FULL_cff.minLayer
minLayer
Definition: HLT_FULL_cff.py:53000
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
ticl::PatternRecognitionbyCLUE3D::densitySiblingLayers_
const int densitySiblingLayers_
Definition: PatternRecognitionbyCLUE3D.h:98
hgcal::RecHitTools::getLayerWithOffset
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:362
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
hgcal::RecHitTools::lastLayerEE
unsigned int lastLayerEE(bool nose=false) const
Definition: RecHitTools.h:67
tensorflow::NamedTensorList
std::vector< NamedTensor > NamedTensorList
Definition: TensorFlow.h:30
createfilelist.int
int
Definition: createfilelist.py:10
ticl::PatternRecognitionbyCLUE3D::densityEtaPhiDistanceSqr_
const double densityEtaPhiDistanceSqr_
Definition: PatternRecognitionbyCLUE3D.h:99
ticl::Trackster::vertex_multiplicity
std::vector< float > & vertex_multiplicity()
Definition: Trackster.h:57
hgcal::RecHitTools::zside
int zside(const DetId &id) const
Definition: RecHitTools.cc:160
edm::EventSetup
Definition: EventSetup.h:58
ticl::PatternRecognitionbyCLUE3D::outlierMultiplier_
const double outlierMultiplier_
Definition: PatternRecognitionbyCLUE3D.h:102
hgcal::RecHitTools::getPositionLayer
GlobalPoint getPositionLayer(int layer, bool nose=false) const
Definition: RecHitTools.cc:138
ticl::PatternRecognitionbyCLUE3D::eidSession_
tensorflow::Session * eidSession_
Definition: PatternRecognitionbyCLUE3D.h:113
ticl::TrackstersCache::eidGraphDef
std::atomic< tensorflow::GraphDef * > eidGraphDef
Definition: GlobalCache.h:25
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hgcal::RecHitTools::lastLayer
unsigned int lastLayer(bool nose=false) const
Definition: RecHitTools.h:71
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:33
ticl::PatternRecognitionbyCLUE3D::eidOutputNameEnergy_
const std::string eidOutputNameEnergy_
Definition: PatternRecognitionbyCLUE3D.h:106
ticl::PatternRecognitionbyCLUE3D::densityOnSameLayer_
const double densityOnSameLayer_
Definition: PatternRecognitionbyCLUE3D.h:100
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
ticl::PatternRecognitionbyCLUE3D::criticalEtaPhiDistance_
const double criticalEtaPhiDistance_
Definition: PatternRecognitionbyCLUE3D.h:101
hgcal::RecHitTools::setGeometry
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
ticl::PatternRecognitionbyCLUE3D::reset
void reset()
Definition: PatternRecognitionbyCLUE3D.h:79
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
ticl::Trackster::vertices
std::vector< unsigned int > & vertices()
Definition: Trackster.h:56
Exception
Definition: hltDiff.cc:245
genVertex_cff.x
x
Definition: genVertex_cff.py:13
tensorflow::run
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, std::vector< Tensor > *outputs, const thread::ThreadPoolOptions &threadPoolOptions)
Definition: TensorFlow.cc:213
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ticl::PatternRecognitionbyCLUE3D::eidNLayers_
const int eidNLayers_
Definition: PatternRecognitionbyCLUE3D.h:109
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ticl::PatternRecognitionbyCLUE3D::eidNFeatures_
static const int eidNFeatures_
Definition: PatternRecognitionbyCLUE3D.h:115
ticl::PatternRecognitionbyCLUE3D::minNumLayerCluster_
const int minNumLayerCluster_
Definition: PatternRecognitionbyCLUE3D.h:103
ticl::PatternRecognitionbyCLUE3D::caloGeomToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
Definition: PatternRecognitionbyCLUE3D.h:96
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
makeMuonMisalignmentScenario.sum_x
int sum_x
More diagnostics.
Definition: makeMuonMisalignmentScenario.py:176
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
ticl::PatternRecognitionAlgoBaseT::Advanced
Definition: PatternRecognitionAlgoBase.h:54
hgcal::RecHitTools::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:126
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Log
Definition: MessageLogger.h:70
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
ticl::PatternRecognitionAlgoBaseT::algo_verbosity_
int algo_verbosity_
Definition: PatternRecognitionAlgoBase.h:57
ticl::Trackster
Definition: Trackster.h:19
jets_cff.outputNames
outputNames
Definition: jets_cff.py:335
ticl::Trackster::ParticleType::electron