ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Gep::BasicGepClusterMaker Class Reference

#include <BasicGepClusterMaker.h>

Inheritance diagram for Gep::BasicGepClusterMaker:
Collaboration diagram for Gep::BasicGepClusterMaker:

Public Member Functions

 BasicGepClusterMaker ()=default
 
 ~BasicGepClusterMaker ()=default
 
std::vector< Gep::ClustermakeClusters (const pGepCellMap &) const override
 
std::string getName () const override
 

Private Member Functions

bool isSeedCell (const Gep::GepCaloCell &cell, const std::vector< unsigned int > &seenSeedCells) const
 
bool isInAllowedSampling (int sampling, const std::vector< int > &list_of_samplings) const
 
bool isNewCell (unsigned int id, const std::vector< unsigned int > &seenCells) const
 
std::vector< Gep::GepCaloCellclusterFromCells (const Gep::GepCaloCell &seed, const pGepCellMap &, std::vector< unsigned int > &seenSeedCells) const
 
Gep::Cluster getClusterFromListOfCells (const std::vector< Gep::GepCaloCell > &cells) const
 

Private Attributes

const float m_seed_threshold = 4.0
 
const float m_clustering_threshold = 2.0
 
const int m_max_shells = 9999
 
const std::vector< int > m_disallowed_seed_samplings = {}
 
const std::vector< int > m_disallowed_clustering_samplings = {}
 

Detailed Description

Definition at line 14 of file BasicGepClusterMaker.h.

Constructor & Destructor Documentation

◆ BasicGepClusterMaker()

Gep::BasicGepClusterMaker::BasicGepClusterMaker ( )
default

◆ ~BasicGepClusterMaker()

Gep::BasicGepClusterMaker::~BasicGepClusterMaker ( )
default

Member Function Documentation

◆ clusterFromCells()

std::vector< Gep::GepCaloCell > Gep::BasicGepClusterMaker::clusterFromCells ( const Gep::GepCaloCell seed,
const pGepCellMap caloCellsMap,
std::vector< unsigned int > &  seenSeedCells 
) const
private

Definition at line 64 of file BasicGepClusterMaker.cxx.

65  {
66 
67  std::vector<Gep::GepCaloCell> v_clusterCells;
68 
69  std::vector<Gep::GepCaloCell> cellsNextLayer, cellsThisLayer;
70  std::vector<unsigned int> seenCells;
71 
72  // Fill seed into supporting vectors
73  v_clusterCells.push_back(seed);
74  cellsNextLayer.push_back(seed);
75  seenCells.push_back(seed.id);
76  seenSeedCells.push_back(seed.id);
77 
78  int i_shell = 1;
79 
80  while (!cellsNextLayer.empty() && i_shell <= m_max_shells) {
81 
82  cellsThisLayer.swap(cellsNextLayer);
83  cellsNextLayer.clear();
84  ++i_shell;
85 
86  // Loop over all cells in this shell
87  for (unsigned int i_cell = 0; i_cell < cellsThisLayer.size(); ++i_cell) {
88 
89  // Go through list of neighbouring cells and check whether they are part of the cluster
90  for (unsigned int i_neighbour = 0; i_neighbour < (cellsThisLayer[i_cell]).neighbours.size(); ++i_neighbour) {
91 
92  // Check whether this neighbouring cell was sent to the GEP
93  auto const& nghbr_itr = caloCellsMap->find((cellsThisLayer[i_cell]).neighbours[i_neighbour]);
94  if (nghbr_itr == caloCellsMap->end()) continue;
95 
96  Gep::GepCaloCell neighbour = nghbr_itr->second;
97 
98  // reject if bad cell
99  if (neighbour.isBadCell()) continue;
100 
101  // Reject if cell is not above clustering threshold
102  if (neighbour.sigma < m_clustering_threshold) continue;
103 
104  // Reject if cell was already considered
105  if (!isNewCell(neighbour.id, seenCells)) continue;
106 
107  // Ignore cells in disallowed samplings
109 
110  seenCells.push_back(neighbour.id);
111  cellsNextLayer.push_back(neighbour);
112  v_clusterCells.push_back(neighbour);
113 
114  // If the cell is another seed cell, we write it into the list of seen seed cells to not reconstruct this cluster again
115  if (neighbour.sigma > m_seed_threshold) seenSeedCells.push_back(neighbour.id);
116  }
117  }
118  cellsThisLayer.clear();
119  }
120 
121  return v_clusterCells;
122 }

