ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTopoSplitterHashCluster Class Reference

#include <CaloTopoSplitterHashCluster.h>

Inheritance diagram for CaloTopoSplitterHashCluster:
Collaboration diagram for CaloTopoSplitterHashCluster:

Public Types

typedef pointer_list::pool_type pool_type

Public Member Functions

 CaloTopoSplitterHashCluster (pool_type &pool)
 ~CaloTopoSplitterHashCluster ()=default
const xAOD::CaloClustergetParentCluster () const
size_t getParentClusterIndex () const
void removeAll ()
void add (HashCell &hashCell)
void remove (const HashCell &hashCell)
void add (CaloTopoSplitterHashCluster &hashCluster)
float getEnergy ()
const HepGeom::Vector3D< double > & getCentroid ()
bool getContainsLocalMax () const
void setContainsLocalMax ()
float getMaxRatio () const
int size () const
iterator begin ()
iterator end ()
void add (CaloTopoTmpHashClusterBase &hashCluster)

Protected Types

typedef CxxUtils::pointer_list pointer_list

Protected Attributes

pointer_list m_members
float m_maxRatio

Private Types

typedef CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCellBase
typedef CaloTopoTmpHashCell< CaloTopoSplitterClusterCellHashCell

Private Member Functions

void calcEnergy ()
void calcCentroid ()

Private Attributes

const xAOD::CaloClusterm_parentCluster = nullptr
size_t m_parentClusterIndex = 0
float m_energy = 0
bool m_hasValidEnergy = false
bool m_containsLocalMax = false
std::optional< HepGeom::Vector3D< double > > m_centroid

Detailed Description

Definition at line 32 of file CaloTopoSplitterHashCluster.h.

Member Typedef Documentation

◆ Base

◆ HashCell

◆ pointer_list

Definition at line 32 of file CaloTopoTmpHashClusterBase.h.

◆ pool_type

Constructor & Destructor Documentation

◆ CaloTopoSplitterHashCluster()

CaloTopoSplitterHashCluster::CaloTopoSplitterHashCluster ( pool_type & pool)
inline

Definition at line 51 of file CaloTopoSplitterHashCluster.h.

52 : Base (pool)
53 {}
CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell > Base

◆ ~CaloTopoSplitterHashCluster()

CaloTopoSplitterHashCluster::~CaloTopoSplitterHashCluster ( )
default

Member Function Documentation

◆ add() [1/3]

void CaloTopoSplitterHashCluster::add ( CaloTopoSplitterHashCluster & hashCluster)

Definition at line 65 of file CaloTopoSplitterHashCluster.cxx.

67{
68 if ( !m_parentCluster) {
69 m_parentCluster = rClus.m_parentCluster;
70 m_parentClusterIndex = rClus.m_parentClusterIndex;
71 }
72
73 Base::add(rClus);
74 m_hasValidEnergy = false;
75 m_centroid.reset();
76}
const xAOD::CaloCluster * m_parentCluster
std::optional< HepGeom::Vector3D< double > > m_centroid

◆ add() [2/3]

void CaloTopoSplitterHashCluster::add ( HashCell & hashCell)

Definition at line 29 of file CaloTopoSplitterHashCluster.cxx.

30{
31 if ( !m_parentCluster ) {
32 const CaloTopoSplitterClusterCell* pCell = hashCell.getCaloTopoTmpClusterCell();
35 }
36
37 Base::add(hashCell);
38 m_hasValidEnergy = false;
39 m_centroid.reset();
40}
const xAOD::CaloCluster * getParentCluster() const

◆ add() [3/3]

◆ begin()

iterator CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::begin ( )
inlineinherited

Definition at line 90 of file CaloTopoTmpHashClusterBase.h.

91 {
92 return iterator (m_members.begin());
93 }

◆ calcCentroid()

void CaloTopoSplitterHashCluster::calcCentroid ( )
private

Definition at line 113 of file CaloTopoSplitterHashCluster.cxx.

114{
115 m_centroid.emplace(0,0,0);
116
117 if ( !m_members.empty() ) {
118 double thisAbsEng,absEng = 0;
119
120 for( iterator iter = begin(); iter != end(); ++iter)
121 {
122 CaloTopoSplitterClusterCell *pClusCell = *iter;
124 float myWeight = itrCell.weight();//pClusCell->getParentCluster()->getCellWeight(itrCell);
125 if ( pClusCell->getShared() ) {
126 if ( pClusCell->getCaloTopoTmpHashCluster() == this )
127 myWeight *= pClusCell->getSharedWeight();
128 else
129 myWeight *= (1.-pClusCell->getSharedWeight());
130 }
131
132 thisAbsEng = fabs(myWeight*itrCell->e());
133 absEng += thisAbsEng;
134 HepGeom::Vector3D<double> thisPos(itrCell->x(), itrCell->y(), itrCell->z());
135 m_centroid.value() += thisAbsEng*thisPos;
136 }
137 if ( absEng > 0 )
138 m_centroid.value() *= (1./absEng);
139 }
140}
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition CaloCell.h:333
float y() const
get y (through CaloDetDescrElement)
Definition CaloCell.h:436
float z() const
get z (through CaloDetDescrElement)
Definition CaloCell.h:443
float x() const
get x (through CaloDetDescrElement)
Definition CaloCell.h:429
const CaloTopoSplitterHashCluster * getCaloTopoTmpHashCluster() const
const xAOD::CaloCluster::cell_iterator & getCellIterator() const
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version)

