CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
CaloGeometryRecord
caloGeomToken_
 
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

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

Definition at line 24 of file PatternRecognitionbyCLUE3D.cc.

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

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 }
Session * createSession(SessionOptions &sessionOptions)
Definition: TensorFlow.cc:85
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
std::atomic< tensorflow::GraphDef * > eidGraphDef
Definition: GlobalCache.h:25
def cache
Definition: utilities.py:3
template<typename TILES >
ticl::PatternRecognitionbyCLUE3D< TILES >::~PatternRecognitionbyCLUE3D ( )
overridedefault

Member Function Documentation

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 561 of file PatternRecognitionbyCLUE3D.cc.

References reco::deltaR2(), mps_fire::i, SiStripPI::max, min(), HLT_FULL_cff::minLayer, L1TMuonDQMOffline_cfi::nEtaBins, ecaldqm::binning::nPhiBins, hltrates_dqm_sourceclient-live_cfg::offset, and mathSSE::sqrt().

562  {
563  constexpr int nEtaBin = TILES::constants_type_t::nEtaBins;
564  constexpr int nPhiBin = TILES::constants_type_t::nPhiBins;
565  auto &clustersOnLayer = clusters_[layerId];
566  unsigned int numberOfClusters = clustersOnLayer.x.size();
567 
568  for (unsigned int i = 0; i < numberOfClusters; i++) {
570  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
571  << "Starting searching nearestHigher on " << layerId << " with rho: " << clustersOnLayer.rho[i]
572  << " at eta, phi: " << tiles[layerId].etaBin(clustersOnLayer.eta[i]) << ", "
573  << tiles[layerId].etaBin(clustersOnLayer.phi[i]);
574  }
575  // We need to partition the two sides of the HGCAL detector
576  auto lastLayerPerSide = static_cast<unsigned int>(rhtools_.lastLayer(false));
577  unsigned int minLayer = 0;
578  unsigned int maxLayer = 2 * lastLayerPerSide - 1;
579  if (layerId < lastLayerPerSide) {
580  minLayer = std::max(layerId - densitySiblingLayers_, minLayer);
581  maxLayer = std::min(layerId + densitySiblingLayers_, lastLayerPerSide - 1);
582  } else {
583  minLayer = std::max(layerId - densitySiblingLayers_, lastLayerPerSide + 1);
584  maxLayer = std::min(layerId + densitySiblingLayers_, maxLayer);
585  }
586  float maxDelta = std::numeric_limits<float>::max();
587  float i_delta = maxDelta;
588  std::pair<int, int> i_nearestHigher(-1, -1);
589  for (unsigned int currentLayer = minLayer; currentLayer <= maxLayer; currentLayer++) {
590  const auto &tileOnLayer = tiles[currentLayer];
591  int etaWindow = 2;
592  int phiWindow = 2;
593  int etaBinMin = std::max(tileOnLayer.etaBin(clustersOnLayer.eta[i]) - etaWindow, 0);
594  int etaBinMax = std::min(tileOnLayer.etaBin(clustersOnLayer.eta[i]) + etaWindow, nEtaBin);
595  int phiBinMin = tileOnLayer.phiBin(clustersOnLayer.phi[i]) - phiWindow;
596  int phiBinMax = tileOnLayer.phiBin(clustersOnLayer.phi[i]) + phiWindow;
597  for (int ieta = etaBinMin; ieta <= etaBinMax; ++ieta) {
598  auto offset = ieta * nPhiBin;
599  for (int iphi_it = phiBinMin; iphi_it <= phiBinMax; ++iphi_it) {
600  int iphi = ((iphi_it % nPhiBin + nPhiBin) % nPhiBin);
602  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
603  << "Searching nearestHigher on " << currentLayer << " eta, phi: " << ieta << ", " << iphi_it;
604  }
605  for (auto otherClusterIdx : tileOnLayer[offset + iphi]) {
606  auto const &layerandSoa = layerIdx2layerandSoa[otherClusterIdx];
607  // Skip masked layer clusters
608  if ((layerandSoa.first == -1) && (layerandSoa.second == -1))
609  continue;
610  auto const &clustersOnOtherLayer = clusters_[layerandSoa.first];
611  float dist = reco::deltaR2(clustersOnLayer.eta[i],
612  clustersOnLayer.phi[i],
613  clustersOnOtherLayer.eta[layerandSoa.second],
614  clustersOnOtherLayer.phi[layerandSoa.second]);
615  bool foundHigher = (clustersOnOtherLayer.rho[layerandSoa.second] > clustersOnLayer.rho[i]) ||
616  (clustersOnOtherLayer.rho[layerandSoa.second] == clustersOnLayer.rho[i] &&
617  clustersOnOtherLayer.layerClusterOriginalIdx[layerandSoa.second] >
618  clustersOnLayer.layerClusterOriginalIdx[i]);
620  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
621  << "Searching nearestHigher on " << currentLayer
622  << " with rho: " << clustersOnOtherLayer.rho[layerandSoa.second]
623  << " on layerIdxInSOA: " << layerandSoa.first << ", " << layerandSoa.second
624  << " with distance: " << sqrt(dist) << " foundHigher: " << foundHigher;
625  }
626  if (foundHigher && dist <= i_delta) {
627  // update i_delta
628  i_delta = dist;
629  // update i_nearestHigher
630  i_nearestHigher = layerandSoa;
631  }
632  }
633  }
634  }
635  }
636 
637  bool foundNearestHigherInEtaPhiCylinder = (i_delta != maxDelta);
639  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
640  << "i_delta: " << sqrt(i_delta) << " passed: " << foundNearestHigherInEtaPhiCylinder << " "
641  << i_nearestHigher.first << " " << i_nearestHigher.second;
642  }
643  if (foundNearestHigherInEtaPhiCylinder) {
644  clustersOnLayer.delta[i] = sqrt(i_delta);
645  clustersOnLayer.nearestHigher[i] = i_nearestHigher;
646  } else {
647  // otherwise delta is guaranteed to be larger outlierDeltaFactor_*delta_c
648  // we can safely maximize delta to be maxDelta
649  clustersOnLayer.delta[i] = maxDelta;
650  clustersOnLayer.nearestHigher[i] = {-1, -1};
651  }
652  }
653 }
Log< level::Info, true > LogVerbatim
std::vector< ClustersOnLayer > clusters_
T sqrt(T t)
Definition: SSEVec.h:19
unsigned int lastLayer(bool nose=false) const
Definition: RecHitTools.h:79
T min(T a, T b)
Definition: MathUtil.h:58
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
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 442 of file PatternRecognitionbyCLUE3D.cc.

