CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCalClusteringImpl Class Reference

#include <HGCalClusteringImpl.h>

Public Member Functions

void clusterizeDR (const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters)
 
void clusterizeDRNN (const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters, const HGCalTriggerGeometryBase &triggerGeometry)
 
void clusterizeNN (const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters, const HGCalTriggerGeometryBase &triggerGeometry)
 
void eventSetup (const edm::EventSetup &es)
 
 HGCalClusteringImpl (const edm::ParameterSet &conf)
 
bool isPertinent (const l1t::HGCalTriggerCell &tc, const l1t::HGCalCluster &clu, double distXY) const
 
void mergeClusters (l1t::HGCalCluster &main_cluster, const l1t::HGCalCluster &secondary_cluster) const
 
void NNKernel (const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &reshuffledTriggerCells, l1t::HGCalClusterBxCollection &clusters, const HGCalTriggerGeometryBase &triggerGeometry)
 

Private Member Functions

bool areTCneighbour (uint32_t detIDa, uint32_t detIDb, const HGCalTriggerGeometryBase &triggerGeometry)
 
void calibratePt (l1t::HGCalCluster &cluster)
 
void removeUnconnectedTCinCluster (l1t::HGCalCluster &cluster, const HGCalTriggerGeometryBase &triggerGeometry)
 
void triggerCellReshuffling (const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, std::array< std::vector< std::vector< edm::Ptr< l1t::HGCalTriggerCell >>>, kNSides_ > &reshuffledTriggerCells)
 

Private Attributes

bool applyLayerWeights_
 
double calibSF_
 
std::string clusteringAlgorithmType_
 
double dr_
 
std::vector< double > layerWeights_
 
double scintillatorSeedThreshold_
 
double scintillatorTriggerCellThreshold_
 
double siliconSeedThreshold_
 
double siliconTriggerCellThreshold_
 
HGCalTriggerTools triggerTools_
 

Static Private Attributes

static constexpr unsigned kNSides_ = 2
 

Detailed Description

Definition at line 17 of file HGCalClusteringImpl.h.

Constructor & Destructor Documentation

◆ HGCalClusteringImpl()

HGCalClusteringImpl::HGCalClusteringImpl ( const edm::ParameterSet conf)

Definition at line 8 of file HGCalClusteringImpl.cc.

9  : siliconSeedThreshold_(conf.getParameter<double>("seeding_threshold_silicon")),
10  siliconTriggerCellThreshold_(conf.getParameter<double>("clustering_threshold_silicon")),
11  scintillatorSeedThreshold_(conf.getParameter<double>("seeding_threshold_scintillator")),
12  scintillatorTriggerCellThreshold_(conf.getParameter<double>("clustering_threshold_scintillator")),
13  dr_(conf.getParameter<double>("dR_cluster")),
14  clusteringAlgorithmType_(conf.getParameter<string>("clusterType")),
15  calibSF_(conf.getParameter<double>("calibSF_cluster")),
16  layerWeights_(conf.getParameter<std::vector<double>>("layerWeights")),
17  applyLayerWeights_(conf.getParameter<bool>("applyLayerCalibration")) {
18  edm::LogInfo("HGCalClusterParameters") << "C2d Clustering Algorithm selected : " << clusteringAlgorithmType_;
19  edm::LogInfo("HGCalClusterParameters") << "C2d silicon seeding Thr: " << siliconSeedThreshold_;
20  edm::LogInfo("HGCalClusterParameters") << "C2d silicon clustering Thr: " << siliconTriggerCellThreshold_;
21  edm::LogInfo("HGCalClusterParameters") << "C2d scintillator seeding Thr: " << scintillatorSeedThreshold_;
22  edm::LogInfo("HGCalClusterParameters") << "C2d scintillator clustering Thr: " << scintillatorTriggerCellThreshold_;
23  edm::LogInfo("HGCalClusterParameters") << "C2d global calibration factor: " << calibSF_;
24 }

References calibSF_, clusteringAlgorithmType_, scintillatorSeedThreshold_, scintillatorTriggerCellThreshold_, siliconSeedThreshold_, and siliconTriggerCellThreshold_.

Member Function Documentation

◆ areTCneighbour()

bool HGCalClusteringImpl::areTCneighbour ( uint32_t  detIDa,
uint32_t  detIDb,
const HGCalTriggerGeometryBase triggerGeometry 
)
private

Definition at line 341 of file HGCalClusteringImpl.cc.

343  {
344  const auto neighbors = triggerGeometry.getNeighborsFromTriggerCell(detIDa);
345 
346  if (neighbors.find(detIDb) != neighbors.end())
347  return true;
348 
349  return false;
350 }

References HGCalTriggerGeometryBase::getNeighborsFromTriggerCell().

Referenced by clusterizeDRNN(), and removeUnconnectedTCinCluster().

◆ calibratePt()

void HGCalClusteringImpl::calibratePt ( l1t::HGCalCluster cluster)
private

Definition at line 396 of file HGCalClusteringImpl.cc.

396  {
397  double calibPt = 0.;
398 
399  if (applyLayerWeights_) {
400  unsigned layerN = triggerTools_.layerWithOffset(cluster.detId());
401 
402  if (layerWeights_.at(layerN) == 0.) {
403  throw cms::Exception("BadConfiguration")
404  << "2D cluster energy forced to 0 by calibration coefficients.\n"
405  << "The configuration should be changed. "
406  << "Discarded layers should be defined in hgcalTriggerGeometryESProducer.TriggerGeometry.DisconnectedLayers "
407  "and not with calibration coefficients = 0\n";
408  }
409 
410  calibPt = layerWeights_.at(layerN) * cluster.mipPt();
411 
412  }
413 
414  else {
415  calibPt = cluster.pt() * calibSF_;
416  }
417 
418  math::PtEtaPhiMLorentzVector calibP4(calibPt, cluster.eta(), cluster.phi(), 0.);
419 
420  cluster.setP4(calibP4);
421 }