◆ getClusterFromListOfCells()

Gep::Cluster Gep::BasicGepClusterMaker::getClusterFromListOfCells ( const std::vector< Gep::GepCaloCell > &  cells) const
private

Definition at line 125 of file BasicGepClusterMaker.cxx.

125  {
126 
127  Gep::Cluster cluster;
128  std::vector<unsigned int> v_cellIDs;
129 
130  TLorentzVector tlv_cluster;
131  for (unsigned int i_cell = 0; i_cell < cells.size(); ++i_cell) {
132  TLorentzVector cell;
133  cell.SetPtEtaPhiE(cells[i_cell].et, cells[i_cell].eta, cells[i_cell].phi, cells[i_cell].et*std::cosh(cells[i_cell].eta));
134 
135  tlv_cluster += cell;
136 
137  v_cellIDs.push_back(cells[i_cell].id);
138  }
139 
140  cluster.ncells = cells.size();
141  cluster.time = cells[0].time; // Take time of seed cell
142  cluster.cell_id = std::move(v_cellIDs);
143  cluster.setEtEtaPhi(tlv_cluster.Et(), tlv_cluster.Eta(), tlv_cluster.Phi());
144 
145  return cluster;
146 }

◆ getName()

std::string Gep::BasicGepClusterMaker::getName ( ) const
overridevirtual

Implements Gep::IClusterMaker.

Definition at line 149 of file BasicGepClusterMaker.cxx.

149  {
150  return "GEPBasic";
151 }

◆ isInAllowedSampling()

bool Gep::BasicGepClusterMaker::isInAllowedSampling ( int  sampling,
const std::vector< int > &  list_of_samplings 
) const
private

Definition at line 44 of file BasicGepClusterMaker.cxx.

44  {
45 
46  for (unsigned int i = 0; i < list_of_samplings.size(); ++i) {
47  if (list_of_samplings[i] == sampling) return false;
48  }
49  return true;
50 }

◆ isNewCell()

bool Gep::BasicGepClusterMaker::isNewCell ( unsigned int  id,
const std::vector< unsigned int > &  seenCells 
) const
private

Definition at line 53 of file BasicGepClusterMaker.cxx.

53  {
54 
55  for (unsigned int i = 0; i < seenCells.size(); ++i) {
56  if (id == seenCells[i]) return false;
57  }
58 
59  return true;
60 }

◆ isSeedCell()

bool Gep::BasicGepClusterMaker::isSeedCell ( const Gep::GepCaloCell cell,
const std::vector< unsigned int > &  seenSeedCells 
) const
private

Definition at line 33 of file BasicGepClusterMaker.cxx.

33  {
34 
35  if (cell.isBadCell()) return false;
36  if (cell.sigma < m_seed_threshold) return false;
37  if (!isNewCell(cell.id, seenSeedCells)) return false;
38  if (!isInAllowedSampling(cell.sampling, m_disallowed_seed_samplings)) return false;
39 
40  return true;
41 }

◆ makeClusters()

std::vector< Gep::Cluster > Gep::BasicGepClusterMaker::makeClusters ( const pGepCellMap caloCellsMap) const
overridevirtual

Implements Gep::IClusterMaker.

Definition at line 8 of file BasicGepClusterMaker.cxx.

8  {
9 
10  std::vector<Gep::Cluster> clusters;
11 
12  // Loop over all cells
13  std::vector<unsigned int> seenSeedCells;
14  for (auto const& cell_itr : *caloCellsMap) {
15 
16  // Select only seed cells
17  if (!isSeedCell(cell_itr.second, seenSeedCells)) continue;
18 
19  // Clustering
20  std::vector<Gep::GepCaloCell> cluster_cells = clusterFromCells(cell_itr.second, caloCellsMap, seenSeedCells);
21 
22  Gep::Cluster cluster = getClusterFromListOfCells(cluster_cells);
23  clusters.push_back(cluster);
24  }
25 
26  // Order topo clusters according to their Et
27  std::sort(clusters.begin(), clusters.end(),[](const auto &c1, const auto &c2) {return c1.et() > c2.et();});
28 
29  return clusters;
30 }

Member Data Documentation

◆ m_clustering_threshold