References CommonMethods::delta(), reco::deltaR2(), mps_fire::i, SiStripPI::max, min(), HLT_FULL_cff::minLayer, L1TMuonDQMOffline_cfi::nEtaBins, ecaldqm::binning::nPhiBins, and hltrates_dqm_sourceclient-live_cfg::offset.

443  {
444  constexpr int nEtaBin = TILES::constants_type_t::nEtaBins;
445  constexpr int nPhiBin = TILES::constants_type_t::nPhiBins;
446  auto &clustersOnLayer = clusters_[layerId];
447  unsigned int numberOfClusters = clustersOnLayer.x.size();
448 
449  auto isReachable = [&](float x1, float x2, float y1, float y2, float delta_sqr) -> bool {
451  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
452  << ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) << " vs " << delta_sqr << "["
453  << ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) < delta_sqr) << "]\n";
454  }
455  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) < delta_sqr;
456  };
457 
458  for (unsigned int i = 0; i < numberOfClusters; i++) {
459  // We need to partition the two sides of the HGCAL detector
460  auto lastLayerPerSide = static_cast<unsigned int>(rhtools_.lastLayer(false)) - 1;
461  unsigned int minLayer = 0;
462  unsigned int maxLayer = 2 * lastLayerPerSide - 1;
463  if (layerId < lastLayerPerSide) {
464  minLayer = std::max(layerId - densitySiblingLayers_, minLayer);
465  maxLayer = std::min(layerId + densitySiblingLayers_, lastLayerPerSide - 1);
466  } else {
467  minLayer = std::max(layerId - densitySiblingLayers_, lastLayerPerSide + 1);
468  maxLayer = std::min(layerId + densitySiblingLayers_, maxLayer);
469  }
470  for (unsigned int currentLayer = minLayer; currentLayer <= maxLayer; currentLayer++) {
472  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "RefLayer: " << layerId << " SoaIDX: " << i;
473  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "NextLayer: " << currentLayer;
474  }
475  const auto &tileOnLayer = tiles[currentLayer];
476  bool onSameLayer = (currentLayer == layerId);
478  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "onSameLayer: " << onSameLayer;
479  }
480  int etaWindow = onSameLayer ? 2 : 1;
481  int phiWindow = onSameLayer ? 2 : 1;
482  int etaBinMin = std::max(tileOnLayer.etaBin(clustersOnLayer.eta[i]) - etaWindow, 0);
483  int etaBinMax = std::min(tileOnLayer.etaBin(clustersOnLayer.eta[i]) + etaWindow, nEtaBin);
484  int phiBinMin = tileOnLayer.phiBin(clustersOnLayer.phi[i]) - phiWindow;
485  int phiBinMax = tileOnLayer.phiBin(clustersOnLayer.phi[i]) + phiWindow;
487  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "eta: " << clustersOnLayer.eta[i];
488  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "phi: " << clustersOnLayer.phi[i];
489  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "etaBinMin: " << etaBinMin << ", etaBinMax: " << etaBinMax;
490  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "phiBinMin: " << phiBinMin << ", phiBinMax: " << phiBinMax;
491  }
492  for (int ieta = etaBinMin; ieta <= etaBinMax; ++ieta) {
493  auto offset = ieta * nPhiBin;
495  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "offset: " << offset;
496  }
497  for (int iphi_it = phiBinMin; iphi_it <= phiBinMax; ++iphi_it) {
498  int iphi = ((iphi_it % nPhiBin + nPhiBin) % nPhiBin);
500  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "iphi: " << iphi;
501  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
502  << "Entries in tileBin: " << tileOnLayer[offset + iphi].size();
503  }
504  for (auto otherClusterIdx : tileOnLayer[offset + iphi]) {
505  auto const &layerandSoa = layerIdx2layerandSoa[otherClusterIdx];
506  // Skip masked layer clusters
507  if ((layerandSoa.first == -1) && (layerandSoa.second == -1)) {
509  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Skipping masked layerIdx " << otherClusterIdx;
510  }
511  continue;
512  }
513  auto const &clustersLayer = clusters_[layerandSoa.first];
515  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
516  << "OtherLayer: " << layerandSoa.first << " SoaIDX: " << layerandSoa.second;
517  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "OtherEta: " << clustersLayer.eta[layerandSoa.second];
518  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "OtherPhi: " << clustersLayer.phi[layerandSoa.second];
519  }
520  // extend by 26 mm, roughly 2 cells, more wrt sum of radii
521  float delta = clustersOnLayer.radius[i] + clustersLayer.radius[layerandSoa.second] + 2.6f;
522  if (densityOnSameLayer_ && onSameLayer) {
523  if (isReachable(clustersOnLayer.x[i],
524  clustersLayer.x[layerandSoa.second],
525  clustersOnLayer.y[i],
526  clustersLayer.y[layerandSoa.second],
527  delta * delta)) {
528  clustersOnLayer.rho[i] += (clustersOnLayer.layerClusterOriginalIdx[i] == otherClusterIdx ? 1.f : 0.2f) *
529  clustersLayer.energy[layerandSoa.second];
530  }
531  } else {
533  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Distance: "
534  << reco::deltaR2(clustersOnLayer.eta[i],
535  clustersOnLayer.phi[i],
536  clustersLayer.eta[layerandSoa.second],
537  clustersLayer.phi[layerandSoa.second]);
538  }
539  if (reco::deltaR2(clustersOnLayer.eta[i],
540  clustersOnLayer.phi[i],
541  clustersLayer.eta[layerandSoa.second],
542  clustersLayer.phi[layerandSoa.second]) < densityEtaPhiDistanceSqr_) {
543  auto energyToAdd = (clustersOnLayer.layerClusterOriginalIdx[i] == otherClusterIdx ? 1.f : 0.5f) *
544  clustersLayer.energy[layerandSoa.second];
545  clustersOnLayer.rho[i] += energyToAdd;
546  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
547  << "Adding " << energyToAdd << " partial " << clustersOnLayer.rho[i];
548  }
549  }
550  } // end of loop on possible compatible clusters
551  } // end of loop over phi-bin region
552  } // end of loop over eta-bin region
553  } // end of loop on the sibling layers
554  } // end of loop over clusters on this layer
556  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << std::endl;
557  }
558 }
Log< level::Info, true > LogVerbatim
std::vector< ClustersOnLayer > clusters_
unsigned int lastLayer(bool nose=false) const
Definition: RecHitTools.h:79
T min(T a, T b)
Definition: MathUtil.h:58
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
template<typename TILES >
void PatternRecognitionbyCLUE3D::dumpClusters ( const std::vector< std::pair< int, int >> &  layerIdx2layerandSoa,
const int  eventNumber 
) const
private