◆ calcEnergy()

void CaloTopoSplitterHashCluster::calcEnergy ( )
private

Definition at line 92 of file CaloTopoSplitterHashCluster.cxx.

93{
94 if ( ! m_members.empty() ) {
95 m_energy = 0;
96 for( iterator iter=begin(); iter!= end(); ++iter)
97 {
98 CaloTopoSplitterClusterCell *pClusCell = *iter;
100 float myWeight = itrCell.weight();//pClusCell->getParentCluster()->getCellWeight(itrCell);
101 if ( pClusCell->getShared() ) {
102 if ( pClusCell->getCaloTopoTmpHashCluster() == this )
103 myWeight *= pClusCell->getSharedWeight();
104 else
105 myWeight *= (1.-pClusCell->getSharedWeight());
106 }
107 m_energy += myWeight*itrCell->e();
108 }
109 }
110 m_hasValidEnergy = true;
111}

◆ end()

iterator CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::end ( )
inlineinherited

Definition at line 95 of file CaloTopoTmpHashClusterBase.h.

96 {
97 return iterator (m_members.end());
98 }

◆ getCentroid()

const HepGeom::Vector3D< double > & CaloTopoSplitterHashCluster::getCentroid ( )

Definition at line 85 of file CaloTopoSplitterHashCluster.cxx.

86{
87 if ( !m_centroid)
88 this->calcCentroid();
89 return m_centroid.value();
90}

◆ getContainsLocalMax()

bool CaloTopoSplitterHashCluster::getContainsLocalMax ( ) const
inline

Definition at line 91 of file CaloTopoSplitterHashCluster.h.

◆ getEnergy()

float CaloTopoSplitterHashCluster::getEnergy ( )

Definition at line 78 of file CaloTopoSplitterHashCluster.cxx.

79{
80 if ( !m_hasValidEnergy)
81 this->calcEnergy();
82 return m_energy;
83}

◆ getMaxRatio()

float CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::getMaxRatio ( ) const
inlineinherited

◆ getParentCluster()

const xAOD::CaloCluster * CaloTopoSplitterHashCluster::getParentCluster ( ) const
inline

Definition at line 62 of file CaloTopoSplitterHashCluster.h.

63 {
64 return m_parentCluster;
65 }

◆ getParentClusterIndex()

size_t CaloTopoSplitterHashCluster::getParentClusterIndex ( ) const
inline

Definition at line 67 of file CaloTopoSplitterHashCluster.h.

68 {
70 }

◆ remove()

void CaloTopoSplitterHashCluster::remove ( const HashCell & hashCell)

Definition at line 42 of file CaloTopoSplitterHashCluster.cxx.

43{
44 const CaloTopoSplitterClusterCell* cell = hashCell.getCaloTopoTmpClusterCell();
45 {
47 std::find (m_members.begin(), m_members.end(), cell);
48 if (iter != m_members.end())
49 m_members.erase (iter);
50 }
51
52 float ratio = cell->getSignedRatio();
53 if ( ratio >= m_maxRatio ) {
54 for(iterator iter = begin(); iter!= end(); ++iter)
55 {
56 float myRatio = iter->getSignedRatio();
57 if ( iter == m_members.begin() || myRatio > m_maxRatio )
58 m_maxRatio = myRatio;
59 }
60 }
61 m_hasValidEnergy = false;
62 m_centroid.reset();
63}
Forward iterator over the list.

◆ removeAll()

void CaloTopoSplitterHashCluster::removeAll ( )
inline

◆ setContainsLocalMax()

void CaloTopoSplitterHashCluster::setContainsLocalMax ( )
inline

Definition at line 96 of file CaloTopoSplitterHashCluster.h.

97 {
98 m_containsLocalMax = true;
99 }

◆ size()

int CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::size ( ) const
inlineinherited

Definition at line 85 of file CaloTopoTmpHashClusterBase.h.

86 {
87 return m_members.size();
88 }

Member Data Documentation

◆ m_centroid

std::optional<HepGeom::Vector3D<double> > CaloTopoSplitterHashCluster::m_centroid
private

Definition at line 46 of file CaloTopoSplitterHashCluster.h.

◆ m_containsLocalMax

bool CaloTopoSplitterHashCluster::m_containsLocalMax = false
private

Definition at line 45 of file CaloTopoSplitterHashCluster.h.

◆ m_energy

float CaloTopoSplitterHashCluster::m_energy = 0
private

Definition at line 43 of file CaloTopoSplitterHashCluster.h.

◆ m_hasValidEnergy

bool CaloTopoSplitterHashCluster::m_hasValidEnergy = false
private

Definition at line 44 of file CaloTopoSplitterHashCluster.h.

◆ m_maxRatio

float CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::m_maxRatio
protectedinherited

Definition at line 39 of file CaloTopoTmpHashClusterBase.h.

◆ m_members

Definition at line 38 of file CaloTopoTmpHashClusterBase.h.

◆ m_parentCluster

const xAOD::CaloCluster* CaloTopoSplitterHashCluster::m_parentCluster = nullptr
private

Definition at line 41 of file CaloTopoSplitterHashCluster.h.

◆ m_parentClusterIndex

size_t CaloTopoSplitterHashCluster::m_parentClusterIndex = 0
private

Definition at line 42 of file CaloTopoSplitterHashCluster.h.


The documentation for this class was generated from the following files: