ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloRec
src
CaloTopoTmpHashClusterBase.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//-----------------------------------------------------------------------
6
// File and Version Information:
7
//
8
// Description: base class for temporary Cluster Container for
9
// topological cluster making tools
10
//
11
// Environment:
12
// Software developed for the ATLAS Detector at the CERN LHC
13
//
14
// Author List:
15
// Sven Menke
16
//
17
//-----------------------------------------------------------------------
18
19
#ifndef CALOTOPOTMPHASHCLUSTERBASE_H
20
#define CALOTOPOTMPHASHCLUSTERBASE_H
21
22
#include <vector>
23
#include "
CaloTopoTmpHashCell.h
"
24
#include "
CxxUtils/pointer_list.h
"
25
26
27
template
<
class
T>
28
class
CaloTopoTmpHashClusterBase
29
{
30
protected
:
31
typedef
CaloTopoTmpHashCell<T>
HashCell
;
32
typedef
CxxUtils::pointer_list<>
pointer_list
;
33
34
// Friends
35
36
// Data members
37
38
pointer_list
m_members
;
39
float
m_maxRatio
;
40
// Helper functions
41
42
public
:
43
typedef
pointer_list::pool_type
pool_type
;
44
45
class
iterator
46
:
public
pointer_list::iterator
47
{
48
public
:
49
typedef
T*
value_type
;
50
typedef
value_type
&
reference
;
51
typedef
value_type
*
pointer
;
52
53
iterator
(
pointer_list::iterator
iter)
54
:
pointer_list
::
iterator
(iter)
55
{}
56
57
reference
operator*
()
58
{
59
return
reinterpret_cast<
reference
>
(pointer_list::iterator::operator*());
60
}
61
62
reference
operator->
()
63
{
64
return
reinterpret_cast<
reference
>
(pointer_list::iterator::operator*());
65
}
66
};
67
68
69
// Constructors
70
CaloTopoTmpHashClusterBase
(
pool_type
&
pool
)
71
:
m_members
(
pool
),
72
m_maxRatio
(0)
73
{
74
}
75
76
// Operators
77
78
// Selectors
79
80
inline
float
getMaxRatio
()
const
81
{
82
return
m_maxRatio
;
83
}
84
85
inline
int
size
()
const
86
{
87
return
m_members
.size();
88
}
89
90
iterator
begin
()
91
{
92
return
iterator (
m_members
.begin());
93
}
94
95
iterator
end
()
96
{
97
return
iterator (
m_members
.end());
98
}
99
100
void
removeAll
()
101
{
102
m_members
.clear();
103
m_maxRatio
=0;
104
}
105
106
void
add
(
HashCell
& hashCell);
107
108
void
add
(
CaloTopoTmpHashClusterBase
& hashCluster);
109
110
};
111
112
113
template
<
class
T>
114
void
CaloTopoTmpHashClusterBase<T>::add
(
HashCell
& hashCell)
115
{
116
T* cell = hashCell.
getCaloTopoTmpClusterCell
();
117
m_members
.push_back (cell);
118
119
float
ratio = cell->getSignedRatio();
120
if
( ratio >
m_maxRatio
) {
121
m_maxRatio
= ratio;
122
}
123
}
124
125
template
<
class
T>
126
void
CaloTopoTmpHashClusterBase<T>::add
127
(
CaloTopoTmpHashClusterBase
& hashCluster)
128
{
129
pointer_list::iterator
beg = hashCluster.
m_members
.
begin
();
130
pointer_list::iterator
end
= hashCluster.
m_members
.
end
();
131
while
(beg !=
end
) {
132
m_members
.push_back (*beg);
133
++beg;
134
}
135
if
( hashCluster.
m_maxRatio
>
m_maxRatio
) {
136
m_maxRatio
= hashCluster.
m_maxRatio
;
137
}
138
}
139
140
#endif
// CALOTOPOTMPHASHCLUSTERBASE_H
141
CaloTopoTmpHashCell.h
CaloTopoTmpHashCell
Definition
CaloTopoTmpHashCell.h:22
CaloTopoTmpHashCell::getCaloTopoTmpClusterCell
const T * getCaloTopoTmpClusterCell() const
Definition
CaloTopoTmpHashCell.h:59
CaloTopoTmpHashClusterBase::iterator::iterator
iterator(pointer_list::iterator iter)
Definition
CaloTopoTmpHashClusterBase.h:53
CaloTopoTmpHashClusterBase::iterator::value_type
T * value_type
Definition
CaloTopoTmpHashClusterBase.h:49
CaloTopoTmpHashClusterBase::iterator::operator->
reference operator->()
Definition
CaloTopoTmpHashClusterBase.h:62
CaloTopoTmpHashClusterBase::iterator::operator*
reference operator*()
Definition
CaloTopoTmpHashClusterBase.h:57
CaloTopoTmpHashClusterBase::iterator::reference
value_type & reference
Definition
CaloTopoTmpHashClusterBase.h:50
CaloTopoTmpHashClusterBase::iterator::pointer
value_type * pointer
Definition
CaloTopoTmpHashClusterBase.h:51
CaloTopoTmpHashClusterBase::add
void add(HashCell &hashCell)
Definition
CaloTopoTmpHashClusterBase.h:114
CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::m_members
pointer_list m_members
Definition
CaloTopoTmpHashClusterBase.h:38
CaloTopoTmpHashClusterBase::end
iterator end()
Definition
CaloTopoTmpHashClusterBase.h:95
CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::pool_type
pointer_list::pool_type pool_type
Definition
CaloTopoTmpHashClusterBase.h:43
CaloTopoTmpHashClusterBase::CaloTopoTmpHashClusterBase
CaloTopoTmpHashClusterBase(pool_type &pool)
Definition
CaloTopoTmpHashClusterBase.h:70
CaloTopoTmpHashClusterBase::removeAll
void removeAll()
Definition
CaloTopoTmpHashClusterBase.h:100
CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::m_maxRatio
float m_maxRatio
Definition
CaloTopoTmpHashClusterBase.h:39
CaloTopoTmpHashClusterBase::size
int size() const
Definition
CaloTopoTmpHashClusterBase.h:85
CaloTopoTmpHashClusterBase::begin
iterator begin()
Definition
CaloTopoTmpHashClusterBase.h:90
CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::pointer_list
CxxUtils::pointer_list pointer_list
Definition
CaloTopoTmpHashClusterBase.h:32
CaloTopoTmpHashClusterBase::getMaxRatio
float getMaxRatio() const
Definition
CaloTopoTmpHashClusterBase.h:80
CaloTopoTmpHashClusterBase::add
void add(CaloTopoTmpHashClusterBase &hashCluster)
Definition
CaloTopoTmpHashClusterBase.h:127
CaloTopoTmpHashClusterBase< CaloTopoSplitterClusterCell >::HashCell
CaloTopoTmpHashCell< CaloTopoSplitterClusterCell > HashCell
Definition
CaloTopoTmpHashClusterBase.h:31
CxxUtils::pointer_list::iterator
Forward iterator over the list.
Definition
pointer_list.h:281
CxxUtils::pointer_list::iterator::pointer_list
friend class pointer_list
Definition
pointer_list.h:312
CxxUtils::pointer_list
A fast way to store a variable-sized collection of pointers.
Definition
pointer_list.h:242
CxxUtils::pointer_list::end
iterator end()
Iterator at the end of the container.
CxxUtils::pointer_list::begin
iterator begin()
Iterator at the beginning of the container.
CxxUtils::pointer_list::pool_type
allocator pool_type
Definition
pointer_list.h:315
pool
Framework include files.
Definition
libname.h:15
pointer_list.h
A fast way to store a variable-sized collection of pointers.
Generated on
for ATLAS Offline Software by
1.17.0