Definition at line 107 of file PatternRecognitionbyCLUE3D.cc.

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

108  {
110  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "[evt, layer, x, y, eta, phi, cells, energy, radius, rho, delta, "
111  "isSeed, clusterIdx, layerClusterOriginalIdx";
112  }
113 
114  for (unsigned int layer = 0; layer < clusters_.size(); layer++) {
116  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "On Layer " << layer;
117  }
118  auto const &thisLayer = clusters_[layer];
119  int num = 0;
120  for (auto v : thisLayer.x) {
122  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
123  << "ClusterInfo: " << eventNumber << ", " << layer << ", " << v << ", " << thisLayer.y[num] << ", "
124  << thisLayer.eta[num] << ", " << thisLayer.phi[num] << ", " << thisLayer.cells[num] << ", "
125  << thisLayer.energy[num] << ", " << thisLayer.radius[num] << ", " << thisLayer.rho[num] << ", "
126  << thisLayer.delta[num] << ", " << thisLayer.isSeed[num] << ", " << thisLayer.clusterIndex[num] << ", "
127  << thisLayer.layerClusterOriginalIdx[num];
128  }
129  ++num;
130  }
131  }
132  for (unsigned int lcIdx = 0; lcIdx < layerIdx2layerandSoa.size(); lcIdx++) {
133  auto const &layerandSoa = layerIdx2layerandSoa[lcIdx];
134  // Skip masked layer clusters
135  if ((layerandSoa.first == -1) && (layerandSoa.second == -1))
136  continue;
138  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
139  << "lcIdx: " << lcIdx << " on Layer: " << layerandSoa.first << " SOA: " << layerandSoa.second;
140  }
141  }
142 }
Log< level::Info, true > LogVerbatim
std::vector< ClustersOnLayer > clusters_
constexpr std::array< uint8_t, layerIndexSize > layer
template<typename TILES >
void PatternRecognitionbyCLUE3D::dumpTiles ( const TILES &  tiles) const
private