References applyLayerWeights_, calibSF_, l1t::HGCalClusterT< C >::detId(), reco::LeafCandidate::eta(), Exception, layerWeights_, HGCalTriggerTools::layerWithOffset(), l1t::HGCalClusterT< C >::mipPt(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::setP4(), and triggerTools_.

Referenced by clusterizeDR(), clusterizeDRNN(), and NNKernel().

◆ clusterizeDR()

void HGCalClusteringImpl::clusterizeDR ( const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &  triggerCellsPtrs,
l1t::HGCalClusterBxCollection clusters 
)

Definition at line 42 of file HGCalClusteringImpl.cc.

43  {
44  bool isSeed[triggerCellsPtrs.size()];
45 
46  /* search for cluster seeds */
47  int itc(0);
48  for (std::vector<edm::Ptr<l1t::HGCalTriggerCell>>::const_iterator tc = triggerCellsPtrs.begin();
49  tc != triggerCellsPtrs.end();
50  ++tc, ++itc) {
51  double seedThreshold = ((*tc)->subdetId() == HGCHEB ? scintillatorSeedThreshold_ : siliconSeedThreshold_);
52  isSeed[itc] = ((*tc)->mipPt() > seedThreshold) ? true : false;
53  }
54 
55  /* clustering the TCs */
56  std::vector<l1t::HGCalCluster> clustersTmp;
57 
58  itc = 0;
59  for (std::vector<edm::Ptr<l1t::HGCalTriggerCell>>::const_iterator tc = triggerCellsPtrs.begin();
60  tc != triggerCellsPtrs.end();
61  ++tc, ++itc) {
63  if ((*tc)->mipPt() < threshold) {
64  continue;
65  }
66 
67  /*
68  searching for TC near the center of the cluster
69  ToBeFixed: if a tc is not a seed, but could be potencially be part of a cluster generated by a late seed,
70  the tc will not be clusterized
71  */
72 
73  double minDist = dr_;
74  int targetClu = -1;
75 
76  for (unsigned iclu = 0; iclu < clustersTmp.size(); iclu++) {
77  if (!this->isPertinent(**tc, clustersTmp.at(iclu), dr_))
78  continue;
79 
80  double d = clustersTmp.at(iclu).distance(**tc);
81  if (d < minDist) {
82  minDist = d;
83  targetClu = int(iclu);
84  }
85  }
86 
87  if (targetClu < 0 && isSeed[itc])
88  clustersTmp.emplace_back(*tc);
89  else if (targetClu >= 0)
90  clustersTmp.at(targetClu).addConstituent(*tc);
91  }
92 
93  /* store clusters in the persistent collection */
94  clusters.resize(0, clustersTmp.size());
95  for (unsigned i(0); i < clustersTmp.size(); ++i) {
96  calibratePt(clustersTmp.at(i));
97  clusters.set(0, i, clustersTmp.at(i));
98  }
99 }

References calibratePt(), bsc_activity_cfg::clusters, ztail::d, dr_, HGCHEB, mps_fire::i, createfilelist::int, isPertinent(), scintillatorSeedThreshold_, scintillatorTriggerCellThreshold_, UEAnalysisJets_cfi::seedThreshold, siliconSeedThreshold_, siliconTriggerCellThreshold_, and remoteMonitoring_LED_IterMethod_cfg::threshold.

◆ clusterizeDRNN()

void HGCalClusteringImpl::clusterizeDRNN ( const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &  triggerCellsPtrs,
l1t::HGCalClusterBxCollection clusters,
const HGCalTriggerGeometryBase triggerGeometry 
)

Definition at line 250 of file HGCalClusteringImpl.cc.

252  {
253  bool isSeed[triggerCellsPtrs.size()];
254  std::vector<unsigned> seedPositions;
255  seedPositions.reserve(triggerCellsPtrs.size());
256 
257  /* search for cluster seeds */
258  int itc(0);
259  for (std::vector<edm::Ptr<l1t::HGCalTriggerCell>>::const_iterator tc = triggerCellsPtrs.begin();
260  tc != triggerCellsPtrs.end();
261  ++tc, ++itc) {
262  double seedThreshold = ((*tc)->subdetId() == HGCHEB ? scintillatorSeedThreshold_ : siliconSeedThreshold_);
263 
264  /* decide if is a seed, if yes store the position into of triggerCellsPtrs */
265  isSeed[itc] = ((*tc)->mipPt() > seedThreshold) ? true : false;
266  if (isSeed[itc]) {
267  seedPositions.push_back(itc);
268 
269  /* remove tc from the seed vector if is a NN of an other seed*/
270  for (auto pos : seedPositions) {
271  if (((*tc)->position() - triggerCellsPtrs[pos]->position()).mag() < dr_) {
272  if (this->areTCneighbour((*tc)->detId(), triggerCellsPtrs[pos]->detId(), triggerGeometry)) {
273  isSeed[itc] = false;
274  seedPositions.pop_back();
275  }
276  }
277  }
278  }
279  }
280 
281  /* clustering the TCs */
282  std::vector<l1t::HGCalCluster> clustersTmp;
283 
284  // every seed generates a cluster
285  for (auto pos : seedPositions) {
286  clustersTmp.emplace_back(triggerCellsPtrs[pos]);
287  }
288 
289  /* add the tc to the clusters */
290  itc = 0;
291  for (std::vector<edm::Ptr<l1t::HGCalTriggerCell>>::const_iterator tc = triggerCellsPtrs.begin();
292  tc != triggerCellsPtrs.end();
293  ++tc, ++itc) {
294  /* get the correct threshold for the different part of the detector */
296 
297  /* continue if not passing the threshold */
298  if ((*tc)->mipPt() < threshold)
299  continue;
300  if (isSeed[itc])
301  continue; //No sharing of seeds between clusters (TBC)
302 
303  /* searching for TC near the centre of the cluster */
304  std::vector<unsigned> tcPertinentClusters;
305  unsigned iclu(0);
306 
307  for (const auto& clu : clustersTmp) {
308  if (this->isPertinent(**tc, clu, dr_)) {
309  tcPertinentClusters.push_back(iclu);
310  }
311  ++iclu;
312  }
313 
314  if (tcPertinentClusters.empty()) {
315  continue;
316  } else if (tcPertinentClusters.size() == 1) {
317  clustersTmp.at(tcPertinentClusters.at(0)).addConstituent(*tc);
318  } else {
319  /* calculate the fractions */
320  double totMipt = 0;
321  for (auto clu : tcPertinentClusters) {
322  totMipt += clustersTmp.at(clu).seedMipPt();
323  }
324 
325  for (auto clu : tcPertinentClusters) {
326  double seedMipt = clustersTmp.at(clu).seedMipPt();
327  clustersTmp.at(clu).addConstituent(*tc, true, seedMipt / totMipt);
328  }
329  }
330  }
331 
332  /* store clusters in the persistent collection */
333  clusters.resize(0, clustersTmp.size());
334  for (unsigned i(0); i < clustersTmp.size(); ++i) {
335  this->removeUnconnectedTCinCluster(clustersTmp.at(i), triggerGeometry);
336  calibratePt(clustersTmp.at(i));
337  clusters.set(0, i, clustersTmp.at(i));
338  }
339 }

References areTCneighbour(), calibratePt(), bsc_activity_cfg::clusters, dr_, HGCHEB, mps_fire::i, isPertinent(), mag(), removeUnconnectedTCinCluster(), scintillatorSeedThreshold_, scintillatorTriggerCellThreshold_, UEAnalysisJets_cfi::seedThreshold, siliconSeedThreshold_, siliconTriggerCellThreshold_, and remoteMonitoring_LED_IterMethod_cfg::threshold.

◆ clusterizeNN()

void HGCalClusteringImpl::clusterizeNN ( const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &  triggerCellsPtrs,
l1t::HGCalClusterBxCollection clusters,
const HGCalTriggerGeometryBase triggerGeometry 
)

Definition at line 232 of file HGCalClusteringImpl.cc.

234  {
235  std::array<std::vector<std::vector<edm::Ptr<l1t::HGCalTriggerCell>>>, kNSides_> reshuffledTriggerCells;
237  for (unsigned side = 0; side < kNSides_; side++) {
238  reshuffledTriggerCells[side].resize(layers);
239  }
240  triggerCellReshuffling(triggerCellsPtrs, reshuffledTriggerCells);
241 
242  for (unsigned iec = 0; iec < kNSides_; ++iec) {
243  for (unsigned il = 0; il < layers; ++il) {
244  NNKernel(reshuffledTriggerCells[iec][il], clusters, triggerGeometry);
245  }
246  }
247 }

References bsc_activity_cfg::clusters, ForwardEmpty, kNSides_, hgcalTopologyTester_cfi::layers, HGCalTriggerTools::layers(), NNKernel(), triggerCellReshuffling(), and triggerTools_.

◆ eventSetup()

void HGCalClusteringImpl::eventSetup ( const edm::EventSetup es)
inline

Definition at line 24 of file HGCalClusteringImpl.h.

References HGCalTriggerTools::eventSetup(), and triggerTools_.

◆ isPertinent()

bool HGCalClusteringImpl::isPertinent ( const l1t::HGCalTriggerCell tc,
const l1t::HGCalCluster clu,
double  distXY 
) const

Definition at line 27 of file HGCalClusteringImpl.cc.

29  {
30  DetId tcDetId(tc.detId());
31  DetId cluDetId(clu.detId());
32  if ((triggerTools_.layer(tcDetId) != triggerTools_.layer(cluDetId)) || (tcDetId.subdetId() != cluDetId.subdetId()) ||
33  (triggerTools_.zside(tcDetId) != triggerTools_.zside(cluDetId))) {
34  return false;
35  }
36  if (clu.distance((tc)) < distXY) {
37  return true;
38  }
39  return false;
40 }

References l1t::HGCalTriggerCell::detId(), l1t::HGCalClusterT< C >::detId(), l1t::HGCalClusterT< C >::distance(), HGCalTriggerTools::layer(), triggerTools_, and HGCalTriggerTools::zside().

Referenced by clusterizeDR(), and clusterizeDRNN().

◆ mergeClusters()

void HGCalClusteringImpl::mergeClusters ( l1t::HGCalCluster main_cluster,
const l1t::HGCalCluster secondary_cluster 
) const

Definition at line 117 of file HGCalClusteringImpl.cc.

118  {
119  const std::unordered_map<uint32_t, edm::Ptr<l1t::HGCalTriggerCell>>& pertinentTC = secondary_cluster.constituents();
120 
121  for (const auto& id_tc : pertinentTC) {
122  main_cluster.addConstituent(id_tc.second);
123  }
124 }

References l1t::HGCalClusterT< C >::addConstituent(), and l1t::HGCalClusterT< C >::constituents().

Referenced by NNKernel().

◆ NNKernel()

void HGCalClusteringImpl::NNKernel ( const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &  reshuffledTriggerCells,
l1t::HGCalClusterBxCollection clusters,
const HGCalTriggerGeometryBase triggerGeometry 
)

Definition at line 126 of file HGCalClusteringImpl.cc.

128  {
129  /* declaring the clusters vector */
130  std::vector<l1t::HGCalCluster> clustersTmp;
131 
132  // map TC id -> cluster index in clustersTmp
133  std::unordered_map<uint32_t, unsigned> cluNNmap;
134 
135  /* loop over the trigger-cells */
136  for (const auto& tc_ptr : reshuffledTriggerCells) {
137  double threshold =
139  if (tc_ptr->mipPt() < threshold) {
140  continue;
141  }
142 
143  // Check if the neighbors of that TC are already included in a cluster
144  // If this is the case, add the TC to the first (arbitrary) neighbor cluster
145  // Otherwise create a new cluster
146  bool createNewC2d(true);
147  const auto neighbors = triggerGeometry.getNeighborsFromTriggerCell(tc_ptr->detId());
148  for (const auto neighbor : neighbors) {
149  auto tc_cluster_itr = cluNNmap.find(neighbor);
150  if (tc_cluster_itr != cluNNmap.end()) {
151  createNewC2d = false;
152  if (tc_cluster_itr->second < clustersTmp.size()) {
153  clustersTmp.at(tc_cluster_itr->second).addConstituent(tc_ptr);
154  // map TC id to the existing cluster
155  cluNNmap.emplace(tc_ptr->detId(), tc_cluster_itr->second);
156  } else {
157  throw cms::Exception("HGCTriggerUnexpected")
158  << "Trying to access a non-existing cluster. But it should exist...\n";
159  }
160  break;
161  }
162  }
163  if (createNewC2d) {
164  clustersTmp.emplace_back(tc_ptr);
165  clustersTmp.back().setValid(true);
166  // map TC id to the cluster index (size - 1)
167  cluNNmap.emplace(tc_ptr->detId(), clustersTmp.size() - 1);
168  }
169  }
170 
171  /* declaring the vector with possible clusters merged */
172  // Merge neighbor clusters together
173  for (auto& cluster1 : clustersTmp) {
174  // If the cluster has been merged into another one, skip it
175  if (!cluster1.valid())
176  continue;
177  // Fill a set containing all TC included in the clusters
178  // as well as all neighbor TC
179  std::unordered_set<uint32_t> cluTcSet;
180  for (const auto& tc_clu1 : cluster1.constituents()) {
181  cluTcSet.insert(tc_clu1.second->detId());
182  const auto neighbors = triggerGeometry.getNeighborsFromTriggerCell(tc_clu1.second->detId());
183  for (const auto neighbor : neighbors) {
184  cluTcSet.insert(neighbor);
185  }
186  }
187 
188  for (auto& cluster2 : clustersTmp) {
189  // If the cluster has been merged into another one, skip it
190  if (cluster1.detId() == cluster2.detId())
191  continue;
192  if (!cluster2.valid())
193  continue;
194  // Check if the TC in clu2 are in clu1 or its neighbors
195  // If yes, merge the second cluster into the first one
196  for (const auto& tc_clu2 : cluster2.constituents()) {
197  if (cluTcSet.find(tc_clu2.second->detId()) != cluTcSet.end()) {
198  mergeClusters(cluster1, cluster2);
199  cluTcSet.insert(tc_clu2.second->detId());
200  const auto neighbors = triggerGeometry.getNeighborsFromTriggerCell(tc_clu2.second->detId());
201  for (const auto neighbor : neighbors) {
202  cluTcSet.insert(neighbor);
203  }
204  cluster2.setValid(false);
205  break;
206  }
207  }
208  }
209  }
210 
211  /* store clusters in the persistent collection */
212  // only if the cluster contain a TC above the seed threshold
213  for (auto& cluster : clustersTmp) {
214  if (!cluster.valid())
215  continue;
216  bool saveInCollection(false);
217  for (const auto& id_tc : cluster.constituents()) {
218  /* threshold in transverse-mip */
219  double seedThreshold = (id_tc.second->subdetId() == HGCHEB ? scintillatorSeedThreshold_ : siliconSeedThreshold_);
220  if (id_tc.second->mipPt() > seedThreshold) {
221  saveInCollection = true;
222  break;
223  }
224  }
225  if (saveInCollection) {
226  calibratePt(cluster);
227  clusters.push_back(0, cluster);
228  }
229  }
230 }

References calibratePt(), bsc_activity_cfg::clusters, Exception, HGCalTriggerGeometryBase::getNeighborsFromTriggerCell(), HGCHEB, mergeClusters(), scintillatorSeedThreshold_, scintillatorTriggerCellThreshold_, UEAnalysisJets_cfi::seedThreshold, siliconSeedThreshold_, siliconTriggerCellThreshold_, and remoteMonitoring_LED_IterMethod_cfg::threshold.

Referenced by clusterizeNN().

◆ removeUnconnectedTCinCluster()

void HGCalClusteringImpl::removeUnconnectedTCinCluster ( l1t::HGCalCluster cluster,
const HGCalTriggerGeometryBase triggerGeometry 
)
private

Definition at line 352 of file HGCalClusteringImpl.cc.

353  {
354  /* get the constituents and the centre of the seed tc (considered as the first of the constituents) */
355  const std::unordered_map<uint32_t, edm::Ptr<l1t::HGCalTriggerCell>>& constituents = cluster.constituents();
356  Basic3DVector<float> seedCentre(constituents.at(cluster.detId())->position());
357 
358  /* distances from the seed */
359  vector<pair<edm::Ptr<l1t::HGCalTriggerCell>, float>> distances;
360  for (const auto& id_tc : constituents) {
361  Basic3DVector<float> tcCentre(id_tc.second->position());
362  float distance = (seedCentre - tcCentre).mag();
363  distances.push_back(pair<edm::Ptr<l1t::HGCalTriggerCell>, float>(id_tc.second, distance));
364  }
365 
366  /* sorting (needed in order to be sure that we are skipping any tc) */
367  /* FIXME: better sorting needed!!! */
368  std::sort(distances.begin(), distances.end(), distanceSorter);
369 
370  /* checking if the tc is connected to the seed */
371  bool toRemove[constituents.size()];
372  toRemove[0] = false; // this is the seed
373  for (unsigned itc = 1; itc < distances.size(); itc++) {
374  /* get the tc under study */
375  toRemove[itc] = true;
376  const edm::Ptr<l1t::HGCalTriggerCell>& tcToStudy = distances[itc].first;
377 
378  /* compare with the tc in the cluster */
379  for (unsigned itc_ref = 0; itc_ref < itc; itc_ref++) {
380  if (!toRemove[itc_ref]) {
381  if (areTCneighbour(tcToStudy->detId(), distances.at(itc_ref).first->detId(), triggerGeometry)) {
382  toRemove[itc] = false;
383  break;
384  }
385  }
386  }
387  }
388 
389  /* remove the unconnected TCs */
390  for (unsigned i = 0; i < distances.size(); i++) {
391  if (toRemove[i])
392  cluster.removeConstituent(distances.at(i).first);
393  }
394 }

References areTCneighbour(), l1t::HGCalClusterT< C >::constituents(), l1t::HGCalTriggerCell::detId(), l1t::HGCalClusterT< C >::detId(), HLT_2018_cff::distance, distanceSorter(), mps_fire::i, mag(), position, and l1t::HGCalClusterT< C >::removeConstituent().

Referenced by clusterizeDRNN().

◆ triggerCellReshuffling()

void HGCalClusteringImpl::triggerCellReshuffling ( const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &  triggerCellsPtrs,
std::array< std::vector< std::vector< edm::Ptr< l1t::HGCalTriggerCell >>>, kNSides_ > &  reshuffledTriggerCells 
)
private

Definition at line 104 of file HGCalClusteringImpl.cc.

106  {
107  for (const auto& tc : triggerCellsPtrs) {
108  DetId tcDetId(tc->detId());
109  int endcap = triggerTools_.zside(tcDetId) == -1 ? 0 : 1;
110  unsigned layer = triggerTools_.layerWithOffset(tc->detId());
111 
112  reshuffledTriggerCells[endcap][layer - 1].emplace_back(tc);
113  }
114 }

References makeMuonMisalignmentScenario::endcap, HGCalTriggerTools::layerWithOffset(), triggerTools_, and HGCalTriggerTools::zside().

Referenced by clusterizeNN().

Member Data Documentation

◆ applyLayerWeights_

bool HGCalClusteringImpl::applyLayerWeights_
private

Definition at line 57 of file HGCalClusteringImpl.h.

Referenced by calibratePt().

◆ calibSF_

double HGCalClusteringImpl::calibSF_
private

Definition at line 55 of file HGCalClusteringImpl.h.

Referenced by calibratePt(), and HGCalClusteringImpl().

◆ clusteringAlgorithmType_

std::string HGCalClusteringImpl::clusteringAlgorithmType_
private

Definition at line 54 of file HGCalClusteringImpl.h.

Referenced by HGCalClusteringImpl().

◆ dr_

double HGCalClusteringImpl::dr_
private

Definition at line 53 of file HGCalClusteringImpl.h.

Referenced by clusterizeDR(), and clusterizeDRNN().

◆ kNSides_

constexpr unsigned HGCalClusteringImpl::kNSides_ = 2
staticconstexprprivate

Definition at line 19 of file HGCalClusteringImpl.h.

Referenced by clusterizeNN().

◆ layerWeights_

std::vector<double> HGCalClusteringImpl::layerWeights_
private

Definition at line 56 of file HGCalClusteringImpl.h.

Referenced by calibratePt().

◆ scintillatorSeedThreshold_

double HGCalClusteringImpl::scintillatorSeedThreshold_
private

Definition at line 51 of file HGCalClusteringImpl.h.

Referenced by clusterizeDR(), clusterizeDRNN(), HGCalClusteringImpl(), and NNKernel().

◆ scintillatorTriggerCellThreshold_

double HGCalClusteringImpl::scintillatorTriggerCellThreshold_
private

Definition at line 52 of file HGCalClusteringImpl.h.

Referenced by clusterizeDR(), clusterizeDRNN(), HGCalClusteringImpl(), and NNKernel().

◆ siliconSeedThreshold_

double HGCalClusteringImpl::siliconSeedThreshold_
private

Definition at line 49 of file HGCalClusteringImpl.h.

Referenced by clusterizeDR(), clusterizeDRNN(), HGCalClusteringImpl(), and NNKernel().

◆ siliconTriggerCellThreshold_

double HGCalClusteringImpl::siliconTriggerCellThreshold_
private

Definition at line 50 of file HGCalClusteringImpl.h.

Referenced by clusterizeDR(), clusterizeDRNN(), HGCalClusteringImpl(), and NNKernel().

◆ triggerTools_

HGCalTriggerTools HGCalClusteringImpl::triggerTools_
private
HGCalClusteringImpl::NNKernel
void NNKernel(const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &reshuffledTriggerCells, l1t::HGCalClusterBxCollection &clusters, const HGCalTriggerGeometryBase &triggerGeometry)
Definition: HGCalClusteringImpl.cc:126
HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
HGCalTriggerGeometryBase::getNeighborsFromTriggerCell
virtual geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const =0
mps_fire.i
i
Definition: mps_fire.py:355
HGCalClusteringImpl::siliconTriggerCellThreshold_
double siliconTriggerCellThreshold_
Definition: HGCalClusteringImpl.h:50
HGCalClusteringImpl::isPertinent
bool isPertinent(const l1t::HGCalTriggerCell &tc, const l1t::HGCalCluster &clu, double distXY) const
Definition: HGCalClusteringImpl.cc:27
ForwardEmpty
Definition: ForwardSubdetector.h:5
l1t::HGCalClusterT::mipPt
double mipPt() const
Definition: HGCalClusterT.h:92
pos
Definition: PixelAliasList.h:18
edm::LogInfo
Definition: MessageLogger.h:254
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
HGCalClusteringImpl::siliconSeedThreshold_
double siliconSeedThreshold_
Definition: HGCalClusteringImpl.h:49
distanceSorter
bool distanceSorter(pair< edm::Ptr< l1t::HGCalTriggerCell >, float > i, pair< edm::Ptr< l1t::HGCalTriggerCell >, float > j)
Definition: HGCalClusteringImpl.h:13
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
HGCalClusteringImpl::scintillatorTriggerCellThreshold_
double scintillatorTriggerCellThreshold_
Definition: HGCalClusteringImpl.h:52
HGCalClusteringImpl::applyLayerWeights_
bool applyLayerWeights_
Definition: HGCalClusteringImpl.h:57
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
l1t::HGCalClusterT::detId
uint32_t detId() const
Definition: HGCalClusterT.h:94
DetId
Definition: DetId.h:17
HGCalClusteringImpl::calibSF_
double calibSF_
Definition: HGCalClusteringImpl.h:55
HGCalClusteringImpl::calibratePt
void calibratePt(l1t::HGCalCluster &cluster)
Definition: HGCalClusteringImpl.cc:396
l1t::HGCalClusterT::removeConstituent
void removeConstituent(const edm::Ptr< C > &c, bool updateCentre=true)
Definition: HGCalClusterT.h:74
HGCalClusteringImpl::mergeClusters
void mergeClusters(l1t::HGCalCluster &main_cluster, const l1t::HGCalCluster &secondary_cluster) const
Definition: HGCalClusteringImpl.cc:117
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
HGCalTriggerTools::zside
int zside(const DetId &) const
Definition: HGCalTriggerTools.cc:210
l1t::HGCalClusterT::constituents
const std::unordered_map< uint32_t, edm::Ptr< C > > & constituents() const
Definition: HGCalClusterT.h:51
HGCalClusteringImpl::removeUnconnectedTCinCluster
void removeUnconnectedTCinCluster(l1t::HGCalCluster &cluster, const HGCalTriggerGeometryBase &triggerGeometry)
Definition: HGCalClusteringImpl.cc:352
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
l1t::HGCalTriggerCell::detId
uint32_t detId() const
Definition: HGCalTriggerCell.h:25
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
HGCalClusteringImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalClusteringImpl.h:58
HGCalClusteringImpl::areTCneighbour
bool areTCneighbour(uint32_t detIDa, uint32_t detIDb, const HGCalTriggerGeometryBase &triggerGeometry)
Definition: HGCalClusteringImpl.cc:341
l1t::HGCalClusterT::distance
double distance(const l1t::HGCalTriggerCell &tc) const
Definition: HGCalClusterT.h:99
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
HGCalTriggerTools::layer
unsigned layer(const DetId &) const
Definition: HGCalTriggerTools.cc:111
createfilelist.int
int
Definition: createfilelist.py:10
HGCalClusteringImpl::kNSides_
static constexpr unsigned kNSides_
Definition: HGCalClusteringImpl.h:19
HGCalTriggerTools::layers
unsigned layers(ForwardSubdetector type) const
Definition: HGCalTriggerTools.cc:65
l1t::HGCalClusterT::addConstituent
void addConstituent(const edm::Ptr< C > &c, bool updateCentre=true, float fraction=1.)
Definition: HGCalClusterT.h:56
HGCalClusteringImpl::clusteringAlgorithmType_
std::string clusteringAlgorithmType_
Definition: HGCalClusteringImpl.h:54
edm::Ptr
Definition: AssociationVector.h:31
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
Exception
Definition: hltDiff.cc:246
ztail.d
d
Definition: ztail.py:151
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
HGCalClusteringImpl::triggerCellReshuffling
void triggerCellReshuffling(const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, std::array< std::vector< std::vector< edm::Ptr< l1t::HGCalTriggerCell >>>, kNSides_ > &reshuffledTriggerCells)
Definition: HGCalClusteringImpl.cc:104
HGCalClusteringImpl::scintillatorSeedThreshold_
double scintillatorSeedThreshold_
Definition: HGCalClusteringImpl.h:51
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
HGCalClusteringImpl::layerWeights_
std::vector< double > layerWeights_
Definition: HGCalClusteringImpl.h:56
UEAnalysisJets_cfi.seedThreshold
seedThreshold
Definition: UEAnalysisJets_cfi.py:8
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
Basic3DVector< float >
HGCHEB
Definition: ForwardSubdetector.h:10
HGCalClusteringImpl::dr_
double dr_
Definition: HGCalClusteringImpl.h:53