const float Gep::BasicGepClusterMaker::m_clustering_threshold = 2.0
private

Definition at line 29 of file BasicGepClusterMaker.h.

◆ m_disallowed_clustering_samplings

const std::vector<int> Gep::BasicGepClusterMaker::m_disallowed_clustering_samplings = {}
private

Definition at line 33 of file BasicGepClusterMaker.h.

◆ m_disallowed_seed_samplings

const std::vector<int> Gep::BasicGepClusterMaker::m_disallowed_seed_samplings = {}
private

Definition at line 32 of file BasicGepClusterMaker.h.

◆ m_max_shells

const int Gep::BasicGepClusterMaker::m_max_shells = 9999
private

Definition at line 30 of file BasicGepClusterMaker.h.

◆ m_seed_threshold

const float Gep::BasicGepClusterMaker::m_seed_threshold = 4.0
private

Definition at line 28 of file BasicGepClusterMaker.h.


The documentation for this class was generated from the following files:
Gep::GepCaloCell::sigma
float sigma
Definition: GepCaloCell.h:22
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:281
et
Extra patterns decribing particle interation process.
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
Gep::GepCaloCell::isBadCell
bool isBadCell() const
Definition: GepCaloCell.h:59
Gep::Cluster::setEtEtaPhi
void setEtEtaPhi(double et, double eta, double phi)
Definition: Trigger/TrigT1/TrigGepPerf/src/Cluster.h:28
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
Gep::Cluster::ncells
int ncells
Definition: Trigger/TrigT1/TrigGepPerf/src/Cluster.h:33
extractSporadic.c1
c1
Definition: extractSporadic.py:133
Gep::BasicGepClusterMaker::m_clustering_threshold
const float m_clustering_threshold
Definition: BasicGepClusterMaker.h:29
Gep::Cluster
Definition: Trigger/TrigT1/TrigGepPerf/src/Cluster.h:13
Gep::GepCaloCell::sampling
unsigned int sampling
Definition: GepCaloCell.h:49
Gep::BasicGepClusterMaker::clusterFromCells
std::vector< Gep::GepCaloCell > clusterFromCells(const Gep::GepCaloCell &seed, const pGepCellMap &, std::vector< unsigned int > &seenSeedCells) const
Definition: BasicGepClusterMaker.cxx:64
Gep::BasicGepClusterMaker::m_disallowed_clustering_samplings
const std::vector< int > m_disallowed_clustering_samplings
Definition: BasicGepClusterMaker.h:33
Gep::BasicGepClusterMaker::isInAllowedSampling
bool isInAllowedSampling(int sampling, const std::vector< int > &list_of_samplings) const
Definition: BasicGepClusterMaker.cxx:44
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
lumiFormat.i
int i
Definition: lumiFormat.py:85
Gep::GepCaloCell::id
unsigned int id
Definition: GepCaloCell.h:50
Gep::Cluster::cell_id
std::vector< unsigned int > cell_id
Definition: Trigger/TrigT1/TrigGepPerf/src/Cluster.h:36
Gep::GepCaloCell
Definition: GepCaloCell.h:13
Gep::BasicGepClusterMaker::m_max_shells
const int m_max_shells
Definition: BasicGepClusterMaker.h:30
Gep::BasicGepClusterMaker::m_seed_threshold
const float m_seed_threshold
Definition: BasicGepClusterMaker.h:28
Gep::BasicGepClusterMaker::isNewCell
bool isNewCell(unsigned int id, const std::vector< unsigned int > &seenCells) const
Definition: BasicGepClusterMaker.cxx:53
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
Gep::BasicGepClusterMaker::m_disallowed_seed_samplings
const std::vector< int > m_disallowed_seed_samplings
Definition: BasicGepClusterMaker.h:32
Gep::BasicGepClusterMaker::isSeedCell
bool isSeedCell(const Gep::GepCaloCell &cell, const std::vector< unsigned int > &seenSeedCells) const
Definition: BasicGepClusterMaker.cxx:33
Gep::BasicGepClusterMaker::getClusterFromListOfCells
Gep::Cluster getClusterFromListOfCells(const std::vector< Gep::GepCaloCell > &cells) const
Definition: BasicGepClusterMaker.cxx:125
Gep::Cluster::time
float time
Definition: Trigger/TrigT1/TrigGepPerf/src/Cluster.h:34