Definition at line 53 of file PatternRecognitionbyCLUE3D.cc.

References relativeConstraints::empty, phase1PixelTopology::layer, L1TMuonDQMOffline_cfi::nEtaBins, ecaldqm::binning::nPhiBins, and hltrates_dqm_sourceclient-live_cfg::offset.

53  {
54  constexpr int nEtaBin = TILES::constants_type_t::nEtaBins;
55  constexpr int nPhiBin = TILES::constants_type_t::nPhiBins;
56  auto lastLayerPerSide = (unsigned int)(rhtools_.lastLayer(false));
57  unsigned int maxLayer = 2 * lastLayerPerSide - 1;
58  for (unsigned int layer = 0; layer <= maxLayer; layer++) {
59  for (int ieta = 0; ieta < nEtaBin; ieta++) {
60  auto offset = ieta * nPhiBin;
61  for (int phi = 0; phi < nPhiBin; phi++) {
62  int iphi = ((phi % nPhiBin + nPhiBin) % nPhiBin);
63  if (!tiles[layer][offset + iphi].empty()) {
64  if (this->algo_verbosity_ > this->Advanced) {
65  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Layer: " << layer << " ieta: " << ieta << " phi: " << phi
66  << " " << tiles[layer][offset + iphi].size();
67  }
68  }
69  }
70  }
71  }
72 }
Log< level::Info, true > LogVerbatim
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int lastLayer(bool nose=false) const
Definition: RecHitTools.h:79
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 75 of file PatternRecognitionbyCLUE3D.cc.

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

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

Definition at line 303 of file PatternRecognitionbyCLUE3D.cc.

References a, funct::abs(), b, data, relval_parameters_module::energy, reco::CaloCluster::energy(), reco::CaloCluster::eta(), validate-o2o-wbm::f, lowptgsfeleseed::features(), reco::CaloCluster::hitsAndFractions(), mps_fire::i, input, dqmiolumiharvest::j, isotrackApplyRegressor::k, cmsLHEtoEOSManager::l, reco::CaloCluster::phi(), tensorflow::run(), and beam_dqm_sourceclient-live_cfg::vertices.

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

Definition at line 716 of file PatternRecognitionbyCLUE3D.cc.

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

716  {
717  iDesc.add<int>("algo_verbosity", 0);
718  iDesc.add<double>("criticalDensity", 4)->setComment("in GeV");
719  iDesc.add<int>("densitySiblingLayers", 3);
720  iDesc.add<double>("densityEtaPhiDistanceSqr", 0.0008);
721  iDesc.add<bool>("densityOnSameLayer", false);
722  iDesc.add<double>("criticalEtaPhiDistance", 0.035);
723  iDesc.add<double>("outlierMultiplier", 2);
724  iDesc.add<int>("minNumLayerCluster", 5)->setComment("Not Inclusive");
725  iDesc.add<std::string>("eid_input_name", "input");
726  iDesc.add<std::string>("eid_output_name_energy", "output/regressed_energy");
727  iDesc.add<std::string>("eid_output_name_id", "output/id_probabilities");
728  iDesc.add<double>("eid_min_cluster_energy", 1.);
729  iDesc.add<int>("eid_n_layers", 50);
730  iDesc.add<int>("eid_n_clusters", 10);
731 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
template<typename TILES >
int PatternRecognitionbyCLUE3D::findAndAssignTracksters ( const TILES &  tiles,
const std::vector< std::pair< int, int >> &  layerIdx2layerandSoa 
)
private

Definition at line 656 of file PatternRecognitionbyCLUE3D.cc.

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

657  {
658  unsigned int nTracksters = 0;
659 
660  std::vector<std::pair<int, int>> localStack;
661  // find cluster seeds and outlier
662  for (unsigned int layer = 0; layer < 2 * rhtools_.lastLayer(); layer++) {
663  auto &clustersOnLayer = clusters_[layer];
664  unsigned int numberOfClusters = clustersOnLayer.x.size();
665  for (unsigned int i = 0; i < numberOfClusters; i++) {
666  // initialize clusterIndex
667  clustersOnLayer.clusterIndex[i] = -1;
668  bool isSeed =
669  (clustersOnLayer.delta[i] > criticalEtaPhiDistance_) && (clustersOnLayer.rho[i] >= criticalDensity_);
670  bool isOutlier = (clustersOnLayer.delta[i] > outlierMultiplier_ * criticalEtaPhiDistance_) &&
671  (clustersOnLayer.rho[i] < criticalDensity_);
672  if (isSeed) {
674  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
675  << "Found seed on Layer " << layer << " SOAidx: " << i << " assigned ClusterIdx: " << nTracksters;
676  }
677  clustersOnLayer.clusterIndex[i] = nTracksters++;
678  clustersOnLayer.isSeed[i] = true;
679  localStack.emplace_back(layer, i);
680  } else if (!isOutlier) {
681  auto [lyrIdx, soaIdx] = clustersOnLayer.nearestHigher[i];
683  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
684  << "Found follower on Layer " << layer << " SOAidx: " << i << " attached to cluster on layer: " << lyrIdx
685  << " SOAidx: " << soaIdx;
686  }
687  clusters_[lyrIdx].followers[soaIdx].emplace_back(layer, i);
688  } else {
690  edm::LogVerbatim("PatternRecogntionbyCLUE3D")
691  << "Found Outlier on Layer " << layer << " SOAidx: " << i << " with rho: " << clustersOnLayer.rho[i]
692  << " and delta: " << clustersOnLayer.delta[i];
693  }
694  }
695  }
696  }
697 
698  // Propagate cluster index
699  while (!localStack.empty()) {
700  auto [lyrIdx, soaIdx] = localStack.back();
701  auto &thisSeed = clusters_[lyrIdx].followers[soaIdx];
702  localStack.pop_back();
703 
704  // loop over followers
705  for (auto [follower_lyrIdx, follower_soaIdx] : thisSeed) {
706  // pass id to a follower
707  clusters_[follower_lyrIdx].clusterIndex[follower_soaIdx] = clusters_[lyrIdx].clusterIndex[soaIdx];
708  // push this follower to localStack
709  localStack.emplace_back(follower_lyrIdx, follower_soaIdx);
710  }
711  }
712  return nTracksters;
713 }
Log< level::Info, true > LogVerbatim
std::vector< ClustersOnLayer > clusters_
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int lastLayer(bool nose=false) const
Definition: RecHitTools.h:79
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 145 of file PatternRecognitionbyCLUE3D.cc.

References cms::cuda::assert(), ticl::assignPCAtoTracksters(), SplitLinear::begin, caloGeomToken_, dataset::end, ticl::PatternRecognitionAlgoBaseT< TILES >::Inputs::es, ticl::PatternRecognitionAlgoBaseT< TILES >::Inputs::ev, edm::EventAuxiliary::event(), edm::Event::eventAuxiliary(), validate-o2o-wbm::f, relativeConstraints::geom, edm::EventSetup::getData(), mps_fire::i, phase1PixelTopology::layer, ticl::PatternRecognitionAlgoBaseT< TILES >::Inputs::layerClusters, ticl::PatternRecognitionAlgoBaseT< TILES >::Inputs::layerClustersTime, ticl::PatternRecognitionAlgoBaseT< TILES >::Inputs::mask, SiStripPI::max, point, ticl::PatternRecognitionAlgoBaseT< TILES >::Inputs::regions, reset(), mathSSE::sqrt(), makeMuonMisalignmentScenario::sum_x, makeMuonMisalignmentScenario::sum_y, submitPVValidationJobs::t, ticl::PatternRecognitionAlgoBaseT< TILES >::Inputs::tiles, and findQualityFiles::v.

148  {
149  // Protect from events with no seeding regions
150  if (input.regions.empty())
151  return;
152 
153  const int eventNumber = input.ev.eventAuxiliary().event();
155  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "New Event";
156  }
157 
158  edm::EventSetup const &es = input.es;
160  rhtools_.setGeometry(geom);
161 
162  clusters_.clear();
163  clusters_.resize(2 * rhtools_.lastLayer(false));
164  std::vector<std::pair<int, int>> layerIdx2layerandSoa; //used everywhere also to propagate cluster masking
165 
166  layerIdx2layerandSoa.reserve(input.layerClusters.size());
167  unsigned int layerIdx = 0;
168  for (auto const &lc : input.layerClusters) {
169  if (input.mask[layerIdx] == 0.) {
171  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Skipping masked clustrer: " << layerIdx;
172  }
173  layerIdx2layerandSoa.emplace_back(-1, -1);
174  layerIdx++;
175  continue;
176  }
177  const auto firstHitDetId = lc.hitsAndFractions()[0].first;
178  int layer = rhtools_.getLayerWithOffset(firstHitDetId) - 1 +
179  rhtools_.lastLayer(false) * ((rhtools_.zside(firstHitDetId) + 1) >> 1);
180  assert(layer >= 0);
181 
182  layerIdx2layerandSoa.emplace_back(layer, clusters_[layer].x.size());
183  float sum_x = 0.;
184  float sum_y = 0.;
185  float sum_sqr_x = 0.;
186  float sum_sqr_y = 0.;
187  float ref_x = lc.x();
188  float ref_y = lc.y();
189  float invClsize = 1. / lc.hitsAndFractions().size();
190  for (auto const &hitsAndFractions : lc.hitsAndFractions()) {
191  auto const &point = rhtools_.getPosition(hitsAndFractions.first);
192  sum_x += point.x() - ref_x;
193  sum_sqr_x += (point.x() - ref_x) * (point.x() - ref_x);
194  sum_y += point.y() - ref_y;
195  sum_sqr_y += (point.y() - ref_y) * (point.y() - ref_y);
196  }
197  // The variance of X for X uniform in circle of radius R is R^2/4,
198  // therefore we multiply the sqrt(var) by 2 to have a rough estimate of the
199  // radius. On the other hand, while averaging the x and y radius, we would
200  // end up dividing by 2. Hence we omit the value here and in the average
201  // below, too.
202  float radius_x = sqrt((sum_sqr_x - (sum_x * sum_x) * invClsize) * invClsize);
203  float radius_y = sqrt((sum_sqr_y - (sum_y * sum_y) * invClsize) * invClsize);
204  clusters_[layer].x.emplace_back(lc.x());
205  clusters_[layer].y.emplace_back(lc.y());
206  clusters_[layer].radius.emplace_back(radius_x + radius_y);
207  clusters_[layer].eta.emplace_back(lc.eta());
208  clusters_[layer].phi.emplace_back(lc.phi());
209  clusters_[layer].cells.push_back(lc.hitsAndFractions().size());
210  clusters_[layer].energy.emplace_back(lc.energy());
211  clusters_[layer].isSeed.push_back(false);
212  clusters_[layer].clusterIndex.emplace_back(-1);
213  clusters_[layer].layerClusterOriginalIdx.emplace_back(layerIdx++);
214  clusters_[layer].nearestHigher.emplace_back(-1, -1);
215  clusters_[layer].rho.emplace_back(0.f);
216  clusters_[layer].delta.emplace_back(std::numeric_limits<float>::max());
217  }
218  for (unsigned int layer = 0; layer < clusters_.size(); layer++) {
219  clusters_[layer].followers.resize(clusters_[layer].x.size());
220  }
221 
222  auto lastLayerPerSide = (unsigned int)(rhtools_.lastLayer(false));
223  unsigned int maxLayer = 2 * lastLayerPerSide - 1;
224  std::vector<int> numberOfClustersPerLayer(maxLayer, 0);
225  for (unsigned int i = 0; i <= maxLayer; i++) {
226  calculateLocalDensity(input.tiles, i, layerIdx2layerandSoa);
227  }
228  for (unsigned int i = 0; i <= maxLayer; i++) {
229  calculateDistanceToHigher(input.tiles, i, layerIdx2layerandSoa);
230  }
231 
232  auto nTracksters = findAndAssignTracksters(input.tiles, layerIdx2layerandSoa);
234  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Reconstructed " << nTracksters << " tracksters" << std::endl;
235  dumpClusters(layerIdx2layerandSoa, eventNumber);
236  }
237 
238  // Build Trackster
239  result.resize(nTracksters);
240 
241  for (unsigned int layer = 0; layer < clusters_.size(); ++layer) {
242  const auto &thisLayer = clusters_[layer];
244  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Examining Layer: " << layer;
245  }
246  for (unsigned int lc = 0; lc < thisLayer.x.size(); ++lc) {
248  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Trackster " << thisLayer.clusterIndex[lc];
249  }
250  if (thisLayer.clusterIndex[lc] >= 0) {
252  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << " adding lcIdx: " << thisLayer.layerClusterOriginalIdx[lc];
253  }
254  result[thisLayer.clusterIndex[lc]].vertices().push_back(thisLayer.layerClusterOriginalIdx[lc]);
255  result[thisLayer.clusterIndex[lc]].vertex_multiplicity().push_back(1);
256  // loop over followers
257  for (auto [follower_lyrIdx, follower_soaIdx] : thisLayer.followers[lc]) {
258  std::array<unsigned int, 2> edge = {
259  {(unsigned int)thisLayer.layerClusterOriginalIdx[lc],
260  (unsigned int)clusters_[follower_lyrIdx].layerClusterOriginalIdx[follower_soaIdx]}};
261  result[thisLayer.clusterIndex[lc]].edges().push_back(edge);
262  }
263  }
264  }
265  }
266 
267  result.erase(
268  std::remove_if(std::begin(result),
269  std::end(result),
270  [&](auto const &v) { return static_cast<int>(v.vertices().size()) < minNumLayerCluster_; }),
271  result.end());
272  result.shrink_to_fit();
273 
275  input.layerClusters,
276  input.layerClustersTime,
277  rhtools_.getPositionLayer(rhtools_.lastLayerEE(false), false).z());
278 
279  // run energy regression and ID
280  energyRegressionAndID(input.layerClusters, result);
282  for (auto const &t : result) {
283  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Barycenter: " << t.barycenter();
284  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "LCs: " << t.vertices().size();
285  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Energy: " << t.raw_energy();
286  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << "Regressed: " << t.regressed_energy();
287  }
288  }
289 
290  // Dump Tracksters information
292  dumpTracksters(layerIdx2layerandSoa, eventNumber, result);
293  }
294 
295  // Reset internal clusters_ structure of array for next event
296  reset();
298  edm::LogVerbatim("PatternRecogntionbyCLUE3D") << std::endl;
299  }
300 }
Log< level::Info, true > LogVerbatim
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
void dumpTracksters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int, const std::vector< Trackster > &) const
int zside(const DetId &id) const
Definition: RecHitTools.cc:163
void calculateDistanceToHigher(const TILES &, const unsigned int layerId, const std::vector< std::pair< int, int >> &)
std::vector< ClustersOnLayer > clusters_
assert(be >=bs)
constexpr std::array< uint8_t, layerIndexSize > layer
static std::string const input
Definition: EdmProvDump.cc:47
tuple result
Definition: mps_fire.py:311
bool getData(T &iHolder) const
Definition: EventSetup.h:128
void assignPCAtoTracksters(std::vector< Trackster > &, const std::vector< reco::CaloCluster > &, const edm::ValueMap< std::pair< float, float >> &, double, bool energyWeight=true)
T sqrt(T t)
Definition: SSEVec.h:19
unsigned int lastLayer(bool nose=false) const
Definition: RecHitTools.h:79
int findAndAssignTracksters(const TILES &, const std::vector< std::pair< int, int >> &)
void calculateLocalDensity(const TILES &, const unsigned int layerId, const std::vector< std::pair< int, int >> &)
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:365
GlobalPoint getPositionLayer(int layer, bool nose=false) const
Definition: RecHitTools.cc:141
void dumpClusters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int) const
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:129
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
unsigned int lastLayerEE(bool nose=false) const
Definition: RecHitTools.h:75
string end
Definition: dataset.py:937
*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
void energyRegressionAndID(const std::vector< reco::CaloCluster > &layerClusters, std::vector< Trackster > &result)
template<typename TILES >
void ticl::PatternRecognitionbyCLUE3D< TILES >::reset ( void  )
inlineprivate

Definition at line 79 of file PatternRecognitionbyCLUE3D.h.

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

79  {
80  for (auto& c : clusters_) {
81  c.clear();
82  c.shrink_to_fit();
83  }
84  }
const edm::EventSetup & c
std::vector< ClustersOnLayer > clusters_

Member Data Documentation

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

Definition at line 96 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 97 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 101 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 99 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 100 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 98 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 105 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 108 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 110 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 115 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 109 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 106 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 107 of file PatternRecognitionbyCLUE3D.h.

template<typename TILES >
tensorflow::Session* ticl::PatternRecognitionbyCLUE3D< TILES >::eidSession_
private
template<typename TILES >
const std::vector<int> ticl::PatternRecognitionbyCLUE3D< TILES >::filter_on_categories_
private

Definition at line 104 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 103 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 102 of file PatternRecognitionbyCLUE3D.h.

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

Definition at line 112 of file PatternRecognitionbyCLUE3D.h.